* [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities
@ 2025-09-09 14:51 Dmitry Baryshkov
2025-09-09 14:51 ` [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported Dmitry Baryshkov
` (9 more replies)
0 siblings, 10 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:51 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
It's not uncommon for the particular device to support only a subset of
HDMI InfoFrames. Currently it's mostly ignored by the framework: it
calls write_infoframe() / clear_infoframe() callbacks for all frames and
expects them to return success even if the InfoFrame is not supported.
Likewise debugfs lists all InfoFrames with some contents even if it the
particular type is not being supported by the hardware.
Sort that out, making sure that all interfaces are consistent:
- Add a way for the driver to define which InfoFrames it supports
- Don't call callbacks for unsupported InfoFrames
- Don't register debugfs files for unsupported InfoFrame types
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Changes in v4:
- Dropped software / autogenerated distinction, revert back to
software_infoframes
- Dropped LT9611UXC patch, it doesn't fit anymore
- Don't warn in HDMI Audio helpers if the device doesn't support
InfoFrames at all (this is useful for DP controllers).
- Rebased on a fresh drm-misc-next, picking up ADV7511 and IT6263
InfoFrames changes.
- Link to v3: https://lore.kernel.org/r/20250830-drm-limit-infoframes-v3-0-32fcbec4634e@oss.qualcomm.com
Changes in v3:
- Fixed supported infoframes initialization (Liu Ying)
- Implemented separate flags for DRM-generated InfoFrames and
hardware-generated ones
- Warn if required InfoFrames are not supported by the driver (Maxime)
- Changed drivers to error out if the DRM framework requires the
unsupported InfoFrame (Maxime)
- Implemented DRM_BRIDGE_OP_HDMI and DRM_BRIDGE_OP_HDMI_AUDIO for
Lontium lt9611uxc bridge.
- Link to v2: https://lore.kernel.org/r/20250819-drm-limit-infoframes-v2-0-7595dda24fbd@oss.qualcomm.com
Changes in v2:
- Corrected whitespace / newline issues & other small syntax fixes (Liu
Ying)
- Added audio to the list of InfoFrames supported by the VC4 driver (Liu
Ying)
- Changed drm_dbg_kms() to drm_warn_once() in the Audio InfoFrame update
code (Liu Ying)
- Corrected subject for ITE IT6263 patch (Liu Ying)
- Added patch, dropping default list of InfoFrames in
drm_bridge_connector.
- Link to v1: https://lore.kernel.org/r/20250816-drm-limit-infoframes-v1-0-6dc17d5f07e9@oss.qualcomm.com
---
Dmitry Baryshkov (10):
drm/connector: let drivers declare infoframes as unsupported
drm/bridge: adv7511: declare supported infoframes
drm/bridge: ite-it6263: declare supported infoframes
drm/bridge: lontium-lt9611: declare supported infoframes
drm/bridge: synopsys/dw-hdmi-qp: declare supported infoframes
drm/msm: hdmi: declare supported infoframes
drm/rockchip: rk3066: declare supported infoframes
drm/display: bridge_connector: drop default list for HDMI Infoframes
drm/connector: verify that HDMI connectors support necessary InfoFrames
drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 ++++-
drivers/gpu/drm/bridge/ite-it6263.c | 5 +++
drivers/gpu/drm/bridge/lontium-lt9611.c | 11 ++++--
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 7 +++-
drivers/gpu/drm/display/drm_bridge_connector.c | 1 +
drivers/gpu/drm/display/drm_hdmi_audio_helper.c | 12 ++++++
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 43 +++++++++++++++++++---
drivers/gpu/drm/drm_connector.c | 11 ++++++
drivers/gpu/drm/drm_debugfs.c | 16 +++++---
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 8 +++-
drivers/gpu/drm/rockchip/inno_hdmi.c | 5 ++-
drivers/gpu/drm/rockchip/rk3066_hdmi.c | 6 ++-
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 3 +-
drivers/gpu/drm/tests/drm_connector_test.c | 28 ++++++++++++++
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 8 ++++
drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++
include/drm/drm_bridge.h | 12 +++++-
include/drm/drm_connector.h | 30 ++++++++++++++-
18 files changed, 193 insertions(+), 27 deletions(-)
---
base-commit: f50b969bafafb2810a07f376387350c4c0d72a21
change-id: 20250815-drm-limit-infoframes-e782fa7f3360
Best regards,
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
@ 2025-09-09 14:51 ` Dmitry Baryshkov
2025-09-10 11:03 ` Maxime Ripard
2025-09-09 14:52 ` [PATCH v4 02/10] drm/bridge: adv7511: declare supported infoframes Dmitry Baryshkov
` (8 subsequent siblings)
9 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:51 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Currently DRM framework expects that the HDMI connector driver supports
all infoframe types: it generates the data as required and calls into
the driver to program all of them, letting the driver to soft-fail if
the infoframe is unsupported. This has a major drawback on userspace
API: the framework also registers debugfs files for all Infoframe types,
possibly surprising the users when infoframe is visible in the debugfs
file, but it is not visible on the wire. Drivers are also expected to
return success even for unsuppoted InfoFrame types.
Let drivers declare that they support only a subset of infoframes,
creating a more consistent interface. Make the affected drivers return
-EOPNOTSUPP if they are asked to program (or clear) InfoFrames which are
not supported.
Acked-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 6 +++
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 43 +++++++++++++++++++---
drivers/gpu/drm/drm_connector.c | 4 ++
drivers/gpu/drm/drm_debugfs.c | 16 +++++---
drivers/gpu/drm/rockchip/inno_hdmi.c | 5 ++-
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 3 +-
drivers/gpu/drm/tests/drm_connector_test.c | 28 ++++++++++++++
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 8 ++++
drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++
include/drm/drm_bridge.h | 12 +++++-
include/drm/drm_connector.h | 30 ++++++++++++++-
11 files changed, 143 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index baacd21e7341fca95ef3e5b793930ffde9d4d4e3..55bf5ac53739fda098be69a5c61e4934704ce046 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -783,6 +783,12 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
&drm_bridge_connector_hdmi_funcs,
connector_type, ddc,
supported_formats,
+ bridge->supported_infoframes ? |
+ DRM_CONNECTOR_INFOFRAME_AUDIO |
+ DRM_CONNECTOR_INFOFRAME_AVI |
+ DRM_CONNECTOR_INFOFRAME_DRM |
+ DRM_CONNECTOR_INFOFRAME_SPD |
+ DRM_CONNECTOR_INFOFRAME_VENDOR,
max_bpc);
if (ret)
return ERR_PTR(ret);
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index a561f124be99a0cd4259dbacf5f5f6651ff8a0ea..9ae996b5a2acf27d23da7108865b721cc8975dbf 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -687,6 +687,9 @@ static int hdmi_generate_avi_infoframe(const struct drm_connector *connector,
infoframe->set = false;
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_AVI))
+ return 0;
+
ret = drm_hdmi_avi_infoframe_from_display_mode(frame, connector, mode);
if (ret)
return ret;
@@ -718,6 +721,9 @@ static int hdmi_generate_spd_infoframe(const struct drm_connector *connector,
infoframe->set = false;
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_SPD))
+ return 0;
+
ret = hdmi_spd_infoframe_init(frame,
connector->hdmi.vendor,
connector->hdmi.product);
@@ -742,6 +748,9 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
infoframe->set = false;
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_DRM))
+ return 0;
+
if (connector->max_bpc < 10)
return 0;
@@ -771,6 +780,9 @@ static int hdmi_generate_hdmi_vendor_infoframe(const struct drm_connector *conne
infoframe->set = false;
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_VENDOR))
+ return 0;
+
if (!info->has_hdmi_infoframe)
return 0;
@@ -898,13 +910,18 @@ static int clear_device_infoframe(struct drm_connector *connector,
struct drm_device *dev = connector->dev;
int ret;
- drm_dbg_kms(dev, "Clearing infoframe type 0x%x\n", type);
-
if (!funcs || !funcs->clear_infoframe) {
drm_dbg_kms(dev, "Function not implemented, bailing.\n");
return 0;
}
+ if (!drm_hdmi_connector_supported_infoframe(connector, type)) {
+ drm_dbg_kms(dev, "Infoframe 0x%02x not supported, bailing.\n", type);
+ return -EOPNOTSUPP;
+ }
+
+ drm_dbg_kms(dev, "Clearing infoframe type 0x%02x\n", type);
+
ret = funcs->clear_infoframe(connector, type);
if (ret) {
drm_dbg_kms(dev, "Call failed: %d\n", ret);
@@ -930,23 +947,29 @@ static int write_device_infoframe(struct drm_connector *connector,
union hdmi_infoframe *frame)
{
const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs;
+ enum hdmi_infoframe_type type = frame->any.type;
struct drm_device *dev = connector->dev;
u8 buffer[HDMI_INFOFRAME_SIZE(MAX)];
int ret;
int len;
- drm_dbg_kms(dev, "Writing infoframe type %x\n", frame->any.type);
-
if (!funcs || !funcs->write_infoframe) {
drm_dbg_kms(dev, "Function not implemented, bailing.\n");
return -EINVAL;
}
+ if (!drm_hdmi_connector_supported_infoframe(connector, type)) {
+ drm_dbg_kms(dev, "Infoframe 0x%02x not supported, bailing.\n", type);
+ return -EOPNOTSUPP;
+ }
+
+ drm_dbg_kms(dev, "Writing infoframe type 0x%02x\n", type);
+
len = hdmi_infoframe_pack(frame, buffer, sizeof(buffer));
if (len < 0)
return len;
- ret = funcs->write_infoframe(connector, frame->any.type, buffer, len);
+ ret = funcs->write_infoframe(connector, type, buffer, len);
if (ret) {
drm_dbg_kms(dev, "Call failed: %d\n", ret);
return ret;
@@ -1067,6 +1090,11 @@ drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *co
struct drm_display_info *info = &connector->display_info;
int ret;
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_AUDIO)) {
+ drm_warn_once(connector->dev, "Audio Infoframe not supported, bailing.\n");
+ return -EOPNOTSUPP;
+ }
+
if (!info->is_hdmi)
return 0;
@@ -1102,6 +1130,11 @@ drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *con
struct drm_display_info *info = &connector->display_info;
int ret;
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_AUDIO)) {
+ drm_warn_once(connector->dev, "Audio Infoframe not supported, bailing.\n");
+ return -EOPNOTSUPP;
+ }
+
if (!info->is_hdmi)
return 0;
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 272d6254ea4784e97ca894ec4d463beebf9fdbf0..92a75684a0f7375d3a94e8c666cb71064ecc8035 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -553,6 +553,7 @@ EXPORT_SYMBOL(drmm_connector_init);
* @connector_type: user visible type of the connector
* @ddc: optional pointer to the associated ddc adapter
* @supported_formats: Bitmask of @hdmi_colorspace listing supported output formats
+ * @supported_infoframes: Bitmask of @DRM_CONNECTOR_INFOFRAME listing Infoframes generated by DRM core
* @max_bpc: Maximum bits per char the HDMI connector supports
*
* Initialises a preallocated HDMI connector. Connectors can be
@@ -576,6 +577,7 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
int connector_type,
struct i2c_adapter *ddc,
unsigned long supported_formats,
+ unsigned long supported_infoframes,
unsigned int max_bpc)
{
int ret;
@@ -623,6 +625,8 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
connector->hdmi.funcs = hdmi_funcs;
+ connector->hdmi.supported_infoframes = supported_infoframes;
+
return 0;
}
EXPORT_SYMBOL(drmm_connector_hdmi_init);
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 365cf337529fa2a88b69516d57360d212419c126..0bf70164550b4eb0551aeab026d5bf1131739a02 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -672,6 +672,9 @@ static int create_hdmi_audio_infoframe_file(struct drm_connector *connector,
{
struct dentry *file;
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_AUDIO))
+ return 0;
+
file = debugfs_create_file("audio", 0400, parent, connector, &audio_infoframe_fops);
if (IS_ERR(file))
return PTR_ERR(file);
@@ -679,7 +682,7 @@ static int create_hdmi_audio_infoframe_file(struct drm_connector *connector,
return 0;
}
-#define DEFINE_INFOFRAME_FILE(_f) \
+#define DEFINE_INFOFRAME_FILE(_f, _F) \
static ssize_t _f##_read_infoframe(struct file *filp, \
char __user *ubuf, \
size_t count, \
@@ -726,6 +729,9 @@ static int create_hdmi_## _f ## _infoframe_file(struct drm_connector *connector,
{ \
struct dentry *file; \
\
+ if (!drm_hdmi_connector_supported_infoframe(connector, HDMI_INFOFRAME_TYPE_ ## _F)) \
+ return 0; \
+ \
file = debugfs_create_file(#_f, 0400, parent, connector, &_f ## _infoframe_fops); \
if (IS_ERR(file)) \
return PTR_ERR(file); \
@@ -733,10 +739,10 @@ static int create_hdmi_## _f ## _infoframe_file(struct drm_connector *connector,
return 0; \
}
-DEFINE_INFOFRAME_FILE(avi);
-DEFINE_INFOFRAME_FILE(hdmi);
-DEFINE_INFOFRAME_FILE(hdr_drm);
-DEFINE_INFOFRAME_FILE(spd);
+DEFINE_INFOFRAME_FILE(avi, AVI);
+DEFINE_INFOFRAME_FILE(hdmi, VENDOR);
+DEFINE_INFOFRAME_FILE(hdr_drm, DRM);
+DEFINE_INFOFRAME_FILE(spd, SPD);
static int create_hdmi_infoframe_files(struct drm_connector *connector,
struct dentry *parent)
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 1ab3ad4bde9ea7305021186ea221d2ff9057fdbb..31d742b7627b8b31ebbd7056c9d44a0454407d6d 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -645,7 +645,7 @@ static int inno_hdmi_disable_frame(struct drm_connector *connector,
if (type != HDMI_INFOFRAME_TYPE_AVI) {
drm_err(connector->dev,
"Unsupported infoframe type: %u\n", type);
- return 0;
+ return -EOPNOTSUPP;
}
hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, INFOFRAME_AVI);
@@ -663,7 +663,7 @@ static int inno_hdmi_upload_frame(struct drm_connector *connector,
if (type != HDMI_INFOFRAME_TYPE_AVI) {
drm_err(connector->dev,
"Unsupported infoframe type: %u\n", type);
- return 0;
+ return -EOPNOTSUPP;
}
inno_hdmi_disable_frame(connector, type);
@@ -1065,6 +1065,7 @@ static int inno_hdmi_register(struct drm_device *drm, struct inno_hdmi *hdmi)
DRM_MODE_CONNECTOR_HDMIA,
hdmi->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_INFOFRAME_AVI,
8);
drm_connector_attach_encoder(&hdmi->connector, encoder);
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index ab0938ba61f7d75dd0bec473807a04a20e1cffbd..f4c8ff60d78250d0100e210210d4e9a64a903af5 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -50,7 +50,7 @@ static int sun4i_hdmi_write_infoframe(struct drm_connector *connector,
if (type != HDMI_INFOFRAME_TYPE_AVI) {
drm_err(connector->dev,
"Unsupported infoframe type: %u\n", type);
- return 0;
+ return -EOPNOTSUPP;
}
for (i = 0; i < len; i++)
@@ -640,6 +640,7 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,
DRM_MODE_CONNECTOR_HDMIA,
hdmi->ddc_i2c,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_INFOFRAME_AVI,
8);
if (ret) {
dev_err(dev,
diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c
index 22e2d959eb31459f9981fef488228904d67cb6f9..fd28ed2bf8bcecabaabc67f2f8f5ccc1f42525d3 100644
--- a/drivers/gpu/drm/tests/drm_connector_test.c
+++ b/drivers/gpu/drm/tests/drm_connector_test.c
@@ -641,6 +641,13 @@ static struct kunit_suite drm_connector_dynamic_register_test_suite = {
.test_cases = drm_connector_dynamic_register_tests,
};
+#define DRM_CONNECTOR_ALL_INFOFRAMES \
+ (DRM_CONNECTOR_INFOFRAME_AUDIO | \
+ DRM_CONNECTOR_INFOFRAME_AVI | \
+ DRM_CONNECTOR_INFOFRAME_DRM | \
+ DRM_CONNECTOR_INFOFRAME_SPD | \
+ DRM_CONNECTOR_INFOFRAME_VENDOR)
+
/*
* Test that the registration of a bog standard connector works as
* expected and doesn't report any error.
@@ -657,6 +664,7 @@ static void drm_test_connector_hdmi_init_valid(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
}
@@ -677,6 +685,7 @@ static void drm_test_connector_hdmi_init_null_ddc(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
NULL,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
}
@@ -697,6 +706,7 @@ static void drm_test_connector_hdmi_init_null_vendor(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -717,6 +727,7 @@ static void drm_test_connector_hdmi_init_null_product(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -743,6 +754,7 @@ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
KUNIT_EXPECT_MEMEQ(test,
@@ -776,6 +788,7 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
KUNIT_EXPECT_MEMEQ(test,
@@ -803,6 +816,7 @@ static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *t
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -829,6 +843,7 @@ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
KUNIT_EXPECT_MEMEQ(test,
@@ -861,6 +876,7 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
KUNIT_EXPECT_MEMEQ(test,
@@ -888,6 +904,7 @@ static void drm_test_connector_hdmi_init_vendor_length_too_long(struct kunit *te
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -908,6 +925,7 @@ static void drm_test_connector_hdmi_init_bpc_invalid(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
9);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -928,6 +946,7 @@ static void drm_test_connector_hdmi_init_bpc_null(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
0);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -953,6 +972,7 @@ static void drm_test_connector_hdmi_init_bpc_8(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
@@ -994,6 +1014,7 @@ static void drm_test_connector_hdmi_init_bpc_10(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
10);
KUNIT_EXPECT_EQ(test, ret, 0);
@@ -1035,6 +1056,7 @@ static void drm_test_connector_hdmi_init_bpc_12(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
12);
KUNIT_EXPECT_EQ(test, ret, 0);
@@ -1071,6 +1093,7 @@ static void drm_test_connector_hdmi_init_formats_empty(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
0,
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -1091,6 +1114,7 @@ static void drm_test_connector_hdmi_init_formats_no_rgb(struct kunit *test)
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_YUV422),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -1149,6 +1173,7 @@ static void drm_test_connector_hdmi_init_formats_yuv420_allowed(struct kunit *te
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
params->supported_formats,
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, params->expected_result);
}
@@ -1170,6 +1195,7 @@ static void drm_test_connector_hdmi_init_type_valid(struct kunit *test)
connector_type,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
}
@@ -1205,6 +1231,7 @@ static void drm_test_connector_hdmi_init_type_invalid(struct kunit *test)
connector_type,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_LT(test, ret, 0);
}
@@ -1482,6 +1509,7 @@ static void drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector(
DRM_MODE_CONNECTOR_HDMIA,
&priv->ddc,
BIT(HDMI_COLORSPACE_RGB),
+ DRM_CONNECTOR_ALL_INFOFRAMES,
8);
KUNIT_EXPECT_EQ(test, ret, 0);
diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
index 8bd412735000cb18e66aeca21433b2ebbefe2b44..2901fcb6b12ee318a4a9c727a62d5290d7c9aa84 100644
--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
@@ -138,6 +138,13 @@ static const struct drm_connector_funcs dummy_connector_funcs = {
.reset = dummy_hdmi_connector_reset,
};
+#define DRM_CONNECTOR_ALL_INFOFRAMES \
+ (DRM_CONNECTOR_INFOFRAME_AUDIO | \
+ DRM_CONNECTOR_INFOFRAME_AVI | \
+ DRM_CONNECTOR_INFOFRAME_DRM | \
+ DRM_CONNECTOR_INFOFRAME_SPD | \
+ DRM_CONNECTOR_INFOFRAME_VENDOR)
+
static
struct drm_atomic_helper_connector_hdmi_priv *
__connector_hdmi_init(struct kunit *test,
@@ -192,6 +199,7 @@ __connector_hdmi_init(struct kunit *test,
DRM_MODE_CONNECTOR_HDMIA,
NULL,
formats,
+ DRM_CONNECTOR_ALL_INFOFRAMES,
max_bpc);
KUNIT_ASSERT_EQ(test, ret, 0);
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 07c91b450f93ab9e795d040d6f60f485ac71cfe8..2098d04c95e7e733307c90bb9ab5e2631f6f5df0 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -556,6 +556,11 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
BIT(HDMI_COLORSPACE_RGB) |
BIT(HDMI_COLORSPACE_YUV422) |
BIT(HDMI_COLORSPACE_YUV444),
+ DRM_CONNECTOR_INFOFRAME_AUDIO |
+ DRM_CONNECTOR_INFOFRAME_AVI |
+ DRM_CONNECTOR_INFOFRAME_DRM |
+ DRM_CONNECTOR_INFOFRAME_SPD |
+ DRM_CONNECTOR_INFOFRAME_VENDOR,
max_bpc);
if (ret)
return ret;
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 76e05930f50e00f6ef5999b3f5a476215951028d..a3e3518905a06835f61a1a60bd2f165820f57918 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -788,7 +788,7 @@ struct drm_bridge_funcs {
*
* This callback clears the infoframes in the hardware during commit.
* It will be called multiple times, once for every disabled infoframe
- * type.
+ * type. It should return -EOPNOTSUPP if the frame is not supported.
*
* This callback is optional but it must be implemented by bridges that
* set the DRM_BRIDGE_OP_HDMI flag in their &drm_bridge->ops.
@@ -799,7 +799,8 @@ struct drm_bridge_funcs {
* @hdmi_write_infoframe:
*
* Program the infoframe into the hardware. It will be called multiple
- * times, once for every updated infoframe type.
+ * times, once for every updated infoframe type. It should return
+ * -EOPNOTSUPP if the frame is not supported.
*
* This callback is optional but it must be implemented by bridges that
* set the DRM_BRIDGE_OP_HDMI flag in their &drm_bridge->ops.
@@ -1205,6 +1206,13 @@ struct drm_bridge {
*/
unsigned int max_bpc;
+ /**
+ * @supported_infoframes: Bitmask of DRM_CONNECTOR_INFOFRAME values,
+ * listing InfoFrames to be generated by the DRM core. This is only
+ * relevant if @DRM_BRIDGE_OP_HDMI is set.
+ */
+ unsigned int supported_infoframes;
+
/**
* @hdmi_cec_dev: device to be used as a containing device for CEC
* functions.
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 8f34f4b8183d83dccd3e820a444fbf74fb6c16f2..7849a2343771ee869cd1e38b30f34d0c2237f4d7 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1256,7 +1256,8 @@ struct drm_connector_hdmi_funcs {
* The @clear_infoframe callback is optional.
*
* Returns:
- * 0 on success, a negative error code otherwise
+ * 0 on success, a negative error code otherwise, it should return
+ * -EOPNOTSUPP if the frame is not supported
*/
int (*clear_infoframe)(struct drm_connector *connector,
enum hdmi_infoframe_type type);
@@ -1273,7 +1274,8 @@ struct drm_connector_hdmi_funcs {
* The @write_infoframe callback is mandatory.
*
* Returns:
- * 0 on success, a negative error code otherwise
+ * 0 on success, a negative error code otherwise, it should return
+ * -EOPNOTSUPP if the frame is not supported
*/
int (*write_infoframe)(struct drm_connector *connector,
enum hdmi_infoframe_type type,
@@ -1839,6 +1841,14 @@ struct drm_connector_hdmi {
*/
unsigned long supported_formats;
+ /**
+ * @supported_infoframes: Bitmask of infoframe types supported by the
+ * controller and generated AS IS by the software.
+ * See @DRM_CONNECTOR_INFOFRAME and
+ * @drm_connector_hdmi_funcs.write_infoframe().
+ */
+ unsigned long supported_infoframes;
+
/**
* @funcs: HDMI connector Control Functions
*/
@@ -2336,6 +2346,7 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
int connector_type,
struct i2c_adapter *ddc,
unsigned long supported_formats,
+ unsigned long supported_infoframes,
unsigned int max_bpc);
void drm_connector_attach_edid_property(struct drm_connector *connector);
int drm_connector_register(struct drm_connector *connector);
@@ -2488,6 +2499,21 @@ void drm_connector_attach_privacy_screen_provider(
struct drm_connector *connector, struct drm_privacy_screen *priv);
void drm_connector_update_privacy_screen(const struct drm_connector_state *connector_state);
+#define DRM_CONNECTOR_INFOFRAME(type) ((type) > 0x80 ? BIT((type) - 0x80) : 0)
+
+#define DRM_CONNECTOR_INFOFRAME_AUDIO DRM_CONNECTOR_INFOFRAME(HDMI_INFOFRAME_TYPE_AUDIO)
+#define DRM_CONNECTOR_INFOFRAME_AVI DRM_CONNECTOR_INFOFRAME(HDMI_INFOFRAME_TYPE_AVI)
+#define DRM_CONNECTOR_INFOFRAME_DRM DRM_CONNECTOR_INFOFRAME(HDMI_INFOFRAME_TYPE_DRM)
+#define DRM_CONNECTOR_INFOFRAME_SPD DRM_CONNECTOR_INFOFRAME(HDMI_INFOFRAME_TYPE_SPD)
+#define DRM_CONNECTOR_INFOFRAME_VENDOR DRM_CONNECTOR_INFOFRAME(HDMI_INFOFRAME_TYPE_VENDOR)
+
+static inline bool
+drm_hdmi_connector_supported_infoframe(const struct drm_connector *connector,
+ enum hdmi_infoframe_type type)
+{
+ return connector->hdmi.supported_infoframes & DRM_CONNECTOR_INFOFRAME(type);
+}
+
/**
* struct drm_tile_group - Tile group metadata
* @refcount: reference count
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 02/10] drm/bridge: adv7511: declare supported infoframes
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
2025-09-09 14:51 ` [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 03/10] drm/bridge: ite-it6263: " Dmitry Baryshkov
` (7 subsequent siblings)
9 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Declare which infoframes are supported via the .hdmi_write_infoframe()
interface. Return -EOPNOTSUPP if the driver is asked to write or clear
the unsupported InfoFrame.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index b9be8654130758e69ac7ccbc73a82cc25d731a5c..280a5f82ebb0c792a0667e9f55af103f29ff2948 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -907,7 +907,7 @@ static int adv7511_bridge_hdmi_clear_infoframe(struct drm_bridge *bridge,
break;
default:
drm_dbg_driver(adv7511->bridge.dev, "Unsupported HDMI InfoFrame %x\n", type);
- break;
+ return -EOPNOTSUPP;
}
return 0;
@@ -967,7 +967,7 @@ static int adv7511_bridge_hdmi_write_infoframe(struct drm_bridge *bridge,
break;
default:
drm_dbg_driver(adv7511->bridge.dev, "Unsupported HDMI InfoFrame %x\n", type);
- break;
+ return -EOPNOTSUPP;
}
return 0;
@@ -1328,6 +1328,11 @@ static int adv7511_probe(struct i2c_client *i2c)
adv7511->bridge.vendor = "Analog";
adv7511->bridge.product = adv7511->info->name;
+ adv7511->bridge.supported_infoframes =
+ DRM_CONNECTOR_INFOFRAME_AUDIO |
+ DRM_CONNECTOR_INFOFRAME_AVI |
+ DRM_CONNECTOR_INFOFRAME_SPD |
+ DRM_CONNECTOR_INFOFRAME_VENDOR;
#ifdef CONFIG_DRM_I2C_ADV7511_AUDIO
adv7511->bridge.ops |= DRM_BRIDGE_OP_HDMI_AUDIO;
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 03/10] drm/bridge: ite-it6263: declare supported infoframes
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
2025-09-09 14:51 ` [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 02/10] drm/bridge: adv7511: declare supported infoframes Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 04/10] drm/bridge: lontium-lt9611: " Dmitry Baryshkov
` (6 subsequent siblings)
9 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Declare which infoframes are supported via the .hdmi_write_infoframe()
interface. Return -EOPNOTSUPP if the driver is asked to write or clear
the unsupported InfoFrame.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/bridge/ite-it6263.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c
index 2eb8fba7016cbf0dcb19aec4ca8849f1fffaa64c..691e2d8a721bdbf99ca2dd49a45ce508ee7d9591 100644
--- a/drivers/gpu/drm/bridge/ite-it6263.c
+++ b/drivers/gpu/drm/bridge/ite-it6263.c
@@ -773,6 +773,7 @@ static int it6263_hdmi_clear_infoframe(struct drm_bridge *bridge,
break;
default:
dev_dbg(it->dev, "unsupported HDMI infoframe 0x%x\n", type);
+ return -EOPNOTSUPP;
}
return 0;
@@ -813,6 +814,7 @@ static int it6263_hdmi_write_infoframe(struct drm_bridge *bridge,
break;
default:
dev_dbg(it->dev, "unsupported HDMI infoframe 0x%x\n", type);
+ return -EOPNOTSUPP;
}
return 0;
@@ -899,6 +901,9 @@ static int it6263_probe(struct i2c_client *client)
it->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
it->bridge.vendor = "ITE";
it->bridge.product = "IT6263";
+ it->bridge.supported_infoframes =
+ DRM_CONNECTOR_INFOFRAME_AVI |
+ DRM_CONNECTOR_INFOFRAME_VENDOR;
return devm_drm_bridge_add(dev, &it->bridge);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 04/10] drm/bridge: lontium-lt9611: declare supported infoframes
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
` (2 preceding siblings ...)
2025-09-09 14:52 ` [PATCH v4 03/10] drm/bridge: ite-it6263: " Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 05/10] drm/bridge: synopsys/dw-hdmi-qp: " Dmitry Baryshkov
` (5 subsequent siblings)
9 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Declare which infoframes are supported via the .hdmi_write_infoframe()
interface. Return -EOPNOTSUPP if the driver is asked to write or clear
the unsupported InfoFrame.
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/bridge/lontium-lt9611.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c
index a2d032ee4744715b88eb66883edf69bab4c274b0..019114eb343764dbc3da36ab02d53ece11f46adc 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611.c
@@ -870,8 +870,7 @@ static int lt9611_hdmi_clear_infoframe(struct drm_bridge *bridge,
default:
drm_dbg_driver(lt9611->bridge.dev, "Unsupported HDMI InfoFrame %x\n", type);
- mask = 0;
- break;
+ return -EOPNOTSUPP;
}
if (mask)
@@ -911,8 +910,7 @@ static int lt9611_hdmi_write_infoframe(struct drm_bridge *bridge,
default:
drm_dbg_driver(lt9611->bridge.dev, "Unsupported HDMI InfoFrame %x\n", type);
- mask = 0;
- break;
+ return -EOPNOTSUPP;
}
if (mask) {
@@ -1136,6 +1134,11 @@ static int lt9611_probe(struct i2c_client *client)
lt9611->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
lt9611->bridge.vendor = "Lontium";
lt9611->bridge.product = "LT9611";
+ lt9611->bridge.supported_infoframes =
+ DRM_CONNECTOR_INFOFRAME_AUDIO |
+ DRM_CONNECTOR_INFOFRAME_AVI |
+ DRM_CONNECTOR_INFOFRAME_SPD |
+ DRM_CONNECTOR_INFOFRAME_VENDOR;
lt9611->bridge.hdmi_audio_dev = dev;
lt9611->bridge.hdmi_audio_max_i2s_playback_channels = 8;
lt9611->bridge.hdmi_audio_dai_port = 2;
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 05/10] drm/bridge: synopsys/dw-hdmi-qp: declare supported infoframes
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
` (3 preceding siblings ...)
2025-09-09 14:52 ` [PATCH v4 04/10] drm/bridge: lontium-lt9611: " Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 06/10] drm/msm: hdmi: " Dmitry Baryshkov
` (4 subsequent siblings)
9 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Declare which infoframes are supported via the .hdmi_write_infoframe()
interface. Return -EOPNOTSUPP if the driver is asked to write or clear
the unsupported InfoFrame.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index 39332c57f2c54296f39e27612544f4fbf923863f..9a195c479bcaf112f67b6a2f085402d0e33896de 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -936,6 +936,7 @@ static int dw_hdmi_qp_bridge_clear_infoframe(struct drm_bridge *bridge,
break;
default:
dev_dbg(hdmi->dev, "Unsupported infoframe type %x\n", type);
+ return -EOPNOTSUPP;
}
return 0;
@@ -961,7 +962,7 @@ static int dw_hdmi_qp_bridge_write_infoframe(struct drm_bridge *bridge,
default:
dev_dbg(hdmi->dev, "Unsupported infoframe type %x\n", type);
- return 0;
+ return -EOPNOTSUPP;
}
}
@@ -1084,6 +1085,10 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
hdmi->bridge.vendor = "Synopsys";
hdmi->bridge.product = "DW HDMI QP TX";
+ hdmi->bridge.supported_infoframes =
+ DRM_CONNECTOR_INFOFRAME_AUDIO |
+ DRM_CONNECTOR_INFOFRAME_AVI |
+ DRM_CONNECTOR_INFOFRAME_DRM;
hdmi->bridge.ddc = dw_hdmi_qp_i2c_adapter(hdmi);
if (IS_ERR(hdmi->bridge.ddc))
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 06/10] drm/msm: hdmi: declare supported infoframes
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
` (4 preceding siblings ...)
2025-09-09 14:52 ` [PATCH v4 05/10] drm/bridge: synopsys/dw-hdmi-qp: " Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 07/10] drm/rockchip: rk3066: " Dmitry Baryshkov
` (3 subsequent siblings)
9 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Declare which infoframes are supported via the .hdmi_write_infoframe()
interface. Return -EOPNOTSUPP if the driver is asked to write or clear
the unsupported InfoFrame.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
index 46fd58646d32fd0611192595826a3aa680bd0d02..f6ba8032904187a2f169456052b0e4cbd60ab919 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
@@ -249,6 +249,7 @@ static int msm_hdmi_bridge_clear_infoframe(struct drm_bridge *bridge,
default:
drm_dbg_driver(hdmi_bridge->base.dev, "Unsupported infoframe type %x\n", type);
+ return -EOPNOTSUPP;
}
return 0;
@@ -274,7 +275,7 @@ static int msm_hdmi_bridge_write_infoframe(struct drm_bridge *bridge,
return msm_hdmi_config_hdmi_infoframe(hdmi, buffer, len);
default:
drm_dbg_driver(hdmi_bridge->base.dev, "Unsupported infoframe type %x\n", type);
- return 0;
+ return -EOPNOTSUPP;
}
}
@@ -498,6 +499,11 @@ int msm_hdmi_bridge_init(struct hdmi *hdmi)
bridge->type = DRM_MODE_CONNECTOR_HDMIA;
bridge->vendor = "Qualcomm";
bridge->product = "Snapdragon";
+ bridge->supported_infoframes =
+ DRM_CONNECTOR_INFOFRAME_AVI |
+ DRM_CONNECTOR_INFOFRAME_AUDIO |
+ DRM_CONNECTOR_INFOFRAME_SPD |
+ DRM_CONNECTOR_INFOFRAME_VENDOR;
bridge->ops = DRM_BRIDGE_OP_HPD |
DRM_BRIDGE_OP_DETECT |
DRM_BRIDGE_OP_HDMI |
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 07/10] drm/rockchip: rk3066: declare supported infoframes
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
` (5 preceding siblings ...)
2025-09-09 14:52 ` [PATCH v4 06/10] drm/msm: hdmi: " Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 08/10] drm/display: bridge_connector: drop default list for HDMI Infoframes Dmitry Baryshkov
` (2 subsequent siblings)
9 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Declare which infoframes are supported via the .hdmi_write_infoframe()
interface. Return -EOPNOTSUPP if the driver is asked to write or clear
the unsupported InfoFrame.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/rockchip/rk3066_hdmi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index ae4a5ac2299a93a49f87df7604752f6b651c839c..6ac854c0fe4d155b351821782a6d8bbd550de656 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -164,7 +164,7 @@ static int rk3066_hdmi_bridge_clear_infoframe(struct drm_bridge *bridge,
if (type != HDMI_INFOFRAME_TYPE_AVI) {
drm_err(bridge->dev, "Unsupported infoframe type: %u\n", type);
- return 0;
+ return -EOPNOTSUPP;
}
hdmi_writeb(hdmi, HDMI_CP_BUF_INDEX, HDMI_INFOFRAME_AVI);
@@ -182,7 +182,7 @@ rk3066_hdmi_bridge_write_infoframe(struct drm_bridge *bridge,
if (type != HDMI_INFOFRAME_TYPE_AVI) {
drm_err(bridge->dev, "Unsupported infoframe type: %u\n", type);
- return 0;
+ return -EOPNOTSUPP;
}
rk3066_hdmi_bridge_clear_infoframe(bridge, type);
@@ -696,6 +696,8 @@ rk3066_hdmi_register(struct drm_device *drm, struct rk3066_hdmi *hdmi)
hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
hdmi->bridge.vendor = "Rockchip";
hdmi->bridge.product = "RK3066 HDMI";
+ hdmi->bridge.supported_infoframes =
+ DRM_CONNECTOR_INFOFRAME_AVI;
hdmi->bridge.ddc = rk3066_hdmi_i2c_adapter(hdmi);
if (IS_ERR(hdmi->bridge.ddc))
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 08/10] drm/display: bridge_connector: drop default list for HDMI Infoframes
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
` (6 preceding siblings ...)
2025-09-09 14:52 ` [PATCH v4 07/10] drm/rockchip: rk3066: " Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 09/10] drm/connector: verify that HDMI connectors support necessary InfoFrames Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 10/10] drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF Dmitry Baryshkov
9 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Now as all bridges are updated to list supported HDMI InfoFrames, drop
the default value from drm_bridge_connector_init(). All HDMI bridges now
have to declare all supported InfoFrames.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 55bf5ac53739fda098be69a5c61e4934704ce046..05dc2b61643af5316df431a3cbf53b86139a63e9 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -783,12 +783,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
&drm_bridge_connector_hdmi_funcs,
connector_type, ddc,
supported_formats,
- bridge->supported_infoframes ? |
- DRM_CONNECTOR_INFOFRAME_AUDIO |
- DRM_CONNECTOR_INFOFRAME_AVI |
- DRM_CONNECTOR_INFOFRAME_DRM |
- DRM_CONNECTOR_INFOFRAME_SPD |
- DRM_CONNECTOR_INFOFRAME_VENDOR,
+ bridge->supported_infoframes,
max_bpc);
if (ret)
return ERR_PTR(ret);
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 09/10] drm/connector: verify that HDMI connectors support necessary InfoFrames
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
` (7 preceding siblings ...)
2025-09-09 14:52 ` [PATCH v4 08/10] drm/display: bridge_connector: drop default list for HDMI Infoframes Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-10 11:08 ` Maxime Ripard
2025-09-09 14:52 ` [PATCH v4 10/10] drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF Dmitry Baryshkov
9 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Check that connector initialized by drmm_connector_hdmi_init() supports
AVI InfoFrames and warn if it doesn't support Vendor-Specific
InfofRames (HDMI InfoFrames are more or less required).
Suggested-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/drm_connector.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 92a75684a0f7375d3a94e8c666cb71064ecc8035..222a0ef66d9fdbdb56108ceeb40e7f369d810350 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -602,6 +602,13 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
return -EINVAL;
+ /* AVI is required */
+ if (!(supported_infoframes & DRM_CONNECTOR_INFOFRAME_AVI))
+ return -EINVAL;
+
+ if (!(supported_infoframes & DRM_CONNECTOR_INFOFRAME_VENDOR))
+ drm_info(dev, "HDMI connector with no support for Vendor-Specific InfoFrame\n");
+
ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc);
if (ret)
return ret;
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 10/10] drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
` (8 preceding siblings ...)
2025-09-09 14:52 ` [PATCH v4 09/10] drm/connector: verify that HDMI connectors support necessary InfoFrames Dmitry Baryshkov
@ 2025-09-09 14:52 ` Dmitry Baryshkov
2025-09-10 11:05 ` Maxime Ripard
9 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-09 14:52 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
linux-sunxi, linux-arm-msm, freedreno, Daniel Stone
Sending Audio InfoFrames is mandatory for getting audio to work over the
HDMI link. Warn if the driver requests HDMI audio support for the HDMI
connector, but there is no support for Audio InfoFrames.
Suggested-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/display/drm_hdmi_audio_helper.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
index 7d78b02c144621de528b40b1425f25e465edd1ae..35e0e79cb683a68af813344aa86c154c3a5531fe 100644
--- a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
@@ -10,6 +10,7 @@
#include <drm/drm_connector.h>
#include <drm/drm_device.h>
+#include <drm/drm_print.h>
#include <drm/display/drm_hdmi_audio_helper.h>
#include <sound/hdmi-codec.h>
@@ -178,6 +179,17 @@ int drm_connector_hdmi_audio_init(struct drm_connector *connector,
!funcs->shutdown)
return -EINVAL;
+ if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+ connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) {
+ unsigned long supported_infoframes =
+ connector->hdmi.supported_infoframes;
+
+ if (supported_infoframes &&
+ !(supported_infoframes & DRM_CONNECTOR_INFOFRAME_AUDIO))
+ drm_warn(connector->dev, "HDMI Audio with no support for Audio InfoFrames\n");
+ }
+
+
connector->hdmi_audio.funcs = funcs;
connector->hdmi_audio.dai_port = dai_port;
--
2.47.3
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-09-09 14:51 ` [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported Dmitry Baryshkov
@ 2025-09-10 11:03 ` Maxime Ripard
2025-09-10 15:16 ` Dmitry Baryshkov
0 siblings, 1 reply; 24+ messages in thread
From: Maxime Ripard @ 2025-09-10 11:03 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]
On Tue, Sep 09, 2025 at 05:51:59PM +0300, Dmitry Baryshkov wrote:
> Currently DRM framework expects that the HDMI connector driver supports
> all infoframe types: it generates the data as required and calls into
> the driver to program all of them, letting the driver to soft-fail if
> the infoframe is unsupported. This has a major drawback on userspace
> API: the framework also registers debugfs files for all Infoframe types,
> possibly surprising the users when infoframe is visible in the debugfs
> file, but it is not visible on the wire. Drivers are also expected to
> return success even for unsuppoted InfoFrame types.
>
> Let drivers declare that they support only a subset of infoframes,
> creating a more consistent interface. Make the affected drivers return
> -EOPNOTSUPP if they are asked to program (or clear) InfoFrames which are
> not supported.
>
> Acked-by: Liu Ying <victor.liu@nxp.com>
> Acked-by: Daniel Stone <daniels@collabora.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Again, I still believe that it's a bad idea, goes against what the spec
states, and the framework was meant to be.
So, no, sorry. That's still a no for me. Please stop sending that patch
unless we have a discussion about it and you convince me that it's
actually something that we'd need.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 10/10] drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF
2025-09-09 14:52 ` [PATCH v4 10/10] drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF Dmitry Baryshkov
@ 2025-09-10 11:05 ` Maxime Ripard
2025-09-10 13:43 ` Dmitry Baryshkov
0 siblings, 1 reply; 24+ messages in thread
From: Maxime Ripard @ 2025-09-10 11:05 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]
On Tue, Sep 09, 2025 at 05:52:08PM +0300, Dmitry Baryshkov wrote:
> Sending Audio InfoFrames is mandatory for getting audio to work over the
> HDMI link. Warn if the driver requests HDMI audio support for the HDMI
> connector, but there is no support for Audio InfoFrames.
>
> Suggested-by: Maxime Ripard <mripard@kernel.org>
> Acked-by: Daniel Stone <daniels@collabora.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/gpu/drm/display/drm_hdmi_audio_helper.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
> index 7d78b02c144621de528b40b1425f25e465edd1ae..35e0e79cb683a68af813344aa86c154c3a5531fe 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
> @@ -10,6 +10,7 @@
>
> #include <drm/drm_connector.h>
> #include <drm/drm_device.h>
> +#include <drm/drm_print.h>
> #include <drm/display/drm_hdmi_audio_helper.h>
>
> #include <sound/hdmi-codec.h>
> @@ -178,6 +179,17 @@ int drm_connector_hdmi_audio_init(struct drm_connector *connector,
> !funcs->shutdown)
> return -EINVAL;
>
> + if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> + connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) {
> + unsigned long supported_infoframes =
> + connector->hdmi.supported_infoframes;
> +
> + if (supported_infoframes &&
> + !(supported_infoframes & DRM_CONNECTOR_INFOFRAME_AUDIO))
> + drm_warn(connector->dev, "HDMI Audio with no support for Audio InfoFrames\n");
> + }
> +
> +
That's not what I suggested. What I suggested was that we tould check
the return code of write_infoframe, and warn if it is set by the
framework, but returns EOPNOTSUPP.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 09/10] drm/connector: verify that HDMI connectors support necessary InfoFrames
2025-09-09 14:52 ` [PATCH v4 09/10] drm/connector: verify that HDMI connectors support necessary InfoFrames Dmitry Baryshkov
@ 2025-09-10 11:08 ` Maxime Ripard
0 siblings, 0 replies; 24+ messages in thread
From: Maxime Ripard @ 2025-09-10 11:08 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]
On Tue, Sep 09, 2025 at 05:52:07PM +0300, Dmitry Baryshkov wrote:
> Check that connector initialized by drmm_connector_hdmi_init() supports
> AVI InfoFrames and warn if it doesn't support Vendor-Specific
> InfofRames (HDMI InfoFrames are more or less required).
>
> Suggested-by: Maxime Ripard <mripard@kernel.org>
> Acked-by: Daniel Stone <daniels@collabora.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/gpu/drm/drm_connector.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 92a75684a0f7375d3a94e8c666cb71064ecc8035..222a0ef66d9fdbdb56108ceeb40e7f369d810350 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -602,6 +602,13 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
> if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
> return -EINVAL;
>
> + /* AVI is required */
> + if (!(supported_infoframes & DRM_CONNECTOR_INFOFRAME_AVI))
> + return -EINVAL;
> +
> + if (!(supported_infoframes & DRM_CONNECTOR_INFOFRAME_VENDOR))
> + drm_info(dev, "HDMI connector with no support for Vendor-Specific InfoFrame\n");
> +
Same remark than on patch 10. It's not something we can check at init
time, and we should check (and document!) that if we expect an infoframe
to be written but the write_infoframe hook doesn't support it, it's an
error.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 10/10] drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF
2025-09-10 11:05 ` Maxime Ripard
@ 2025-09-10 13:43 ` Dmitry Baryshkov
0 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-10 13:43 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
On Wed, Sep 10, 2025 at 01:05:47PM +0200, Maxime Ripard wrote:
> On Tue, Sep 09, 2025 at 05:52:08PM +0300, Dmitry Baryshkov wrote:
> > Sending Audio InfoFrames is mandatory for getting audio to work over the
> > HDMI link. Warn if the driver requests HDMI audio support for the HDMI
> > connector, but there is no support for Audio InfoFrames.
> >
> > Suggested-by: Maxime Ripard <mripard@kernel.org>
> > Acked-by: Daniel Stone <daniels@collabora.com>
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > ---
> > drivers/gpu/drm/display/drm_hdmi_audio_helper.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
> > index 7d78b02c144621de528b40b1425f25e465edd1ae..35e0e79cb683a68af813344aa86c154c3a5531fe 100644
> > --- a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
> > +++ b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c
> > @@ -10,6 +10,7 @@
> >
> > #include <drm/drm_connector.h>
> > #include <drm/drm_device.h>
> > +#include <drm/drm_print.h>
> > #include <drm/display/drm_hdmi_audio_helper.h>
> >
> > #include <sound/hdmi-codec.h>
> > @@ -178,6 +179,17 @@ int drm_connector_hdmi_audio_init(struct drm_connector *connector,
> > !funcs->shutdown)
> > return -EINVAL;
> >
> > + if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> > + connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) {
> > + unsigned long supported_infoframes =
> > + connector->hdmi.supported_infoframes;
> > +
> > + if (supported_infoframes &&
> > + !(supported_infoframes & DRM_CONNECTOR_INFOFRAME_AUDIO))
> > + drm_warn(connector->dev, "HDMI Audio with no support for Audio InfoFrames\n");
> > + }
> > +
> > +
>
> That's not what I suggested. What I suggested was that we tould check
> the return code of write_infoframe, and warn if it is set by the
> framework, but returns EOPNOTSUPP.
I see, I misunderstood you then. I will respond to the comment at patch
1.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-09-10 11:03 ` Maxime Ripard
@ 2025-09-10 15:16 ` Dmitry Baryshkov
2025-09-25 12:36 ` Maxime Ripard
0 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-10 15:16 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
On Wed, Sep 10, 2025 at 01:03:47PM +0200, Maxime Ripard wrote:
> On Tue, Sep 09, 2025 at 05:51:59PM +0300, Dmitry Baryshkov wrote:
> > Currently DRM framework expects that the HDMI connector driver supports
> > all infoframe types: it generates the data as required and calls into
> > the driver to program all of them, letting the driver to soft-fail if
> > the infoframe is unsupported. This has a major drawback on userspace
> > API: the framework also registers debugfs files for all Infoframe types,
> > possibly surprising the users when infoframe is visible in the debugfs
> > file, but it is not visible on the wire. Drivers are also expected to
> > return success even for unsuppoted InfoFrame types.
> >
> > Let drivers declare that they support only a subset of infoframes,
> > creating a more consistent interface. Make the affected drivers return
> > -EOPNOTSUPP if they are asked to program (or clear) InfoFrames which are
> > not supported.
> >
> > Acked-by: Liu Ying <victor.liu@nxp.com>
> > Acked-by: Daniel Stone <daniels@collabora.com>
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>
> Again, I still believe that it's a bad idea, goes against what the spec
> states, and the framework was meant to be.
Please correct me if I'm wrong. The specs (HDMI & CEA) define several
infoframes and whether we should be sending them. If I'm reading it
correctrly, CEA spec explicitly says 'If the Source supports the
transmission of [foo] InfoFrame..." (6.4 - AVI, 6.6 - Audio, 6.7 MPEG,
6.9 - DRM). For other InfoFrames (6.5 SPD, 6.8 NTSC VBI) it just defines
that sending those frames is optional.
We can't even infer support for InfoFrames from the Source features.
E.g. CEA 6.6.1 defines a case when digital audio is allowed to be sent,
without sending Audio InfoFrame.
As we will be getting more and more features, some of the InfoFrames
or data packets will be 'good to have, but not required'.
>
> So, no, sorry. That's still a no for me. Please stop sending that patch
Oops :-)
> unless we have a discussion about it and you convince me that it's
> actually something that we'd need.
My main concern is that the drivers should not opt-out of the features.
E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
(yes, stupid examples), it should not be required to go through all the
drivers, making sure that they disable those. Instead the DRM framework
should be able to make decisions like:
- The driver supports SPD and the VSDB defines SPD, enable this
InfoFrame (BTW, this needs to be done anyway, we should not be sending
SPD if it's not defined in VSDB, if I read it correctly).
- The driver hints that the pixel data has only 10 meaninful bits of
data per component (e.g. out of 12 for DeepColor 36), the Sink has
HF-VSDB, send HF-VSIF.
- The driver has enabled 3D stereo mode, but it doesn't declare support
for HF-VSIF. Send only H14b-VSIF.
Similarly (no, I don't have these on my TODO list, these are just
examples):
- The driver defines support for NTSC VBI, register a VBI device.
- The driver defines support for ISRC packets, register ISRC-related
properties.
- The driver defines support for MPEG Source InfoFrame, provide a way
for media players to report frame type and bit rate.
- The driver provides limited support for Extended HDR DM InfoFrames,
select the correct frame type according to driver capabilities.
Without the 'supported' information we should change atomic_check()
functions to set infoframe->set to false for all unsupported InfoFrames
_and_ go through all the drivers again each time we add support for a
feature (e.g. after adding HF-VSIF support).
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-09-10 15:16 ` Dmitry Baryshkov
@ 2025-09-25 12:36 ` Maxime Ripard
2025-09-25 14:55 ` Dmitry Baryshkov
0 siblings, 1 reply; 24+ messages in thread
From: Maxime Ripard @ 2025-09-25 12:36 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
[-- Attachment #1: Type: text/plain, Size: 6601 bytes --]
On Wed, Sep 10, 2025 at 06:16:25PM +0300, Dmitry Baryshkov wrote:
> On Wed, Sep 10, 2025 at 01:03:47PM +0200, Maxime Ripard wrote:
> > On Tue, Sep 09, 2025 at 05:51:59PM +0300, Dmitry Baryshkov wrote:
> > > Currently DRM framework expects that the HDMI connector driver supports
> > > all infoframe types: it generates the data as required and calls into
> > > the driver to program all of them, letting the driver to soft-fail if
> > > the infoframe is unsupported. This has a major drawback on userspace
> > > API: the framework also registers debugfs files for all Infoframe types,
> > > possibly surprising the users when infoframe is visible in the debugfs
> > > file, but it is not visible on the wire. Drivers are also expected to
> > > return success even for unsuppoted InfoFrame types.
> > >
> > > Let drivers declare that they support only a subset of infoframes,
> > > creating a more consistent interface. Make the affected drivers return
> > > -EOPNOTSUPP if they are asked to program (or clear) InfoFrames which are
> > > not supported.
> > >
> > > Acked-by: Liu Ying <victor.liu@nxp.com>
> > > Acked-by: Daniel Stone <daniels@collabora.com>
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> >
> > Again, I still believe that it's a bad idea, goes against what the spec
> > states, and the framework was meant to be.
>
> Please correct me if I'm wrong. The specs (HDMI & CEA) define several
> infoframes and whether we should be sending them. If I'm reading it
> correctrly, CEA spec explicitly says 'If the Source supports the
> transmission of [foo] InfoFrame..." (6.4 - AVI, 6.6 - Audio, 6.7 MPEG,
> 6.9 - DRM). For other InfoFrames (6.5 SPD, 6.8 NTSC VBI) it just defines
> that sending those frames is optional.
SPD is indeed optional, but the HDMI spec, (HDMI 1.4b, Section 8.2.1 -
Auxiliary Video information (AVI) InfoFrame) states that:
A Source shall always transmit an AVI InfoFrame at least once per two
Video Fields if the Source:
* is ever capable of transmitting an AVI InfoFrame or,
* is ever capable of transmitting YCBCR pixel encoding or,
* is ever capable of transmitting any colorimetry other than the
transmitted video format’s default colorimetry or,
* is ever capable of transmitting any xvYCC or future enhanced
colorimetry or,
* is ever capable of transmitting any Gamut Metadata packet or,
* is ever capable of transmitting any video format with multiple
allowed pixel repetitions or,
* is ever capable of transmitting Content Type other than “no data” or,
* is ever capable of transmitting YCC Quantization Range.
The AVI InfoFrame shall be transmitted even while such a Source is
transmitting RGB and non-pixel-repeated video. When a Source is not
explicitly required to transmit AVI InfoFrames, it is recommended that
the Source transmit AVI InfoFrames.
So it's recommended in every case, and the list kind of makes it
mandatory for how Linux uses HDMI.
Also, did we ever encounter some hardware that couldn't send AVI?
Audio is mandatory when streaming audio, DRM when using HDR, and we
don't support the others yet.
So the only we support but don't have to send is SPD.
> We can't even infer support for InfoFrames from the Source features.
> E.g. CEA 6.6.1 defines a case when digital audio is allowed to be sent,
> without sending Audio InfoFrame.
HDMI 1.4 section 8.2.2 - Audio Infoframe states that:
Whenever an active audio stream is being transmitted, an accurate
Audio InfoFrame shall be transmitted at least once per two Video
Fields.
I'd say it takes precedence over CTA-861.
> As we will be getting more and more features, some of the InfoFrames
> or data packets will be 'good to have, but not required'.
And drivers would be free to ignore those.
> > So, no, sorry. That's still a no for me. Please stop sending that patch
>
> Oops :-)
>
> > unless we have a discussion about it and you convince me that it's
> > actually something that we'd need.
>
> My main concern is that the drivers should not opt-out of the features.
> E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
> (yes, stupid examples), it should not be required to go through all the
> drivers, making sure that they disable those. Instead the DRM framework
> should be able to make decisions like:
>
> - The driver supports SPD and the VSDB defines SPD, enable this
> InfoFrame (BTW, this needs to be done anyway, we should not be sending
> SPD if it's not defined in VSDB, if I read it correctly).
>
> - The driver hints that the pixel data has only 10 meaninful bits of
> data per component (e.g. out of 12 for DeepColor 36), the Sink has
> HF-VSDB, send HF-VSIF.
>
> - The driver has enabled 3D stereo mode, but it doesn't declare support
> for HF-VSIF. Send only H14b-VSIF.
>
> Similarly (no, I don't have these on my TODO list, these are just
> examples):
> - The driver defines support for NTSC VBI, register a VBI device.
>
> - The driver defines support for ISRC packets, register ISRC-related
> properties.
>
> - The driver defines support for MPEG Source InfoFrame, provide a way
> for media players to report frame type and bit rate.
>
> - The driver provides limited support for Extended HDR DM InfoFrames,
> select the correct frame type according to driver capabilities.
>
> Without the 'supported' information we should change atomic_check()
> functions to set infoframe->set to false for all unsupported InfoFrames
> _and_ go through all the drivers again each time we add support for a
> feature (e.g. after adding HF-VSIF support).
From what you described here, I think we share a similar goal and have
somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
we just disagree on the trade-offs and ideal solution :)
I agree that we need to sanity check the drivers, and I don't want to go
back to the situation we had before where drivers could just ignore
infoframes and take the easy way out.
It should be hard, and easy to catch during review.
I don't think bitflag are a solution because, to me, it kind of fails
both.
What if, just like the debugfs discussion, we split write_infoframe into
write_avi_infoframe (mandatory), write_spd_infoframe (optional),
write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
How does that sound?
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-09-25 12:36 ` Maxime Ripard
@ 2025-09-25 14:55 ` Dmitry Baryshkov
2025-10-03 14:23 ` Maxime Ripard
0 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-09-25 14:55 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
On Thu, Sep 25, 2025 at 02:36:46PM +0200, Maxime Ripard wrote:
> On Wed, Sep 10, 2025 at 06:16:25PM +0300, Dmitry Baryshkov wrote:
> > On Wed, Sep 10, 2025 at 01:03:47PM +0200, Maxime Ripard wrote:
> > > On Tue, Sep 09, 2025 at 05:51:59PM +0300, Dmitry Baryshkov wrote:
> > > > Currently DRM framework expects that the HDMI connector driver supports
> > > > all infoframe types: it generates the data as required and calls into
> > > > the driver to program all of them, letting the driver to soft-fail if
> > > > the infoframe is unsupported. This has a major drawback on userspace
> > > > API: the framework also registers debugfs files for all Infoframe types,
> > > > possibly surprising the users when infoframe is visible in the debugfs
> > > > file, but it is not visible on the wire. Drivers are also expected to
> > > > return success even for unsuppoted InfoFrame types.
> > > >
> > > > Let drivers declare that they support only a subset of infoframes,
> > > > creating a more consistent interface. Make the affected drivers return
> > > > -EOPNOTSUPP if they are asked to program (or clear) InfoFrames which are
> > > > not supported.
> > > >
> > > > Acked-by: Liu Ying <victor.liu@nxp.com>
> > > > Acked-by: Daniel Stone <daniels@collabora.com>
> > > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > >
> > > Again, I still believe that it's a bad idea, goes against what the spec
> > > states, and the framework was meant to be.
> >
> > Please correct me if I'm wrong. The specs (HDMI & CEA) define several
> > infoframes and whether we should be sending them. If I'm reading it
> > correctrly, CEA spec explicitly says 'If the Source supports the
> > transmission of [foo] InfoFrame..." (6.4 - AVI, 6.6 - Audio, 6.7 MPEG,
> > 6.9 - DRM). For other InfoFrames (6.5 SPD, 6.8 NTSC VBI) it just defines
> > that sending those frames is optional.
>
> SPD is indeed optional, but the HDMI spec, (HDMI 1.4b, Section 8.2.1 -
> Auxiliary Video information (AVI) InfoFrame) states that:
>
> A Source shall always transmit an AVI InfoFrame at least once per two
> Video Fields if the Source:
>
> * is ever capable of transmitting an AVI InfoFrame or,
> * is ever capable of transmitting YCBCR pixel encoding or,
> * is ever capable of transmitting any colorimetry other than the
> transmitted video format’s default colorimetry or,
> * is ever capable of transmitting any xvYCC or future enhanced
> colorimetry or,
> * is ever capable of transmitting any Gamut Metadata packet or,
> * is ever capable of transmitting any video format with multiple
> allowed pixel repetitions or,
> * is ever capable of transmitting Content Type other than “no data” or,
> * is ever capable of transmitting YCC Quantization Range.
>
> The AVI InfoFrame shall be transmitted even while such a Source is
> transmitting RGB and non-pixel-repeated video. When a Source is not
> explicitly required to transmit AVI InfoFrames, it is recommended that
> the Source transmit AVI InfoFrames.
>
> So it's recommended in every case, and the list kind of makes it
> mandatory for how Linux uses HDMI.
Agreed.
>
> Also, did we ever encounter some hardware that couldn't send AVI?
No.
>
> Audio is mandatory when streaming audio, DRM when using HDR, and we
> don't support the others yet.
>
> So the only we support but don't have to send is SPD.
>
> > We can't even infer support for InfoFrames from the Source features.
> > E.g. CEA 6.6.1 defines a case when digital audio is allowed to be sent,
> > without sending Audio InfoFrame.
>
> HDMI 1.4 section 8.2.2 - Audio Infoframe states that:
>
> Whenever an active audio stream is being transmitted, an accurate
> Audio InfoFrame shall be transmitted at least once per two Video
> Fields.
>
> I'd say it takes precedence over CTA-861.
I see, I was referring to CTA indeed. HDMI takes precedence.
>
> > As we will be getting more and more features, some of the InfoFrames
> > or data packets will be 'good to have, but not required'.
>
> And drivers would be free to ignore those.
>
> > > So, no, sorry. That's still a no for me. Please stop sending that patch
> >
> > Oops :-)
> >
> > > unless we have a discussion about it and you convince me that it's
> > > actually something that we'd need.
> >
> > My main concern is that the drivers should not opt-out of the features.
> > E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
> > (yes, stupid examples), it should not be required to go through all the
> > drivers, making sure that they disable those. Instead the DRM framework
> > should be able to make decisions like:
> >
> > - The driver supports SPD and the VSDB defines SPD, enable this
> > InfoFrame (BTW, this needs to be done anyway, we should not be sending
> > SPD if it's not defined in VSDB, if I read it correctly).
> >
> > - The driver hints that the pixel data has only 10 meaninful bits of
> > data per component (e.g. out of 12 for DeepColor 36), the Sink has
> > HF-VSDB, send HF-VSIF.
> >
> > - The driver has enabled 3D stereo mode, but it doesn't declare support
> > for HF-VSIF. Send only H14b-VSIF.
> >
> > Similarly (no, I don't have these on my TODO list, these are just
> > examples):
> > - The driver defines support for NTSC VBI, register a VBI device.
> >
> > - The driver defines support for ISRC packets, register ISRC-related
> > properties.
> >
> > - The driver defines support for MPEG Source InfoFrame, provide a way
> > for media players to report frame type and bit rate.
> >
> > - The driver provides limited support for Extended HDR DM InfoFrames,
> > select the correct frame type according to driver capabilities.
> >
> > Without the 'supported' information we should change atomic_check()
> > functions to set infoframe->set to false for all unsupported InfoFrames
> > _and_ go through all the drivers again each time we add support for a
> > feature (e.g. after adding HF-VSIF support).
>
> From what you described here, I think we share a similar goal and have
> somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
> we just disagree on the trade-offs and ideal solution :)
>
> I agree that we need to sanity check the drivers, and I don't want to go
> back to the situation we had before where drivers could just ignore
> infoframes and take the easy way out.
>
> It should be hard, and easy to catch during review.
>
> I don't think bitflag are a solution because, to me, it kind of fails
> both.
>
> What if, just like the debugfs discussion, we split write_infoframe into
> write_avi_infoframe (mandatory), write_spd_infoframe (optional),
> write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
> write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
>
> How does that sound?
I'd say, I really like the single function to be called for writing the
infoframes. It makes it much harder for drivers to misbehave or to skip
something.
Following this discussion, let's take smaller steps: modify the drivers
to disable unsupported infoframes in atomic_check() and return an error
from write/clear_infoframe if the type is unuspported. Then I'd probably
like to correct SPD handling, only sending it if it is supported by the
Sink. I still think in the end we should have the bitmask for
truly-optional packets and InfoFrames, but having only SPD doesn't
provide enough pressure. I'd just leave the FIXME and let somebody
working on those features to implement that. I am tempted to implement
ISRC support just for the sake of it, but it probably doesn't make any
sense.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-09-25 14:55 ` Dmitry Baryshkov
@ 2025-10-03 14:23 ` Maxime Ripard
2025-10-03 15:41 ` Dmitry Baryshkov
0 siblings, 1 reply; 24+ messages in thread
From: Maxime Ripard @ 2025-10-03 14:23 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
[-- Attachment #1: Type: text/plain, Size: 3600 bytes --]
On Thu, Sep 25, 2025 at 05:55:06PM +0300, Dmitry Baryshkov wrote:
> > > As we will be getting more and more features, some of the InfoFrames
> > > or data packets will be 'good to have, but not required'.
> >
> > And drivers would be free to ignore those.
> >
> > > > So, no, sorry. That's still a no for me. Please stop sending that patch
> > >
> > > Oops :-)
> > >
> > > > unless we have a discussion about it and you convince me that it's
> > > > actually something that we'd need.
> > >
> > > My main concern is that the drivers should not opt-out of the features.
> > > E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
> > > (yes, stupid examples), it should not be required to go through all the
> > > drivers, making sure that they disable those. Instead the DRM framework
> > > should be able to make decisions like:
> > >
> > > - The driver supports SPD and the VSDB defines SPD, enable this
> > > InfoFrame (BTW, this needs to be done anyway, we should not be sending
> > > SPD if it's not defined in VSDB, if I read it correctly).
> > >
> > > - The driver hints that the pixel data has only 10 meaninful bits of
> > > data per component (e.g. out of 12 for DeepColor 36), the Sink has
> > > HF-VSDB, send HF-VSIF.
> > >
> > > - The driver has enabled 3D stereo mode, but it doesn't declare support
> > > for HF-VSIF. Send only H14b-VSIF.
> > >
> > > Similarly (no, I don't have these on my TODO list, these are just
> > > examples):
> > > - The driver defines support for NTSC VBI, register a VBI device.
> > >
> > > - The driver defines support for ISRC packets, register ISRC-related
> > > properties.
> > >
> > > - The driver defines support for MPEG Source InfoFrame, provide a way
> > > for media players to report frame type and bit rate.
> > >
> > > - The driver provides limited support for Extended HDR DM InfoFrames,
> > > select the correct frame type according to driver capabilities.
> > >
> > > Without the 'supported' information we should change atomic_check()
> > > functions to set infoframe->set to false for all unsupported InfoFrames
> > > _and_ go through all the drivers again each time we add support for a
> > > feature (e.g. after adding HF-VSIF support).
> >
> > From what you described here, I think we share a similar goal and have
> > somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
> > we just disagree on the trade-offs and ideal solution :)
> >
> > I agree that we need to sanity check the drivers, and I don't want to go
> > back to the situation we had before where drivers could just ignore
> > infoframes and take the easy way out.
> >
> > It should be hard, and easy to catch during review.
> >
> > I don't think bitflag are a solution because, to me, it kind of fails
> > both.
> >
> > What if, just like the debugfs discussion, we split write_infoframe into
> > write_avi_infoframe (mandatory), write_spd_infoframe (optional),
> > write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
> > write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
> >
> > How does that sound?
>
> I'd say, I really like the single function to be called for writing the
> infoframes. It makes it much harder for drivers to misbehave or to skip
> something.
From a driver PoV, I believe we should still have that single function
indeed. It would be drm_atomic_helper_connector_hdmi_update_infoframes's
job to fan out and call the multiple callbacks, not the drivers.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-10-03 14:23 ` Maxime Ripard
@ 2025-10-03 15:41 ` Dmitry Baryshkov
2025-10-14 12:43 ` Maxime Ripard
0 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-10-03 15:41 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
On 03/10/2025 17:23, Maxime Ripard wrote:
> On Thu, Sep 25, 2025 at 05:55:06PM +0300, Dmitry Baryshkov wrote:
>>>> As we will be getting more and more features, some of the InfoFrames
>>>> or data packets will be 'good to have, but not required'.
>>>
>>> And drivers would be free to ignore those.
>>>
>>>>> So, no, sorry. That's still a no for me. Please stop sending that patch
>>>>
>>>> Oops :-)
>>>>
>>>>> unless we have a discussion about it and you convince me that it's
>>>>> actually something that we'd need.
>>>>
>>>> My main concern is that the drivers should not opt-out of the features.
>>>> E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
>>>> (yes, stupid examples), it should not be required to go through all the
>>>> drivers, making sure that they disable those. Instead the DRM framework
>>>> should be able to make decisions like:
>>>>
>>>> - The driver supports SPD and the VSDB defines SPD, enable this
>>>> InfoFrame (BTW, this needs to be done anyway, we should not be sending
>>>> SPD if it's not defined in VSDB, if I read it correctly).
>>>>
>>>> - The driver hints that the pixel data has only 10 meaninful bits of
>>>> data per component (e.g. out of 12 for DeepColor 36), the Sink has
>>>> HF-VSDB, send HF-VSIF.
>>>>
>>>> - The driver has enabled 3D stereo mode, but it doesn't declare support
>>>> for HF-VSIF. Send only H14b-VSIF.
>>>>
>>>> Similarly (no, I don't have these on my TODO list, these are just
>>>> examples):
>>>> - The driver defines support for NTSC VBI, register a VBI device.
>>>>
>>>> - The driver defines support for ISRC packets, register ISRC-related
>>>> properties.
>>>>
>>>> - The driver defines support for MPEG Source InfoFrame, provide a way
>>>> for media players to report frame type and bit rate.
>>>>
>>>> - The driver provides limited support for Extended HDR DM InfoFrames,
>>>> select the correct frame type according to driver capabilities.
>>>>
>>>> Without the 'supported' information we should change atomic_check()
>>>> functions to set infoframe->set to false for all unsupported InfoFrames
>>>> _and_ go through all the drivers again each time we add support for a
>>>> feature (e.g. after adding HF-VSIF support).
>>>
>>> From what you described here, I think we share a similar goal and have
>>> somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
>>> we just disagree on the trade-offs and ideal solution :)
>>>
>>> I agree that we need to sanity check the drivers, and I don't want to go
>>> back to the situation we had before where drivers could just ignore
>>> infoframes and take the easy way out.
>>>
>>> It should be hard, and easy to catch during review.
>>>
>>> I don't think bitflag are a solution because, to me, it kind of fails
>>> both.
>>>
>>> What if, just like the debugfs discussion, we split write_infoframe into
>>> write_avi_infoframe (mandatory), write_spd_infoframe (optional),
>>> write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
>>> write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
>>>
>>> How does that sound?
>>
>> I'd say, I really like the single function to be called for writing the
>> infoframes. It makes it much harder for drivers to misbehave or to skip
>> something.
>
> From a driver PoV, I believe we should still have that single function
> indeed. It would be drm_atomic_helper_connector_hdmi_update_infoframes's
> job to fan out and call the multiple callbacks, not the drivers.
I like this idea, however it stops at the drm_bridge_connector
abstraction. The only way to handle this I can foresee is to make
individual bridges provide struct drm_connector_hdmi_funcs
implementation (which I'm fine with) and store void *data or struct
drm_bridge *hdmi_bridge somewhere inside struct drm_connector_hdmi in
order to let bridge drivers find their data.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-10-03 15:41 ` Dmitry Baryshkov
@ 2025-10-14 12:43 ` Maxime Ripard
2025-10-14 16:02 ` Dmitry Baryshkov
0 siblings, 1 reply; 24+ messages in thread
From: Maxime Ripard @ 2025-10-14 12:43 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
[-- Attachment #1: Type: text/plain, Size: 4613 bytes --]
On Fri, Oct 03, 2025 at 06:41:58PM +0300, Dmitry Baryshkov wrote:
> On 03/10/2025 17:23, Maxime Ripard wrote:
> > On Thu, Sep 25, 2025 at 05:55:06PM +0300, Dmitry Baryshkov wrote:
> > > > > As we will be getting more and more features, some of the InfoFrames
> > > > > or data packets will be 'good to have, but not required'.
> > > >
> > > > And drivers would be free to ignore those.
> > > >
> > > > > > So, no, sorry. That's still a no for me. Please stop sending that patch
> > > > >
> > > > > Oops :-)
> > > > >
> > > > > > unless we have a discussion about it and you convince me that it's
> > > > > > actually something that we'd need.
> > > > >
> > > > > My main concern is that the drivers should not opt-out of the features.
> > > > > E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
> > > > > (yes, stupid examples), it should not be required to go through all the
> > > > > drivers, making sure that they disable those. Instead the DRM framework
> > > > > should be able to make decisions like:
> > > > >
> > > > > - The driver supports SPD and the VSDB defines SPD, enable this
> > > > > InfoFrame (BTW, this needs to be done anyway, we should not be sending
> > > > > SPD if it's not defined in VSDB, if I read it correctly).
> > > > >
> > > > > - The driver hints that the pixel data has only 10 meaninful bits of
> > > > > data per component (e.g. out of 12 for DeepColor 36), the Sink has
> > > > > HF-VSDB, send HF-VSIF.
> > > > >
> > > > > - The driver has enabled 3D stereo mode, but it doesn't declare support
> > > > > for HF-VSIF. Send only H14b-VSIF.
> > > > >
> > > > > Similarly (no, I don't have these on my TODO list, these are just
> > > > > examples):
> > > > > - The driver defines support for NTSC VBI, register a VBI device.
> > > > >
> > > > > - The driver defines support for ISRC packets, register ISRC-related
> > > > > properties.
> > > > >
> > > > > - The driver defines support for MPEG Source InfoFrame, provide a way
> > > > > for media players to report frame type and bit rate.
> > > > >
> > > > > - The driver provides limited support for Extended HDR DM InfoFrames,
> > > > > select the correct frame type according to driver capabilities.
> > > > >
> > > > > Without the 'supported' information we should change atomic_check()
> > > > > functions to set infoframe->set to false for all unsupported InfoFrames
> > > > > _and_ go through all the drivers again each time we add support for a
> > > > > feature (e.g. after adding HF-VSIF support).
> > > >
> > > > From what you described here, I think we share a similar goal and have
> > > > somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
> > > > we just disagree on the trade-offs and ideal solution :)
> > > >
> > > > I agree that we need to sanity check the drivers, and I don't want to go
> > > > back to the situation we had before where drivers could just ignore
> > > > infoframes and take the easy way out.
> > > >
> > > > It should be hard, and easy to catch during review.
> > > >
> > > > I don't think bitflag are a solution because, to me, it kind of fails
> > > > both.
> > > >
> > > > What if, just like the debugfs discussion, we split write_infoframe into
> > > > write_avi_infoframe (mandatory), write_spd_infoframe (optional),
> > > > write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
> > > > write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
> > > >
> > > > How does that sound?
> > >
> > > I'd say, I really like the single function to be called for writing the
> > > infoframes. It makes it much harder for drivers to misbehave or to skip
> > > something.
> >
> > From a driver PoV, I believe we should still have that single function
> > indeed. It would be drm_atomic_helper_connector_hdmi_update_infoframes's
> > job to fan out and call the multiple callbacks, not the drivers.
>
> I like this idea, however it stops at the drm_bridge_connector abstraction.
> The only way to handle this I can foresee is to make individual bridges
> provide struct drm_connector_hdmi_funcs implementation (which I'm fine with)
> and store void *data or struct drm_bridge *hdmi_bridge somewhere inside
> struct drm_connector_hdmi in order to let bridge drivers find their data.
Does it change anything? The last HDMI bridge should implement all the
infoframes it supports. I don't think we should take care of one bridge
with one infoframe type and some other with another?
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-10-14 12:43 ` Maxime Ripard
@ 2025-10-14 16:02 ` Dmitry Baryshkov
2025-11-21 15:48 ` Maxime Ripard
0 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-10-14 16:02 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
On Tue, Oct 14, 2025 at 02:43:58PM +0200, Maxime Ripard wrote:
> On Fri, Oct 03, 2025 at 06:41:58PM +0300, Dmitry Baryshkov wrote:
> > On 03/10/2025 17:23, Maxime Ripard wrote:
> > > On Thu, Sep 25, 2025 at 05:55:06PM +0300, Dmitry Baryshkov wrote:
> > > > > > As we will be getting more and more features, some of the InfoFrames
> > > > > > or data packets will be 'good to have, but not required'.
> > > > >
> > > > > And drivers would be free to ignore those.
> > > > >
> > > > > > > So, no, sorry. That's still a no for me. Please stop sending that patch
> > > > > >
> > > > > > Oops :-)
> > > > > >
> > > > > > > unless we have a discussion about it and you convince me that it's
> > > > > > > actually something that we'd need.
> > > > > >
> > > > > > My main concern is that the drivers should not opt-out of the features.
> > > > > > E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
> > > > > > (yes, stupid examples), it should not be required to go through all the
> > > > > > drivers, making sure that they disable those. Instead the DRM framework
> > > > > > should be able to make decisions like:
> > > > > >
> > > > > > - The driver supports SPD and the VSDB defines SPD, enable this
> > > > > > InfoFrame (BTW, this needs to be done anyway, we should not be sending
> > > > > > SPD if it's not defined in VSDB, if I read it correctly).
> > > > > >
> > > > > > - The driver hints that the pixel data has only 10 meaninful bits of
> > > > > > data per component (e.g. out of 12 for DeepColor 36), the Sink has
> > > > > > HF-VSDB, send HF-VSIF.
> > > > > >
> > > > > > - The driver has enabled 3D stereo mode, but it doesn't declare support
> > > > > > for HF-VSIF. Send only H14b-VSIF.
> > > > > >
> > > > > > Similarly (no, I don't have these on my TODO list, these are just
> > > > > > examples):
> > > > > > - The driver defines support for NTSC VBI, register a VBI device.
> > > > > >
> > > > > > - The driver defines support for ISRC packets, register ISRC-related
> > > > > > properties.
> > > > > >
> > > > > > - The driver defines support for MPEG Source InfoFrame, provide a way
> > > > > > for media players to report frame type and bit rate.
> > > > > >
> > > > > > - The driver provides limited support for Extended HDR DM InfoFrames,
> > > > > > select the correct frame type according to driver capabilities.
> > > > > >
> > > > > > Without the 'supported' information we should change atomic_check()
> > > > > > functions to set infoframe->set to false for all unsupported InfoFrames
> > > > > > _and_ go through all the drivers again each time we add support for a
> > > > > > feature (e.g. after adding HF-VSIF support).
> > > > >
> > > > > From what you described here, I think we share a similar goal and have
> > > > > somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
> > > > > we just disagree on the trade-offs and ideal solution :)
> > > > >
> > > > > I agree that we need to sanity check the drivers, and I don't want to go
> > > > > back to the situation we had before where drivers could just ignore
> > > > > infoframes and take the easy way out.
> > > > >
> > > > > It should be hard, and easy to catch during review.
> > > > >
> > > > > I don't think bitflag are a solution because, to me, it kind of fails
> > > > > both.
> > > > >
> > > > > What if, just like the debugfs discussion, we split write_infoframe into
> > > > > write_avi_infoframe (mandatory), write_spd_infoframe (optional),
> > > > > write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
> > > > > write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
> > > > >
> > > > > How does that sound?
> > > >
> > > > I'd say, I really like the single function to be called for writing the
> > > > infoframes. It makes it much harder for drivers to misbehave or to skip
> > > > something.
> > >
> > > From a driver PoV, I believe we should still have that single function
> > > indeed. It would be drm_atomic_helper_connector_hdmi_update_infoframes's
> > > job to fan out and call the multiple callbacks, not the drivers.
> >
> > I like this idea, however it stops at the drm_bridge_connector abstraction.
> > The only way to handle this I can foresee is to make individual bridges
> > provide struct drm_connector_hdmi_funcs implementation (which I'm fine with)
> > and store void *data or struct drm_bridge *hdmi_bridge somewhere inside
> > struct drm_connector_hdmi in order to let bridge drivers find their data.
>
> Does it change anything? The last HDMI bridge should implement all the
> infoframes it supports. I don't think we should take care of one bridge
> with one infoframe type and some other with another?
Note: I wrote about the _data_. So far the connector's write_infoframe /
clear_infoframe callbacks get drm_connector as an arg. The fact that
there is a drm_bridge which implements a callback is hidden well inside
drm_bridge_connector (and only it knows the bridge_hdmi pointer).
Otherwise, the bridge, trying to implement drm_connector_hdmi_funcs has
no way to go from drm_connector to drm_bridge.
The only possible solution would be to introduce something like
drm_connector_hdmi::data (either void* or drm_bridge*) and use it
internally. But for me this looks like a bit loose abstraction. Though,
if it looks good from your POV, I agree, it would solve enough of
issues.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-10-14 16:02 ` Dmitry Baryshkov
@ 2025-11-21 15:48 ` Maxime Ripard
2025-11-21 16:08 ` Dmitry Baryshkov
0 siblings, 1 reply; 24+ messages in thread
From: Maxime Ripard @ 2025-11-21 15:48 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
[-- Attachment #1: Type: text/plain, Size: 6145 bytes --]
On Tue, Oct 14, 2025 at 07:02:03PM +0300, Dmitry Baryshkov wrote:
> On Tue, Oct 14, 2025 at 02:43:58PM +0200, Maxime Ripard wrote:
> > On Fri, Oct 03, 2025 at 06:41:58PM +0300, Dmitry Baryshkov wrote:
> > > On 03/10/2025 17:23, Maxime Ripard wrote:
> > > > On Thu, Sep 25, 2025 at 05:55:06PM +0300, Dmitry Baryshkov wrote:
> > > > > > > As we will be getting more and more features, some of the InfoFrames
> > > > > > > or data packets will be 'good to have, but not required'.
> > > > > >
> > > > > > And drivers would be free to ignore those.
> > > > > >
> > > > > > > > So, no, sorry. That's still a no for me. Please stop sending that patch
> > > > > > >
> > > > > > > Oops :-)
> > > > > > >
> > > > > > > > unless we have a discussion about it and you convince me that it's
> > > > > > > > actually something that we'd need.
> > > > > > >
> > > > > > > My main concern is that the drivers should not opt-out of the features.
> > > > > > > E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
> > > > > > > (yes, stupid examples), it should not be required to go through all the
> > > > > > > drivers, making sure that they disable those. Instead the DRM framework
> > > > > > > should be able to make decisions like:
> > > > > > >
> > > > > > > - The driver supports SPD and the VSDB defines SPD, enable this
> > > > > > > InfoFrame (BTW, this needs to be done anyway, we should not be sending
> > > > > > > SPD if it's not defined in VSDB, if I read it correctly).
> > > > > > >
> > > > > > > - The driver hints that the pixel data has only 10 meaninful bits of
> > > > > > > data per component (e.g. out of 12 for DeepColor 36), the Sink has
> > > > > > > HF-VSDB, send HF-VSIF.
> > > > > > >
> > > > > > > - The driver has enabled 3D stereo mode, but it doesn't declare support
> > > > > > > for HF-VSIF. Send only H14b-VSIF.
> > > > > > >
> > > > > > > Similarly (no, I don't have these on my TODO list, these are just
> > > > > > > examples):
> > > > > > > - The driver defines support for NTSC VBI, register a VBI device.
> > > > > > >
> > > > > > > - The driver defines support for ISRC packets, register ISRC-related
> > > > > > > properties.
> > > > > > >
> > > > > > > - The driver defines support for MPEG Source InfoFrame, provide a way
> > > > > > > for media players to report frame type and bit rate.
> > > > > > >
> > > > > > > - The driver provides limited support for Extended HDR DM InfoFrames,
> > > > > > > select the correct frame type according to driver capabilities.
> > > > > > >
> > > > > > > Without the 'supported' information we should change atomic_check()
> > > > > > > functions to set infoframe->set to false for all unsupported InfoFrames
> > > > > > > _and_ go through all the drivers again each time we add support for a
> > > > > > > feature (e.g. after adding HF-VSIF support).
> > > > > >
> > > > > > From what you described here, I think we share a similar goal and have
> > > > > > somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
> > > > > > we just disagree on the trade-offs and ideal solution :)
> > > > > >
> > > > > > I agree that we need to sanity check the drivers, and I don't want to go
> > > > > > back to the situation we had before where drivers could just ignore
> > > > > > infoframes and take the easy way out.
> > > > > >
> > > > > > It should be hard, and easy to catch during review.
> > > > > >
> > > > > > I don't think bitflag are a solution because, to me, it kind of fails
> > > > > > both.
> > > > > >
> > > > > > What if, just like the debugfs discussion, we split write_infoframe into
> > > > > > write_avi_infoframe (mandatory), write_spd_infoframe (optional),
> > > > > > write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
> > > > > > write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
> > > > > >
> > > > > > How does that sound?
> > > > >
> > > > > I'd say, I really like the single function to be called for writing the
> > > > > infoframes. It makes it much harder for drivers to misbehave or to skip
> > > > > something.
> > > >
> > > > From a driver PoV, I believe we should still have that single function
> > > > indeed. It would be drm_atomic_helper_connector_hdmi_update_infoframes's
> > > > job to fan out and call the multiple callbacks, not the drivers.
> > >
> > > I like this idea, however it stops at the drm_bridge_connector abstraction.
> > > The only way to handle this I can foresee is to make individual bridges
> > > provide struct drm_connector_hdmi_funcs implementation (which I'm fine with)
> > > and store void *data or struct drm_bridge *hdmi_bridge somewhere inside
> > > struct drm_connector_hdmi in order to let bridge drivers find their data.
> >
> > Does it change anything? The last HDMI bridge should implement all the
> > infoframes it supports. I don't think we should take care of one bridge
> > with one infoframe type and some other with another?
>
> Note: I wrote about the _data_. So far the connector's write_infoframe /
> clear_infoframe callbacks get drm_connector as an arg. The fact that
> there is a drm_bridge which implements a callback is hidden well inside
> drm_bridge_connector (and only it knows the bridge_hdmi pointer).
> Otherwise, the bridge, trying to implement drm_connector_hdmi_funcs has
> no way to go from drm_connector to drm_bridge.
>
> The only possible solution would be to introduce something like
> drm_connector_hdmi::data (either void* or drm_bridge*) and use it
> internally. But for me this looks like a bit loose abstraction. Though,
> if it looks good from your POV, I agree, it would solve enough of
> issues.
I'm not sure I understand, sorry.
What prevents us from adding ~4 functions to bridge->funcs that take the
bridge, and drm_bridge_connector would get the connector, retrieve the
bridge instance from it, and pass it to the bridge actually implementing
it? Like we do currently for write_infoframe and clear_infoframe
already?
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported
2025-11-21 15:48 ` Maxime Ripard
@ 2025-11-21 16:08 ` Dmitry Baryshkov
0 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2025-11-21 16:08 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Sandy Huang,
Heiko Stübner, Andy Yan, Chen-Yu Tsai, Samuel Holland,
Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
Liu Ying, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-rockchip, linux-sunxi, linux-arm-msm,
freedreno, Daniel Stone
On Fri, Nov 21, 2025 at 04:48:02PM +0100, Maxime Ripard wrote:
> On Tue, Oct 14, 2025 at 07:02:03PM +0300, Dmitry Baryshkov wrote:
> > On Tue, Oct 14, 2025 at 02:43:58PM +0200, Maxime Ripard wrote:
> > > On Fri, Oct 03, 2025 at 06:41:58PM +0300, Dmitry Baryshkov wrote:
> > > > On 03/10/2025 17:23, Maxime Ripard wrote:
> > > > > On Thu, Sep 25, 2025 at 05:55:06PM +0300, Dmitry Baryshkov wrote:
> > > > > > > > As we will be getting more and more features, some of the InfoFrames
> > > > > > > > or data packets will be 'good to have, but not required'.
> > > > > > >
> > > > > > > And drivers would be free to ignore those.
> > > > > > >
> > > > > > > > > So, no, sorry. That's still a no for me. Please stop sending that patch
> > > > > > > >
> > > > > > > > Oops :-)
> > > > > > > >
> > > > > > > > > unless we have a discussion about it and you convince me that it's
> > > > > > > > > actually something that we'd need.
> > > > > > > >
> > > > > > > > My main concern is that the drivers should not opt-out of the features.
> > > > > > > > E.g. if we start supporting ISRC packets or MPEG or NTSC VBI InfoFrames
> > > > > > > > (yes, stupid examples), it should not be required to go through all the
> > > > > > > > drivers, making sure that they disable those. Instead the DRM framework
> > > > > > > > should be able to make decisions like:
> > > > > > > >
> > > > > > > > - The driver supports SPD and the VSDB defines SPD, enable this
> > > > > > > > InfoFrame (BTW, this needs to be done anyway, we should not be sending
> > > > > > > > SPD if it's not defined in VSDB, if I read it correctly).
> > > > > > > >
> > > > > > > > - The driver hints that the pixel data has only 10 meaninful bits of
> > > > > > > > data per component (e.g. out of 12 for DeepColor 36), the Sink has
> > > > > > > > HF-VSDB, send HF-VSIF.
> > > > > > > >
> > > > > > > > - The driver has enabled 3D stereo mode, but it doesn't declare support
> > > > > > > > for HF-VSIF. Send only H14b-VSIF.
> > > > > > > >
> > > > > > > > Similarly (no, I don't have these on my TODO list, these are just
> > > > > > > > examples):
> > > > > > > > - The driver defines support for NTSC VBI, register a VBI device.
> > > > > > > >
> > > > > > > > - The driver defines support for ISRC packets, register ISRC-related
> > > > > > > > properties.
> > > > > > > >
> > > > > > > > - The driver defines support for MPEG Source InfoFrame, provide a way
> > > > > > > > for media players to report frame type and bit rate.
> > > > > > > >
> > > > > > > > - The driver provides limited support for Extended HDR DM InfoFrames,
> > > > > > > > select the correct frame type according to driver capabilities.
> > > > > > > >
> > > > > > > > Without the 'supported' information we should change atomic_check()
> > > > > > > > functions to set infoframe->set to false for all unsupported InfoFrames
> > > > > > > > _and_ go through all the drivers again each time we add support for a
> > > > > > > > feature (e.g. after adding HF-VSIF support).
> > > > > > >
> > > > > > > From what you described here, I think we share a similar goal and have
> > > > > > > somewhat similar concerns (thanks, btw, it wasn't obvious to me before),
> > > > > > > we just disagree on the trade-offs and ideal solution :)
> > > > > > >
> > > > > > > I agree that we need to sanity check the drivers, and I don't want to go
> > > > > > > back to the situation we had before where drivers could just ignore
> > > > > > > infoframes and take the easy way out.
> > > > > > >
> > > > > > > It should be hard, and easy to catch during review.
> > > > > > >
> > > > > > > I don't think bitflag are a solution because, to me, it kind of fails
> > > > > > > both.
> > > > > > >
> > > > > > > What if, just like the debugfs discussion, we split write_infoframe into
> > > > > > > write_avi_infoframe (mandatory), write_spd_infoframe (optional),
> > > > > > > write_audio_infoframe (checked by drm_connector_hdmi_audio_init?) and
> > > > > > > write_hdr_infoframe (checked in drmm_connector_hdmi_init if max_bpc > 8)
> > > > > > >
> > > > > > > How does that sound?
> > > > > >
> > > > > > I'd say, I really like the single function to be called for writing the
> > > > > > infoframes. It makes it much harder for drivers to misbehave or to skip
> > > > > > something.
> > > > >
> > > > > From a driver PoV, I believe we should still have that single function
> > > > > indeed. It would be drm_atomic_helper_connector_hdmi_update_infoframes's
> > > > > job to fan out and call the multiple callbacks, not the drivers.
> > > >
> > > > I like this idea, however it stops at the drm_bridge_connector abstraction.
> > > > The only way to handle this I can foresee is to make individual bridges
> > > > provide struct drm_connector_hdmi_funcs implementation (which I'm fine with)
> > > > and store void *data or struct drm_bridge *hdmi_bridge somewhere inside
> > > > struct drm_connector_hdmi in order to let bridge drivers find their data.
> > >
> > > Does it change anything? The last HDMI bridge should implement all the
> > > infoframes it supports. I don't think we should take care of one bridge
> > > with one infoframe type and some other with another?
> >
> > Note: I wrote about the _data_. So far the connector's write_infoframe /
> > clear_infoframe callbacks get drm_connector as an arg. The fact that
> > there is a drm_bridge which implements a callback is hidden well inside
> > drm_bridge_connector (and only it knows the bridge_hdmi pointer).
> > Otherwise, the bridge, trying to implement drm_connector_hdmi_funcs has
> > no way to go from drm_connector to drm_bridge.
> >
> > The only possible solution would be to introduce something like
> > drm_connector_hdmi::data (either void* or drm_bridge*) and use it
> > internally. But for me this looks like a bit loose abstraction. Though,
> > if it looks good from your POV, I agree, it would solve enough of
> > issues.
>
> I'm not sure I understand, sorry.
>
> What prevents us from adding ~4 functions to bridge->funcs that take the
> bridge, and drm_bridge_connector would get the connector, retrieve the
> bridge instance from it, and pass it to the bridge actually implementing
> it? Like we do currently for write_infoframe and clear_infoframe
> already?
Well, we discussed that having the write_foo_infoframe in the
drm_connector_hdmi_funcs means that the connector supports that
infoframe (and it can be used to e.g. report errors). However with
drm_bridge_container, we need to set all callbacks in
drm_connector_hdmi_funcs, even if the underlying bridge reports them as
unsupported.
Am I missing something?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2025-11-21 16:08 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 14:51 [PATCH v4 00/10] drm/connector: hdmi: limit infoframes per driver capabilities Dmitry Baryshkov
2025-09-09 14:51 ` [PATCH v4 01/10] drm/connector: let drivers declare infoframes as unsupported Dmitry Baryshkov
2025-09-10 11:03 ` Maxime Ripard
2025-09-10 15:16 ` Dmitry Baryshkov
2025-09-25 12:36 ` Maxime Ripard
2025-09-25 14:55 ` Dmitry Baryshkov
2025-10-03 14:23 ` Maxime Ripard
2025-10-03 15:41 ` Dmitry Baryshkov
2025-10-14 12:43 ` Maxime Ripard
2025-10-14 16:02 ` Dmitry Baryshkov
2025-11-21 15:48 ` Maxime Ripard
2025-11-21 16:08 ` Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 02/10] drm/bridge: adv7511: declare supported infoframes Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 03/10] drm/bridge: ite-it6263: " Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 04/10] drm/bridge: lontium-lt9611: " Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 05/10] drm/bridge: synopsys/dw-hdmi-qp: " Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 06/10] drm/msm: hdmi: " Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 07/10] drm/rockchip: rk3066: " Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 08/10] drm/display: bridge_connector: drop default list for HDMI Infoframes Dmitry Baryshkov
2025-09-09 14:52 ` [PATCH v4 09/10] drm/connector: verify that HDMI connectors support necessary InfoFrames Dmitry Baryshkov
2025-09-10 11:08 ` Maxime Ripard
2025-09-09 14:52 ` [PATCH v4 10/10] drm/display: hdmi-audio: warn if HDMI connector doesn't support Audio IF Dmitry Baryshkov
2025-09-10 11:05 ` Maxime Ripard
2025-09-10 13:43 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox