summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-01-07 21:15:02 +0300
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-01-19 14:11:46 +0300
commitb626b1a1c9ccadd8861870a2a450f02e0c61ab88 (patch)
tree7297ae1fe3ea7ed78bd1c733c50ae65668c4e1da /include/drm
parentafc399f7a5ea7bf405b2ef85c7470529b1a9e47c (diff)
downloadlinux-b626b1a1c9ccadd8861870a2a450f02e0c61ab88.tar.xz
drm/bridge: refactor HDMI InfoFrame callbacks
Having only a single set of callbacks, hdmi_clear_infoframe and hdmi_write_infoframe, bridge drivers don't have an easy way to signal to the DRM framework, which InfoFrames are actually supported by the hardware and by the driver and which are not. Also, it makes it extremely easy for HDMI bridge drivers to skip implementing the seemingly required InfoFrames (e.g. HDMI VSI). Last, but not least, those callbacks take a single 'type' parameter, which makes it impossible to implement support for multiple VSIs (which will be required once we start working on HDMI Forum VSI). Split the callbacks into a per-InfoFrame-kind pairs, letting the bridge drivers actually signal supported features. The implementation follows the overall drm_bridge design, where the bridge has a single drm_bridge_funcs implementation and signals, which functions are to be called using the drm_bridge->ops flags. The AVI and HDMI VSI are assumed to be required for a normal HDMI operation (with the drivers getting a drm_warn_once() stub implementation if one is missing). The Audio InfoFrame is handled by the existing DRM_BRIDGE_OP_HDMI_AUDIO, while the SPD and HDR DRM InfoFrames got new drm_bridge_ops values. Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260107-limit-infoframes-2-v4-5-213d0d3bd490@oss.qualcomm.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_bridge.h127
1 files changed, 115 insertions, 12 deletions
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 3e6cbfa9dc44..73c23fece792 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -785,29 +785,113 @@ struct drm_bridge_funcs {
unsigned long long tmds_rate);
/**
- * @hdmi_clear_infoframe:
+ * @hdmi_clear_avi_infoframe:
*
* This callback clears the infoframes in the hardware during commit.
- * It will be called multiple times, once for every disabled infoframe
- * type.
*
* This callback is optional but it must be implemented by bridges that
* set the DRM_BRIDGE_OP_HDMI flag in their &drm_bridge->ops.
*/
- int (*hdmi_clear_infoframe)(struct drm_bridge *bridge,
- enum hdmi_infoframe_type type);
+ int (*hdmi_clear_avi_infoframe)(struct drm_bridge *bridge);
+
+ /**
+ * @hdmi_write_avi_infoframe:
+ *
+ * Program the infoframe into the hardware.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI flag in their &drm_bridge->ops.
+ */
+ int (*hdmi_write_avi_infoframe)(struct drm_bridge *bridge,
+ const u8 *buffer, size_t len);
+
+ /**
+ * @hdmi_clear_hdmi_infoframe:
+ *
+ * This callback clears the infoframes in the hardware during commit.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI flag in their &drm_bridge->ops.
+ */
+ int (*hdmi_clear_hdmi_infoframe)(struct drm_bridge *bridge);
+
/**
- * @hdmi_write_infoframe:
+ * @hdmi_write_hdmi_infoframe:
*
- * Program the infoframe into the hardware. It will be called multiple
- * times, once for every updated infoframe type.
+ * Program the infoframe into the hardware.
*
* This callback is optional but it must be implemented by bridges that
* set the DRM_BRIDGE_OP_HDMI flag in their &drm_bridge->ops.
*/
- int (*hdmi_write_infoframe)(struct drm_bridge *bridge,
- enum hdmi_infoframe_type type,
- const u8 *buffer, size_t len);
+ int (*hdmi_write_hdmi_infoframe)(struct drm_bridge *bridge,
+ const u8 *buffer, size_t len);
+
+ /**
+ * @hdmi_clear_hdr_drm_infoframe:
+ *
+ * This callback clears the infoframes in the hardware during commit.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME flag in their
+ * &drm_bridge->ops.
+ */
+ int (*hdmi_clear_hdr_drm_infoframe)(struct drm_bridge *bridge);
+
+ /**
+ * @hdmi_write_hdr_drm_infoframe:
+ *
+ * Program the infoframe into the hardware.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME flag in their
+ * &drm_bridge->ops.
+ */
+ int (*hdmi_write_hdr_drm_infoframe)(struct drm_bridge *bridge,
+ const u8 *buffer, size_t len);
+
+ /**
+ * @hdmi_clear_spd_infoframe:
+ *
+ * This callback clears the infoframes in the hardware during commit.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME flag in their
+ * &drm_bridge->ops.
+ */
+ int (*hdmi_clear_spd_infoframe)(struct drm_bridge *bridge);
+
+ /**
+ * @hdmi_write_spd_infoframe:
+ *
+ * Program the infoframe into the hardware.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME flag in their
+ * &drm_bridge->ops.
+ */
+ int (*hdmi_write_spd_infoframe)(struct drm_bridge *bridge,
+ const u8 *buffer, size_t len);
+
+ /**
+ * @hdmi_clear_audio_infoframe:
+ *
+ * This callback clears the infoframes in the hardware during commit.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI_AUDIO flag in their &drm_bridge->ops.
+ */
+ int (*hdmi_clear_audio_infoframe)(struct drm_bridge *bridge);
+
+ /**
+ * @hdmi_write_audio_infoframe:
+ *
+ * Program the infoframe into the hardware.
+ *
+ * This callback is optional but it must be implemented by bridges that
+ * set the DRM_BRIDGE_OP_HDMI_AUDIO flag in their &drm_bridge->ops.
+ */
+ int (*hdmi_write_audio_infoframe)(struct drm_bridge *bridge,
+ const u8 *buffer, size_t len);
/**
* @hdmi_audio_startup:
@@ -1063,7 +1147,11 @@ enum drm_bridge_ops {
/**
* @DRM_BRIDGE_OP_HDMI: The bridge provides HDMI connector operations,
* including infoframes support. Bridges that set this flag must
- * implement the &drm_bridge_funcs->write_infoframe callback.
+ * provide HDMI-related information and implement the
+ * &drm_bridge_funcs->clear_avi_infoframe,
+ * &drm_bridge_funcs->write_avi_infoframe,
+ * &drm_bridge_funcs->clear_hdmi_infoframe and
+ * &drm_bridge_funcs->write_hdmi_infoframe callbacks.
*
* Note: currently there can be at most one bridge in a chain that sets
* this bit. This is to simplify corresponding glue code in connector
@@ -1075,6 +1163,9 @@ enum drm_bridge_ops {
* Bridges that set this flag must implement the
* &drm_bridge_funcs->hdmi_audio_prepare and
* &drm_bridge_funcs->hdmi_audio_shutdown callbacks.
+ * If the bridge implements @DRM_BRIDGE_OP_HDMI, it also must implement
+ * &drm_bridge_funcs->hdmi_write_audio_infoframe and
+ * &drm_bridge_funcs->hdmi_cleaer_audio_infoframe callbacks.
*
* Note: currently there can be at most one bridge in a chain that sets
* this bit. This is to simplify corresponding glue code in connector
@@ -1106,6 +1197,18 @@ enum drm_bridge_ops {
* to be present.
*/
DRM_BRIDGE_OP_HDMI_CEC_ADAPTER = BIT(8),
+ /**
+ * @DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME: The bridge supports
+ * &drm_bridge_funcs->hdmi_write_hdr_drm_infoframe and
+ * &drm_bridge_funcs->hdmi_clear_hdr_drm_infoframe callbacks.
+ */
+ DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME = BIT(9),
+ /**
+ * @DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME: The bridge supports
+ * &drm_bridge_funcs->hdmi_write_spd_infoframe and
+ * &drm_bridge_funcs->hdmi_clear_spd_infoframe callbacks.
+ */
+ DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME = BIT(10),
};
/**