Skip to contentSkip to conversation

drm: Introduce display-helper library

PATCH Superseded Thomas Zimmermann 5 participants 33 messages Mar 22, 2022 – Apr 18, 2022

Subsystems (33)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover drm: Introduce display-helper library

Move DisplayPort, HDMI and various other display helpers from KMS helpers into a new module. Adapt all drivers.

This patch is part of an on-going effort to reduce the minimum size of DRM when linked into the kernel binary. The helpers for various display and video-output standards are not required for minimal graphics output and can be moved into a separate module.

The DisplayPort code was already part of the DP module, which now forms the base of the display-helper module. Moving other helpers into the new module reduces KMS helpers by ~14 KiB (from 243 KiB to 229 KiB). More importantly, restructuring the code allows for a more fine-grained selection of helpers and dependencies.

Built on x64-64, i586, aarch64, and arm.

Thomas Zimmermann (8):
drm: Put related statements next to each other in Makefile
drm: Rename dp/ to display/
drm/display: Introduce a DRM display-helper module drm/display: Split DisplayPort header into core and helper drm/display: Move DSC header and helpers into display-helper module drm/display: Move HDCP helpers into display-helper module drm/display: Move HDMI helpers into display-helper module drm/display: Move SCDC helpers into display-helper library

 Documentation/gpu/drm-kms-helpers.rst         |  43 +-
 drivers/gpu/drm/Kconfig                       |  23 +
 drivers/gpu/drm/Makefile                      |  29 +-
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h      |   4 +-
 drivers/gpu/drm/amd/amdgpu/atombios_dp.c      |   3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |   1 +
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c        |   1 +
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |   1 +
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |   1 +
 drivers/gpu/drm/amd/display/Kconfig           |   1 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   5 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |   2 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |   2 +-
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   4 +-
 .../drm/amd/display/dc/core/dc_link_dpcd.c    |   2 +-
 .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c  |   2 +
 .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h  |   2 +-
 .../drm/amd/display/dc/dml/dsc/rc_calc_fpu.h  |   2 +-
 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c   |   4 +-
 .../gpu/drm/amd/display/dc/dsc/dscc_types.h   |   2 +-
 .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c  |   2 +-
 drivers/gpu/drm/amd/display/dc/os_types.h     |   2 +-
 .../gpu/drm/amd/display/include/dpcd_defs.h   |   2 +-
 .../gpu/drm/amd/display/modules/hdcp/hdcp.h   |   4 +-
 drivers/gpu/drm/bridge/Kconfig                |   5 +
 drivers/gpu/drm/bridge/analogix/Kconfig       |   2 +
 .../drm/bridge/analogix/analogix-anx6345.c    |   2 +-
 .../drm/bridge/analogix/analogix-anx78xx.c    |   4 +-
 .../drm/bridge/analogix/analogix-i2c-dptx.c   |   2 +-
 .../drm/bridge/analogix/analogix_dp_core.h    |   2 +-
 drivers/gpu/drm/bridge/analogix/anx7625.c     |   6 +-
 drivers/gpu/drm/bridge/cadence/Kconfig        |   1 +
 .../drm/bridge/cadence/cdns-mhdp8546-core.c   |   4 +-
 .../drm/bridge/cadence/cdns-mhdp8546-core.h   |   2 +-
 .../drm/bridge/cadence/cdns-mhdp8546-hdcp.c   |   2 +-
 drivers/gpu/drm/bridge/ite-it6505.c           |   4 +-
 drivers/gpu/drm/bridge/parade-ps8640.c        |   4 +-
 drivers/gpu/drm/bridge/sii902x.c              |   2 +-
 drivers/gpu/drm/bridge/sil-sii8620.c          |   2 +-
 drivers/gpu/drm/bridge/synopsys/Kconfig       |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |   4 +-
 drivers/gpu/drm/bridge/tc358767.c             |   2 +-
 drivers/gpu/drm/bridge/tc358775.c             |   2 +-
 drivers/gpu/drm/bridge/ti-sn65dsi86.c         |   4 +-
 drivers/gpu/drm/display/Makefile              |  13 +
 .../drm_display_helper_mod.c}                 |  10 +-
 .../gpu/drm/{dp => display}/drm_dp_aux_bus.c  |   4 +-
 .../gpu/drm/{dp => display}/drm_dp_aux_dev.c  |   4 +-
 drivers/gpu/drm/{dp => display}/drm_dp_cec.c  |   2 +-
 .../{dp => display}/drm_dp_dual_mode_helper.c |   2 +-
 .../{dp/drm_dp.c => display/drm_dp_helper.c}  |   4 +-
 .../{dp => display}/drm_dp_helper_internal.h  |   0
 .../drm/{dp => display}/drm_dp_mst_topology.c |   2 +-
 .../drm_dp_mst_topology_internal.h            |   2 +-
 .../{drm_dsc.c => display/drm_dsc_helper.c}   |   5 +-
 .../{drm_hdcp.c => display/drm_hdcp_helper.c} |   4 +-
 drivers/gpu/drm/display/drm_hdmi_helper.c     | 463 +++++++++++
 .../gpu/drm/{ => display}/drm_scdc_helper.c   |   3 +-
 drivers/gpu/drm/dp/Makefile                   |   9 -
 drivers/gpu/drm/drm_connector.c               |  34 -
 drivers/gpu/drm/drm_edid.c                    | 439 +----------
 drivers/gpu/drm/drm_mipi_dsi.c                |   6 +-
 drivers/gpu/drm/exynos/Kconfig                |   1 +
 drivers/gpu/drm/exynos/exynos_hdmi.c          |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_dp.c         |   2 +-
 drivers/gpu/drm/gma500/intel_bios.c           |   3 +-
 drivers/gpu/drm/hdmi/Makefile                 |   4 +
 drivers/gpu/drm/i2c/Kconfig                   |   1 +
 drivers/gpu/drm/i2c/tda998x_drv.c             |   2 +-
 drivers/gpu/drm/i915/Kconfig                  |   2 +
 drivers/gpu/drm/i915/display/icl_dsi.c        |   1 +
 drivers/gpu/drm/i915/display/intel_bios.c     |   3 +-
 drivers/gpu/drm/i915/display/intel_ddi.c      |   2 +-
 drivers/gpu/drm/i915/display/intel_display.c  |   2 +-
 .../drm/i915/display/intel_display_types.h    |   6 +-
 drivers/gpu/drm/i915/display/intel_dp.c       |   5 +-
 drivers/gpu/drm/i915/display/intel_dp_hdcp.c  |   6 +-
 .../drm/i915/display/intel_dp_link_training.h |   2 +-
 drivers/gpu/drm/i915/display/intel_gmbus.c    |   2 +-
 drivers/gpu/drm/i915/display/intel_hdcp.c     |   2 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c     |   5 +-
 drivers/gpu/drm/i915/display/intel_lspcon.c   |   4 +-
 .../gpu/drm/i915/display/intel_qp_tables.c    |   2 +-
 drivers/gpu/drm/i915/display/intel_sdvo.c     |   1 +
 drivers/gpu/drm/i915/display/intel_vdsc.c     |   2 +
 drivers/gpu/drm/mediatek/Kconfig              |   1 +
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |   2 +-
 drivers/gpu/drm/msm/Kconfig                   |   1 +
 drivers/gpu/drm/msm/dp/dp_audio.c             |   2 +-
 drivers/gpu/drm/msm/dp/dp_aux.h               |   2 +-
 drivers/gpu/drm/msm/dp/dp_catalog.c           |   2 +-
 drivers/gpu/drm/msm/dp/dp_ctrl.c              |   3 +-
 drivers/gpu/drm/msm/edp/edp.h                 |   3 +-
 drivers/gpu/drm/msm/edp/edp_ctrl.c            |   3 +-
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c        |   2 +
 drivers/gpu/drm/nouveau/Kconfig               |   1 +
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |   5 +-
 drivers/gpu/drm/nouveau/nouveau_connector.h   |   2 +-
 drivers/gpu/drm/nouveau/nouveau_dp.c          |   2 +-
 drivers/gpu/drm/nouveau/nouveau_encoder.h     |   6 +-
 drivers/gpu/drm/omapdrm/Kconfig               |   2 +
 drivers/gpu/drm/omapdrm/dss/hdmi4.c           |   1 +
 drivers/gpu/drm/panel/panel-edp.c             |   4 +-
 .../gpu/drm/panel/panel-samsung-atna33xc20.c  |   4 +-
 drivers/gpu/drm/radeon/atombios_dp.c          |   2 +-
 drivers/gpu/drm/radeon/radeon_audio.c         |   1 +
 drivers/gpu/drm/radeon/radeon_connectors.c    |   2 +-
 drivers/gpu/drm/radeon/radeon_dp_mst.c        |   2 +-
 drivers/gpu/drm/radeon/radeon_mode.h          |   4 +-
 drivers/gpu/drm/rockchip/Kconfig              |   2 +
 .../gpu/drm/rockchip/analogix_dp-rockchip.c   |   2 +-
 drivers/gpu/drm/rockchip/cdn-dp-core.c        |   2 +-
 drivers/gpu/drm/rockchip/cdn-dp-core.h        |   2 +-
 drivers/gpu/drm/rockchip/inno_hdmi.c          |   2 +-
 drivers/gpu/drm/rockchip/rk3066_hdmi.c        |   1 +
 drivers/gpu/drm/rockchip/rockchip_lvds.c      |   2 +-
 drivers/gpu/drm/rockchip/rockchip_rgb.c       |   2 +-
 .../drm/selftests/test-drm_dp_mst_helper.c    |   4 +-
 drivers/gpu/drm/sti/Kconfig                   |   1 +
 drivers/gpu/drm/sti/sti_hdmi.c                |   2 +-
 drivers/gpu/drm/sun4i/Kconfig                 |   1 +
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c        |   2 +-
 drivers/gpu/drm/tegra/Kconfig                 |   1 +
 drivers/gpu/drm/tegra/dp.c                    |   2 +-
 drivers/gpu/drm/tegra/dpaux.c                 |   4 +-
 drivers/gpu/drm/tegra/hdmi.c                  |   1 +
 drivers/gpu/drm/tegra/sor.c                   |   5 +-
 drivers/gpu/drm/vc4/Kconfig                   |   1 +
 drivers/gpu/drm/vc4/vc4_hdmi.c                |   4 +-
 drivers/gpu/drm/xlnx/zynqmp_dp.c              |   2 +-
 drivers/misc/mei/hdcp/mei_hdcp.h              |   2 +-
 .../{dp/drm_dp_helper.h => display/drm_dp.h}  | 695 +----------------
 include/drm/{dp => display}/drm_dp_aux_bus.h  |   0
 .../{dp => display}/drm_dp_dual_mode_helper.h |   0
 include/drm/display/drm_dp_helper.h           | 719 ++++++++++++++++++
 .../drm/{dp => display}/drm_dp_mst_helper.h   |   2 +-
 include/drm/{ => display}/drm_dsc.h           |   8 +-
 include/drm/display/drm_dsc_helper.h          |  20 +
 include/drm/{ => display}/drm_hdcp.h          |  14 +-
 include/drm/display/drm_hdcp_helper.h         |  22 +
 include/drm/display/drm_hdmi_helper.h         |  36 +
 .../{drm_scdc_helper.h => display/drm_scdc.h} |  52 +-
 include/drm/display/drm_scdc_helper.h         |  79 ++
 include/drm/drm_connector.h                   |   2 -
 include/drm/drm_edid.h                        |  31 +-
 include/drm/i915_mei_hdcp_interface.h         |   2 +-
 147 files changed, 1631 insertions(+), 1428 deletions(-)
 create mode 100644 drivers/gpu/drm/display/Makefile
 rename drivers/gpu/drm/{dp/drm_dp_helper_mod.c => display/drm_display_helper_mod.c} (51%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_aux_bus.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_aux_dev.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_cec.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_dual_mode_helper.c (99%)
 rename drivers/gpu/drm/{dp/drm_dp.c => display/drm_dp_helper.c} (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_helper_internal.h (100%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_mst_topology.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_mst_topology_internal.h (94%)
 rename drivers/gpu/drm/{drm_dsc.c => display/drm_dsc_helper.c} (99%)
 rename drivers/gpu/drm/{drm_hdcp.c => display/drm_hdcp_helper.c} (99%)
 create mode 100644 drivers/gpu/drm/display/drm_hdmi_helper.c
 rename drivers/gpu/drm/{ => display}/drm_scdc_helper.c (99%)
 delete mode 100644 drivers/gpu/drm/dp/Makefile
 create mode 100644 drivers/gpu/drm/hdmi/Makefile
 rename include/drm/{dp/drm_dp_helper.h => display/drm_dp.h} (74%)
 rename include/drm/{dp => display}/drm_dp_aux_bus.h (100%)
 rename include/drm/{dp => display}/drm_dp_dual_mode_helper.h (100%)
 create mode 100644 include/drm/display/drm_dp_helper.h
 rename include/drm/{dp => display}/drm_dp_mst_helper.h (99%)
 rename include/drm/{ => display}/drm_dsc.h (97%)
 create mode 100644 include/drm/display/drm_dsc_helper.h
 rename include/drm/{ => display}/drm_hdcp.h (95%)
 create mode 100644 include/drm/display/drm_hdcp_helper.h
 create mode 100644 include/drm/display/drm_hdmi_helper.h
 rename include/drm/{drm_scdc_helper.h => display/drm_scdc.h} (65%)
 create mode 100644 include/drm/display/drm_scdc_helper.h

base-commit: fe83949cd4316608ea785fc376b6ed444224adad
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: 6e1032c6302461624f33194c8b8f37103a3fa6ef

Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH 1/8 drm: Put related statements next to each other in Makefile

Give the Makefile a bit more structure by putting rules for core, helpers, drivers, etc next to each other.

---
 drivers/gpu/drm/Makefile | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/gpu/drm/Makefile +17 -6
index c2ef5f9fce54..e5929437e13c 100644
@@ -18,7 +18,6 @@ drm-y       :=	drm_aperture.o drm_auth.o drm_cache.o \
 		drm_syncobj.o drm_lease.o drm_writeback.o drm_client.o \
 		drm_client_modeset.o drm_atomic_uapi.o \
 		drm_managed.o drm_vblank_work.o
-
 drm-$(CONFIG_DRM_LEGACY) += drm_agpsupport.o drm_bufs.o drm_context.o drm_dma.o \
 			    drm_hashtab.o drm_irq.o drm_legacy_misc.o drm_lock.o \
 			    drm_memory.o drm_scatter.o drm_vm.o
@@ -30,8 +29,16 @@ drm-$(CONFIG_PCI) += drm_pci.o
 drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o
 drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
 drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86.o
+obj-$(CONFIG_DRM)	+= drm.o
 
 obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o
+obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
+
+#
+# Memory-management helpers
+#
+
+obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
 
 drm_cma_helper-y := drm_gem_cma_helper.o
 drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_cma_helper.o
@@ -40,14 +47,16 @@ obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o
 drm_shmem_helper-y := drm_gem_shmem_helper.o
 obj-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_shmem_helper.o
 
-obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
-
 drm_vram_helper-y := drm_gem_vram_helper.o
 obj-$(CONFIG_DRM_VRAM_HELPER) += drm_vram_helper.o
 
 drm_ttm_helper-y := drm_gem_ttm_helper.o
 obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
 
+#
+# Modesetting helpers
+#
+
 drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
 		drm_dsc.o drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
 		drm_probe_helper.o \
@@ -60,14 +69,16 @@ drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
 		drm_format_helper.o drm_self_refresh_helper.o drm_rect.o
 drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
 drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o
-
 obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
+
+#
+# Drivers and the rest
+#
+
 obj-$(CONFIG_DRM_DEBUG_SELFTEST) += selftests/
 
-obj-$(CONFIG_DRM)	+= drm.o
 obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
 obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
-obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
 obj-y			+= arm/
 obj-y			+= dp/
 obj-$(CONFIG_DRM_TTM)	+= ttm/
Signature · 1 line
2.35.1
maintainer
#2 lore raw

Re: [PATCH 1/8] drm: Put related statements next to each other in Makefile

Quoted 2 lines · Thomas Zimmermann

Give the Makefile a bit more structure by putting rules for core, helpers, drivers, etc next to each other.

If you're up for it, I think it would be time to split these one per line, in alphabetical order, to make the diffs nicer:

drm-y := \
	drm_aperture.o \
	drm_auth.o \
	...

Sure it takes up a lot of vertical screen estate, but IMO makes life easier in the long run.

Definitely can be a follow-up, I don't really want to make the series harder to land than it already is.

BR,
Jani.

Quoted 74 lines
---
 drivers/gpu/drm/Makefile | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/gpu/drm/Makefile +17 -6
index c2ef5f9fce54..e5929437e13c 100644
@@ -18,7 +18,6 @@ drm-y       :=	drm_aperture.o drm_auth.o drm_cache.o \
 		drm_syncobj.o drm_lease.o drm_writeback.o drm_client.o \
 		drm_client_modeset.o drm_atomic_uapi.o \
 		drm_managed.o drm_vblank_work.o
-
 drm-$(CONFIG_DRM_LEGACY) += drm_agpsupport.o drm_bufs.o drm_context.o drm_dma.o \
 			    drm_hashtab.o drm_irq.o drm_legacy_misc.o drm_lock.o \
 			    drm_memory.o drm_scatter.o drm_vm.o
@@ -30,8 +29,16 @@ drm-$(CONFIG_PCI) += drm_pci.o
 drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o
 drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
 drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86.o
+obj-$(CONFIG_DRM)	+= drm.o
 
 obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o
+obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
+
+#
+# Memory-management helpers
+#
+
+obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
 
 drm_cma_helper-y := drm_gem_cma_helper.o
 drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_cma_helper.o
@@ -40,14 +47,16 @@ obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o
 drm_shmem_helper-y := drm_gem_shmem_helper.o
 obj-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_shmem_helper.o
 
-obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
-
 drm_vram_helper-y := drm_gem_vram_helper.o
 obj-$(CONFIG_DRM_VRAM_HELPER) += drm_vram_helper.o
 
 drm_ttm_helper-y := drm_gem_ttm_helper.o
 obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
 
+#
+# Modesetting helpers
+#
+
 drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
 		drm_dsc.o drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
 		drm_probe_helper.o \
@@ -60,14 +69,16 @@ drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
 		drm_format_helper.o drm_self_refresh_helper.o drm_rect.o
 drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
 drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o
-
 obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
+
+#
+# Drivers and the rest
+#
+
 obj-$(CONFIG_DRM_DEBUG_SELFTEST) += selftests/
 
-obj-$(CONFIG_DRM)	+= drm.o
 obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
 obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
-obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
 obj-y			+= arm/
 obj-y			+= dp/
 obj-$(CONFIG_DRM_TTM)	+= ttm/
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Reviewed-by on v1 1/8
#3 lore raw

Re: [PATCH 1/8] drm: Put related statements next to each other in Makefile

In reply to Thomas Zimmermann

Hello Thomas,

Quoted 5 lines · Thomas Zimmermann

Give the Makefile a bit more structure by putting rules for core, helpers, drivers, etc next to each other.

---

This is a nice cleanup.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
author maintainer
#4 lore raw

PATCH 2/8 drm: Rename dp/ to display/

In reply to Thomas Zimmermann

Rename dp/ to display/ to account for additional display-related helpers, such as HDMI. Update all related include statements. No functional changes.

Various drivers, such as i915 and amdgpu, use similar naming scheme by putting code for video-output standards into a local display/ directory. The new directory's name is aligned with that policy.

---
 Documentation/gpu/drm-kms-helpers.rst         | 26 +++++++++----------
 drivers/gpu/drm/Makefile                      |  2 +-
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h      |  4 +--
 drivers/gpu/drm/amd/amdgpu/atombios_dp.c      |  3 ++-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  2 +-
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |  4 +--
 .../drm/amd/display/dc/core/dc_link_dpcd.c    |  2 +-
 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c   |  2 +-
 drivers/gpu/drm/amd/display/dc/os_types.h     |  2 +-
 .../gpu/drm/amd/display/include/dpcd_defs.h   |  2 +-
 .../gpu/drm/amd/display/modules/hdcp/hdcp.h   |  2 +-
 .../drm/bridge/analogix/analogix-anx6345.c    |  2 +-
 .../drm/bridge/analogix/analogix-anx78xx.c    |  2 +-
 .../drm/bridge/analogix/analogix-i2c-dptx.c   |  2 +-
 .../drm/bridge/analogix/analogix_dp_core.h    |  2 +-
 drivers/gpu/drm/bridge/analogix/anx7625.c     |  4 +--
 .../drm/bridge/cadence/cdns-mhdp8546-core.c   |  2 +-
 .../drm/bridge/cadence/cdns-mhdp8546-core.h   |  2 +-
 drivers/gpu/drm/bridge/ite-it6505.c           |  2 +-
 drivers/gpu/drm/bridge/parade-ps8640.c        |  4 +--
 drivers/gpu/drm/bridge/tc358767.c             |  2 +-
 drivers/gpu/drm/bridge/tc358775.c             |  2 +-
 drivers/gpu/drm/bridge/ti-sn65dsi86.c         |  4 +--
 drivers/gpu/drm/{dp => display}/Makefile      |  0
 drivers/gpu/drm/{dp => display}/drm_dp.c      |  4 +--
 .../gpu/drm/{dp => display}/drm_dp_aux_bus.c  |  4 +--
 .../gpu/drm/{dp => display}/drm_dp_aux_dev.c  |  4 +--
 drivers/gpu/drm/{dp => display}/drm_dp_cec.c  |  2 +-
 .../{dp => display}/drm_dp_dual_mode_helper.c |  2 +-
 .../{dp => display}/drm_dp_helper_internal.h  |  0
 .../drm/{dp => display}/drm_dp_helper_mod.c   |  0
 .../drm/{dp => display}/drm_dp_mst_topology.c |  2 +-
 .../drm_dp_mst_topology_internal.h            |  2 +-
 drivers/gpu/drm/drm_dsc.c                     |  3 ++-
 drivers/gpu/drm/gma500/cdv_intel_dp.c         |  2 +-
 drivers/gpu/drm/gma500/intel_bios.c           |  3 ++-
 drivers/gpu/drm/i915/display/intel_bios.c     |  2 +-
 drivers/gpu/drm/i915/display/intel_display.c  |  2 +-
 .../drm/i915/display/intel_display_types.h    |  4 +--
 drivers/gpu/drm/i915/display/intel_dp.c       |  2 +-
 drivers/gpu/drm/i915/display/intel_dp_hdcp.c  |  4 +--
 .../drm/i915/display/intel_dp_link_training.h |  2 +-
 drivers/gpu/drm/i915/display/intel_lspcon.c   |  2 +-
 drivers/gpu/drm/msm/dp/dp_audio.c             |  2 +-
 drivers/gpu/drm/msm/dp/dp_aux.h               |  2 +-
 drivers/gpu/drm/msm/dp/dp_catalog.c           |  2 +-
 drivers/gpu/drm/msm/dp/dp_ctrl.c              |  3 ++-
 drivers/gpu/drm/msm/edp/edp.h                 |  3 ++-
 drivers/gpu/drm/msm/edp/edp_ctrl.c            |  3 ++-
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |  2 +-
 drivers/gpu/drm/nouveau/nouveau_connector.h   |  2 +-
 drivers/gpu/drm/nouveau/nouveau_dp.c          |  2 +-
 drivers/gpu/drm/nouveau/nouveau_encoder.h     |  6 +++--
 drivers/gpu/drm/panel/panel-edp.c             |  4 +--
 .../gpu/drm/panel/panel-samsung-atna33xc20.c  |  4 +--
 drivers/gpu/drm/radeon/atombios_dp.c          |  2 +-
 drivers/gpu/drm/radeon/radeon_connectors.c    |  2 +-
 drivers/gpu/drm/radeon/radeon_dp_mst.c        |  2 +-
 drivers/gpu/drm/radeon/radeon_mode.h          |  4 +--
 .../gpu/drm/rockchip/analogix_dp-rockchip.c   |  2 +-
 drivers/gpu/drm/rockchip/cdn-dp-core.c        |  2 +-
 drivers/gpu/drm/rockchip/cdn-dp-core.h        |  2 +-
 drivers/gpu/drm/rockchip/rockchip_lvds.c      |  2 +-
 drivers/gpu/drm/rockchip/rockchip_rgb.c       |  2 +-
 .../drm/selftests/test-drm_dp_mst_helper.c    |  4 +--
 drivers/gpu/drm/tegra/dp.c                    |  2 +-
 drivers/gpu/drm/tegra/dpaux.c                 |  4 +--
 drivers/gpu/drm/tegra/sor.c                   |  2 +-
 drivers/gpu/drm/xlnx/zynqmp_dp.c              |  2 +-
 include/drm/{dp => display}/drm_dp_aux_bus.h  |  0
 .../{dp => display}/drm_dp_dual_mode_helper.h |  0
 include/drm/{dp => display}/drm_dp_helper.h   |  0
 .../drm/{dp => display}/drm_dp_mst_helper.h   |  2 +-
 include/drm/drm_dsc.h                         |  2 +-
 76 files changed, 106 insertions(+), 98 deletions(-)
 rename drivers/gpu/drm/{dp => display}/Makefile (100%)
 rename drivers/gpu/drm/{dp => display}/drm_dp.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_aux_bus.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_aux_dev.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_cec.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_dual_mode_helper.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_helper_internal.h (100%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_helper_mod.c (100%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_mst_topology.c (99%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_mst_topology_internal.h (94%)
 rename include/drm/{dp => display}/drm_dp_aux_bus.h (100%)
 rename include/drm/{dp => display}/drm_dp_dual_mode_helper.h (100%)
 rename include/drm/{dp => display}/drm_dp_helper.h (100%)
 rename include/drm/{dp => display}/drm_dp_mst_helper.h (99%)
Documentation/gpu/drm-kms-helpers.rst +13 -13
index c3ce91eecbc1..2584f5bff66f 100644
@@ -232,34 +232,34 @@ HDCP Helper Functions Reference
 Display Port Helper Functions Reference
 =======================================
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
    :doc: dp helpers
 
-.. kernel-doc:: include/drm/dp/drm_dp_helper.h
+.. kernel-doc:: include/drm/display/drm_dp_helper.h
    :internal:
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
    :export:
 
 Display Port CEC Helper Functions Reference
 ===========================================
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_cec.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
    :doc: dp cec helpers
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_cec.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
    :export:
 
 Display Port Dual Mode Adaptor Helper Functions Reference
 =========================================================
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_dual_mode_helper.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
    :doc: dp dual mode helpers
 
-.. kernel-doc:: include/drm/dp/drm_dp_dual_mode_helper.h
+.. kernel-doc:: include/drm/display/drm_dp_dual_mode_helper.h
    :internal:
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_dual_mode_helper.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
    :export:
 
 Display Port MST Helpers
@@ -268,19 +268,19 @@ Display Port MST Helpers
 Overview
 --------
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
    :doc: dp mst helper
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
    :doc: Branch device and port refcounting
 
 Functions Reference
 -------------------
 
-.. kernel-doc:: include/drm/dp/drm_dp_mst_helper.h
+.. kernel-doc:: include/drm/display/drm_dp_mst_helper.h
    :internal:
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
    :export:
 
 Topology Lifetime Internals
@@ -289,7 +289,7 @@ Topology Lifetime Internals
 These functions aren't exported to drivers, but are documented here to help make
 the MST topology helpers easier to understand
 
-.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
    :functions: drm_dp_mst_topology_try_get_mstb drm_dp_mst_topology_get_mstb
                drm_dp_mst_topology_put_mstb
                drm_dp_mst_topology_try_get_port drm_dp_mst_topology_get_port
drivers/gpu/drm/Makefile +1 -1
index e5929437e13c..07f7a70a78ea 100644
@@ -80,7 +80,7 @@ obj-$(CONFIG_DRM_DEBUG_SELFTEST) += selftests/
 obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
 obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
 obj-y			+= arm/
-obj-y			+= dp/
+obj-y			+= display/
 obj-$(CONFIG_DRM_TTM)	+= ttm/
 obj-$(CONFIG_DRM_SCHED)	+= scheduler/
 obj-$(CONFIG_DRM_TDFX)	+= tdfx/
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -1
index fa20261aa928..954f728f8857 100644
@@ -24,9 +24,9 @@
  *          Alex Deucher
  */
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_fb_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/amdgpu_drm.h>
 #include "amdgpu.h"
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +2 -2
index a546cb3cfa18..72c6f6cb7a44 100644
@@ -30,10 +30,10 @@
 #ifndef AMDGPU_MODE_H
 #define AMDGPU_MODE_H
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_fixed.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -44,7 +44,7 @@
 #include <linux/hrtimer.h>
 #include "amdgpu_irq.h"
 
-#include <drm/dp/drm_dp_mst_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include "modules/inc/mod_freesync.h"
 #include "amdgpu_dm_irq_params.h"
 
drivers/gpu/drm/amd/amdgpu/atombios_dp.c +2 -1
index 49a2f594fb2c..87c41e0e9b7c 100644
@@ -26,6 +26,8 @@
  */
 
 #include <drm/amdgpu_drm.h>
+#include <drm/display/drm_dp_helper.h>
+
 #include "amdgpu.h"
 
 #include "atom.h"
@@ -34,7 +36,6 @@
 #include "atombios_dp.h"
 #include "amdgpu_connectors.h"
 #include "amdgpu_atombios.h"
-#include <drm/dp/drm_dp_helper.h>
 
 /* move these to drm_dp_helper.c/h */
 #define DP_LINK_CONFIGURATION_SIZE 9
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index e1d3db3fe8de..4473ac43e5f5 100644
@@ -73,10 +73,10 @@
 #include <linux/firmware.h>
 #include <linux/component.h>
 
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_uapi.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_edid.h>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -1
index 6a908d736d6a..d6396753e98b 100644
@@ -26,10 +26,10 @@
 #ifndef __AMDGPU_DM_H__
 #define __AMDGPU_DM_H__
 
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc.h>
-#include <drm/dp/drm_dp_mst_helper.h>
 #include <drm/drm_plane.h>
 
 /*
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +2 -2
index 31ac1fce36f8..43efd915ee6f 100644
@@ -23,10 +23,10 @@
  *
  */
 
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include "dm_services.h"
 #include "amdgpu.h"
 #include "amdgpu_dm.h"
drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c +1 -1
index 48a18766f002..af110bf9470f 100644
@@ -27,8 +27,8 @@
 #include <dc_link.h>
 #include <inc/link_hwss.h>
 #include <inc/link_dpcd.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <dc_dp_types.h>
+#include <drm/display/drm_dp_helper.h>
 #include "dm_helpers.h"
 
 #define END_ADDRESS(start, size) (start + size - 1)
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +1 -1
index efc2339f1fa0..411b79979e2e 100644
@@ -25,7 +25,7 @@
 #include <drm/drm_dsc.h>
 #include "dc_hw_types.h"
 #include "dsc.h"
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 #include "dc.h"
 #include "rc_calc.h"
 #include "fixed31_32.h"
drivers/gpu/drm/amd/display/dc/os_types.h +1 -1
index 17d05071b809..981a9ed6fb61 100644
@@ -35,8 +35,8 @@
 
 #include <asm/byteorder.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_print.h>
-#include <drm/dp/drm_dp_helper.h>
 
 #include "cgs_common.h"
 
drivers/gpu/drm/amd/display/include/dpcd_defs.h +1 -1
index ac822181359c..b2df07f9e91c 100644
@@ -26,7 +26,7 @@
 #ifndef __DAL_DPCD_DEFS_H__
 #define __DAL_DPCD_DEFS_H__
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 #ifndef DP_SINK_HW_REVISION_START // can remove this once the define gets into linux drm_dp_helper.h
 #define DP_SINK_HW_REVISION_START 0x409
 #endif
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h +1 -1
index 8502263d2968..6e88705e22f7 100644
@@ -29,8 +29,8 @@
 #include "mod_hdcp.h"
 #include "hdcp_log.h"
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_hdcp.h>
-#include <drm/dp/drm_dp_helper.h>
 
 enum mod_hdcp_trans_input_result {
 	UNKNOWN = 0,
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +1 -1
index 94e56a2e91f2..ae3d6e9a606c 100644
@@ -18,11 +18,11 @@
 #include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c +1 -1
index 2768b41c48e9..d2fc8676fab6 100644
@@ -18,10 +18,10 @@
 #include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c +1 -1
index e8297168bfef..b1e482994ffe 100644
@@ -7,8 +7,8 @@
  */
 #include <linux/regmap.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_print.h>
 
 #include "analogix-i2c-dptx.h"
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +1 -1
index 32665203a6ae..433f2d7efa0c 100644
@@ -9,8 +9,8 @@
 #ifndef _ANALOGIX_DP_CORE_H
 #define _ANALOGIX_DP_CORE_H
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/dp/drm_dp_helper.h>
 
 #define DP_TIMEOUT_LOOP_COUNT 100
 #define MAX_CR_LOOP 5
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -2
index 9a2a19ad4202..21f16394012f 100644
@@ -21,11 +21,11 @@
 #include <linux/of_graph.h>
 #include <linux/of_platform.h>
 
+#include <drm/display/drm_dp_aux_bus.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/dp/drm_dp_aux_bus.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_hdcp.h>
 #include <drm/drm_mipi_dsi.h>
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +1 -1
index ac18e15aa167..dec93a6d14c7 100644
@@ -35,13 +35,13 @@
 #include <linux/slab.h>
 #include <linux/wait.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_hdcp.h>
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_print.h>
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h +1 -1
index fc77f987c835..bedddd510d17 100644
@@ -15,9 +15,9 @@
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_connector.h>
-#include <drm/dp/drm_dp_helper.h>
 
 struct clk;
 struct device;
drivers/gpu/drm/bridge/ite-it6505.c +1 -1
index f2f101220ade..85cffc108278 100644
@@ -21,7 +21,7 @@
 
 #include <crypto/hash.h>
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
drivers/gpu/drm/bridge/parade-ps8640.c +2 -2
index 9766cbbd62ad..edb939b14c04 100644
@@ -13,9 +13,9 @@
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 
+#include <drm/display/drm_dp_aux_bus.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_bridge.h>
-#include <drm/dp/drm_dp_aux_bus.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
drivers/gpu/drm/bridge/tc358767.c +1 -1
index 7f9574b17caa..0c0295e2ab74 100644
@@ -25,9 +25,9 @@
 #include <linux/regmap.h>
 #include <linux/slab.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
drivers/gpu/drm/bridge/tc358775.c +1 -1
index b987e5ac80f0..62a7ef352daa 100644
@@ -19,10 +19,10 @@
 
 #include <asm/unaligned.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
drivers/gpu/drm/bridge/ti-sn65dsi86.c +2 -2
index 28d91ea5f9fd..8cad662de9bb 100644
@@ -23,12 +23,12 @@
 
 #include <asm/unaligned.h>
 
+#include <drm/display/drm_dp_aux_bus.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_bridge_connector.h>
-#include <drm/dp/drm_dp_aux_bus.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
drivers/gpu/drm/display/Makefile renamed from drivers/gpu/drm/dp/Makefile +0 -0
similarity index 100%
rename from drivers/gpu/drm/dp/Makefile
rename to drivers/gpu/drm/display/Makefile
drivers/gpu/drm/display/drm_dp.c renamed from drivers/gpu/drm/dp/drm_dp.c +2 -2
similarity index 99%
rename from drivers/gpu/drm/dp/drm_dp.c
rename to drivers/gpu/drm/display/drm_dp.c
index 703972ae14c6..5249475af904 100644
@@ -30,10 +30,10 @@
 #include <linux/seq_file.h>
 #include <linux/string_helpers.h>
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_print.h>
 #include <drm/drm_vblank.h>
-#include <drm/dp/drm_dp_mst_helper.h>
 #include <drm/drm_panel.h>
 
 #include "drm_dp_helper_internal.h"
drivers/gpu/drm/display/drm_dp_aux_bus.c renamed from drivers/gpu/drm/dp/drm_dp_aux_bus.c +2 -2
similarity index 99%
rename from drivers/gpu/drm/dp/drm_dp_aux_bus.c
rename to drivers/gpu/drm/display/drm_dp_aux_bus.c
index 415afce3cf96..dccf3e2ea323 100644
@@ -19,8 +19,8 @@
 #include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
 
-#include <drm/dp/drm_dp_aux_bus.h>
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_aux_bus.h>
+#include <drm/display/drm_dp_helper.h>
 
 /**
  * dp_aux_ep_match() - The match function for the dp_aux_bus.
drivers/gpu/drm/display/drm_dp_aux_dev.c renamed from drivers/gpu/drm/dp/drm_dp_aux_dev.c +2 -2
similarity index 99%
rename from drivers/gpu/drm/dp/drm_dp_aux_dev.c
rename to drivers/gpu/drm/display/drm_dp_aux_dev.c
index 53ad4e72790b..098e482e65a2 100644
@@ -35,9 +35,9 @@
 #include <linux/uaccess.h>
 #include <linux/uio.h>
 
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/dp/drm_dp_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
 #include <drm/drm_print.h>
 
 #include "drm_dp_helper_internal.h"
drivers/gpu/drm/display/drm_dp_cec.c renamed from drivers/gpu/drm/dp/drm_dp_cec.c +1 -1
similarity index 99%
rename from drivers/gpu/drm/dp/drm_dp_cec.c
rename to drivers/gpu/drm/display/drm_dp_cec.c
index f9e927355879..ae39dc794190 100644
@@ -11,9 +11,9 @@
 
 #include <media/cec.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_device.h>
-#include <drm/dp/drm_dp_helper.h>
 
 /*
  * Unfortunately it turns out that we have a chicken-and-egg situation
drivers/gpu/drm/display/drm_dp_dual_mode_helper.c renamed from drivers/gpu/drm/dp/drm_dp_dual_mode_helper.c +1 -1
similarity index 99%
rename from drivers/gpu/drm/dp/drm_dp_dual_mode_helper.c
rename to drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
index 2049cb0f7ed0..3ea53bb67d3b 100644
@@ -27,8 +27,8 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 
+#include <drm/display/drm_dp_dual_mode_helper.h>
 #include <drm/drm_device.h>
-#include <drm/dp/drm_dp_dual_mode_helper.h>
 #include <drm/drm_print.h>
 
 /**
drivers/gpu/drm/display/drm_dp_helper_internal.h renamed from drivers/gpu/drm/dp/drm_dp_helper_internal.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/dp/drm_dp_helper_internal.h
rename to drivers/gpu/drm/display/drm_dp_helper_internal.h
drivers/gpu/drm/display/drm_dp_helper_mod.c renamed from drivers/gpu/drm/dp/drm_dp_helper_mod.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/dp/drm_dp_helper_mod.c
rename to drivers/gpu/drm/display/drm_dp_helper_mod.c
drivers/gpu/drm/display/drm_dp_mst_topology.c renamed from drivers/gpu/drm/dp/drm_dp_mst_topology.c +1 -1
similarity index 99%
rename from drivers/gpu/drm/dp/drm_dp_mst_topology.c
rename to drivers/gpu/drm/display/drm_dp_mst_topology.c
index 11300b53d24f..8526aae75c6d 100644
@@ -38,7 +38,7 @@
 #include <linux/math64.h>
 #endif
 
-#include <drm/dp/drm_dp_mst_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
drivers/gpu/drm/display/drm_dp_mst_topology_internal.h renamed from drivers/gpu/drm/dp/drm_dp_mst_topology_internal.h +1 -1
similarity index 94%
rename from drivers/gpu/drm/dp/drm_dp_mst_topology_internal.h
rename to drivers/gpu/drm/display/drm_dp_mst_topology_internal.h
index 401953b59d45..a785ccbfdd73 100644
@@ -10,7 +10,7 @@
 #ifndef _DRM_DP_MST_HELPER_INTERNAL_H_
 #define _DRM_DP_MST_HELPER_INTERNAL_H_
 
-#include <drm/dp/drm_dp_mst_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 
 void
 drm_dp_encode_sideband_req(const struct drm_dp_sideband_msg_req_body *req,
drivers/gpu/drm/drm_dsc.c +2 -1
index fdd8d5f42622..2428bdfc4c8f 100644
@@ -11,8 +11,9 @@
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/byteorder/generic.h>
+
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_print.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_dsc.h>
 
 /**
drivers/gpu/drm/gma500/cdv_intel_dp.c +1 -1
index f562e91337c7..d77115fa68cf 100644
@@ -29,9 +29,9 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_simple_kms_helper.h>
 
 #include "gma_display.h"
drivers/gpu/drm/gma500/intel_bios.c +2 -1
index ea7c16f33a0e..8245b5603d2c 100644
@@ -5,8 +5,9 @@
  * Authors:
  *    Eric Anholt <[email protected]>
  */
+
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm.h>
-#include <drm/dp/drm_dp_helper.h>
 
 #include "intel_bios.h"
 #include "psb_drv.h"
drivers/gpu/drm/i915/display/intel_bios.c +1 -1
index c7afe19dd44a..3a990918eab7 100644
@@ -25,7 +25,7 @@
  *
  */
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 
 #include "display/intel_display.h"
 #include "display/intel_display_types.h"
drivers/gpu/drm/i915/display/intel_display.c +1 -1
index 6ed976b77b1c..4cec7ef4d50d 100644
@@ -35,11 +35,11 @@
 #include <linux/string_helpers.h>
 #include <linux/vga_switcheroo.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_uapi.h>
 #include <drm/drm_damage_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_plane_helper.h>
drivers/gpu/drm/i915/display/intel_display_types.h +2 -2
index c94eb7d5191d..d3b5d1325d49 100644
@@ -31,8 +31,8 @@
 #include <linux/pwm.h>
 #include <linux/sched/clock.h>
 
-#include <drm/dp/drm_dp_dual_mode_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
+#include <drm/display/drm_dp_dual_mode_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_dsc.h>
drivers/gpu/drm/i915/display/intel_dp.c +1 -1
index 9e19165fd175..9477479d8449 100644
@@ -35,9 +35,9 @@
 
 #include <asm/byteorder.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_probe_helper.h>
 
drivers/gpu/drm/i915/display/intel_dp_hdcp.c +2 -2
index 82d024dafe7b..598cad09d499 100644
@@ -6,8 +6,8 @@
  * Sean Paul <[email protected]>
  */
 
-#include <drm/dp/drm_dp_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_hdcp.h>
 #include <drm/drm_print.h>
 
drivers/gpu/drm/i915/display/intel_dp_link_training.h +1 -1
index dc1556b46b85..7fa1c0833096 100644
@@ -6,7 +6,7 @@
 #ifndef __INTEL_DP_LINK_TRAINING_H__
 #define __INTEL_DP_LINK_TRAINING_H__
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 
 struct intel_crtc_state;
 struct intel_dp;
drivers/gpu/drm/i915/display/intel_lspcon.c +1 -1
index 76357c9b76e4..be0b1010b304 100644
@@ -23,8 +23,8 @@
  *
  */
 
+#include <drm/display/drm_dp_dual_mode_helper.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/dp/drm_dp_dual_mode_helper.h>
 #include <drm/drm_edid.h>
 
 #include "intel_de.h"
drivers/gpu/drm/msm/dp/dp_audio.c +1 -1
index 4553f4985434..077d3b6507e7 100644
@@ -8,7 +8,7 @@
 
 #include <linux/of_platform.h>
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 
 #include "dp_catalog.h"
drivers/gpu/drm/msm/dp/dp_aux.h +1 -1
index 82afc8d5210f..c64951215ab5 100644
@@ -7,7 +7,7 @@
 #define _DP_AUX_H_
 
 #include "dp_catalog.h"
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 
 int dp_aux_register(struct drm_dp_aux *dp_aux);
 void dp_aux_unregister(struct drm_dp_aux *dp_aux);
drivers/gpu/drm/msm/dp/dp_catalog.c +1 -1
index fac815fb6d91..b5dd0240d1dc 100644
@@ -10,7 +10,7 @@
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-dp.h>
 #include <linux/rational.h>
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_print.h>
 
 #include "dp_catalog.h"
drivers/gpu/drm/msm/dp/dp_ctrl.c +2 -1
index 53568567e05b..a96f6a8fa9bd 100644
@@ -11,8 +11,9 @@
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-dp.h>
 #include <linux/pm_opp.h>
+
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_fixed.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_print.h>
 
 #include "dp_reg.h"
drivers/gpu/drm/msm/edp/edp.h +2 -1
index 1a82d7a4af9f..14b0ef02287e 100644
@@ -10,7 +10,8 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
-#include <drm/dp/drm_dp_helper.h>
+
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
 
drivers/gpu/drm/msm/edp/edp_ctrl.c +2 -1
index 9f537b1fd849..9ac1963c679e 100644
@@ -6,7 +6,8 @@
 #include <linux/clk.h>
 #include <linux/gpio/consumer.h>
 #include <linux/regulator/consumer.h>
-#include <drm/dp/drm_dp_helper.h>
+
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
 
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -1
index df58c6445c51..45db61ac2bfe 100644
@@ -33,9 +33,9 @@
 #include <linux/component.h>
 #include <linux/iopoll.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_plane_helper.h>
drivers/gpu/drm/nouveau/nouveau_connector.h +1 -1
index 1b173191cc41..b0773af5a98f 100644
@@ -33,10 +33,10 @@
 #include <nvhw/class/cl907d.h>
 #include <nvhw/drf.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_util.h>
 
 #include "nouveau_crtc.h"
drivers/gpu/drm/nouveau/nouveau_dp.c +1 -1
index 724d40ddd452..c36f510d5d4c 100644
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_connector.h"
drivers/gpu/drm/nouveau/nouveau_encoder.h +4 -2
index 65ed84f88cca..c2f5f0cb70d5 100644
@@ -29,10 +29,12 @@
 
 #include <subdev/bios/dcb.h>
 
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_encoder_slave.h>
-#include <drm/dp/drm_dp_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
+
 #include "dispnv04/disp.h"
+
 struct nv50_head_atom;
 struct nouveau_connector;
 
drivers/gpu/drm/panel/panel-edp.c +2 -2
index e15e62f235d8..0000a752c16f 100644
@@ -35,10 +35,10 @@
 #include <video/of_display_timing.h>
 #include <video/videomode.h>
 
+#include <drm/display/drm_dp_aux_bus.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
-#include <drm/dp/drm_dp_aux_bus.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_panel.h>
 
 /**
drivers/gpu/drm/panel/panel-samsung-atna33xc20.c +2 -2
index 20666b6217e7..3dd10412d147 100644
@@ -14,8 +14,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 
-#include <drm/dp/drm_dp_aux_bus.h>
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_aux_bus.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_panel.h>
 
drivers/gpu/drm/radeon/atombios_dp.c +1 -1
index 4798cf23d251..009333645438 100644
@@ -30,7 +30,7 @@
 
 #include "atom.h"
 #include "atom-bits.h"
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 
 /* move these to drm_dp_helper.c/h */
 #define DP_LINK_CONFIGURATION_SIZE 9
drivers/gpu/drm/radeon/radeon_connectors.c +1 -1
index a7925a8290b2..a4055023ccfb 100644
@@ -24,10 +24,10 @@
  *          Alex Deucher
  */
 
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/radeon_drm.h>
 #include "radeon.h"
drivers/gpu/drm/radeon/radeon_dp_mst.c +1 -1
index 9f26baf7adb0..54ced1f4ff67 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: MIT
 
-#include <drm/dp/drm_dp_mst_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_file.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/radeon/radeon_mode.h +2 -2
index 5288dc7a4897..3485e7f142e9 100644
@@ -30,11 +30,11 @@
 #ifndef RADEON_MODE_H
 #define RADEON_MODE_H
 
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
-#include <drm/dp/drm_dp_helper.h>
-#include <drm/dp/drm_dp_mst_helper.h>
 #include <drm/drm_fixed.h>
 #include <drm/drm_crtc_helper.h>
 #include <linux/i2c.h>
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +1 -1
index c82901d9a9cc..f7e3fb94ed04 100644
@@ -19,10 +19,10 @@
 #include <video/of_videomode.h>
 #include <video/videomode.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/bridge/analogix_dp.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/rockchip/cdn-dp-core.c +1 -1
index 4740cc14beb8..bc1fe30877f4 100644
@@ -15,8 +15,8 @@
 
 #include <sound/hdmi-codec.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/rockchip/cdn-dp-core.h +1 -1
index 0d044146f4e9..f46243c6efda 100644
@@ -7,7 +7,7 @@
 #ifndef _CDN_DP_CORE_H
 #define _CDN_DP_CORE_H
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
 
drivers/gpu/drm/rockchip/rockchip_lvds.c +1 -1
index 0b972418067e..997b7d46a2d1 100644
@@ -17,10 +17,10 @@
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_bridge_connector.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/rockchip/rockchip_rgb.c +1 -1
index 2494b079489d..418eb631d7cd 100644
@@ -8,10 +8,10 @@
 #include <linux/component.h>
 #include <linux/of_graph.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_bridge_connector.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c +2 -2
index fc1deb1231a2..967c52150b67 100644
@@ -7,10 +7,10 @@
 
 #include <linux/random.h>
 
-#include <drm/dp/drm_dp_mst_helper.h>
+#include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_print.h>
 
-#include "../dp/drm_dp_mst_topology_internal.h"
+#include "../display/drm_dp_mst_topology_internal.h"
 #include "test-drm_modeset_common.h"
 
 int igt_dp_mst_calc_pbn_mode(void *ignored)
drivers/gpu/drm/tegra/dp.c +1 -1
index 7295975e5733..08fbd8f151a1 100644
@@ -4,8 +4,8 @@
  * Copyright (C) 2015 Rob Clark
  */
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_print.h>
 
 #include "dp.h"
drivers/gpu/drm/tegra/dpaux.c +2 -2
index 20e1dd6b3bf0..7dc681e2ee90 100644
@@ -18,8 +18,8 @@
 #include <linux/reset.h>
 #include <linux/workqueue.h>
 
-#include <drm/dp/drm_dp_helper.h>
-#include <drm/dp/drm_dp_aux_bus.h>
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp_aux_bus.h>
 #include <drm/drm_panel.h>
 
 #include "dp.h"
drivers/gpu/drm/tegra/sor.c +1 -1
index b125572feb84..47b6c8e190cc 100644
@@ -16,9 +16,9 @@
 
 #include <soc/tegra/pmc.h>
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_debugfs.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_file.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_scdc_helper.h>
drivers/gpu/drm/xlnx/zynqmp_dp.c +1 -1
index b1bbbb1d0a54..155971c319b2 100644
@@ -9,11 +9,11 @@
  * - Laurent Pinchart <[email protected]>
  */
 
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
-#include <drm/dp/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_managed.h>
include/drm/display/drm_dp_aux_bus.h renamed from include/drm/dp/drm_dp_aux_bus.h +0 -0
similarity index 100%
rename from include/drm/dp/drm_dp_aux_bus.h
rename to include/drm/display/drm_dp_aux_bus.h
include/drm/display/drm_dp_dual_mode_helper.h renamed from include/drm/dp/drm_dp_dual_mode_helper.h +0 -0
similarity index 100%
rename from include/drm/dp/drm_dp_dual_mode_helper.h
rename to include/drm/display/drm_dp_dual_mode_helper.h
include/drm/display/drm_dp_helper.h renamed from include/drm/dp/drm_dp_helper.h +0 -0
similarity index 100%
rename from include/drm/dp/drm_dp_helper.h
rename to include/drm/display/drm_dp_helper.h
include/drm/display/drm_dp_mst_helper.h renamed from include/drm/dp/drm_dp_mst_helper.h +1 -1
similarity index 99%
rename from include/drm/dp/drm_dp_mst_helper.h
rename to include/drm/display/drm_dp_mst_helper.h
index 08276eb8c187..10adec068b7f 100644
@@ -23,7 +23,7 @@
 #define _DRM_DP_MST_HELPER_H_
 
 #include <linux/types.h>
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 #include <drm/drm_atomic.h>
 
 #if IS_ENABLED(CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS)
include/drm/drm_dsc.h +1 -1
index ca022e960dcc..84e3d11cc1bb 100644
@@ -8,7 +8,7 @@
 #ifndef DRM_DSC_H_
 #define DRM_DSC_H_
 
-#include <drm/dp/drm_dp_helper.h>
+#include <drm/display/drm_dp_helper.h>
 
 /* VESA Display Stream Compression DSC 1.2 constants */
 #define DSC_NUM_BUF_RANGES			15
Signature · 1 line
2.35.1
Reviewed-by on v1 2/8
#5 lore raw

Re: [PATCH 2/8] drm: Rename dp/ to display/

Quoted 8 lines · Thomas Zimmermann

Rename dp/ to display/ to account for additional display-related helpers, such as HDMI. Update all related include statements. No functional changes.

Various drivers, such as i915 and amdgpu, use similar naming scheme by putting code for video-output standards into a local display/ directory. The new directory's name is aligned with that policy.

It is really a policy or just a convention ?

Quoted 3 lines

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
author maintainer
#6 lore raw

Re: [PATCH 2/8] drm: Rename dp/ to display/

Hi

Am 30.03.22 um 11:04 schrieb Javier Martinez Canillas:

Quoted 11 lines · Thomas Zimmermann
Quoted 8 lines

Rename dp/ to display/ to account for additional display-related helpers, such as HDMI. Update all related include statements. No functional changes.

Various drivers, such as i915 and amdgpu, use similar naming scheme by putting code for video-output standards into a local display/ directory. The new directory's name is aligned with that policy.

It is really a policy or just a convention ?

Convention, I think. I'll update the wording.

Best regards
Thomas

Quoted 7 lines
Quoted 4 lines

---

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
Reviewed-by on v1 2/8
#7 lore raw

Re: [PATCH 2/8] drm: Rename dp/ to display/

In reply to Thomas Zimmermann
Quoted 10 lines · Thomas Zimmermann

Rename dp/ to display/ to account for additional display-related helpers, such as HDMI. Update all related include statements. No functional changes.

Various drivers, such as i915 and amdgpu, use similar naming scheme by putting code for video-output standards into a local display/ directory. The new directory's name is aligned with that policy.

author maintainer
#8 lore raw

PATCH 3/8 drm/display: Introduce a DRM display-helper module

In reply to Thomas Zimmermann

Replace the DP-helper module with a display-helper module. 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 still be able to select the required video-output helpers. Linking all such code into a single module avoids the proliferation of small kernel modules.

---
 drivers/gpu/drm/Kconfig                                |  7 +++++++
 drivers/gpu/drm/display/Makefile                       |  9 +++++----
 .../{drm_dp_helper_mod.c => drm_display_helper_mod.c}  | 10 +++++-----
 drivers/gpu/drm/display/{drm_dp.c => drm_dp_helper.c}  |  0
 4 files changed, 17 insertions(+), 9 deletions(-)
 rename drivers/gpu/drm/display/{drm_dp_helper_mod.c => drm_display_helper_mod.c} (51%)
 rename drivers/gpu/drm/display/{drm_dp.c => drm_dp_helper.c} (100%)
drivers/gpu/drm/Kconfig +7 -0
index f1422bee3dcc..bffcd4d2314b 100644
@@ -82,9 +82,16 @@ config DRM_DEBUG_SELFTEST
 
 	  If in doubt, say "N".
 
+config DRM_DISPLAY_HELPER
+	tristate
+	depends on DRM
+	help
+	  DRM helpers for display adapters.
+
 config DRM_DP_HELPER
 	tristate
 	depends on DRM
+	select DRM_DISPLAY_HELPER
 	help
 	  DRM helpers for DisplayPort.
 
drivers/gpu/drm/display/Makefile +5 -4
index 75faffc706b1..90f12e9b4735 100644
@@ -2,8 +2,9 @@
 
 obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
 
-drm_dp_helper-y := drm_dp.o drm_dp_dual_mode_helper.o drm_dp_helper_mod.o drm_dp_mst_topology.o
-drm_dp_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
-drm_dp_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
+drm_display_helper-y := drm_display_helper_mod.o
+drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_helper.o drm_dp_mst_topology.o
+drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
+drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
 
-obj-$(CONFIG_DRM_DP_HELPER) += drm_dp_helper.o
+obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o
drivers/gpu/drm/display/drm_display_helper_mod.c renamed from drivers/gpu/drm/display/drm_dp_helper_mod.c +5 -5
similarity index 51%
rename from drivers/gpu/drm/display/drm_dp_helper_mod.c
rename to drivers/gpu/drm/display/drm_display_helper_mod.c
index db753de24000..d8a6e6228773 100644
@@ -4,19 +4,19 @@
 
 #include "drm_dp_helper_internal.h"
 
-MODULE_DESCRIPTION("DRM DisplayPort helper");
+MODULE_DESCRIPTION("DRM display adapter helper");
 MODULE_LICENSE("GPL and additional rights");
 
-static int __init drm_dp_helper_module_init(void)
+static int __init drm_display_helper_module_init(void)
 {
 	return drm_dp_aux_dev_init();
 }
 
-static void __exit drm_dp_helper_module_exit(void)
+static void __exit drm_display_helper_module_exit(void)
 {
 	/* Call exit functions from specific dp helpers here */
 	drm_dp_aux_dev_exit();
 }
 
-module_init(drm_dp_helper_module_init);
-module_exit(drm_dp_helper_module_exit);
+module_init(drm_display_helper_module_init);
+module_exit(drm_display_helper_module_exit);
drivers/gpu/drm/display/drm_dp_helper.c renamed from drivers/gpu/drm/display/drm_dp.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/display/drm_dp.c
rename to drivers/gpu/drm/display/drm_dp_helper.c
Signature · 1 line
2.35.1
#9 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

Quoted 11 lines · Thomas Zimmermann

Replace the DP-helper module with a display-helper module. 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 still be able to select the required video-output helpers. Linking all such code into a single module avoids the proliferation of small kernel modules.

---

[snip]

drivers/gpu/drm/Kconfig config DRM_DEBUG_SELFTEST · line 96

Quoted 13 lines
drivers/gpu/drm/Kconfig +7 -0
+config DRM_DISPLAY_HELPER
+	tristate
+	depends on DRM
+	help
+	  DRM helpers for display adapters.
+
 config DRM_DP_HELPER
 	tristate
 	depends on DRM
+	select DRM_DISPLAY_HELPER
 	help
 	  DRM helpers for DisplayPort.

I was about to ask why this would still be needed but then re-read the commit message that says drivers will still be able to select required video-output helpers.

That makes sense since the fact that all helpers will be in the same module would be transparent to drivers.

Quoted 8 lines
drivers/gpu/drm/display/Makefile +0 -0
index 75faffc706b1..90f12e9b4735 100644
@@ -2,8 +2,9 @@
 
 obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
 

drivers/gpu/drm/display/Makefile line 10

Quoted 10 lines
drivers/gpu/drm/display/Makefile +5 -4
-drm_dp_helper-y := drm_dp.o drm_dp_dual_mode_helper.o drm_dp_helper_mod.o drm_dp_mst_topology.o
-drm_dp_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
-drm_dp_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
+drm_display_helper-y := drm_display_helper_mod.o
+drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_helper.o drm_dp_mst_topology.o
+drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
+drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
 
-obj-$(CONFIG_DRM_DP_HELPER) += drm_dp_helper.o
+obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o

The drm_dp_helper.ko module has some parameters and this change will break existing kernel cmdline that are using it:

$ modinfo drivers/gpu/drm/dp/drm_dp_helper.ko | grep parm | cut -d : -f2
           drm_dp_cec_unregister_delay
           dp_aux_i2c_speed_khz
           dp_aux_i2c_transfer_size

I don't know whether those are considered a kernel ABI or not though, and some already changed when the DP helpers were moved from drm_kms_helper.ko

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
author maintainer
#10 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

Hi

Am 30.03.22 um 11:23 schrieb Javier Martinez Canillas:

Quoted 58 lines · Thomas Zimmermann
Quoted 11 lines

Replace the DP-helper module with a display-helper module. 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 still be able to select the required video-output helpers. Linking all such code into a single module avoids the proliferation of small kernel modules.

---

[snip]

drivers/gpu/drm/Kconfig config DRM_DEBUG_SELFTEST · line 96

Quoted 13 lines
drivers/gpu/drm/Kconfig +7 -0
+config DRM_DISPLAY_HELPER
+	tristate
+	depends on DRM
+	help
+	  DRM helpers for display adapters.
+
  config DRM_DP_HELPER
  	tristate
  	depends on DRM
+	select DRM_DISPLAY_HELPER
  	help
  	  DRM helpers for DisplayPort.

I was about to ask why this would still be needed but then re-read the commit message that says drivers will still be able to select required video-output helpers.

That makes sense since the fact that all helpers will be in the same module would be transparent to drivers.

Quoted 8 lines
drivers/gpu/drm/display/Makefile +0 -0
index 75faffc706b1..90f12e9b4735 100644
@@ -2,8 +2,9 @@
 
  obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
 

drivers/gpu/drm/display/Makefile line 10

Quoted 10 lines
drivers/gpu/drm/display/Makefile +5 -4
-drm_dp_helper-y := drm_dp.o drm_dp_dual_mode_helper.o drm_dp_helper_mod.o drm_dp_mst_topology.o
-drm_dp_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
-drm_dp_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
+drm_display_helper-y := drm_display_helper_mod.o
+drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_helper.o drm_dp_mst_topology.o
+drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
+drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
 
-obj-$(CONFIG_DRM_DP_HELPER) += drm_dp_helper.o
+obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o

The drm_dp_helper.ko module has some parameters and this change will break existing kernel cmdline that are using it:

Quoted 7 lines
$ modinfo drivers/gpu/drm/dp/drm_dp_helper.ko | grep parm | cut -d : -f2
            drm_dp_cec_unregister_delay
            dp_aux_i2c_speed_khz
            dp_aux_i2c_transfer_size

I don't know whether those are considered a kernel ABI or not though, and some already changed when the DP helpers were moved from drm_kms_helper.ko

Good point. I'll mention it in the commit message andcheck the documentation as well.

At least, no one complained when these functions moved from kms helpers into dp helpers. Moving them again is unfortunate, but I hope that the new library will stick.

I somehow expected that HDMI, HDCP et al would require their own libraries. But introducing several new and tiny kernel modules for such small helpers wasn't worth it. Hence, there's the display library that can collect all such helpers in a single place.

It looks like MIPI DSI could be another candidate to be moved into the display library; at least partially. I have go through the codebase to see if there are drivers that would benefit from such a change.

Best regards
Thomas

Quoted 1 line
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
#11 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

Hello Thomas,

Quoted 2 lines · Thomas Zimmermann

Hi

[snip]

Quoted 15 lines
Quoted 7 lines

drivers/gpu/drm/display/Makefile line 10

Quoted 3 lines
drivers/gpu/drm/display/Makefile +1 -1
-obj-$(CONFIG_DRM_DP_HELPER) += drm_dp_helper.o
+obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o

The drm_dp_helper.ko module has some parameters and this change will break existing kernel cmdline that are using it:

Quoted 7 lines
$ modinfo drivers/gpu/drm/dp/drm_dp_helper.ko | grep parm | cut -d : -f2
            drm_dp_cec_unregister_delay
            dp_aux_i2c_speed_khz
            dp_aux_i2c_transfer_size

I don't know whether those are considered a kernel ABI or not though, and some already changed when the DP helpers were moved from drm_kms_helper.ko

Quoted 7 lines

Good point. I'll mention it in the commit message andcheck the documentation as well.

At least, no one complained when these functions moved from kms helpers into dp helpers. Moving them again is unfortunate, but I hope that the new library will stick.

I was just pointing out because honestly I didn't know what was the kernel policy around changing kernel command line parameters. It seems that isn't documented anywhere.

But since no one complained when these were moved from drm_kms_helper.ko and the current drm_dp_helper.ko is so recent, I would say that's fine.

If you re-spin feel free to add,

Quoted 5 lines

I somehow expected that HDMI, HDCP et al would require their own libraries. But introducing several new and tiny kernel modules for such small helpers wasn't worth it. Hence, there's the display library that can collect all such helpers in a single place.

Yes, I agree with your approach to have all helpers into a single module.

Quoted 4 lines

It looks like MIPI DSI could be another candidate to be moved into the display library; at least partially. I have go through the codebase to see if there are drivers that would benefit from such a change.

Great.

Quoted 5 lines

Best regards
Thomas

Quoted 1 line
Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
author maintainer
#12 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

In reply to Javier Martinez Canillas

Hi Javier

Am 30.03.22 um 11:23 schrieb Javier Martinez Canillas:

Quoted 33 lines · Thomas Zimmermann
Quoted 11 lines

Replace the DP-helper module with a display-helper module. 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 still be able to select the required video-output helpers. Linking all such code into a single module avoids the proliferation of small kernel modules.

---

[snip]

drivers/gpu/drm/Kconfig config DRM_DEBUG_SELFTEST · line 96

Quoted 13 lines
drivers/gpu/drm/Kconfig +7 -0
+config DRM_DISPLAY_HELPER
+	tristate
+	depends on DRM
+	help
+	  DRM helpers for display adapters.
+
  config DRM_DP_HELPER
  	tristate
  	depends on DRM
+	select DRM_DISPLAY_HELPER
  	help
  	  DRM helpers for DisplayPort.

I was about to ask why this would still be needed but then re-read the commit message that says drivers will still be able to select required video-output helpers.

Quoted 2 lines

That makes sense since the fact that all helpers will be in the same module would be transparent to drivers.

After some more testing, it turns out to be not so easy. For example, if we have DP_HELPER=m and HDMI_HELPER=y, then DISPLAY_HELPER would be auto-selected as 'y'. The code for DP_HELPER would not be linked correctly.

I'm going to make drivers select DISPLAY_HELPER and the rsp helpers explicitly. The individual helpers would be covered boolean options that enable the feature in the display-helper library.

If you know some Kconfig magic to enable the original design, let me know.

Best regards
Thomas

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
#13 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

Quoted 43 lines · Thomas Zimmermann

Hi Javier

Am 30.03.22 um 11:23 schrieb Javier Martinez Canillas:

Quoted 33 lines · Thomas Zimmermann
Quoted 11 lines

Replace the DP-helper module with a display-helper module. 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 still be able to select the required video-output helpers. Linking all such code into a single module avoids the proliferation of small kernel modules.

---

[snip]

drivers/gpu/drm/Kconfig config DRM_DEBUG_SELFTEST · line 96

Quoted 13 lines
drivers/gpu/drm/Kconfig +7 -0
+config DRM_DISPLAY_HELPER
+	tristate
+	depends on DRM
+	help
+	  DRM helpers for display adapters.
+
  config DRM_DP_HELPER
  	tristate
  	depends on DRM
+	select DRM_DISPLAY_HELPER
  	help
  	  DRM helpers for DisplayPort.

I was about to ask why this would still be needed but then re-read the commit message that says drivers will still be able to select required video-output helpers.

Quoted 2 lines

That makes sense since the fact that all helpers will be in the same module would be transparent to drivers.

After some more testing, it turns out to be not so easy. For example, if we have DP_HELPER=m and HDMI_HELPER=y, then DISPLAY_HELPER would be auto-selected as 'y'. The code for DP_HELPER would not be linked correctly.

Quoted 6 lines

I'm going to make drivers select DISPLAY_HELPER and the rsp helpers explicitly. The individual helpers would be covered boolean options that enable the feature in the display-helper library.

If you know some Kconfig magic to enable the original design, let me know.

I do not. But I wonder if the problem here is the usage of select rather than depends and if with the later the original design could still be achieved...

But yes, probably the only way to prevent that issue is to make the drivers to explicitly select both DRM_DISPLAY_HELPER and respective helpers symbol.
--
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat

author maintainer
#14 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

Hi Javier

Am 07.04.22 um 09:43 schrieb Javier Martinez Canillas:

Quoted 48 lines · Thomas Zimmermann
Quoted 47 lines

Hi Javier

Am 30.03.22 um 11:23 schrieb Javier Martinez Canillas:

Quoted 33 lines · Thomas Zimmermann
Quoted 11 lines

Replace the DP-helper module with a display-helper module. 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 still be able to select the required video-output helpers. Linking all such code into a single module avoids the proliferation of small kernel modules.

---

[snip]

drivers/gpu/drm/Kconfig config DRM_DEBUG_SELFTEST · line 96

Quoted 13 lines
drivers/gpu/drm/Kconfig +7 -0
+config DRM_DISPLAY_HELPER
+	tristate
+	depends on DRM
+	help
+	  DRM helpers for display adapters.
+
   config DRM_DP_HELPER
   	tristate
   	depends on DRM
+	select DRM_DISPLAY_HELPER
   	help
   	  DRM helpers for DisplayPort.

I was about to ask why this would still be needed but then re-read the commit message that says drivers will still be able to select required video-output helpers.

Quoted 2 lines

That makes sense since the fact that all helpers will be in the same module would be transparent to drivers.

After some more testing, it turns out to be not so easy. For example, if we have DP_HELPER=m and HDMI_HELPER=y, then DISPLAY_HELPER would be auto-selected as 'y'. The code for DP_HELPER would not be linked correctly.

I'm going to make drivers select DISPLAY_HELPER and the rsp helpers explicitly. The individual helpers would be covered boolean options that enable the feature in the display-helper library.

Quoted 5 lines
Quoted 2 lines

If you know some Kconfig magic to enable the original design, let me know.

I do not. But I wonder if the problem here is the usage of select rather than depends and if with the later the original design could still be achieved...

With 'depends DRM_DISPLAY_HELPER' users would need to explictly enable DRM_DISPLAY_HELPER, I think.

Quoted 3 lines

But yes, probably the only way to prevent that issue is to make the drivers to explicitly select both DRM_DISPLAY_HELPER and respective helpers symbol.

I'll remake the patches with the new style.

I think another idea that could work is to use an intermediate symbol. For DP, drivers would select the tristate DP_HELPER, which in turn selects tristate DISPLAY_HELPER and boolean DISPLAY_DP_HELPER. But this would require a 'useless' symbol DP_HELPER only for convenience. It's an even less optimal solution, it seems.

Best regards
Thomas

Quoted 7 lines

--
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
maintainer
#15 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

Quoted 64 lines · Thomas Zimmermann

Hi Javier

Am 07.04.22 um 09:43 schrieb Javier Martinez Canillas:

Quoted 48 lines · Thomas Zimmermann
Quoted 47 lines

Hi Javier

Am 30.03.22 um 11:23 schrieb Javier Martinez Canillas:

Quoted 33 lines · Thomas Zimmermann
Quoted 11 lines

Replace the DP-helper module with a display-helper module. 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 still be able to select the required video-output helpers. Linking all such code into a single module avoids the proliferation of small kernel modules.

---

[snip]

drivers/gpu/drm/Kconfig config DRM_DEBUG_SELFTEST · line 96

Quoted 13 lines
drivers/gpu/drm/Kconfig +7 -0
+config DRM_DISPLAY_HELPER
+	tristate
+	depends on DRM
+	help
+	  DRM helpers for display adapters.
+
   config DRM_DP_HELPER
   	tristate
   	depends on DRM
+	select DRM_DISPLAY_HELPER
   	help
   	  DRM helpers for DisplayPort.

I was about to ask why this would still be needed but then re-read the commit message that says drivers will still be able to select required video-output helpers.

Quoted 2 lines

That makes sense since the fact that all helpers will be in the same module would be transparent to drivers.

After some more testing, it turns out to be not so easy. For example, if we have DP_HELPER=m and HDMI_HELPER=y, then DISPLAY_HELPER would be auto-selected as 'y'. The code for DP_HELPER would not be linked correctly.

I'm going to make drivers select DISPLAY_HELPER and the rsp helpers explicitly. The individual helpers would be covered boolean options that enable the feature in the display-helper library.

Quoted 5 lines
Quoted 2 lines

If you know some Kconfig magic to enable the original design, let me know.

I do not. But I wonder if the problem here is the usage of select rather than depends and if with the later the original design could still be achieved...

With 'depends DRM_DISPLAY_HELPER' users would need to explictly enable DRM_DISPLAY_HELPER, I think.

Quoted 3 lines

But yes, probably the only way to prevent that issue is to make the drivers to explicitly select both DRM_DISPLAY_HELPER and respective helpers symbol.

Quoted 7 lines

I'll remake the patches with the new style.

I think another idea that could work is to use an intermediate symbol. For DP, drivers would select the tristate DP_HELPER, which in turn selects tristate DISPLAY_HELPER and boolean DISPLAY_DP_HELPER. But this would require a 'useless' symbol DP_HELPER only for convenience. It's an even less optimal solution, it seems.

Documentation/kbuild/kconfig-language.rst:

Note:
select should be used with care. select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set.
--> In general use select only for non-visible symbols
--> (no prompts anywhere) and for symbols with no dependencies.
That will limit the usefulness but on the other hand avoid the illegal configurations all over.

Most of the difficult Kconfig issues I've encountered over the years come from not following the above two rules. People break those rules for "convenience", causing a lot of inconvenience down the line.

BR,
Jani.

Quoted 11 lines

Best regards
Thomas

Quoted 7 lines

--
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
author maintainer
#16 lore raw

Re: [PATCH 3/8] drm/display: Introduce a DRM display-helper module

Hi Jani

Am 07.04.22 um 10:45 schrieb Jani Nikula:
...

Quoted 19 lines
Quoted 6 lines

I think another idea that could work is to use an intermediate symbol. For DP, drivers would select the tristate DP_HELPER, which in turn selects tristate DISPLAY_HELPER and boolean DISPLAY_DP_HELPER. But this would require a 'useless' symbol DP_HELPER only for convenience. It's an even less optimal solution, it seems.

Documentation/kbuild/kconfig-language.rst:

Note:
select should be used with care. select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set.
--> In general use select only for non-visible symbols
--> (no prompts anywhere) and for symbols with no dependencies.
That will limit the usefulness but on the other hand avoid the illegal configurations all over.

Quoted 3 lines

Most of the difficult Kconfig issues I've encountered over the years come from not following the above two rules. People break those rules for "convenience", causing a lot of inconvenience down the line.

I have meanwhile updated the patchset and all new boolean options are internal. No select will be performed on 'visible' symbols. So it should be fine.

Best regards
Thomas

Quoted 18 lines

BR,
Jani.

Quoted 11 lines

Best regards
Thomas

Quoted 7 lines
   --

Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
author maintainer
#17 lore raw

PATCH 4/8 drm/display: Split DisplayPort header into core and helper

In reply to Thomas Zimmermann

Move DisplayPort protocol constants and structures into the new header drm_dp.h, which can be used by DRM core components. The existing header drm_dp_helper.h now only contains helper code for graphics drivers. No functional changes.

---
 Documentation/gpu/drm-kms-helpers.rst |    3 +
 include/drm/display/drm_dp.h          | 1688 +++++++++++++++++++++++++
 include/drm/display/drm_dp_helper.h   | 1662 +-----------------------
 3 files changed, 1693 insertions(+), 1660 deletions(-)
 create mode 100644 include/drm/display/drm_dp.h
Documentation/gpu/drm-kms-helpers.rst +3 -0
index 2584f5bff66f..09463ee99730 100644
@@ -235,6 +235,9 @@ Display Port Helper Functions Reference
 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
    :doc: dp helpers
 
+.. kernel-doc:: include/drm/display/drm_dp.h
+   :internal:
+
 .. kernel-doc:: include/drm/display/drm_dp_helper.h
    :internal:
 
include/drm/display/drm_dp.h new file +1688 -0

1,688 lines not on this page · raw message

include/drm/display/drm_dp_helper.h +2 -1660

1,303 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.35.1

Part of the diff is not shown here. View the raw message.

Reviewed-by on v1 4/8
#18 lore raw

Re: [PATCH 4/8] drm/display: Split DisplayPort header into core and helper

Quoted 7 lines · Thomas Zimmermann

Move DisplayPort protocol constants and structures into the new header drm_dp.h, which can be used by DRM core components. The existing header drm_dp_helper.h now only contains helper code for graphics drivers. No functional changes.

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
author maintainer
#19 lore raw

PATCH 5/8 drm/display: Move DSC header and helpers into display-helper module

In reply to Thomas Zimmermann

DSC is the Display Stream Compression standard for DisplayPort. Move the DSC code into display/ and split the header into files for protocol core and DRM helpers. Adapt all users of the code. No functional changes.

To avoid the proliferation of Kconfig options, DSC is part of DRM's support for DisplayPort. If necessary, a new option could make DSC an independent feature.

---
 Documentation/gpu/drm-kms-helpers.rst         |  6 +++---
 drivers/gpu/drm/Makefile                      |  2 +-
 .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c  |  2 ++
 .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h  |  2 +-
 .../drm/amd/display/dc/dml/dsc/rc_calc_fpu.h  |  2 +-
 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c   |  4 ++--
 .../gpu/drm/amd/display/dc/dsc/dscc_types.h   |  2 +-
 .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c  |  2 +-
 drivers/gpu/drm/display/Makefile              |  3 ++-
 .../{drm_dsc.c => display/drm_dsc_helper.c}   |  2 +-
 drivers/gpu/drm/drm_mipi_dsi.c                |  6 +++---
 drivers/gpu/drm/i915/display/icl_dsi.c        |  1 +
 drivers/gpu/drm/i915/display/intel_bios.c     |  1 +
 .../drm/i915/display/intel_display_types.h    |  2 +-
 drivers/gpu/drm/i915/display/intel_dp.c       |  1 +
 .../gpu/drm/i915/display/intel_qp_tables.c    |  2 +-
 drivers/gpu/drm/i915/display/intel_vdsc.c     |  2 ++
 include/drm/{ => display}/drm_dsc.h           |  8 +-------
 include/drm/display/drm_dsc_helper.h          | 20 +++++++++++++++++++
 19 files changed, 46 insertions(+), 24 deletions(-)
 rename drivers/gpu/drm/{drm_dsc.c => display/drm_dsc_helper.c} (99%)
 rename include/drm/{ => display}/drm_dsc.h (97%)
 create mode 100644 include/drm/display/drm_dsc_helper.h
Documentation/gpu/drm-kms-helpers.rst +3 -3
index 09463ee99730..7af55fb4072c 100644
@@ -326,13 +326,13 @@ MIPI DSI Helper Functions Reference
 Display Stream Compression Helper Functions Reference
 =====================================================
 
-.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
    :doc: dsc helpers
 
-.. kernel-doc:: include/drm/drm_dsc.h
+.. kernel-doc:: include/drm/display/drm_dsc.h
    :internal:
 
-.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
    :export:
 
 Output Probing Helper Functions Reference
drivers/gpu/drm/Makefile +1 -1
index 07f7a70a78ea..b8353af70152 100644
@@ -58,7 +58,7 @@ obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
 #
 
 drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
-		drm_dsc.o drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
+		drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
 		drm_probe_helper.o \
 		drm_plane_helper.o drm_atomic_helper.o \
 		drm_kms_helper_common.o \
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +2 -0
index ef5c4c0f4d6c..6f24ceab97ad 100644
@@ -23,6 +23,8 @@
  *
  */
 
+#include <drm/display/drm_dsc_helper.h>
+
 #include "reg_helper.h"
 #include "dcn20_dsc.h"
 #include "dsc/dscc_types.h"
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h +1 -1
index 1118e33aaa2c..c21ecedc4692 100644
@@ -26,7 +26,7 @@
 
 #include "dsc.h"
 #include "dsc/dscc_types.h"
-#include <drm/drm_dsc.h>
+#include <drm/display/drm_dsc.h>
 
 #define TO_DCN20_DSC(dsc)\
 	container_of(dsc, struct dcn20_dsc, base)
drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.h +1 -1
index cad244c023cd..d7cd8cc24758 100644
@@ -27,7 +27,7 @@
 #define __RC_CALC_FPU_H__
 
 #include "os_types.h"
-#include <drm/drm_dsc.h>
+#include <drm/display/drm_dsc.h>
 
 #define QP_SET_SIZE 15
 
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +2 -2
index 411b79979e2e..8da28bcfac7e 100644
@@ -22,10 +22,10 @@
  * Author: AMD
  */
 
-#include <drm/drm_dsc.h>
+#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dsc_helper.h>
 #include "dc_hw_types.h"
 #include "dsc.h"
-#include <drm/display/drm_dp_helper.h>
 #include "dc.h"
 #include "rc_calc.h"
 #include "fixed31_32.h"
drivers/gpu/drm/amd/display/dc/dsc/dscc_types.h +1 -1
index 9f70e87b3ecb..ad80bde9bc0f 100644
@@ -26,7 +26,7 @@
 #ifndef __DSCC_TYPES_H__
 #define __DSCC_TYPES_H__
 
-#include <drm/drm_dsc.h>
+#include <drm/display/drm_dsc.h>
 
 #ifndef NUM_BUF_RANGES
 #define NUM_BUF_RANGES 15
drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c +1 -1
index 7e306aa3e2b9..f0aea988fef0 100644
@@ -22,7 +22,7 @@
  * Authors: AMD
  *
  */
-#include <drm/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
 #include "dscc_types.h"
 #include "rc_calc.h"
 
drivers/gpu/drm/display/Makefile +2 -1
index 90f12e9b4735..cb750af7d63f 100644
@@ -3,7 +3,8 @@
 obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
 
 drm_display_helper-y := drm_display_helper_mod.o
-drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_helper.o drm_dp_mst_topology.o
+drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_helper.o \
+					      drm_dp_mst_topology.o drm_dsc_helper.o
 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
 
drivers/gpu/drm/display/drm_dsc_helper.c renamed from drivers/gpu/drm/drm_dsc.c +1 -1
similarity index 99%
rename from drivers/gpu/drm/drm_dsc.c
rename to drivers/gpu/drm/display/drm_dsc_helper.c
index 2428bdfc4c8f..c869c6e51e2b 100644
@@ -13,8 +13,8 @@
 #include <linux/byteorder/generic.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dsc_helper.h>
 #include <drm/drm_print.h>
-#include <drm/drm_dsc.h>
 
 /**
  * DOC: dsc helpers
drivers/gpu/drm/drm_mipi_dsi.c +3 -3
index 18cef04df2f2..c40bde96cfdf 100644
@@ -25,16 +25,16 @@
  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <drm/drm_mipi_dsi.h>
-
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
 
-#include <drm/drm_dsc.h>
+#include <drm/display/drm_dsc.h>
+#include <drm/drm_mipi_dsi.h>
 #include <drm/drm_print.h>
+
 #include <video/mipi_display.h>
 
 /**
drivers/gpu/drm/i915/display/icl_dsi.c +1 -0
index 00cae5d26637..146cbaae2ede 100644
@@ -25,6 +25,7 @@
  *   Jani Nikula <[email protected]>
  */
 
+#include <drm/display/drm_dsc_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_mipi_dsi.h>
 
drivers/gpu/drm/i915/display/intel_bios.c +1 -0
index 3a990918eab7..b300cd1f557d 100644
@@ -26,6 +26,7 @@
  */
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dsc_helper.h>
 
 #include "display/intel_display.h"
 #include "display/intel_display_types.h"
drivers/gpu/drm/i915/display/intel_display_types.h +1 -1
index d3b5d1325d49..b924fc5de83a 100644
@@ -33,9 +33,9 @@
 
 #include <drm/display/drm_dp_dual_mode_helper.h>
 #include <drm/display/drm_dp_mst_helper.h>
+#include <drm/display/drm_dsc.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_dsc.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/i915/display/intel_dp.c +1 -0
index 9477479d8449..cad8cba93ba8 100644
@@ -36,6 +36,7 @@
 #include <asm/byteorder.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dsc_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
drivers/gpu/drm/i915/display/intel_qp_tables.c +1 -1
index c626a24fe98f..6f8e4ec5c0fb 100644
@@ -3,7 +3,7 @@
  * Copyright © 2021 Intel Corporation
  */
 
-#include <drm/drm_dsc.h>
+#include <drm/display/drm_dsc.h>
 
 #include "i915_utils.h"
 #include "intel_qp_tables.h"
drivers/gpu/drm/i915/display/intel_vdsc.c +2 -0
index e59c29ab1300..43e1bbc1e303 100644
@@ -7,6 +7,8 @@
  */
 #include <linux/limits.h>
 
+#include <drm/display/drm_dsc_helper.h>
+
 #include "i915_drv.h"
 #include "intel_crtc.h"
 #include "intel_de.h"
include/drm/display/drm_dsc.h renamed from include/drm/drm_dsc.h +1 -7
similarity index 97%
rename from include/drm/drm_dsc.h
rename to include/drm/display/drm_dsc.h
index 84e3d11cc1bb..bc90273d06a6 100644
@@ -8,7 +8,7 @@
 #ifndef DRM_DSC_H_
 #define DRM_DSC_H_
 
-#include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_dp.h>
 
 /* VESA Display Stream Compression DSC 1.2 constants */
 #define DSC_NUM_BUF_RANGES			15
@@ -602,10 +602,4 @@ struct drm_dsc_pps_infoframe {
 	struct drm_dsc_picture_parameter_set pps_payload;
 } __packed;
 
-void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header);
-int drm_dsc_dp_rc_buffer_size(u8 rc_buffer_block_size, u8 rc_buffer_size);
-void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_sdp,
-				const struct drm_dsc_config *dsc_cfg);
-int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
-
 #endif /* _DRM_DSC_H_ */
include/drm/display/drm_dsc_helper.h new file +20 -0
new file mode 100644
index 000000000000..6da3716f9f39
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: MIT
+ * Copyright (C) 2018 Intel Corp.
+ *
+ * Authors:
+ * Manasi Navare <[email protected]>
+ */
+
+#ifndef DRM_DSC_HELPER_H_
+#define DRM_DSC_HELPER_H_
+
+#include <drm/display/drm_dsc.h>
+
+void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header);
+int drm_dsc_dp_rc_buffer_size(u8 rc_buffer_block_size, u8 rc_buffer_size);
+void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_sdp,
+				const struct drm_dsc_config *dsc_cfg);
+int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
+
+#endif /* _DRM_DSC_HELPER_H_ */
+
Signature · 1 line
2.35.1
Reviewed-by on v1 5/8
#20 lore raw

Re: [PATCH 5/8] drm/display: Move DSC header and helpers into display-helper module

Quoted 11 lines · Thomas Zimmermann

DSC is the Display Stream Compression standard for DisplayPort. Move the DSC code into display/ and split the header into files for protocol core and DRM helpers. Adapt all users of the code. No functional changes.

To avoid the proliferation of Kconfig options, DSC is part of DRM's support for DisplayPort. If necessary, a new option could make DSC an independent feature.

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
author maintainer
#21 lore raw

PATCH 6/8 drm/display: Move HDCP helpers into display-helper module

In reply to Thomas Zimmermann

Move DRM's HDCP helper library into the display/ subdirectory and add it to DRM's display helpers. Split the header file into core and helpers. Update all affected drivers. No functional changes.

---
 Documentation/gpu/drm-kms-helpers.rst         |  2 +-
 drivers/gpu/drm/Kconfig                       |  7 ++++++
 drivers/gpu/drm/Makefile                      |  2 +-
 drivers/gpu/drm/amd/display/Kconfig           |  1 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |  2 +-
 .../gpu/drm/amd/display/modules/hdcp/hdcp.h   |  2 +-
 drivers/gpu/drm/bridge/Kconfig                |  1 +
 drivers/gpu/drm/bridge/analogix/Kconfig       |  1 +
 drivers/gpu/drm/bridge/analogix/anx7625.c     |  2 +-
 drivers/gpu/drm/bridge/cadence/Kconfig        |  1 +
 .../drm/bridge/cadence/cdns-mhdp8546-core.c   |  2 +-
 .../drm/bridge/cadence/cdns-mhdp8546-hdcp.c   |  2 +-
 drivers/gpu/drm/bridge/ite-it6505.c           |  2 +-
 drivers/gpu/drm/display/Makefile              |  1 +
 .../{drm_hdcp.c => display/drm_hdcp_helper.c} |  4 ++--
 drivers/gpu/drm/i915/Kconfig                  |  1 +
 drivers/gpu/drm/i915/display/intel_dp_hdcp.c  |  2 +-
 drivers/gpu/drm/i915/display/intel_gmbus.c    |  2 +-
 drivers/gpu/drm/i915/display/intel_hdcp.c     |  2 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c     |  2 +-
 drivers/misc/mei/hdcp/mei_hdcp.h              |  2 +-
 include/drm/{ => display}/drm_hdcp.h          | 14 ++----------
 include/drm/display/drm_hdcp_helper.h         | 22 +++++++++++++++++++
 include/drm/i915_mei_hdcp_interface.h         |  2 +-
 25 files changed, 54 insertions(+), 29 deletions(-)
 rename drivers/gpu/drm/{drm_hdcp.c => display/drm_hdcp_helper.c} (99%)
 rename include/drm/{ => display}/drm_hdcp.h (95%)
 create mode 100644 include/drm/display/drm_hdcp_helper.h
Documentation/gpu/drm-kms-helpers.rst +1 -1
index 7af55fb4072c..cfda5a092a48 100644
@@ -226,7 +226,7 @@ Panel Self Refresh Helper Reference
 HDCP Helper Functions Reference
 ===============================
 
-.. kernel-doc:: drivers/gpu/drm/drm_hdcp.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_hdcp_helper.c
    :export:
 
 Display Port Helper Functions Reference
drivers/gpu/drm/Kconfig +7 -0
index bffcd4d2314b..5cc5fc0d386d 100644
@@ -95,6 +95,13 @@ config DRM_DP_HELPER
 	help
 	  DRM helpers for DisplayPort.
 
+config DRM_HDCP_HELPER
+	tristate
+	depends on DRM
+	select DRM_DISPLAY_HELPER
+	help
+	  DRM helpers for HDCP.
+
 config DRM_KMS_HELPER
 	tristate
 	depends on DRM
drivers/gpu/drm/Makefile +1 -1
index b8353af70152..746a3a4953f3 100644
@@ -58,7 +58,7 @@ obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
 #
 
 drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
-		drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
+		drm_encoder_slave.o drm_flip_work.o \
 		drm_probe_helper.o \
 		drm_plane_helper.o drm_atomic_helper.o \
 		drm_kms_helper_common.o \
drivers/gpu/drm/amd/display/Kconfig +1 -0
index 127667e549c1..2264245c42de 100644
@@ -20,6 +20,7 @@ config DRM_AMD_DC_DCN
 config DRM_AMD_DC_HDCP
 	bool "Enable HDCP support in DC"
 	depends on DRM_AMD_DC
+	select DRM_HDCP_HELPER
 	help
 	  Choose this option if you want to support HDCP authentication.
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 4473ac43e5f5..ca42b7274372 100644
@@ -48,7 +48,7 @@
 #include "amdgpu_dm.h"
 #ifdef CONFIG_DRM_AMD_DC_HDCP
 #include "amdgpu_dm_hdcp.h"
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #endif
 #include "amdgpu_pm.h"
 #include "amdgpu_atombios.h"
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +1 -1
index bf0d50277f8f..15c0e3f2a9c3 100644
@@ -27,7 +27,7 @@
 #include "amdgpu.h"
 #include "amdgpu_dm.h"
 #include "dm_helpers.h"
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include "hdcp_psp.h"
 
 /*
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h +1 -1
index 6e88705e22f7..392c0c03365a 100644
@@ -30,7 +30,7 @@
 #include "hdcp_log.h"
 
 #include <drm/display/drm_dp_helper.h>
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 
 enum mod_hdcp_trans_input_result {
 	UNKNOWN = 0,
drivers/gpu/drm/bridge/Kconfig +1 -0
index 007e5a282f67..83768517d3b5 100644
@@ -77,6 +77,7 @@ config DRM_DISPLAY_CONNECTOR
 config DRM_ITE_IT6505
         tristate "ITE IT6505 DisplayPort bridge"
         depends on OF
+	select DRM_HDCP_HELPER
         select DRM_KMS_HELPER
         select EXTCON
         help
drivers/gpu/drm/bridge/analogix/Kconfig +1 -0
index cc0aa6572d98..47f6cd9109dc 100644
@@ -34,6 +34,7 @@ config DRM_ANALOGIX_ANX7625
 	depends on OF
 	select DRM_DP_AUX_BUS
 	select DRM_DP_HELPER
+	select DRM_HDCP_HELPER
 	select DRM_MIPI_DSI
 	help
 	  ANX7625 is an ultra-low power 4K mobile HD transmitter
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -1
index 21f16394012f..0ad78c73af7c 100644
@@ -23,11 +23,11 @@
 
 #include <drm/display/drm_dp_aux_bus.h>
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
drivers/gpu/drm/bridge/cadence/Kconfig +1 -0
index de697bade05e..8fe97ef7294e 100644
@@ -2,6 +2,7 @@
 config DRM_CDNS_MHDP8546
 	tristate "Cadence DPI/DP bridge"
 	select DRM_DP_HELPER
+	select DRM_HDCP_HELPER
 	select DRM_KMS_HELPER
 	select DRM_PANEL_BRIDGE
 	depends on OF
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +1 -1
index dec93a6d14c7..ee0de221d17d 100644
@@ -36,13 +36,13 @@
 #include <linux/wait.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c +1 -1
index fccd6fbcc257..946212a95598 100644
@@ -11,7 +11,7 @@
 
 #include <asm/unaligned.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 
 #include "cdns-mhdp8546-hdcp.h"
 
drivers/gpu/drm/bridge/ite-it6505.c +1 -1
index 85cffc108278..8fed30df08b0 100644
@@ -22,12 +22,12 @@
 #include <crypto/hash.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 
drivers/gpu/drm/display/Makefile +1 -0
index cb750af7d63f..e1f65f82cf8b 100644
@@ -7,5 +7,6 @@ drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_h
 					      drm_dp_mst_topology.o drm_dsc_helper.o
 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
+drm_display_helper-$(CONFIG_DRM_HDCP_HELPER) += drm_hdcp_helper.o
 
 obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o
drivers/gpu/drm/display/drm_hdcp_helper.c renamed from drivers/gpu/drm/drm_hdcp.c +2 -2
similarity index 99%
rename from drivers/gpu/drm/drm_hdcp.c
rename to drivers/gpu/drm/display/drm_hdcp_helper.c
index ca9b8f697202..0ebdfe7fef8f 100644
@@ -13,7 +13,7 @@
 #include <linux/slab.h>
 #include <linux/firmware.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_sysfs.h>
 #include <drm/drm_print.h>
 #include <drm/drm_device.h>
@@ -21,7 +21,7 @@
 #include <drm/drm_mode_object.h>
 #include <drm/drm_connector.h>
 
-#include "drm_internal.h"
+#include "../drm_internal.h"
 
 static inline void drm_hdcp_print_ksv(const u8 *ksv)
 {
drivers/gpu/drm/i915/Kconfig +1 -0
index 98c5450b8eac..dc65717ad7c0 100644
@@ -10,6 +10,7 @@ config DRM_I915
 	# the shmem_readpage() which depends upon tmpfs
 	select SHMEM
 	select TMPFS
+	select DRM_HDCP_HELPER
 	select DRM_DP_HELPER
 	select DRM_KMS_HELPER
 	select DRM_PANEL
drivers/gpu/drm/i915/display/intel_dp_hdcp.c +1 -1
index 598cad09d499..a7640dbcf00e 100644
@@ -8,7 +8,7 @@
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/display/drm_dp_mst_helper.h>
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_print.h>
 
 #include "intel_ddi.h"
drivers/gpu/drm/i915/display/intel_gmbus.c +1 -1
index 21281a7bdc17..a6ba7fb72339 100644
@@ -31,7 +31,7 @@
 #include <linux/i2c-algo-bit.h>
 #include <linux/i2c.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 
 #include "i915_drv.h"
 #include "intel_de.h"
drivers/gpu/drm/i915/display/intel_hdcp.c +1 -1
index 4de4c174a987..44ac0cee8b77 100644
@@ -12,7 +12,7 @@
 #include <linux/i2c.h>
 #include <linux/random.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/i915_component.h>
 
 #include "i915_drv.h"
drivers/gpu/drm/i915/display/intel_hdmi.c +1 -1
index a4a6f8bd2841..c713cebc63fe 100644
@@ -32,10 +32,10 @@
 #include <linux/slab.h>
 #include <linux/string_helpers.h>
 
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_scdc_helper.h>
 #include <drm/intel_lpe_audio.h>
 
drivers/misc/mei/hdcp/mei_hdcp.h +1 -1
index 834757f5e072..ca09c8f83d6b 100644
@@ -9,7 +9,7 @@
 #ifndef __MEI_HDCP_H__
 #define __MEI_HDCP_H__
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp.h>
 
 /* me_hdcp_status: Enumeration of all HDCP Status Codes */
 enum me_hdcp_status {
include/drm/display/drm_hdcp.h renamed from include/drm/drm_hdcp.h +2 -12
similarity index 95%
rename from include/drm/drm_hdcp.h
rename to include/drm/display/drm_hdcp.h
index 0b1111e3228e..96a99b1377c0 100644
@@ -6,8 +6,8 @@
  * Sean Paul <[email protected]>
  */
 
-#ifndef _DRM_HDCP_H_INCLUDED_
-#define _DRM_HDCP_H_INCLUDED_
+#ifndef _DRM_HDCP_H_
+#define _DRM_HDCP_H_
 
 #include <linux/types.h>
 
@@ -291,16 +291,6 @@ struct hdcp_srm_header {
 	u8 srm_gen_no;
 } __packed;
 
-struct drm_device;
-struct drm_connector;
-
-int drm_hdcp_check_ksvs_revoked(struct drm_device *dev,
-				u8 *ksvs, u32 ksv_count);
-int drm_connector_attach_content_protection_property(
-		struct drm_connector *connector, bool hdcp_content_type);
-void drm_hdcp_update_content_protection(struct drm_connector *connector,
-					u64 val);
-
 /* Content Type classification for HDCP2.2 vs others */
 #define DRM_MODE_HDCP_CONTENT_TYPE0		0
 #define DRM_MODE_HDCP_CONTENT_TYPE1		1
include/drm/display/drm_hdcp_helper.h new file +22 -0
new file mode 100644
index 000000000000..8aaf87bf2735
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright (C) 2017 Google, Inc.
+ *
+ * Authors:
+ * Sean Paul <[email protected]>
+ */
+
+#ifndef _DRM_HDCP_HELPER_H_INCLUDED_
+#define _DRM_HDCP_HELPER_H_INCLUDED_
+
+#include <drm/display/drm_hdcp.h>
+
+struct drm_device;
+struct drm_connector;
+
+int drm_hdcp_check_ksvs_revoked(struct drm_device *dev, u8 *ksvs, u32 ksv_count);
+int drm_connector_attach_content_protection_property(struct drm_connector *connector,
+						     bool hdcp_content_type);
+void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val);
+
+#endif
include/drm/i915_mei_hdcp_interface.h +1 -1
index 702f613243bb..f441cbcd95a4 100644
@@ -11,7 +11,7 @@
 
 #include <linux/mutex.h>
 #include <linux/device.h>
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp.h>
 
 /**
  * enum hdcp_port_type - HDCP port implementation type defined by ME FW
Signature · 1 line
2.35.1
maintainer
#22 lore raw

Re: [PATCH 6/8] drm/display: Move HDCP helpers into display-helper module

drivers/gpu/drm/bridge/analogix/anx7625.c line 26

Quoted 9 lines · Thomas Zimmermann
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -0
index 21f16394012f..0ad78c73af7c 100644
@@ -23,11 +23,11 @@
 
 #include <drm/display/drm_dp_aux_bus.h>
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper_helper.h>

This helper helper crept in a few places.

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
author maintainer
#23 lore raw

Re: [PATCH 6/8] drm/display: Move HDCP helpers into display-helper module

Hi Jani

Am 30.03.22 um 09:12 schrieb Jani Nikula:

Quoted 7 lines · Thomas Zimmermann
Quoted 6 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +0 -0
index 21f16394012f..0ad78c73af7c 100644
@@ -23,11 +23,11 @@
 
Quoted 5 lines

drivers/gpu/drm/bridge/analogix/anx7625.c line 26

Quoted 3 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -0
  #include <drm/display/drm_dp_aux_bus.h>
  #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper_helper.h>

This helper helper crept in a few places.

Thanks for reporting. I'll try to enable more drivers for the patches' next iteration in order to find such issues.

Best regards
Thomas

Quoted 4 lines

BR,
Jani.

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
Reviewed-by on v1 6/8
#24 lore raw

Re: [PATCH 6/8] drm/display: Move HDCP helpers into display-helper module

In reply to Thomas Zimmermann
Quoted 6 lines · Thomas Zimmermann

Move DRM's HDCP helper library into the display/ subdirectory and add it to DRM's display helpers. Split the header file into core and helpers. Update all affected drivers. No functional changes.

---

After fixing Jani's comment about the drm_hdcp_helper_helper.h typo:

[snip]

Quoted 17 lines
drivers/gpu/drm/display/drm_hdcp_helper.c renamed from drivers/gpu/drm/drm_hdcp.c +1 -1
similarity index 99%
rename from drivers/gpu/drm/drm_hdcp.c
rename to drivers/gpu/drm/display/drm_hdcp_helper.c
index ca9b8f697202..0ebdfe7fef8f 100644
@@ -13,7 +13,7 @@
 #include <linux/slab.h>
 #include <linux/firmware.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_sysfs.h>
 #include <drm/drm_print.h>
 #include <drm/drm_device.h>

drivers/gpu/drm/display/drm_hdcp_helper.c line 25

Quoted 6 lines
drivers/gpu/drm/display/drm_hdcp_helper.c renamed from drivers/gpu/drm/drm_hdcp.c +1 -1
@@ -21,7 +21,7 @@
 #include <drm/drm_mode_object.h>
 #include <drm/drm_connector.h>
 
-#include "drm_internal.h"
+#include "../drm_internal.h"
 

As far as I can tell drivers/gpu/drm/drm_hdcp.c doesn't use any of the symbols declared in "drm_internal.h" and this inclusion could just be removed.

If you agree and add a preparatory patch in v2, feel free to also add my R-B.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
author maintainer
#25 lore raw

PATCH 7/8 drm/display: Move HDMI helpers into display-helper module

In reply to Thomas Zimmermann

Move DRM's HMDI helpers into the display/ subdirectoy and add it to DRM's display helpers. Update all affected drivers. No functional changes.

The HDMI helpers were implemented in the EDID and connector code, but are actually unrelated. With the move to the display-helper library, we can remove the dependency on drm_edid.{c,h} in many driver's HDMI source files.

---
 drivers/gpu/drm/Kconfig                       |   9 +
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |   1 +
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c        |   1 +
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |   1 +
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |   1 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   1 +
 drivers/gpu/drm/bridge/Kconfig                |   4 +
 drivers/gpu/drm/bridge/analogix/Kconfig       |   1 +
 .../drm/bridge/analogix/analogix-anx78xx.c    |   2 +-
 drivers/gpu/drm/bridge/sii902x.c              |   2 +-
 drivers/gpu/drm/bridge/sil-sii8620.c          |   2 +-
 drivers/gpu/drm/bridge/synopsys/Kconfig       |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |   2 +-
 drivers/gpu/drm/display/Makefile              |   1 +
 drivers/gpu/drm/display/drm_hdmi_helper.c     | 463 ++++++++++++++++++
 drivers/gpu/drm/drm_connector.c               |  34 --
 drivers/gpu/drm/drm_edid.c                    | 438 +----------------
 drivers/gpu/drm/exynos/Kconfig                |   1 +
 drivers/gpu/drm/exynos/exynos_hdmi.c          |   2 +-
 drivers/gpu/drm/hdmi/Makefile                 |   4 +
 drivers/gpu/drm/i2c/Kconfig                   |   1 +
 drivers/gpu/drm/i2c/tda998x_drv.c             |   2 +-
 drivers/gpu/drm/i915/Kconfig                  |   1 +
 drivers/gpu/drm/i915/display/intel_dp.c       |   2 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c     |   1 +
 drivers/gpu/drm/i915/display/intel_lspcon.c   |   2 +-
 drivers/gpu/drm/i915/display/intel_sdvo.c     |   1 +
 drivers/gpu/drm/mediatek/Kconfig              |   1 +
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |   2 +-
 drivers/gpu/drm/msm/Kconfig                   |   1 +
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c        |   2 +
 drivers/gpu/drm/nouveau/Kconfig               |   1 +
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |   1 +
 drivers/gpu/drm/omapdrm/Kconfig               |   2 +
 drivers/gpu/drm/omapdrm/dss/hdmi4.c           |   1 +
 drivers/gpu/drm/radeon/radeon_audio.c         |   1 +
 drivers/gpu/drm/rockchip/Kconfig              |   2 +
 drivers/gpu/drm/rockchip/inno_hdmi.c          |   2 +-
 drivers/gpu/drm/rockchip/rk3066_hdmi.c        |   1 +
 drivers/gpu/drm/sti/Kconfig                   |   1 +
 drivers/gpu/drm/sti/sti_hdmi.c                |   2 +-
 drivers/gpu/drm/sun4i/Kconfig                 |   1 +
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c        |   2 +-
 drivers/gpu/drm/tegra/Kconfig                 |   1 +
 drivers/gpu/drm/tegra/hdmi.c                  |   1 +
 drivers/gpu/drm/tegra/sor.c                   |   1 +
 drivers/gpu/drm/vc4/Kconfig                   |   1 +
 drivers/gpu/drm/vc4/vc4_hdmi.c                |   2 +-
 include/drm/display/drm_hdmi_helper.h         |  36 ++
 include/drm/drm_connector.h                   |   2 -
 include/drm/drm_edid.h                        |  31 +-
 51 files changed, 572 insertions(+), 507 deletions(-)
 create mode 100644 drivers/gpu/drm/display/drm_hdmi_helper.c
 create mode 100644 drivers/gpu/drm/hdmi/Makefile
 create mode 100644 include/drm/display/drm_hdmi_helper.h
drivers/gpu/drm/Kconfig +9 -0
index 5cc5fc0d386d..c306a09aed81 100644
@@ -102,6 +102,13 @@ config DRM_HDCP_HELPER
 	help
 	  DRM helpers for HDCP.
 
+config DRM_HDMI_HELPER
+	tristate
+	depends on DRM
+	select DRM_DISPLAY_HELPER
+	help
+	  DRM helpers for HDMI.
+
 config DRM_KMS_HELPER
 	tristate
 	depends on DRM
@@ -265,6 +272,7 @@ config DRM_RADEON
 	depends on AGP || !AGP
 	select FW_LOADER
 	select DRM_DP_HELPER
+	select DRM_HDMI_HELPER
         select DRM_KMS_HELPER
         select DRM_TTM
 	select DRM_TTM_HELPER
@@ -285,6 +293,7 @@ config DRM_AMDGPU
 	tristate "AMD GPU"
 	depends on DRM && PCI && MMU
 	select FW_LOADER
+	select DRM_HDMI_HELPER
 	select DRM_DP_HELPER
 	select DRM_KMS_HELPER
 	select DRM_SCHED
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1 -0
index 288fce7dc0ed..a7fe477a0aef 100644
@@ -21,6 +21,7 @@
  *
  */
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_vblank.h>
 
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1 -0
index cbe5250b31cb..67c284bbbb64 100644
@@ -21,6 +21,7 @@
  *
  */
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_vblank.h>
 
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +1 -0
index 982855e6cf52..9b314d509676 100644
@@ -23,6 +23,7 @@
 
 #include <linux/pci.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_vblank.h>
 
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1 -0
index 84440741c60b..198c59ad0d50 100644
@@ -21,6 +21,7 @@
  *
  */
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_vblank.h>
 
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index ca42b7274372..386a6a9af79f 100644
@@ -74,6 +74,7 @@
 #include <linux/component.h>
 
 #include <drm/display/drm_dp_mst_helper.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_uapi.h>
 #include <drm/drm_atomic_helper.h>
drivers/gpu/drm/bridge/Kconfig +4 -0
index 83768517d3b5..37a07f4fce87 100644
@@ -103,6 +103,7 @@ config DRM_LONTIUM_LT9611
 	tristate "Lontium LT9611 DSI/HDMI bridge"
 	select SND_SOC_HDMI_CODEC if SND_SOC
 	depends on OF
+	select DRM_HDMI_HELPER
 	select DRM_PANEL_BRIDGE
 	select DRM_KMS_HELPER
 	select DRM_MIPI_DSI
@@ -130,6 +131,7 @@ config DRM_LONTIUM_LT9611UXC
 config DRM_ITE_IT66121
 	tristate "ITE IT66121 HDMI bridge"
 	depends on OF
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select REGMAP_I2C
 	help
@@ -204,6 +206,7 @@ config DRM_PARADE_PS8640
 config DRM_SIL_SII8620
 	tristate "Silicon Image SII8620 HDMI/MHL bridge"
 	depends on OF
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select EXTCON
 	depends on RC_CORE || !RC_CORE
@@ -213,6 +216,7 @@ config DRM_SIL_SII8620
 config DRM_SII902X
 	tristate "Silicon Image sii902x RGB/HDMI bridge"
 	depends on OF
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select REGMAP_I2C
 	select I2C_MUX
drivers/gpu/drm/bridge/analogix/Kconfig +1 -0
index 47f6cd9109dc..c0b68cf82f32 100644
@@ -15,6 +15,7 @@ config DRM_ANALOGIX_ANX6345
 config DRM_ANALOGIX_ANX78XX
 	tristate "Analogix ANX78XX bridge"
 	select DRM_ANALOGIX_DP
+	select DRM_HDMI_HELPER
 	select DRM_DP_HELPER
 	select DRM_KMS_HELPER
 	select REGMAP_I2C
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c +1 -1
index d2fc8676fab6..391263572b78 100644
@@ -19,10 +19,10 @@
 #include <linux/types.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 
drivers/gpu/drm/bridge/sii902x.c +1 -1
index 65549fbfdc87..9e40bf704f68 100644
@@ -20,10 +20,10 @@
 #include <linux/regulator/consumer.h>
 #include <linux/clk.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 
drivers/gpu/drm/bridge/sil-sii8620.c +1 -1
index ec7745c31da0..2c1ed9909e4f 100644
@@ -9,9 +9,9 @@
 #include <asm/unaligned.h>
 
 #include <drm/bridge/mhl.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 
 #include <linux/clk.h>
drivers/gpu/drm/bridge/synopsys/Kconfig +1 -0
index 21a1be3ced0f..774179026744 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config DRM_DW_HDMI
 	tristate
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select REGMAP_MMIO
 	select CEC_CORE if CEC_NOTIFIER
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1 -1
index a563460f8d20..a06a2d51e77f 100644
@@ -25,10 +25,10 @@
 #include <uapi/linux/videodev2.h>
 
 #include <drm/bridge/dw_hdmi.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/display/Makefile +1 -0
index e1f65f82cf8b..dfe21583afa0 100644
@@ -8,5 +8,6 @@ drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_h
 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
 drm_display_helper-$(CONFIG_DRM_HDCP_HELPER) += drm_hdcp_helper.o
+drm_display_helper-$(CONFIG_DRM_HDMI_HELPER) += drm_hdmi_helper.o
 
 obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o
drivers/gpu/drm/display/drm_hdmi_helper.c new file +463 -0

463 lines not on this page · raw message

drivers/gpu/drm/drm_connector.c +0 -34
index 76a8c707c34b..1c48d162c77e 100644
@@ -1486,40 +1486,6 @@ int drm_connector_attach_content_type_property(struct drm_connector *connector)
 }
 EXPORT_SYMBOL(drm_connector_attach_content_type_property);
 
-
-/**
- * drm_hdmi_avi_infoframe_content_type() - fill the HDMI AVI infoframe
- *                                         content type information, based
- *                                         on correspondent DRM property.
- * @frame: HDMI AVI infoframe
- * @conn_state: DRM display connector state
- *
- */
-void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector_state *conn_state)
-{
-	switch (conn_state->content_type) {
-	case DRM_MODE_CONTENT_TYPE_GRAPHICS:
-		frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
-		break;
-	case DRM_MODE_CONTENT_TYPE_CINEMA:
-		frame->content_type = HDMI_CONTENT_TYPE_CINEMA;
-		break;
-	case DRM_MODE_CONTENT_TYPE_GAME:
-		frame->content_type = HDMI_CONTENT_TYPE_GAME;
-		break;
-	case DRM_MODE_CONTENT_TYPE_PHOTO:
-		frame->content_type = HDMI_CONTENT_TYPE_PHOTO;
-		break;
-	default:
-		/* Graphics is the default(0) */
-		frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
-	}
-
-	frame->itc = conn_state->content_type != DRM_MODE_CONTENT_TYPE_NO_DATA;
-}
-EXPORT_SYMBOL(drm_hdmi_avi_infoframe_content_type);
-
 /**
  * drm_connector_attach_tv_margin_properties - attach TV connector margin
  * 	properties
drivers/gpu/drm/drm_edid.c +7 -431

478 lines not on this page · raw message

drivers/gpu/drm/exynos/Kconfig +1 -0
index f27cfd2a9726..69e0055abf0a 100644
@@ -76,6 +76,7 @@ config DRM_EXYNOS_HDMI
 	bool "HDMI"
 	depends on DRM_EXYNOS_MIXER || DRM_EXYNOS5433_DECON
 	select CEC_CORE if CEC_NOTIFIER
+	select DRM_HDMI_HELPER
 	help
 	  Choose this option if you want to use Exynos HDMI for DRM.
 
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -1
index 7655142a4651..49e33b02dd88 100644
@@ -33,9 +33,9 @@
 #include <sound/hdmi-codec.h>
 #include <media/cec-notifier.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
drivers/gpu/drm/hdmi/Makefile new file +4 -0
new file mode 100644
index 000000000000..650f4930ccca
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: MIT
+
+drm_hdmi_helper-y := drm_hdmi.o
+obj-$(CONFIG_DRM_HDMI_HELPER) += drm_hdmi_helper.o
drivers/gpu/drm/i2c/Kconfig +1 -0
index 6f19e1c35e30..67581ed337d0 100644
@@ -23,6 +23,7 @@ config DRM_I2C_SIL164
 config DRM_I2C_NXP_TDA998X
 	tristate "NXP Semiconductors TDA998X HDMI encoder"
 	default m if DRM_TILCDC
+	select DRM_HDMI_HELPER
 	select CEC_CORE if CEC_NOTIFIER
 	select SND_SOC_HDMI_CODEC if SND_SOC
 	help
drivers/gpu/drm/i2c/tda998x_drv.c +1 -1
index b7ec6c374fbd..94fb0b602f32 100644
@@ -13,9 +13,9 @@
 #include <sound/asoundef.h>
 #include <sound/hdmi-codec.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/i915/Kconfig +1 -0
index dc65717ad7c0..63c746499c24 100644
@@ -11,6 +11,7 @@ config DRM_I915
 	select SHMEM
 	select TMPFS
 	select DRM_HDCP_HELPER
+	select DRM_HDMI_HELPER
 	select DRM_DP_HELPER
 	select DRM_KMS_HELPER
 	select DRM_PANEL
drivers/gpu/drm/i915/display/intel_dp.c +1 -1
index cad8cba93ba8..afd46fec6a8f 100644
@@ -37,9 +37,9 @@
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/display/drm_dsc_helper.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_probe_helper.h>
 
 #include "g4x_dp.h"
drivers/gpu/drm/i915/display/intel_hdmi.c +1 -0
index c713cebc63fe..ce47ae5bab20 100644
@@ -33,6 +33,7 @@
 #include <linux/string_helpers.h>
 
 #include <drm/display/drm_hdcp_helper.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
drivers/gpu/drm/i915/display/intel_lspcon.c +1 -1
index be0b1010b304..7fbc8031a5aa 100644
@@ -24,8 +24,8 @@
  */
 
 #include <drm/display/drm_dp_dual_mode_helper.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/drm_edid.h>
 
 #include "intel_de.h"
 #include "intel_display_types.h"
drivers/gpu/drm/i915/display/intel_sdvo.c +1 -0
index 158e750e5b4d..1ba01e4b39af 100644
@@ -31,6 +31,7 @@
 #include <linux/i2c.h>
 #include <linux/slab.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
drivers/gpu/drm/mediatek/Kconfig +1 -0
index 2976d21e9a34..e360f32b493a 100644
@@ -24,6 +24,7 @@ config DRM_MEDIATEK
 config DRM_MEDIATEK_HDMI
 	tristate "DRM HDMI Support for Mediatek SoCs"
 	depends on DRM_MEDIATEK
+	select DRM_HDMI_HELPER
 	select SND_SOC_HDMI_CODEC if SND_SOC
 	select PHY_MTK_HDMI
 	help
drivers/gpu/drm/mediatek/mtk_hdmi.c +1 -1
index 3196189429bc..c6916753de10 100644
@@ -24,10 +24,10 @@
 
 #include <sound/hdmi-codec.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 
drivers/gpu/drm/msm/Kconfig +1 -0
index c79502525963..1453d842cf3d 100644
@@ -13,6 +13,7 @@ config DRM_MSM
 	select QCOM_MDT_LOADER if ARCH_QCOM
 	select REGULATOR
 	select DRM_DP_HELPER
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select DRM_PANEL
 	select DRM_BRIDGE
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +2 -0
index 10ebe2089cb6..fa830d5aab38 100644
@@ -5,6 +5,8 @@
  */
 
 #include <linux/delay.h>
+
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_bridge_connector.h>
 
 #include "msm_kms.h"
drivers/gpu/drm/nouveau/Kconfig +1 -0
index 3ec690b6f0b4..74a6d4a44608 100644
@@ -5,6 +5,7 @@ config DRM_NOUVEAU
 	select IOMMU_API
 	select FW_LOADER
 	select DRM_DP_HELPER
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select DRM_TTM
 	select DRM_TTM_HELPER
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -0
index 45db61ac2bfe..86d0ac1d50c6 100644
@@ -34,6 +34,7 @@
 #include <linux/iopoll.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_edid.h>
drivers/gpu/drm/omapdrm/Kconfig +2 -0
index 455e1a91f0e5..bfa90fe5dd9c 100644
@@ -58,6 +58,7 @@ config OMAP2_DSS_HDMI_COMMON
 config OMAP4_DSS_HDMI
 	bool "HDMI support for OMAP4"
 	default y
+	select DRM_HDMI_HELPER
 	select OMAP2_DSS_HDMI_COMMON
 	help
 	  HDMI support for OMAP4 based SoCs.
@@ -73,6 +74,7 @@ config OMAP4_DSS_HDMI_CEC
 config OMAP5_DSS_HDMI
 	bool "HDMI support for OMAP5"
 	default n
+	select DRM_HDMI_HELPER
 	select OMAP2_DSS_HDMI_COMMON
 	help
 	  HDMI Interface for OMAP5 and similar cores. This adds the High
drivers/gpu/drm/omapdrm/dss/hdmi4.c +1 -0
index 35b750cebaeb..01992ea0fe43 100644
@@ -27,6 +27,7 @@
 #include <sound/omap-hdmi-audio.h>
 #include <media/cec.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_state_helper.h>
 
drivers/gpu/drm/radeon/radeon_audio.c +1 -0
index 7c5e80d03fc9..2308f9af0666 100644
@@ -24,6 +24,7 @@
 
 #include <linux/gcd.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_crtc.h>
 #include "dce6_afmt.h"
 #include "evergreen_hdmi.h"
drivers/gpu/drm/rockchip/Kconfig +2 -0
index fa5cfda4e90e..55e14ce8d75b 100644
@@ -58,6 +58,7 @@ config ROCKCHIP_DW_MIPI_DSI
 
 config ROCKCHIP_INNO_HDMI
 	bool "Rockchip specific extensions for Innosilicon HDMI"
+	select DRM_HDMI_HELPER
 	help
 	  This selects support for Rockchip SoC specific extensions
 	  for the Innosilicon HDMI driver. If you want to enable
@@ -86,6 +87,7 @@ config ROCKCHIP_RGB
 config ROCKCHIP_RK3066_HDMI
 	bool "Rockchip specific extensions for RK3066 HDMI"
 	depends on DRM_ROCKCHIP
+	select DRM_HDMI_HELPER
 	help
 	  This selects support for Rockchip SoC specific extensions
 	  for the RK3066 HDMI driver. If you want to enable
drivers/gpu/drm/rockchip/inno_hdmi.c +1 -1
index 046e8ec2a71c..cf8f9ee0b7cb 100644
@@ -15,8 +15,8 @@
 #include <linux/mutex.h>
 #include <linux/of_device.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
drivers/gpu/drm/rockchip/rk3066_hdmi.c +1 -0
index 1c546c3a8998..473cd31cc424 100644
@@ -4,6 +4,7 @@
  *    Zheng Yang <[email protected]>
  */
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_of.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
drivers/gpu/drm/sti/Kconfig +1 -0
index 246a94afbe74..23c8a19316b7 100644
@@ -3,6 +3,7 @@ config DRM_STI
 	tristate "DRM Support for STMicroelectronics SoC stiH4xx Series"
 	depends on OF && DRM && (ARCH_STI || ARCH_MULTIPLATFORM)
 	select RESET_CONTROLLER
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select DRM_GEM_CMA_HELPER
 	select DRM_PANEL
drivers/gpu/drm/sti/sti_hdmi.c +1 -1
index f3ace11209dd..08cf2b860287 100644
@@ -13,11 +13,11 @@
 #include <linux/platform_device.h>
 #include <linux/reset.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_debugfs.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_file.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
drivers/gpu/drm/sun4i/Kconfig +1 -0
index befc5a80222d..1897e9478cb0 100644
@@ -18,6 +18,7 @@ if DRM_SUN4I
 config DRM_SUN4I_HDMI
 	tristate "Allwinner A10 HDMI Controller Support"
 	default DRM_SUN4I
+	select DRM_HDMI_HELPER
 	help
 	  Choose this option if you have an Allwinner SoC with an HDMI
 	  controller.
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +1 -1
index 3799a745b7dd..01fc363afabf 100644
@@ -15,8 +15,8 @@
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
drivers/gpu/drm/tegra/Kconfig +1 -0
index 6ed55ebaec8c..5791812d9836 100644
@@ -7,6 +7,7 @@ config DRM_TEGRA
 	depends on OF
 	select DRM_DP_AUX_BUS
 	select DRM_DP_HELPER
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select DRM_MIPI_DSI
 	select DRM_PANEL
drivers/gpu/drm/tegra/hdmi.c +1 -0
index bf240767dad9..4ac07e3db7c4 100644
@@ -19,6 +19,7 @@
 #include <soc/tegra/common.h>
 #include <sound/hdmi-codec.h>
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_debugfs.h>
drivers/gpu/drm/tegra/sor.c +1 -0
index 47b6c8e190cc..2b1b2f76d1fc 100644
@@ -17,6 +17,7 @@
 #include <soc/tegra/pmc.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_debugfs.h>
 #include <drm/drm_file.h>
drivers/gpu/drm/vc4/Kconfig +1 -0
index de3424fed2fc..9c87396ed40c 100644
@@ -5,6 +5,7 @@ config DRM_VC4
 	depends on DRM
 	depends on SND && SND_SOC
 	depends on COMMON_CLK
+	select DRM_HDMI_HELPER
 	select DRM_KMS_HELPER
 	select DRM_GEM_CMA_HELPER
 	select DRM_PANEL_BRIDGE
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -1
index 6c58b0fd13fb..8d760dd69060 100644
@@ -31,8 +31,8 @@
  * encoder block has CEC support.
  */
 
+#include <drm/display/drm_hdmi_helper.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_scdc_helper.h>
include/drm/display/drm_hdmi_helper.h new file +36 -0
new file mode 100644
index 000000000000..0a4ad9bbae9d
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: MIT */
+
+#ifndef DRM_HDMI_HELPER
+#define DRM_HDMI_HELPER
+
+#include <linux/hdmi.h>
+
+struct drm_connector;
+struct drm_connector_state;
+struct drm_display_mode;
+
+int drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
+					     const struct drm_connector *connector,
+					     const struct drm_display_mode *mode);
+int drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
+						const struct drm_connector *connector,
+						const struct drm_display_mode *mode);
+
+void drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
+					const struct drm_connector_state *conn_state);
+
+void drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
+				 const struct drm_connector_state *conn_state);
+
+void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
+					 const struct drm_connector_state *conn_state);
+
+void drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
+					const struct drm_connector *connector,
+					const struct drm_display_mode *mode,
+					enum hdmi_quantization_range rgb_quant_range);
+
+int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
+					const struct drm_connector_state *conn_state);
+
+#endif
include/drm/drm_connector.h +0 -2
index 5166186146f4..81598b923003 100644
@@ -1784,8 +1784,6 @@ int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
 int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector);
 int drm_mode_create_dp_colorspace_property(struct drm_connector *connector);
 int drm_mode_create_content_type_property(struct drm_device *dev);
-void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector_state *conn_state);
 
 int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
 
include/drm/drm_edid.h +4 -27
index 144c495b99c4..e6e9e4557067 100644
@@ -391,33 +391,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
 
 bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
 
-int
-drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector *connector,
-					 const struct drm_display_mode *mode);
-int
-drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
-					    const struct drm_connector *connector,
-					    const struct drm_display_mode *mode);
-
-void
-drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
-			    const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector *connector,
-				   const struct drm_display_mode *mode,
-				   enum hdmi_quantization_range rgb_quant_range);
-
-int
-drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
-				    const struct drm_connector_state *conn_state);
-
 /**
  * drm_eld_mnl - Get ELD monitor name length in bytes.
  * @eld: pointer to an eld memory structure with mnl set
@@ -587,6 +560,10 @@ void drm_edid_get_monitor_name(struct edid *edid, char *name,
 struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
 					   int hsize, int vsize, int fresh,
 					   bool rb);
+
+u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match);
+enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
+enum hdmi_picture_aspect drm_get_hdmi_aspect_ratio(const u8 video_code);
 struct drm_display_mode *
 drm_display_mode_from_cea_vic(struct drm_device *dev,
 			      u8 video_code);
Signature · 1 line
2.35.1
maintainer
#26 lore raw

Re: [PATCH 7/8] drm/display: Move HDMI helpers into display-helper module

Quoted 39 lines · Thomas Zimmermann
include/drm/drm_edid.h +0 -27
index 144c495b99c4..e6e9e4557067 100644
@@ -391,33 +391,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
 
 bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
 
-int
-drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector *connector,
-					 const struct drm_display_mode *mode);
-int
-drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
-					    const struct drm_connector *connector,
-					    const struct drm_display_mode *mode);
-
-void
-drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
-			    const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector *connector,
-				   const struct drm_display_mode *mode,
-				   enum hdmi_quantization_range rgb_quant_range);
-
-int
-drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
-				    const struct drm_connector_state *conn_state);
-
 /**
  * drm_eld_mnl - Get ELD monitor name length in bytes.
  * @eld: pointer to an eld memory structure with mnl set

include/drm/drm_edid.h void drm_edid_get_monitor_name(struct edid *edid, char *name, · line 566

Quoted 7 lines
include/drm/drm_edid.h +4 -0
@@ -587,6 +560,10 @@ void drm_edid_get_monitor_name(struct edid *edid, char *name,
 struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
 					   int hsize, int vsize, int fresh,
 					   bool rb);
+
+u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match);
+enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
+enum hdmi_picture_aspect drm_get_hdmi_aspect_ratio(const u8 video_code);

I think these were fine as static, but not really great interfaces to export. There's zero input checking on the vic in the latter, because internally we could be sure they were fine.

I also wish we could limit the usage to the module you're adding; this is now available to all drivers which should be discouraged.

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
author maintainer
#27 lore raw

Re: [PATCH 7/8] drm/display: Move HDMI helpers into display-helper module

Hi

Am 30.03.22 um 12:35 schrieb Jani Nikula:

Quoted 43 lines · Thomas Zimmermann
Quoted 42 lines
include/drm/drm_edid.h +0 -27
index 144c495b99c4..e6e9e4557067 100644
@@ -391,33 +391,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
 
  bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
 
-int
-drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector *connector,
-					 const struct drm_display_mode *mode);
-int
-drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
-					    const struct drm_connector *connector,
-					    const struct drm_display_mode *mode);
-
-void
-drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
-			    const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector *connector,
-				   const struct drm_display_mode *mode,
-				   enum hdmi_quantization_range rgb_quant_range);
-
-int
-drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
-				    const struct drm_connector_state *conn_state);
-
  /**
   * drm_eld_mnl - Get ELD monitor name length in bytes.
   * @eld: pointer to an eld memory structure with mnl set
@@ -587,6 +560,10 @@ void drm_edid_get_monitor_name(struct edid *edid, char *name,
  struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
  					   int hsize, int vsize, int fresh,
  					   bool rb);
Quoted 8 lines

include/drm/drm_edid.h void drm_edid_get_monitor_name(struct edid *edid, char *name, · line 566

Quoted 4 lines
include/drm/drm_edid.h +4 -0
+
+u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match);
+enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
+enum hdmi_picture_aspect drm_get_hdmi_aspect_ratio(const u8 video_code);

I think these were fine as static, but not really great interfaces to export. There's zero input checking on the vic in the latter, because internally we could be sure they were fine.

I see. If nothing else, HDMI could be removed from the patchset. OTOH having these HDMI functions as part of the edid code doesn't seem right either.

Quoted 3 lines

I also wish we could limit the usage to the module you're adding; this is now available to all drivers which should be discouraged.

Why is that discouraged? Quite a few drivers use these interfaces.

Best regards
Thomas

Quoted 6 lines

BR,
Jani.

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
maintainer
#28 lore raw

Re: [PATCH 7/8] drm/display: Move HDMI helpers into display-helper module

Quoted 60 lines · Thomas Zimmermann

Hi

Am 30.03.22 um 12:35 schrieb Jani Nikula:

Quoted 43 lines · Thomas Zimmermann
Quoted 42 lines
include/drm/drm_edid.h +0 -27
index 144c495b99c4..e6e9e4557067 100644
@@ -391,33 +391,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
 
  bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
 
-int
-drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector *connector,
-					 const struct drm_display_mode *mode);
-int
-drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
-					    const struct drm_connector *connector,
-					    const struct drm_display_mode *mode);
-
-void
-drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
-			    const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector *connector,
-				   const struct drm_display_mode *mode,
-				   enum hdmi_quantization_range rgb_quant_range);
-
-int
-drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
-				    const struct drm_connector_state *conn_state);
-
  /**
   * drm_eld_mnl - Get ELD monitor name length in bytes.
   * @eld: pointer to an eld memory structure with mnl set
@@ -587,6 +560,10 @@ void drm_edid_get_monitor_name(struct edid *edid, char *name,
  struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
  					   int hsize, int vsize, int fresh,
  					   bool rb);
Quoted 8 lines

include/drm/drm_edid.h void drm_edid_get_monitor_name(struct edid *edid, char *name, · line 566

Quoted 4 lines
include/drm/drm_edid.h +4 -0
+
+u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match);
+enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
+enum hdmi_picture_aspect drm_get_hdmi_aspect_ratio(const u8 video_code);

I think these were fine as static, but not really great interfaces to export. There's zero input checking on the vic in the latter, because internally we could be sure they were fine.

I see. If nothing else, HDMI could be removed from the patchset. OTOH having these HDMI functions as part of the edid code doesn't seem right either.

Quoted 1 line
Quoted 4 lines
Quoted 2 lines

I also wish we could limit the usage to the module you're adding; this is now available to all drivers which should be discouraged.

Why is that discouraged? Quite a few drivers use these interfaces.

No driver needed to directly use the functions you're now additionally exporting from drm_edid.c. I'd hope no driver starts to use them either.

BR,
Jani.

Quoted 9 lines

Best regards
Thomas

Quoted 6 lines

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
maintainer
#29 lore raw

Re: [PATCH 7/8] drm/display: Move HDMI helpers into display-helper module

Quoted 56 lines · Jani Nikula
Quoted 55 lines · Thomas Zimmermann

Hi

Am 30.03.22 um 12:35 schrieb Jani Nikula:

Quoted 51 lines · Thomas Zimmermann
Quoted 39 lines
include/drm/drm_edid.h +0 -27
index 144c495b99c4..e6e9e4557067 100644
@@ -391,33 +391,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
 
  bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
 
-int
-drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector *connector,
-					 const struct drm_display_mode *mode);
-int
-drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
-					    const struct drm_connector *connector,
-					    const struct drm_display_mode *mode);
-
-void
-drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
-			    const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector *connector,
-				   const struct drm_display_mode *mode,
-				   enum hdmi_quantization_range rgb_quant_range);
-
-int
-drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
-				    const struct drm_connector_state *conn_state);
-
  /**
   * drm_eld_mnl - Get ELD monitor name length in bytes.
   * @eld: pointer to an eld memory structure with mnl set

include/drm/drm_edid.h void drm_edid_get_monitor_name(struct edid *edid, char *name, · line 566

Quoted 7 lines
include/drm/drm_edid.h +4 -0
@@ -587,6 +560,10 @@ void drm_edid_get_monitor_name(struct edid *edid, char *name,
  struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
  					   int hsize, int vsize, int fresh,
  					   bool rb);
+
+u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match);
+enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
+enum hdmi_picture_aspect drm_get_hdmi_aspect_ratio(const u8 video_code);

I think these were fine as static, but not really great interfaces to export. There's zero input checking on the vic in the latter, because internally we could be sure they were fine.

Quoted 3 lines
Quoted 3 lines

I see. If nothing else, HDMI could be removed from the patchset. OTOH having these HDMI functions as part of the edid code doesn't seem right either.

To clarify, I think the HDMI functionality should probably be moved. It's just the new interfaces I'm worried about.

BR,
Jani.

Quoted 24 lines
Quoted 6 lines
Quoted 4 lines

I also wish we could limit the usage to the module you're adding; this is now available to all drivers which should be discouraged.

Why is that discouraged? Quite a few drivers use these interfaces.

No driver needed to directly use the functions you're now additionally exporting from drm_edid.c. I'd hope no driver starts to use them either.

BR,
Jani.

Quoted 9 lines

Best regards
Thomas

Quoted 6 lines

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
author maintainer
#30 lore raw

Re: [PATCH 7/8] drm/display: Move HDMI helpers into display-helper module

Hi

Am 07.04.22 um 09:34 schrieb Jani Nikula:

Quoted 61 lines · Jani Nikula
Quoted 56 lines · Thomas Zimmermann
Quoted 55 lines

Hi

Am 30.03.22 um 12:35 schrieb Jani Nikula:

Quoted 51 lines · Thomas Zimmermann
Quoted 39 lines
include/drm/drm_edid.h +0 -27
index 144c495b99c4..e6e9e4557067 100644
@@ -391,33 +391,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
 
   bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
 
-int
-drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-					 const struct drm_connector *connector,
-					 const struct drm_display_mode *mode);
-int
-drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
-					    const struct drm_connector *connector,
-					    const struct drm_display_mode *mode);
-
-void
-drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
-			    const struct drm_connector_state *conn_state);
-
-void
-drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
-				   const struct drm_connector *connector,
-				   const struct drm_display_mode *mode,
-				   enum hdmi_quantization_range rgb_quant_range);
-
-int
-drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
-				    const struct drm_connector_state *conn_state);
-
   /**
    * drm_eld_mnl - Get ELD monitor name length in bytes.
    * @eld: pointer to an eld memory structure with mnl set

include/drm/drm_edid.h void drm_edid_get_monitor_name(struct edid *edid, char *name, · line 566

Quoted 7 lines
include/drm/drm_edid.h +4 -0
@@ -587,6 +560,10 @@ void drm_edid_get_monitor_name(struct edid *edid, char *name,
   struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
   					   int hsize, int vsize, int fresh,
   					   bool rb);
+
+u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match);
+enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
+enum hdmi_picture_aspect drm_get_hdmi_aspect_ratio(const u8 video_code);

I think these were fine as static, but not really great interfaces to export. There's zero input checking on the vic in the latter, because internally we could be sure they were fine.

Quoted 3 lines
Quoted 3 lines

I see. If nothing else, HDMI could be removed from the patchset. OTOH having these HDMI functions as part of the edid code doesn't seem right either.

Quoted 16 lines

To clarify, I think the HDMI functionality should probably be moved. It's just the new interfaces I'm worried about.

BR,
Jani.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

I also wish we could limit the usage to the module you're adding; this is now available to all drivers which should be discouraged.

Why is that discouraged? Quite a few drivers use these interfaces.

No driver needed to directly use the functions you're now additionally exporting from drm_edid.c. I'd hope no driver starts to use them either.

I see. I'll reduce the code in the display library, even if that means that some potential helper remains in drm_edid.c for now.

Best regards
Thomas

Quoted 16 lines
Quoted 15 lines

BR,
Jani.

Quoted 9 lines

Best regards
Thomas

Quoted 6 lines

BR,
Jani.

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
author maintainer
#31 lore raw

PATCH 8/8 drm/display: Move SCDC helpers into display-helper library

In reply to Thomas Zimmermann

SCDC is the Status and Control Data Channel for HDMI. Move the SCDC helpers into display/ and split the header into files for core and helpers. Update all affected drivers. No functional changes.

To avoid the proliferation of Kconfig options, SCDC is part of DRM's support for HDMI. If necessary, a new option could make SCDC an independent feature.

---
 Documentation/gpu/drm-kms-helpers.rst         |  6 +-
 drivers/gpu/drm/Makefile                      |  2 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |  2 +-
 drivers/gpu/drm/display/Makefile              |  2 +-
 .../gpu/drm/{ => display}/drm_scdc_helper.c   |  3 +-
 drivers/gpu/drm/drm_edid.c                    |  1 -
 drivers/gpu/drm/i915/display/intel_ddi.c      |  2 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c     |  2 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |  2 +-
 drivers/gpu/drm/tegra/sor.c                   |  2 +-
 drivers/gpu/drm/vc4/vc4_hdmi.c                |  2 +-
 .../{drm_scdc_helper.h => display/drm_scdc.h} | 52 +-----------
 include/drm/display/drm_scdc_helper.h         | 79 +++++++++++++++++++
 13 files changed, 94 insertions(+), 63 deletions(-)
 rename drivers/gpu/drm/{ => display}/drm_scdc_helper.c (99%)
 rename include/drm/{drm_scdc_helper.h => display/drm_scdc.h} (65%)
 create mode 100644 include/drm/display/drm_scdc_helper.h
Documentation/gpu/drm-kms-helpers.rst +3 -3
index cfda5a092a48..2d473bc64c9f 100644
@@ -356,13 +356,13 @@ EDID Helper Functions Reference
 SCDC Helper Functions Reference
 ===============================
 
-.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
    :doc: scdc helpers
 
-.. kernel-doc:: include/drm/drm_scdc_helper.h
+.. kernel-doc:: include/drm/display/drm_scdc_helper.h
    :internal:
 
-.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
    :export:
 
 HDMI Infoframes Helper Reference
drivers/gpu/drm/Makefile +1 -1
index 746a3a4953f3..15fe3163f822 100644
@@ -63,7 +63,7 @@ drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
 		drm_plane_helper.o drm_atomic_helper.o \
 		drm_kms_helper_common.o \
 		drm_simple_kms_helper.o drm_modeset_helper.o \
-		drm_scdc_helper.o drm_gem_atomic_helper.o \
+		drm_gem_atomic_helper.o \
 		drm_gem_framebuffer_helper.o \
 		drm_atomic_state_helper.o drm_damage_helper.o \
 		drm_format_helper.o drm_self_refresh_helper.o drm_rect.o
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1 -1
index a06a2d51e77f..268d1f47d58c 100644
@@ -26,13 +26,13 @@
 
 #include <drm/bridge/dw_hdmi.h>
 #include <drm/display/drm_hdmi_helper.h>
+#include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_of.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_scdc_helper.h>
 
 #include "dw-hdmi-audio.h"
 #include "dw-hdmi-cec.h"
drivers/gpu/drm/display/Makefile +1 -1
index dfe21583afa0..4a36847b4aaf 100644
@@ -8,6 +8,6 @@ drm_display_helper-$(CONFIG_DRM_DP_HELPER) := drm_dp_helper.o drm_dp_dual_mode_h
 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
 drm_display_helper-$(CONFIG_DRM_HDCP_HELPER) += drm_hdcp_helper.o
-drm_display_helper-$(CONFIG_DRM_HDMI_HELPER) += drm_hdmi_helper.o
+drm_display_helper-$(CONFIG_DRM_HDMI_HELPER) += drm_hdmi_helper.o drm_scdc_helper.o
 
 obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o
drivers/gpu/drm/display/drm_scdc_helper.c renamed from drivers/gpu/drm/drm_scdc_helper.c +2 -1
similarity index 99%
rename from drivers/gpu/drm/drm_scdc_helper.c
rename to drivers/gpu/drm/display/drm_scdc_helper.c
index 48a382464d54..81881e81ceae 100644
@@ -21,11 +21,12 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/i2c.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 
+#include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_print.h>
-#include <drm/drm_scdc_helper.h>
 
 /**
  * DOC: scdc helpers
drivers/gpu/drm/drm_edid.c +0 -1
index 4d865ebcd623..cf15690d4a83 100644
@@ -42,7 +42,6 @@
 #include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_print.h>
-#include <drm/drm_scdc_helper.h>
 
 #include "drm_crtc_internal.h"
 
drivers/gpu/drm/i915/display/intel_ddi.c +1 -1
index dc208df829f1..563c3f1c49a1 100644
@@ -27,8 +27,8 @@
 
 #include <linux/string_helpers.h>
 
+#include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_privacy_screen_consumer.h>
-#include <drm/drm_scdc_helper.h>
 
 #include "i915_drv.h"
 #include "intel_audio.h"
drivers/gpu/drm/i915/display/intel_hdmi.c +1 -1
index ce47ae5bab20..1ae09431f53a 100644
@@ -34,10 +34,10 @@
 
 #include <drm/display/drm_hdcp_helper.h>
 #include <drm/display/drm_hdmi_helper.h>
+#include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_scdc_helper.h>
 #include <drm/intel_lpe_audio.h>
 
 #include "i915_debugfs.h"
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -1
index 86d0ac1d50c6..fb573cdda57c 100644
@@ -35,13 +35,13 @@
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/display/drm_hdmi_helper.h>
+#include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_scdc_helper.h>
 #include <drm/drm_vblank.h>
 
 #include <nvif/push507c.h>
drivers/gpu/drm/tegra/sor.c +1 -1
index 2b1b2f76d1fc..5911d78bc801 100644
@@ -18,11 +18,11 @@
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/display/drm_hdmi_helper.h>
+#include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_debugfs.h>
 #include <drm/drm_file.h>
 #include <drm/drm_panel.h>
-#include <drm/drm_scdc_helper.h>
 #include <drm/drm_simple_kms_helper.h>
 
 #include "dc.h"
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -1
index 8d760dd69060..07b7b6c32cdb 100644
@@ -32,10 +32,10 @@
  */
 
 #include <drm/display/drm_hdmi_helper.h>
