From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.251.105.195 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796178029; b=2Sv5RWrFHk0PWI/Ak8DHpHfbK8teX7/9SiUUk7Jwoq6RsnjSZZ2OXHT8RFmk2oN5buki UhZVrPewty5EtSF3kJ0+E7cIFtTdNGjngQpkBAVAuoRXhM5zq6oUMDmjOrnHm74IZJ69s AcqhMdn8I8PlC5kYmq93aJkyg7m7lJryYsiNWy3r94m+6NJQ5vZO365w3AywHrsky7fVD Dqi+zHbj+FDZRD+ydR7LtsTxtccTjVmHXtY4S8uTVHP/Lip5exhApozJF4BBV1mYiL4Tt JkWJctYldnn9tk7r5/lJFKATO+jQQI2wDEC2NPVLTsEBbAnhGGD+G1GLiw1QTX7NFGg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796178029; h=DMARC-Filter:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer; bh=eSTvsFRbvK1vU7K75R4pgwZdUOqvhUEoTvVPZQiwssk=; b=HtxaO8O2Mz5it3tZQcu8eFurkc/qPEdtDWapED/a5PYM7sYkv/ii4W3gWKN4ExEg72dg ewjD+crkKq2F4HwyLZbDGj8jk+p0+y/pVnBtPQ15m+2DVXPDTBPsKyZhWpNgR4W9dGGm5 0s4g5gyV6YsKQylFswESXGfPlHqfJ/8dd3RcrgAxIWM2VyAcYmKdE/Uh8ak3J4cPNZBhG yTyNfT5t4A8/Wjaf7f0fWGyU4hVtVwXdfGKpV5YjZ1WTc9SCru0jrJFHzQpQAGZds9B7/ 7y4d3jtT/3uXrUa9OhSfB2uTlsiZd3J5KvW0zzga9gcgVUZvexzjgZ7+ZIcMxn/KkeA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b="ALPkcQ7/"; arc=none smtp.remote-ip=148.251.105.195 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4044C606A685; Wed, 2 Dec 2026 02:20:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4044C606A685 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=ALPkcQ7/ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1796178024; bh=TgJAZ9LGtg9uybSku1JkV4IaemUdYFUbqTQAK3MbLbs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ALPkcQ7/6uG23XfPjZJGRfyf8jeeSmHktvbcrh0oNs7+3FdL4UwgIVm4zqWXQ9g1u aPN1n3G8O60n/bV9TrJy4rmOhzIZNp8hRuRE8WtjrbxYg8sCT3MbcpmQPrSI7dxHAF kpA3jm/BMiqqzZ/f1pnPpoMcKqXiNbcxBoOHXTYWkxgIdL7xLNQ9Q/BNnybeRnw8Pc 7YyYoTcq+6sXR7ToG2zDUUVH/Q/Y8gQLVxnVnVoc5XhmsiFL9iCcbIcIRmNOdd3PlC UJnwekFVKyr1CWMMbweCWiY7Ka3c7T8Dhx/u5G/tHvDSzeXXa/Y8aluFVqayVF2j66 s6c3U79AB/Klw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 381E917E35DB; Wed, 02 Dec 2026 03:20:24 +0100 (CET) From: Cristian Ciocaltea Date: Wed, 02 Dec 2026 04:20:02 +0200 Subject: [PATCH v2 08/25] drm/connector: Drop redundant hdmi vendor/product fields X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20261202-drm-conn-hdmi-cleanup-v2-8-ba7d32550ea4@collabora.com> References: <20261202-drm-conn-hdmi-cleanup-v2-0-ba7d32550ea4@collabora.com> In-Reply-To: <20261202-drm-conn-hdmi-cleanup-v2-0-ba7d32550ea4@collabora.com> To: Helge Deller , Thomas Zimmermann , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter Cc: kernel@collabora.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Diederik de Haas , =?utf-8?q?Robin_R=C3=A4ber?= , Igor Paunovic X-Mailer: b4 0.15.2 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 # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber Tested-by: Igor Paunovic # RK3588 Orange Pi 5 Plus, dual HDMI Acked-by: Maxime Ripard Signed-off-by: Cristian Ciocaltea --- 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 37f4810db7c6..3b35e1e619ee 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -791,8 +791,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 e1cd4f720b37..898b619aa699 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 11cf4e886a7c..62a10cdd8f1e 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