mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Helge Deller <deller@gmx.de>, Martin Bugge <marbugge@cisco.com>,
	 Thierry Reding <treding@nvidia.com>,
	Hans Verkuil <hverkuil@kernel.org>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>
Cc: kernel@collabora.com, linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Diederik de Haas" <diederik@cknow-tech.com>,
	"Robin Räber" <robin.raebi@gmail.com>,
	"Igor Paunovic" <royalnet026@gmail.com>
Subject: [PATCH 08/25] drm/connector: Drop redundant hdmi vendor/product fields
Date: Sat, 14 Nov 2026 20:03:32 +0200	[thread overview]
Message-ID: <20261114-drm-conn-hdmi-cleanup-v1-8-20e8a33a2286@collabora.com> (raw)
In-Reply-To: <20261114-drm-conn-hdmi-cleanup-v1-0-20e8a33a2286@collabora.com>

Now that all users migrated to the new drmm_connector_hdmi_init()
signature, vendor and product are provided through struct
drm_connector_hdmi_funcs, a reference to which is already stored in
drm_connector_hdmi.

Drop the redundant fields from drm_connector_hdmi and point its users to
hdmi.funcs->vendor and hdmi.funcs->product instead.

The connector registration tests used to verify that both names were
stored zero-padded and without any trailing NUL, as the SPD InfoFrame
requires.  That will be covered by dedicated SPD InfoFrame tests, hence
drop the KUNIT_EXPECT_MEMEQ() checks on the removed fields.

Tested-by: Diederik de Haas <diederik@cknow-tech.com>  # NanoPC-T6 LTS, Rock 5B
Tested-by: Robin Räber <robin.raebi@gmail.com>
Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c |  4 +--
 drivers/gpu/drm/drm_connector.c                 |  4 ---
 drivers/gpu/drm/tests/drm_connector_test.c      | 41 +++----------------------
 include/drm/drm_connector.h                     | 14 ++-------
 4 files changed, 8 insertions(+), 55 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index f533d5a7aab9..0e282abb118d 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -785,8 +785,8 @@ static int hdmi_generate_spd_infoframe(const struct drm_connector *connector,
 		return 0;
 
 	ret = hdmi_spd_infoframe_init(frame,
-				      connector->hdmi.vendor,
-				      connector->hdmi.product);
+				      connector->hdmi.funcs->vendor,
+				      connector->hdmi.funcs->product);
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index bb508ec7a8cd..b1b7662c575b 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -646,10 +646,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
 		connector->hdmi.max_tmds_char_rate = hdmi_funcs->supported_tmds_char_rate;
 	}
 
-	/* TODO: remove after conversion to new drmm_connector_hdmi_init() */
-	strtomem_pad(connector->hdmi.vendor, hdmi_funcs->vendor, 0);
-	strtomem_pad(connector->hdmi.product, hdmi_funcs->product, 0);
-
 	/*
 	 * drm_connector_attach_max_bpc_property() requires the
 	 * connector to have a state.
diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c
index 354e3088cf0f..d98c6a42ccae 100644
--- a/drivers/gpu/drm/tests/drm_connector_test.c
+++ b/drivers/gpu/drm/tests/drm_connector_test.c
@@ -760,14 +760,11 @@ static void drm_test_connector_hdmi_init_null_product(struct kunit *test)
 
 /*
  * Test that the registration of a connector with a valid, shorter than
- * the max length, product name succeeds, and is stored padded with 0.
+ * the max length, product name succeeds.
  */
 static void drm_test_connector_hdmi_init_product_valid(struct kunit *test)
 {
 	struct drm_connector_init_priv *priv = test->priv;
-	const unsigned char expected_product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] = {
-		'P', 'r', 'o', 'd',
-	};
 	int ret;
 
 	priv->hdmi_funcs = dummy_hdmi_funcs;
@@ -782,25 +779,15 @@ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test)
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc);
 	KUNIT_EXPECT_EQ(test, ret, 0);
-	KUNIT_EXPECT_MEMEQ(test,
-			   priv->connector.hdmi.product,
-			   expected_product,
-			   sizeof(priv->connector.hdmi.product));
 }
 
 /*
  * Test that the registration of a connector with a valid, at max
- * length, product name succeeds, and is stored padded without any
- * trailing \0.
+ * length, product name succeeds.
  */
 static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test)
 {
 	struct drm_connector_init_priv *priv = test->priv;
-	const unsigned char expected_product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] = {
-		'P', 'r', 'o', 'd', 'u', 'c', 't',
-		'P', 'r', 'o', 'd', 'u', 'c', 't',
-		'P', 'r',
-	};
 	int ret;
 
 	priv->hdmi_funcs = dummy_hdmi_funcs;
@@ -815,10 +802,6 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc);
 	KUNIT_EXPECT_EQ(test, ret, 0);
-	KUNIT_EXPECT_MEMEQ(test,
-			   priv->connector.hdmi.product,
-			   expected_product,
-			   sizeof(priv->connector.hdmi.product));
 }
 
 /*
@@ -846,14 +829,11 @@ static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *t
 
 /*
  * Test that the registration of a connector with a vendor name smaller
- * than the maximum length succeeds, and is stored padded with zeros.
+ * than the maximum length succeeds.
  */
 static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test)
 {
 	struct drm_connector_init_priv *priv = test->priv;
-	const char expected_vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] = {
-		'V', 'e', 'n', 'd',
-	};
 	int ret;
 
 	priv->hdmi_funcs = dummy_hdmi_funcs;
@@ -868,24 +848,15 @@ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test)
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc);
 	KUNIT_EXPECT_EQ(test, ret, 0);
-	KUNIT_EXPECT_MEMEQ(test,
-			   priv->connector.hdmi.vendor,
-			   expected_vendor,
-			   sizeof(priv->connector.hdmi.vendor));
 }
 
 /*
  * Test that the registration of a connector with a vendor name at the
- * maximum length succeeds, and is stored padded without the trailing
- * zero.
+ * maximum length succeeds.
  */
 static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test)
 {
 	struct drm_connector_init_priv *priv = test->priv;
-	const char expected_vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] = {
-		'V', 'e', 'n', 'd', 'o', 'r',
-		'V', 'e',
-	};
 	int ret;
 
 	priv->hdmi_funcs = dummy_hdmi_funcs;
@@ -900,10 +871,6 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test)
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc);
 	KUNIT_EXPECT_EQ(test, ret, 0);
-	KUNIT_EXPECT_MEMEQ(test,
-			   priv->connector.hdmi.vendor,
-			   expected_vendor,
-			   sizeof(priv->connector.hdmi.vendor));
 }
 
 /*
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 241d20a587e5..c75bf65532d4 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1485,11 +1485,13 @@ struct drm_connector_infoframe_funcs {
  * and controller capabilities
  */
 struct drm_connector_hdmi_funcs {
+#define DRM_CONNECTOR_HDMI_VENDOR_LEN	8
 	/**
 	 * @vendor: HDMI Controller Vendor name.
 	 */
 	const char *vendor;
 
+#define DRM_CONNECTOR_HDMI_PRODUCT_LEN	16
 	/**
 	 * @product: HDMI Controller Product name
 	 */
@@ -2178,18 +2180,6 @@ struct drm_connector_hdmi_audio {
  * struct drm_connector_hdmi - DRM Connector HDMI-related structure
  */
 struct drm_connector_hdmi {
-#define DRM_CONNECTOR_HDMI_VENDOR_LEN	8
-	/**
-	 * @vendor: HDMI Controller Vendor Name
-	 */
-	unsigned char vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] __nonstring;
-
-#define DRM_CONNECTOR_HDMI_PRODUCT_LEN	16
-	/**
-	 * @product: HDMI Controller Product Name
-	 */
-	unsigned char product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] __nonstring;
-
 	/**
 	 * @supported_formats: Bitmask of @drm_output_color_format
 	 * supported by the controller.

-- 
2.56.0


  parent reply	other threads:[~2026-11-14 18:04 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
2026-11-14 18:03 ` [PATCH 02/25] video/hdmi: Define SPD InfoFrame vendor/product field lengths Cristian Ciocaltea
2026-11-23 12:52   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 03/25] drm/display: hdmi-state-helper: Drop drm_atomic_helper_connector_hdmi_force() Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 04/25] drm/display: hdmi-state-helper: Reject connectors lacking HDMI funcs Cristian Ciocaltea
2026-11-23 12:57   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 05/25] drm/tests: connector: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-11-23 12:57   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 06/25] drm/tests: hdmi: " Cristian Ciocaltea
2026-11-23 12:58   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 07/25] drm/connector: Remove drmm_connector_hdmi_ini2() Cristian Ciocaltea
2026-11-23 13:02   ` Maxime Ripard
2026-11-14 18:03 ` Cristian Ciocaltea [this message]
2026-11-23 13:07   ` [PATCH 08/25] drm/connector: Drop redundant hdmi vendor/product fields Maxime Ripard
2026-11-14 18:03 ` [PATCH 09/25] drm/connector: Drop redundant hdmi supported_formats field Cristian Ciocaltea
2026-11-23 13:07   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 10/25] drm/connector: Drop redundant max_bpc field Cristian Ciocaltea
2026-11-23 13:07   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 11/25] drm/connector: Use the SPD InfoFrame field length defines Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 12/25] drm/connector: Fix comment in drmm_connector_hdmi_init() Cristian Ciocaltea
2026-11-23 15:31   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 13/25] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Cristian Ciocaltea
2026-11-23 15:51   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 14/25] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 15/25] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Cristian Ciocaltea
2026-11-23 15:52   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 16/25] drm/tests: connector: Add HDMI max_tmds_char_rate init coverage Cristian Ciocaltea
2026-11-23 16:02   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 17/25] drm/tests: connector: Add HDMI source-side scrambler coverage Cristian Ciocaltea
2026-11-23 16:03   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 18/25] drm/tests: hdmi: Cover mode validation against connector max_tmds_char_rate Cristian Ciocaltea
2026-11-23 16:31   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 19/25] drm/tests: hdmi: Verify scrambler_needed computation Cristian Ciocaltea
2026-11-23 16:32   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 20/25] drm/tests: hdmi: Add SPD InfoFrame vendor/product coverage Cristian Ciocaltea
2026-11-23 16:34   ` Maxime Ripard
2026-11-14 18:03 ` [PATCH 21/25] drm/tests: hdmi: Add HDMI 2.0 scrambling helpers coverage Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 22/25] drm/tests: hdmi: Verify SCDC resync on hotplug Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 23/25] drm/tests: bridge: Set supported HDMI version Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 24/25] drm/tests: bridge: Add HDMI 2.0 bridge connector coverage Cristian Ciocaltea
2026-11-14 18:03 ` [PATCH 25/25] drm/tests: probe-helper: Add .force_ctx() callback coverage Cristian Ciocaltea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261114-drm-conn-hdmi-cleanup-v1-8-20e8a33a2286@collabora.com \
    --to=cristian.ciocaltea@collabora.com \
    --cc=airlied@gmail.com \
    --cc=deller@gmx.de \
    --cc=diederik@cknow-tech.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hverkuil@kernel.org \
    --cc=kernel@collabora.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marbugge@cisco.com \
    --cc=mchehab@kernel.org \
    --cc=mripard@kernel.org \
    --cc=robin.raebi@gmail.com \
    --cc=royalnet026@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=treding@nvidia.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®