+#include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
-#include <drm/drm_scdc_helper.h>
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/i2c.h>
include/drm/display/drm_scdc.h renamed from include/drm/drm_scdc_helper.h +2 -50

62 lines not on this page · raw message

include/drm/display/drm_scdc_helper.h new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
2.35.1
maintainer
#32 lore raw
In reply to Thomas Zimmermann

For patches 2, 3, and 4: Reviewed-by: Lyude Paul <[email protected]>

Quoted 209 lines · Thomas Zimmermann

Move DisplayPort, HDMI and various other display helpers from KMS helpers into a new module. Adapt all drivers.

This patch is part of an on-going effort to reduce the minimum size of DRM when linked into the kernel binary. The helpers for various display and video-output standards are not required for minimal graphics output and can be moved into a separate module.

The DisplayPort code was already part of the DP module, which now forms the base of the display-helper module. Moving other helpers into the new module reduces KMS helpers by ~14 KiB (from 243 KiB to 229 KiB). More importantly, restructuring the code allows for a more fine-grained selection of helpers and dependencies.

Built on x64-64, i586, aarch64, and arm.

Thomas Zimmermann (8):
  drm: Put related statements next to each other in Makefile
  drm: Rename dp/ to display/
  drm/display: Introduce a DRM display-helper module drm/display: Split DisplayPort header into core and helper drm/display: Move DSC header and helpers into display-helper module drm/display: Move HDCP helpers into display-helper module drm/display: Move HDMI helpers into display-helper module drm/display: Move SCDC helpers into display-helper library

 Documentation/gpu/drm-kms-helpers.rst         |  43 +- drivers/gpu/drm/Kconfig                       |  23 + drivers/gpu/drm/Makefile                      |  29 +- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |   2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h      |   4 +- drivers/gpu/drm/amd/amdgpu/atombios_dp.c      |   3 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |   1 + drivers/gpu/drm/amd/amdgpu/dce_v11_0.c        |   1 + drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |   1 + drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |   1 + drivers/gpu/drm/amd/display/Kconfig           |   1 + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   5 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |   2 +- .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |   2 +- .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   4 +- .../drm/amd/display/dc/core/dc_link_dpcd.c    |   2 +-

 .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c  |   2 +
 .../gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h  |   2 +-
 .../drm/amd/display/dc/dml/dsc/rc_calc_fpu.h  |   2 +-

 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c   |   4 +- .../gpu/drm/amd/display/dc/dsc/dscc_types.h   |   2 +- .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c  |   2 +- drivers/gpu/drm/amd/display/dc/os_types.h     |   2 +- .../gpu/drm/amd/display/include/dpcd_defs.h   |   2 +- .../gpu/drm/amd/display/modules/hdcp/hdcp.h   |   4 +- drivers/gpu/drm/bridge/Kconfig                |   5 + drivers/gpu/drm/bridge/analogix/Kconfig       |   2 + .../drm/bridge/analogix/analogix-anx6345.c    |   2 +- .../drm/bridge/analogix/analogix-anx78xx.c    |   4 +- .../drm/bridge/analogix/analogix-i2c-dptx.c   |   2 +- .../drm/bridge/analogix/analogix_dp_core.h    |   2 +- drivers/gpu/drm/bridge/analogix/anx7625.c     |   6 +- drivers/gpu/drm/bridge/cadence/Kconfig        |   1 +

 .../drm/bridge/cadence/cdns-mhdp8546-core.c   |   4 +-
 .../drm/bridge/cadence/cdns-mhdp8546-core.h   |   2 +-
 .../drm/bridge/cadence/cdns-mhdp8546-hdcp.c   |   2 +-

 drivers/gpu/drm/bridge/ite-it6505.c           |   4 +- drivers/gpu/drm/bridge/parade-ps8640.c        |   4 +- drivers/gpu/drm/bridge/sii902x.c              |   2 +- drivers/gpu/drm/bridge/sil-sii8620.c          |   2 +- drivers/gpu/drm/bridge/synopsys/Kconfig       |   1 + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |   4 +- drivers/gpu/drm/bridge/tc358767.c             |   2 +- drivers/gpu/drm/bridge/tc358775.c             |   2 +- drivers/gpu/drm/bridge/ti-sn65dsi86.c         |   4 +- drivers/gpu/drm/display/Makefile              |  13 + .../drm_display_helper_mod.c}                 |  10 +-

 .../gpu/drm/{dp => display}/drm_dp_aux_bus.c  |   4 +-
 .../gpu/drm/{dp => display}/drm_dp_aux_dev.c  |   4 +-
 drivers/gpu/drm/{dp => display}/drm_dp_cec.c  |   2 +-

 .../{dp => display}/drm_dp_dual_mode_helper.c |   2 +- .../{dp/drm_dp.c => display/drm_dp_helper.c}  |   4 +- .../{dp => display}/drm_dp_helper_internal.h  |   0 .../drm/{dp => display}/drm_dp_mst_topology.c |   2 +- .../drm_dp_mst_topology_internal.h            |   2 +- .../{drm_dsc.c => display/drm_dsc_helper.c}   |   5 +- .../{drm_hdcp.c => display/drm_hdcp_helper.c} |   4 +- drivers/gpu/drm/display/drm_hdmi_helper.c     | 463 +++++++++++ .../gpu/drm/{ => display}/drm_scdc_helper.c   |   3 +- drivers/gpu/drm/dp/Makefile                   |   9 - drivers/gpu/drm/drm_connector.c               |  34 - drivers/gpu/drm/drm_edid.c                    | 439 +---------- drivers/gpu/drm/drm_mipi_dsi.c                |   6 +- drivers/gpu/drm/exynos/Kconfig                |   1 + drivers/gpu/drm/exynos/exynos_hdmi.c          |   2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c         |   2 +- drivers/gpu/drm/gma500/intel_bios.c           |   3 +- drivers/gpu/drm/hdmi/Makefile                 |   4 + drivers/gpu/drm/i2c/Kconfig                   |   1 + drivers/gpu/drm/i2c/tda998x_drv.c             |   2 +- drivers/gpu/drm/i915/Kconfig                  |   2 + drivers/gpu/drm/i915/display/icl_dsi.c        |   1 + drivers/gpu/drm/i915/display/intel_bios.c     |   3 +- drivers/gpu/drm/i915/display/intel_ddi.c      |   2 +- drivers/gpu/drm/i915/display/intel_display.c  |   2 +- .../drm/i915/display/intel_display_types.h    |   6 +- drivers/gpu/drm/i915/display/intel_dp.c       |   5 +- drivers/gpu/drm/i915/display/intel_dp_hdcp.c  |   6 +- .../drm/i915/display/intel_dp_link_training.h |   2 +- drivers/gpu/drm/i915/display/intel_gmbus.c    |   2 +- drivers/gpu/drm/i915/display/intel_hdcp.c     |   2 +- drivers/gpu/drm/i915/display/intel_hdmi.c     |   5 +- drivers/gpu/drm/i915/display/intel_lspcon.c   |   4 +- .../gpu/drm/i915/display/intel_qp_tables.c    |   2 +- drivers/gpu/drm/i915/display/intel_sdvo.c     |   1 + drivers/gpu/drm/i915/display/intel_vdsc.c     |   2 + drivers/gpu/drm/mediatek/Kconfig              |   1 + drivers/gpu/drm/mediatek/mtk_hdmi.c           |   2 +- drivers/gpu/drm/msm/Kconfig                   |   1 + drivers/gpu/drm/msm/dp/dp_audio.c             |   2 +- drivers/gpu/drm/msm/dp/dp_aux.h               |   2 +- drivers/gpu/drm/msm/dp/dp_catalog.c           |   2 +- drivers/gpu/drm/msm/dp/dp_ctrl.c              |   3 +- drivers/gpu/drm/msm/edp/edp.h                 |   3 +- drivers/gpu/drm/msm/edp/edp_ctrl.c            |   3 +- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c        |   2 + drivers/gpu/drm/nouveau/Kconfig               |   1 + drivers/gpu/drm/nouveau/dispnv50/disp.c       |   5 +- drivers/gpu/drm/nouveau/nouveau_connector.h   |   2 +- drivers/gpu/drm/nouveau/nouveau_dp.c          |   2 +- drivers/gpu/drm/nouveau/nouveau_encoder.h     |   6 +- drivers/gpu/drm/omapdrm/Kconfig               |   2 + drivers/gpu/drm/omapdrm/dss/hdmi4.c           |   1 + drivers/gpu/drm/panel/panel-edp.c             |   4 +- .../gpu/drm/panel/panel-samsung-atna33xc20.c  |   4 +- drivers/gpu/drm/radeon/atombios_dp.c          |   2 +- drivers/gpu/drm/radeon/radeon_audio.c         |   1 + drivers/gpu/drm/radeon/radeon_connectors.c    |   2 +- drivers/gpu/drm/radeon/radeon_dp_mst.c        |   2 +- drivers/gpu/drm/radeon/radeon_mode.h          |   4 +- drivers/gpu/drm/rockchip/Kconfig              |   2 + .../gpu/drm/rockchip/analogix_dp-rockchip.c   |   2 +- drivers/gpu/drm/rockchip/cdn-dp-core.c        |   2 +- drivers/gpu/drm/rockchip/cdn-dp-core.h        |   2 +- drivers/gpu/drm/rockchip/inno_hdmi.c          |   2 +- drivers/gpu/drm/rockchip/rk3066_hdmi.c        |   1 + drivers/gpu/drm/rockchip/rockchip_lvds.c      |   2 +- drivers/gpu/drm/rockchip/rockchip_rgb.c       |   2 +- .../drm/selftests/test-drm_dp_mst_helper.c    |   4 +- drivers/gpu/drm/sti/Kconfig                   |   1 + drivers/gpu/drm/sti/sti_hdmi.c                |   2 +- drivers/gpu/drm/sun4i/Kconfig                 |   1 + drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c        |   2 +- drivers/gpu/drm/tegra/Kconfig                 |   1 + drivers/gpu/drm/tegra/dp.c                    |   2 +- drivers/gpu/drm/tegra/dpaux.c                 |   4 +- drivers/gpu/drm/tegra/hdmi.c                  |   1 + drivers/gpu/drm/tegra/sor.c                   |   5 +- drivers/gpu/drm/vc4/Kconfig                   |   1 + drivers/gpu/drm/vc4/vc4_hdmi.c                |   4 +- drivers/gpu/drm/xlnx/zynqmp_dp.c              |   2 +- drivers/misc/mei/hdcp/mei_hdcp.h              |   2 +- .../{dp/drm_dp_helper.h => display/drm_dp.h}  | 695 +---------------- include/drm/{dp => display}/drm_dp_aux_bus.h  |   0
 .../{dp => display}/drm_dp_dual_mode_helper.h |   0 include/drm/display/drm_dp_helper.h           | 719 ++++++++++++++++++ .../drm/{dp => display}/drm_dp_mst_helper.h   |   2 +- include/drm/{ => display}/drm_dsc.h           |   8 +- include/drm/display/drm_dsc_helper.h          |  20 + include/drm/{ => display}/drm_hdcp.h          |  14 +- include/drm/display/drm_hdcp_helper.h         |  22 + include/drm/display/drm_hdmi_helper.h         |  36 + .../{drm_scdc_helper.h => display/drm_scdc.h} |  52 +- include/drm/display/drm_scdc_helper.h         |  79 ++ include/drm/drm_connector.h                   |   2 - include/drm/drm_edid.h                        |  31 +- include/drm/i915_mei_hdcp_interface.h         |   2 +-

 147 files changed, 1631 insertions(+), 1428 deletions(-)

 create mode 100644 drivers/gpu/drm/display/Makefile
 rename drivers/gpu/drm/{dp/drm_dp_helper_mod.c => display/drm_display_helper_mod.c} (51%)
 rename drivers/gpu/drm/{dp => display}/drm_dp_aux_bus.c (99%) rename drivers/gpu/drm/{dp => display}/drm_dp_aux_dev.c (99%) rename drivers/gpu/drm/{dp => display}/drm_dp_cec.c (99%) rename drivers/gpu/drm/{dp => display}/drm_dp_dual_mode_helper.c (99%) rename drivers/gpu/drm/{dp/drm_dp.c => display/drm_dp_helper.c} (99%) rename drivers/gpu/drm/{dp => display}/drm_dp_helper_internal.h (100%) rename drivers/gpu/drm/{dp => display}/drm_dp_mst_topology.c (99%) rename drivers/gpu/drm/{dp => display}/drm_dp_mst_topology_internal.h (94%) rename drivers/gpu/drm/{drm_dsc.c => display/drm_dsc_helper.c} (99%) rename drivers/gpu/drm/{drm_hdcp.c => display/drm_hdcp_helper.c} (99%) create mode 100644 drivers/gpu/drm/display/drm_hdmi_helper.c rename drivers/gpu/drm/{ => display}/drm_scdc_helper.c (99%) delete mode 100644 drivers/gpu/drm/dp/Makefile
 create mode 100644 drivers/gpu/drm/hdmi/Makefile
 rename include/drm/{dp/drm_dp_helper.h => display/drm_dp.h} (74%) rename include/drm/{dp => display}/drm_dp_aux_bus.h (100%) rename include/drm/{dp => display}/drm_dp_dual_mode_helper.h (100%) create mode 100644 include/drm/display/drm_dp_helper.h
 rename include/drm/{dp => display}/drm_dp_mst_helper.h (99%) rename include/drm/{ => display}/drm_dsc.h (97%)
 create mode 100644 include/drm/display/drm_dsc_helper.h
 rename include/drm/{ => display}/drm_hdcp.h (95%)
 create mode 100644 include/drm/display/drm_hdcp_helper.h
 create mode 100644 include/drm/display/drm_hdmi_helper.h
 rename include/drm/{drm_scdc_helper.h => display/drm_scdc.h} (65%) create mode 100644 include/drm/display/drm_scdc_helper.h

base-commit: fe83949cd4316608ea785fc376b6ed444224adad
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: 6e1032c6302461624f33194c8b8f37103a3fa6ef

Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat