Series |
drm/connector: Create HDMI Connector infrastructure
|
expand
-
[RFC,v3,00/37] drm/connector: Create HDMI Connector infrastructure
-
[RFC,v3,01/37] drm/connector: Introduce an HDMI connector
-
[RFC,v3,02/37] drm/connector: hdmi: Create a custom state
-
[RFC,v3,03/37] drm/connector: hdmi: Add Broadcast RGB property
-
[RFC,v3,04/37] drm/connector: hdmi: Add RGB Quantization Range to the connector state
-
[RFC,v3,05/37] drm/connector: hdmi: Add output BPC to the connector state
-
[RFC,v3,06/37] drm/connector: hdmi: Add support for output format
-
[RFC,v3,07/37] drm/connector: hdmi: Add HDMI compute clock helper
-
[RFC,v3,08/37] drm/connector: hdmi: Calculate TMDS character rate
-
[RFC,v3,09/37] drm/connector: hdmi: Add custom hook to filter TMDS character rate
-
[RFC,v3,10/37] drm/connector: hdmi: Compute bpc and format automatically
-
[RFC,v3,11/37] drm/connector: hdmi: Add Infoframes generation
-
[RFC,v3,12/37] drm/connector: hdmi: Create Infoframe DebugFS entries
-
[RFC,v3,13/37] drm/vc4: hdmi: Create destroy state implementation
-
[RFC,v3,14/37] drm/vc4: hdmi: Switch to HDMI connector
-
[RFC,v3,15/37] drm/rockchip: inno_hdmi: Remove useless mode_fixup
-
[RFC,v3,16/37] drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode
-
[RFC,v3,17/37] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic
-
[RFC,v3,18/37] drm/rockchip: inno_hdmi: Get rid of mode_set
-
[RFC,v3,19/37] drm/rockchip: inno_hdmi: no need to store vic
-
[RFC,v3,20/37] drm/rockchip: inno_hdmi: Remove unneeded has audio flag
-
[RFC,v3,21/37] drm/rockchip: inno_hdmi: Remove useless input format
-
[RFC,v3,22/37] drm/rockchip: inno_hdmi: Remove useless output format
-
[RFC,v3,23/37] drm/rockchip: inno_hdmi: Remove useless colorimetry
-
[RFC,v3,24/37] drm/rockchip: inno_hdmi: Remove useless enum
-
[RFC,v3,25/37] drm/rockchip: inno_hdmi: Remove tmds rate from structure
-
[RFC,v3,26/37] drm/rockchip: inno_hdmi: Remove useless coeff_csc matrix
-
[RFC,v3,27/37] drm/rockchip: inno_hdmi: Remove useless mode_valid
-
[RFC,v3,28/37] drm/rockchip: inno_hdmi: Move infoframe disable to separate function
-
[RFC,v3,29/37] drm/rockchip: inno_hdmi: Create mask retrieval functions
-
[RFC,v3,30/37] drm/rockchip: inno_hdmi: Switch to infoframe type
-
[RFC,v3,31/37] drm/rockchip: inno_hdmi: Remove unused drm device pointer
-
[RFC,v3,32/37] drm/rockchip: inno_hdmi: Switch to HDMI connector
-
[RFC,v3,33/37] drm/sun4i: hdmi: Convert encoder to atomic
-
[RFC,v3,34/37] drm/sun4i: hdmi: Move mode_set into enable
-
[RFC,v3,35/37] drm/sun4i: hdmi: Switch to container_of_const
-
[RFC,v3,36/37] drm/sun4i: hdmi: Consolidate atomic_check and mode_valid
-
[RFC,v3,37/37] drm/sun4i: hdmi: Switch to HDMI connector
|
Hi, Here's a series that creates a subclass of drm_connector specifically targeted at HDMI controllers. The idea behind this series came from a recent discussion on IRC during which we discussed infoframes generation of i915 vs everything else. Infoframes generation code still requires some decent boilerplate, with each driver doing some variation of it. In parallel, while working on vc4, we ended up converting a lot of i915 logic (mostly around format / bpc selection, and scrambler setup) to apply on top of a driver that relies only on helpers. While currently sitting in the vc4 driver, none of that logic actually relies on any driver or hardware-specific behaviour. The only missing piece to make it shareable are a bunch of extra variables stored in a state (current bpc, format, RGB range selection, etc.). The initial implementation was relying on some generic subclass of drm_connector to address HDMI connectors, with a bunch of helpers that will take care of all the "HDMI Spec" related code. Scrambler setup is missing at the moment but can easily be plugged in. The feedback was that creating a connector subclass like was done for writeback would prevent the adoption of those helpers since it couldn't be used in all situations (like when the connector driver can implement multiple output) and required more churn to cast between the drm_connector and its subclass. The decision was thus to provide a set of helper and to store the required variables in drm_connector and drm_connector_state. This what has been implemented now. Hans Verkuil also expressed interest in implementing a mechanism in v4l2 to retrieve infoframes from HDMI receiver and implementing an infoframe-decode tool. This series thus leverages the infoframe generation code to expose it through debugfs. This entire series has been tested on a Pi4, and has only been build-tested for sunxi and rockchip. Let me know what you think, Maxime Signed-off-by: Maxime Ripard <mripard@kernel.org> --- Changes in v3: - Made sure the series work on the RaspberryPi4 - Handle YUV420 in the char clock rate computation - Use the maximum bpc value the connector allows at reset - Expose the RGB Limited vs Full Range value in the connector state instead of through a helper - Fix Broadcast RGB documentation - Add more debug logging - Small fixes here and there - Link to v2: https://lore.kernel.org/r/20230920-kms-hdmi-connector-state-v2-0-17932daddd7d@kernel.org Changes in v2: - Change from a subclass to a set of helpers for drm_connector and drm_connector state - Don't assume that all drivers support RGB, YUV420 and YUV422 but make them provide a bitfield instead. - Don't assume that all drivers support the Broadcast RGB property but make them call the registration helper. - Document the Broacast RGB property - Convert the inno_hdmi and sun4i_hdmi driver. - Link to v1: https://lore.kernel.org/r/20230814-kms-hdmi-connector-state-v1-0-048054df3654@kernel.org --- Maxime Ripard (37): drm/connector: Introduce an HDMI connector drm/connector: hdmi: Create a custom state drm/connector: hdmi: Add Broadcast RGB property drm/connector: hdmi: Add RGB Quantization Range to the connector state drm/connector: hdmi: Add output BPC to the connector state drm/connector: hdmi: Add support for output format drm/connector: hdmi: Add HDMI compute clock helper drm/connector: hdmi: Calculate TMDS character rate drm/connector: hdmi: Add custom hook to filter TMDS character rate drm/connector: hdmi: Compute bpc and format automatically drm/connector: hdmi: Add Infoframes generation drm/connector: hdmi: Create Infoframe DebugFS entries drm/vc4: hdmi: Create destroy state implementation drm/vc4: hdmi: Switch to HDMI connector drm/rockchip: inno_hdmi: Remove useless mode_fixup drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode drm/rockchip: inno_hdmi: Switch encoder hooks to atomic drm/rockchip: inno_hdmi: Get rid of mode_set drm/rockchip: inno_hdmi: no need to store vic drm/rockchip: inno_hdmi: Remove unneeded has audio flag drm/rockchip: inno_hdmi: Remove useless input format drm/rockchip: inno_hdmi: Remove useless output format drm/rockchip: inno_hdmi: Remove useless colorimetry drm/rockchip: inno_hdmi: Remove useless enum drm/rockchip: inno_hdmi: Remove tmds rate from structure drm/rockchip: inno_hdmi: Remove useless coeff_csc matrix drm/rockchip: inno_hdmi: Remove useless mode_valid drm/rockchip: inno_hdmi: Move infoframe disable to separate function drm/rockchip: inno_hdmi: Create mask retrieval functions drm/rockchip: inno_hdmi: Switch to infoframe type drm/rockchip: inno_hdmi: Remove unused drm device pointer drm/rockchip: inno_hdmi: Switch to HDMI connector drm/sun4i: hdmi: Convert encoder to atomic drm/sun4i: hdmi: Move mode_set into enable drm/sun4i: hdmi: Switch to container_of_const drm/sun4i: hdmi: Consolidate atomic_check and mode_valid drm/sun4i: hdmi: Switch to HDMI connector Documentation/gpu/kms-properties.csv | 1 - drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/drm_atomic.c | 11 + drivers/gpu/drm/drm_atomic_state_helper.c | 661 ++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_atomic_uapi.c | 4 + drivers/gpu/drm/drm_connector.c | 208 ++++++++++ drivers/gpu/drm/drm_debugfs.c | 110 +++++ drivers/gpu/drm/rockchip/inno_hdmi.c | 409 +++++++----------- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 203 +++++---- drivers/gpu/drm/vc4/vc4_hdmi.c | 624 ++++------------------------ drivers/gpu/drm/vc4/vc4_hdmi.h | 44 +- drivers/gpu/drm/vc4/vc4_hdmi_phy.c | 6 +- include/drm/drm_atomic_state_helper.h | 12 + include/drm/drm_connector.h | 248 +++++++++++ 14 files changed, 1598 insertions(+), 944 deletions(-) --- base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa change-id: 20230814-kms-hdmi-connector-state-616787e67927 Best regards,