Skip to content
Snippets Groups Projects
  1. Nov 09, 2022
  2. Aug 26, 2022
  3. Aug 03, 2022
    • Danilo Krummrich's avatar
      drm/gem: rename GEM CMA helpers to GEM DMA helpers · 4a83c26a
      Danilo Krummrich authored
      
      Rename "GEM CMA" helpers to "GEM DMA" helpers - considering the
      hierarchy of APIs (mm/cma -> dma -> gem dma) calling them "GEM
      DMA" seems to be more applicable.
      
      Besides that, commit e57924d4 ("drm/doc: Task to rename CMA helpers")
      requests to rename the CMA helpers and implies that people seem to be
      confused about the naming.
      
      In order to do this renaming the following script was used:
      
      ```
      	#!/bin/bash
      
      	DIRS="drivers/gpu include/drm Documentation/gpu"
      
      	REGEX_SYM_UPPER="[0-9A-Z_\-]"
      	REGEX_SYM_LOWER="[0-9a-z_\-]"
      
      	REGEX_GREP_UPPER="(${REGEX_SYM_UPPER}*)(GEM)_CMA_(${REGEX_SYM_UPPER}*)"
      	REGEX_GREP_LOWER="(${REGEX_SYM_LOWER}*)(gem)_cma_(${REGEX_SYM_LOWER}*)"
      
      	REGEX_SED_UPPER="s/${REGEX_GREP_UPPER}/\1\2_DMA_\3/g"
      	REGEX_SED_LOWER="s/${REGEX_GREP_LOWER}/\1\2_dma_\3/g"
      
      	# Find all upper case 'CMA' symbols and replace them with 'DMA'.
      	for ff in $(grep -REHl "${REGEX_GREP_UPPER}" $DIRS)
      	do
      	       sed -i -E "$REGEX_SED_UPPER" $ff
      	done
      
      	# Find all lower case 'cma' symbols and replace them with 'dma'.
      	for ff in $(grep -REHl "${REGEX_GREP_LOWER}" $DIRS)
      	do
      	       sed -i -E "$REGEX_SED_LOWER" $ff
      	done
      
      	# Replace all occurrences of 'CMA' / 'cma' in comments and
      	# documentation files with 'DMA' / 'dma'.
      	for ff in $(grep -RiHl " cma " $DIRS)
      	do
      		sed -i -E "s/ cma / dma /g" $ff
      		sed -i -E "s/ CMA / DMA /g" $ff
      	done
      
      	# Rename all 'cma_obj's to 'dma_obj'.
      	for ff in $(grep -RiHl "cma_obj" $DIRS)
      	do
      		sed -i -E "s/cma_obj/dma_obj/g" $ff
      	done
      ```
      
      Only a few more manual modifications were needed, e.g. reverting the
      following modifications in some DRM Kconfig files
      
          -       select CMA if HAVE_DMA_CONTIGUOUS
          +       select DMA if HAVE_DMA_CONTIGUOUS
      
      as well as manually picking the occurrences of 'CMA'/'cma' in comments and
      documentation which relate to "GEM CMA", but not "FB CMA".
      
      Also drivers/gpu/drm/Makefile was fixed up manually after renaming
      drm_gem_cma_helper.c to drm_gem_dma_helper.c.
      
      This patch is compile-time tested building a x86_64 kernel with
      `make allyesconfig && make drivers/gpu/drm`.
      
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> #drivers/gpu/drm/arm
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-4-dakr@redhat.com
      4a83c26a
  4. Jun 24, 2022
  5. May 24, 2022
  6. Apr 25, 2022
    • Thomas Zimmermann's avatar
      drm/display: Introduce a DRM display-helper module · 1e0f6642
      Thomas Zimmermann authored
      
      Replace the DP-helper module with a display-helper module. The
      support for DisplayPort becomes an internal option that drivers
      have to select. Update all related Kconfig and Makefile rules.
      
      Besides the existing code for DisplayPort, the new module will
      contain helpers for other video-output standards, such as HDMI.
      Drivers will have to select their required video-output helpers.
      
      Linking all display-related code into a single module avoids the
      proliferation of small kernel modules.
      
      The module parameters drm_dp_cec_unregister_delay, dp_aux_i2c_speed_khz,
      and dp_aux_i2c_transfer_size are moving from the drm_dp_helper namespace
      to drm_display_helper.
      
      v2:
      	* mention module parameters in commit message (Javier)
      	* distiguish between display module and DP support in Kconfig
      	* update Makefile rules for DP helpers
      	* move Kconfig rules into separate file under display/
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-4-tzimmermann@suse.de
      1e0f6642
  7. Apr 05, 2022
  8. Mar 17, 2022
    • Thomas Zimmermann's avatar
      drm: Don't make DRM_PANEL_BRIDGE dependent on DRM_KMS_HELPERS · 3c338405
      Thomas Zimmermann authored
      
      Fix a number of undefined references to drm_kms_helper.ko in
      drm_dp_helper.ko:
      
        arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_duplicate_state':
        drm_dp_mst_topology.c:(.text+0x2df0): undefined reference to `__drm_atomic_helper_private_obj_duplicate_state'
        arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_delayed_destroy_work':
        drm_dp_mst_topology.c:(.text+0x370c): undefined reference to `drm_kms_helper_hotplug_event'
        arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_up_req_work':
        drm_dp_mst_topology.c:(.text+0x7938): undefined reference to `drm_kms_helper_hotplug_event'
        arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_link_probe_work':
        drm_dp_mst_topology.c:(.text+0x82e0): undefined reference to `drm_kms_helper_hotplug_event'
      
      This happens if panel-edp.ko has been configured with
      
        DRM_PANEL_EDP=y
        DRM_DP_HELPER=y
        DRM_KMS_HELPER=m
      
      which builds DP helpers into the kernel and KMS helpers sa a module.
      Making DRM_PANEL_EDP select DRM_KMS_HELPER resolves this problem.
      
      To avoid a resulting cyclic dependency with DRM_PANEL_BRIDGE, don't
      make the latter depend on DRM_KMS_HELPER and fix the one DRM bridge
      drivers that doesn't already select DRM_KMS_HELPER. As KMS helpers
      cannot be selected directly by the user, config symbols should avoid
      depending on it anyway.
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Fixes: 3755d35e ("drm/panel: Select DRM_DP_HELPER for DRM_PANEL_EDP")
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Tested-by: default avatarBrian Masney <bmasney@redhat.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
      Cc: Linux Kernel Functional Testing <lkft@linaro.org>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: dri-devel@lists.freedesktop.org
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/478296/
  9. Mar 12, 2022
  10. Feb 20, 2022
  11. Feb 04, 2022
  12. Nov 30, 2021
  13. Oct 17, 2021
  14. Oct 15, 2021
  15. Oct 14, 2021
  16. Oct 10, 2021
  17. Oct 09, 2021
  18. Sep 20, 2021
  19. Aug 13, 2021
  20. Aug 05, 2021
  21. Jul 31, 2021
  22. Jul 17, 2021
  23. Jul 14, 2021
  24. Jun 14, 2021
  25. Jun 11, 2021
  26. Jun 10, 2021
  27. Apr 20, 2021
    • Douglas Anderson's avatar
      drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare · 3235b0f2
      Douglas Anderson authored
      
      Unpreparing and re-preparing a panel can be a really heavy
      operation. Panels datasheets often specify something on the order of
      500ms as the delay you should insert after turning off the panel
      before turning it on again. In addition, turning on a panel can have
      delays on the order of 100ms - 200ms before the panel will assert HPD
      (AKA "panel ready"). The above means that we should avoid turning a
      panel off if we're going to turn it on again shortly.
      
      The above becomes a problem when we want to read the EDID of a
      panel. The way that ordering works is that userspace wants to read the
      EDID of the panel _before_ fully enabling it so that it can set the
      initial mode correctly. However, we can't read the EDID until we power
      it up. This leads to code that does this dance (like
      ps8640_bridge_get_edid()):
      
      1. When userspace requests EDID / the panel modes (through an ioctl),
         we power on the panel just enough to read the EDID and then power
         it off.
      2. Userspace then turns the panel on.
      
      There's likely not much time between step #1 and #2 and so we want to
      avoid powering the panel off and on again between those two steps.
      
      Let's use Runtime PM to help us. We'll move the existing prepare() and
      unprepare() to be runtime resume() and runtime suspend(). Now when we
      want to prepare() or unprepare() we just increment or decrement the
      refcount. We'll default to a 1 second autosuspend delay which seems
      sane given the typical delays we see for panels.
      
      A few notes:
      - It seems the existing unprepare() and prepare() are defined to be
        no-ops if called extra times. We'll preserve that behavior but may
        try to remove it in a future patch.
      - This is a slight change in the ABI of simple panel. If something was
        absolutely relying on the unprepare() to happen instantly that
        simply won't be the case anymore. I'm not aware of anyone relying on
        that behavior, but if there is someone then we'll need to figure out
        how to enable (or disable) this new delayed behavior selectively.
      - In order for this to work we now have a hard dependency on
        "PM". From memory this is a legit thing to assume these days and we
        don't have to find some fallback to keep working if someone wants to
        build their system without "PM".
      
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210416153909.v4.7.I9e8bd33b49c496745bfac58ea9ab418bd3b6f5ce@changeid
      3235b0f2
  28. Dec 15, 2020
  29. Dec 07, 2020
  30. Nov 17, 2020
  31. Nov 14, 2020
  32. Oct 19, 2020
  33. Oct 15, 2020
  34. Sep 04, 2020
  35. Aug 18, 2020
  36. Jul 01, 2020
Loading