From patchwork Fri Jul 31 16:20:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2886 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 7A03B1C093B for ; Fri, 31 Jul 2026 19:08:11 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24877-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24877-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 4CB8331013C1 for ; Fri, 31 Jul 2026 16:27:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FAF746EC69; Fri, 31 Jul 2026 16:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="mvemhppV" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A01846D083 for ; Fri, 31 Jul 2026 16:20:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; cv=none; b=tQJzvAJSgf48cl8eGmYzKcIuXWn22LMuZQnbXMfEyISQt/a0rSpPZohgiwLmOwdjU7IfB732FAuznjR6Cza4yeLeWqDo2CzIFnpIwQKoWDQsnBIhMn/ukaO28w2De/6HYyjP5ZirBAZ5XxwR0MFK7w7FDekcRDEFFhuC50TJqHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; c=relaxed/simple; bh=MH/ZHTbxAU/pfRYI8iynv05E3beofFeSEJS/oxNVJv8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r5kqxlF3FPhXWROV6Z//i0I2ovKA4fHayx0AUoNA/OJma8ph5V2VU2vdBR0Je7JzYKz2dnMIohuufhpjMMEbbEhjvVEKO4KD59rT4MYYXPc1zDLFjGVlxrSafL1KK/B4P2mOqxue6f34s7+CE1dhUsSRV91cXOuX50OnlXGKE5M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=mvemhppV; arc=none smtp.client-ip=148.251.105.195 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514802; bh=MH/ZHTbxAU/pfRYI8iynv05E3beofFeSEJS/oxNVJv8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mvemhppV2VEH18QNjNAF2n+Rb8qZb/hZ7IifFbqEYd3cOKS2FcPuVuiVvkJRc8wRR XWjhjyqirGUOrGcETm247YpEvOfrAJze3yAq2i3oQaumGrJu4QV+G805e8kbXGPcoz WFUh/YWkI2WyF0nP7lBMJZNmhZz0LWbnTCrw4c8My4N8KER5ce/LJV6/883XijFnKn SrWYiar2HkrnTRLW+Ycowr2vLoDNarPAHaAtDGdhy+stM7kZZNsZ0wjrowtG/do8dq G1D/ceVGXENgDDIyWnEFWugjSr1cGCDq/BQiieFoCzZwdl8rNMg/nJsJ5Ubr9TupI1 DUX9U0D/qHsag== 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 441B917E0B79; Fri, 31 Jul 2026 18:20:02 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:14 +0300 Subject: [PATCH v10 67/69] drm/connector: Drop redundant hdmi vendor/product fields Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-67-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[cknow-tech.com:email,sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24877-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 7A03B1C093B X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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. This allows simplifying the related connector registration tests by getting rid of the now unnecessary KUNIT_EXPECT_MEMEQ() checks. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B 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 04c9e06b9dc1..83a8fcb41343 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -784,8 +784,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 b2e8d99c0e9a..f5f38dc4bfa6 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -656,10 +656,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 3d8500ad8be9..42f804500de6 100644 --- a/drivers/gpu/drm/tests/drm_connector_test.c +++ b/drivers/gpu/drm/tests/drm_connector_test.c @@ -771,14 +771,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; @@ -793,25 +790,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; @@ -826,10 +813,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)); } /* @@ -857,14 +840,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; @@ -879,24 +859,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; @@ -911,10 +882,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 2ad8d1611e84..f7627de624de 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1418,11 +1418,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 */ @@ -2123,18 +2125,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.