* [PATCH 00/25] drm: HDMI connector API cleanup and HDMI 2.0 test coverage
@ 2026-11-14 18:03 Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 01/25] video/hdmi: Copy SPD vendor/product with strtomem_pad() Cristian Ciocaltea
0 siblings, 1 reply; 3+ messages in thread
From: Cristian Ciocaltea @ 2026-11-14 18:03 UTC (permalink / raw)
To: Helge Deller, Martin Bugge, Thierry Reding, Hans Verkuil,
Mauro Carvalho Chehab, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: kernel, linux-fbdev, dri-devel, linux-kernel, stable,
Diederik de Haas, Robin Räber, Igor Paunovic
This is the remaining part of "[PATCH v11 00/74] Add HDMI 2.0 support to
DW HDMI QP TX" [1], to clean up the DRM HDMI connector infrastructure
and extend the KUnit coverage of the HDMI connector, bridge and
probe-helper code.
Patch series structure
======================
Patches 1-2 fix the SPD InfoFrame vendor/product copies by using
strtomem_pad(), so that non-NUL-terminated data is no longer read past
its end, and define the related field lengths.
Patches 3-4 drop drm_atomic_helper_connector_hdmi_force(), which has no
users left now that drivers use .force_ctx(), and make the state helper
reject connectors that lack HDMI funcs instead of dereferencing them.
Patches 5-7 convert the connector and HDMI tests to
drmm_connector_hdmi_init() and remove the transitional
drmm_connector_hdmi_ini2().
Patches 8-12 drop the redundant HDMI vendor/product, supported_formats
and max_bpc fields from the connector, use the SPD InfoFrame field
length defines, and fix a comment in drmm_connector_hdmi_init().
Patches 13-15 fix the conformity of two existing EDID test blobs and add
a 4K@60Hz EDID with a 600MHz TMDS limit.
Patches 16-22 add connector and HDMI state helper tests:
max_tmds_char_rate initialization and limits, the source-side scrambling
decision, SPD InfoFrame vendor/product generation, HDMI 2.0 scrambling
helpers and SCDC resync on hotplug.
Patches 23-24 set the supported HDMI version in the bridge tests and add
HDMI 2.0 bridge connector coverage.
Patch 25 adds .force_ctx() connector callback coverage to the probe
helper tests.
Changes since [1]
=================
- Added new patch 'drm/display: hdmi-state-helper: Reject connectors
lacking HDMI funcs'
- Split 'video/hdmi: Define SPD InfoFrame field lengths and use
strtomem_pad()' into
* Copy SPD vendor/product with strtomem_pad()
* Define SPD InfoFrame vendor/product field lengths
- Fixed comment block in drmm_connector_hdmi_init()
- Dropped the now redundant !connector->hdmi.funcs check in
'drm/connector: Drop redundant hdmi supported_formats field'
- Updated some of the existing test cases
* connector: test NULL hdmi_funcs rejection, max_tmds_char_rate
inference for all HDMI versions, HDMI 2.0 rate capping, and
scrambler callbacks being ignored below HDMI 2.0
* hdmi_state_helper: verify the scrambling decision accounts for
output format and bpc, and gets cleared when switching to a low TMDS
rate mode
* SPD InfoFrame: also check the packed buffer handed over to
.write_infoframe(), and drop the redundant atomic check that
triggered drm_WARN_ON(state->checked)
- New patch adding HDMI 2.0 scrambling helpers coverage, using a fake
SCDC sink on the DDC bus: drm_hdmi_mode_needs_scrambling(),
drm_connector_hdmi_{enable,disable}_scrambling() including error paths
and rollback, and the SCDC status monitoring work
- New patch adding SCDC resync on hotplug coverage, i.e.
drm_connector_hdmi_sync_scdc() via the hotplug and .force_ctx()
helpers
- New patch adding probe helper .force_ctx() coverage, including the
-EDEADLK backoff and retry path
- New patch adding HDMI 2.0 bridge connector coverage: scrambler
callback forwarding, missing ops rejection, and version and max TMDS
character rate propagation
KUnit runtime dependency
========================
Please note that a few unit tests are expected to fail until the
following commits from drm-misc-fixes land in drm-misc-next:
- 59d532e39ea7 ("drm/display: hdmi: Use committed state to decide on SCDC resync")
- b4146c6155b1 ("drm/display: hdmi: Reset sink scrambling on non-scrambled modesets")
[1] https://lore.kernel.org/all/20260901-dw-hdmi-qp-scramb-v11-0-bc12954a0688@collabora.com/
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Cristian Ciocaltea (25):
video/hdmi: Copy SPD vendor/product with strtomem_pad()
video/hdmi: Define SPD InfoFrame vendor/product field lengths
drm/display: hdmi-state-helper: Drop drm_atomic_helper_connector_hdmi_force()
drm/display: hdmi-state-helper: Reject connectors lacking HDMI funcs
drm/tests: connector: Convert to drmm_connector_hdmi_init()
drm/tests: hdmi: Convert to drmm_connector_hdmi_init()
drm/connector: Remove drmm_connector_hdmi_ini2()
drm/connector: Drop redundant hdmi vendor/product fields
drm/connector: Drop redundant hdmi supported_formats field
drm/connector: Drop redundant max_bpc field
drm/connector: Use the SPD InfoFrame field length defines
drm/connector: Fix comment in drmm_connector_hdmi_init()
drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID
drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID
drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS
drm/tests: connector: Add HDMI max_tmds_char_rate init coverage
drm/tests: connector: Add HDMI source-side scrambler coverage
drm/tests: hdmi: Cover mode validation against connector max_tmds_char_rate
drm/tests: hdmi: Verify scrambler_needed computation
drm/tests: hdmi: Add SPD InfoFrame vendor/product coverage
drm/tests: hdmi: Add HDMI 2.0 scrambling helpers coverage
drm/tests: hdmi: Verify SCDC resync on hotplug
drm/tests: bridge: Set supported HDMI version
drm/tests: bridge: Add HDMI 2.0 bridge connector coverage
drm/tests: probe-helper: Add .force_ctx() callback coverage
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 30 +-
drivers/gpu/drm/drm_connector.c | 123 +-
drivers/gpu/drm/tests/drm_bridge_test.c | 185 +-
drivers/gpu/drm/tests/drm_connector_test.c | 643 +++++--
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 2015 ++++++++++++++++++--
drivers/gpu/drm/tests/drm_kunit_edid.c | 251 ++-
drivers/gpu/drm/tests/drm_kunit_edid.h | 1 +
drivers/gpu/drm/tests/drm_probe_helper_test.c | 296 +++
drivers/video/hdmi.c | 31 +-
include/drm/display/drm_hdmi_state_helper.h | 1 -
include/drm/drm_connector.h | 38 +-
include/linux/hdmi.h | 7 +-
12 files changed, 3047 insertions(+), 574 deletions(-)
---
base-commit: fc72cd52fb284f3707fa36a68ea5a22543a51d71
change-id: 20261114-drm-conn-hdmi-cleanup-d9d94c81dceb
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 01/25] video/hdmi: Copy SPD vendor/product with strtomem_pad()
2026-11-14 18:03 [PATCH 00/25] drm: HDMI connector API cleanup and HDMI 2.0 test coverage Cristian Ciocaltea
@ 2026-11-14 18:03 ` Cristian Ciocaltea
2026-11-23 12:53 ` Maxime Ripard
0 siblings, 1 reply; 3+ messages in thread
From: Cristian Ciocaltea @ 2026-11-14 18:03 UTC (permalink / raw)
To: Helge Deller, Martin Bugge, Thierry Reding, Hans Verkuil,
Mauro Carvalho Chehab, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: kernel, linux-fbdev, dri-devel, linux-kernel, stable
The HDMI specification defines the SPD InfoFrame Vendor Name and Product
Description as fixed-size fields, padded with zeros and left without any
trailing NUL when a name spans the whole field.
Mark the fields as non-strings, so that the copies can be handed over to
strtomem_pad(), which implements precisely the required semantics. This
also bounds the reads from the source strings, whereas the open-coded
strlen() could run past the end of the buffer in the
hdmi_spd_infoframe_unpack() path, where the names come straight from the
wire and are not NUL-terminated.
Fixes: 2c676f378edb ("[media] hdmi: added unpack and logging functions for InfoFrames")
Cc: stable@vger.kernel.org # v6.1+
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/video/hdmi.c | 11 +++++------
include/linux/hdmi.h | 4 ++--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 45b42f14a750..cd18121afa20 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -217,23 +217,22 @@ EXPORT_SYMBOL(hdmi_avi_infoframe_pack);
* @vendor: vendor string
* @product: product string
*
+ * Both strings are copied into the fixed-size infoframe fields,
+ * truncated if too long and padded with zeros otherwise.
+ *
* Returns 0 on success or a negative error code on failure.
*/
int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame,
const char *vendor, const char *product)
{
- size_t len;
-
memset(frame, 0, sizeof(*frame));
frame->type = HDMI_INFOFRAME_TYPE_SPD;
frame->version = 1;
frame->length = HDMI_SPD_INFOFRAME_SIZE;
- len = strlen(vendor);
- memcpy(frame->vendor, vendor, min(len, sizeof(frame->vendor)));
- len = strlen(product);
- memcpy(frame->product, product, min(len, sizeof(frame->product)));
+ strtomem_pad(frame->vendor, vendor, 0);
+ strtomem_pad(frame->product, product, 0);
return 0;
}
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index b80a5ee63bb2..08922d5330d6 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -271,8 +271,8 @@ struct hdmi_spd_infoframe {
enum hdmi_infoframe_type type;
unsigned char version;
unsigned char length;
- char vendor[8];
- char product[16];
+ char vendor[8] __nonstring;
+ char product[16] __nonstring;
enum hdmi_spd_sdi sdi;
};
--
2.56.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 01/25] video/hdmi: Copy SPD vendor/product with strtomem_pad()
2026-11-14 18:03 ` [PATCH 01/25] video/hdmi: Copy SPD vendor/product with strtomem_pad() Cristian Ciocaltea
@ 2026-11-23 12:53 ` Maxime Ripard
0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2026-11-23 12:53 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: dri-devel, kernel, linux-fbdev, linux-kernel, stable,
David Airlie, Hans Verkuil, Helge Deller, Maarten Lankhorst,
Martin Bugge, Mauro Carvalho Chehab, Maxime Ripard, Simona Vetter,
Thierry Reding, Thomas Zimmermann
On Sat, 14 Nov 2026 20:03:25 +0200, Cristian Ciocaltea wrote:
> The HDMI specification defines the SPD InfoFrame Vendor Name and Product
> Description as fixed-size fields, padded with zeros and left without any
> trailing NUL when a name spans the whole field.
>
> Mark the fields as non-strings, so that the copies can be handed over to
>
> [ ... ]
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-23 12:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 18:03 [PATCH 00/25] drm: HDMI connector API cleanup and HDMI 2.0 test coverage Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 01/25] video/hdmi: Copy SPD vendor/product with strtomem_pad() Cristian Ciocaltea
2026-11-23 12:53 ` Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox