Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/connector: hdmi: Create an HDMI sub-state

The next features we will need to share across drivers will need to
store some parameters for drivers to use, such as the selected output
format.

Let's create a new connector sub-state dedicated to HDMI controllers,
that will eventually store everything we need.

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240527-kms-hdmi-connector-state-v15-3-c5af16c3aae2@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+73
+7
drivers/gpu/drm/display/Kconfig
··· 70 70 depends on DRM_DISPLAY_HELPER 71 71 help 72 72 DRM display helpers for HDMI. 73 + 74 + config DRM_DISPLAY_HDMI_STATE_HELPER 75 + bool 76 + depends on DRM_DISPLAY_HELPER 77 + depends on DRM_DISPLAY_HDMI_HELPER 78 + help 79 + DRM KMS state helpers for HDMI.
+2
drivers/gpu/drm/display/Makefile
··· 14 14 drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_HELPER) += \ 15 15 drm_hdmi_helper.o \ 16 16 drm_scdc_helper.o 17 + drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_STATE_HELPER) += \ 18 + drm_hdmi_state_helper.o 17 19 drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV) += drm_dp_aux_dev.o 18 20 drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_AUX_CEC) += drm_dp_cec.o 19 21
+41
drivers/gpu/drm/display/drm_hdmi_state_helper.c
··· 1 + // SPDX-License-Identifier: MIT 2 + 3 + #include <drm/drm_atomic.h> 4 + #include <drm/drm_connector.h> 5 + 6 + #include <drm/display/drm_hdmi_state_helper.h> 7 + 8 + /** 9 + * __drm_atomic_helper_connector_hdmi_reset() - Initializes all HDMI @drm_connector_state resources 10 + * @connector: DRM connector 11 + * @new_conn_state: connector state to reset 12 + * 13 + * Initializes all HDMI resources from a @drm_connector_state without 14 + * actually allocating it. This is useful for HDMI drivers, in 15 + * combination with __drm_atomic_helper_connector_reset() or 16 + * drm_atomic_helper_connector_reset(). 17 + */ 18 + void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector, 19 + struct drm_connector_state *new_conn_state) 20 + { 21 + } 22 + EXPORT_SYMBOL(__drm_atomic_helper_connector_hdmi_reset); 23 + 24 + /** 25 + * drm_atomic_helper_connector_hdmi_check() - Helper to check HDMI connector atomic state 26 + * @connector: DRM Connector 27 + * @state: the DRM State object 28 + * 29 + * Provides a default connector state check handler for HDMI connectors. 30 + * Checks that a desired connector update is valid, and updates various 31 + * fields of derived state. 32 + * 33 + * RETURNS: 34 + * Zero on success, or an errno code otherwise. 35 + */ 36 + int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, 37 + struct drm_atomic_state *state) 38 + { 39 + return 0; 40 + } 41 + EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_check);
+16
include/drm/display/drm_hdmi_state_helper.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + 3 + #ifndef DRM_HDMI_STATE_HELPER_H_ 4 + #define DRM_HDMI_STATE_HELPER_H_ 5 + 6 + struct drm_atomic_state; 7 + struct drm_connector; 8 + struct drm_connector_state; 9 + 10 + void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector, 11 + struct drm_connector_state *new_conn_state); 12 + 13 + int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, 14 + struct drm_atomic_state *state); 15 + 16 + #endif // DRM_HDMI_STATE_HELPER_H_
+7
include/drm/drm_connector.h
··· 1031 1031 * DRM blob property for HDR output metadata 1032 1032 */ 1033 1033 struct drm_property_blob *hdr_output_metadata; 1034 + 1035 + /** 1036 + * @hdmi: HDMI-related variable and properties. Filled by 1037 + * @drm_atomic_helper_connector_hdmi_check(). 1038 + */ 1039 + struct { 1040 + } hdmi; 1034 1041 }; 1035 1042 1036 1043 /**