ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Cc: "Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Chen-Yu Tsai" <wens@kernel.org>,
	"Samuel Holland" <samuel@sholland.org>,
	"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
	"Maíra Canal" <mcanal@igalia.com>,
	"Raspberry Pi Kernel Maintenance" <kernel-list@raspberrypi.com>,
	"Sandy Huang" <hjc@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Andy Yan" <andy.yan@rock-chips.com>,
	"Algea Cao" <algea.cao@rock-chips.com>,
	"Daniel Stone" <daniels@collabora.com>,
	"Liu Ying" <victor.liu@nxp.com>, "Phong LE" <ple@baylibre.com>,
	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" <diederik@cknow-tech.com>
Subject: Re: [PATCH v10 67/69] drm/connector: Drop redundant hdmi vendor/product fields
Date: Tue, 8 Sep 2026 14:26:42 +0200	[thread overview]
Message-ID: <ap_-wHX6nw5IbFkH@houat> (raw)
In-Reply-To: <4fc2a3b6-2771-438b-ae99-5574e9c6efc9@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 4935 bytes --]

On Fri, Aug 21, 2026 at 06:30:31PM +0300, Cristian Ciocaltea wrote:
> On 8/20/26 1:10 PM, Maxime Ripard wrote:
> > On Fri, Jul 31, 2026 at 07:20:14PM +0300, Cristian Ciocaltea wrote:
> >> 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 <diederik@cknow-tech.com>  # NanoPC-T6 LTS, Rock 5B
> >> 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(-)
> >>
> [...]
> 
> >>  /*
> >>   * 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));
> >>  }
> > 
> > Unfortunately, these tests were useful, and are there to match what the
> > spec asks for.
> 
> I've just added a new test to cover this, as well as a couple of prerequisites
> to consolidate SPD InfoFrame handling:
> 
> * video/hdmi: Define SPD InfoFrame field lengths and use strtomem_pad()
> 
>   HDMI specification defines the SPD InfoFrame Vendor Name and Product
>   Description as fixed-size fields, 8 and 16 bytes respectively, padded
>   with zeros and left without any trailing NUL when a name spans the whole
>   field.
> 
>   Give those lengths a name and 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.
> 
>   While at it, replace the related magic numbers in the pack and unpack
>   helpers with the new defines.
> 
> * drm/connector: Use the SPD InfoFrame field length defines
> 
>   DRM_CONNECTOR_HDMI_{VENDOR,PRODUCT}_LEN used to size the vendor and
>   product arrays in struct drm_connector_hdmi.  Those arrays are gone and
>   both names are now only validated before being copied into the SPD
>   InfoFrame, hence the limits they have to be checked against are the ones
>   of the SPD InfoFrame fields themselves.
> 
>   Switch the remaining users over to
>   HDMI_SPD_INFOFRAME_{VENDOR,PRODUCT}_LEN and drop the DRM specific
>   defines, so that the two cannot drift apart.
> 
> * drm/tests: hdmi: Add SPD InfoFrame vendor/product coverage
> 
>   The vendor and product strings provided through struct
>   drm_connector_hdmi_funcs end up in the SPD InfoFrame, whose fields are
>   defined by the HDMI specification as fixed-size: 8 bytes for the vendor
>   name and 16 bytes for the product description, padded with zeros and
>   left without any trailing NUL when a name spans the whole field.
> 
>   Nothing exercises that so far, since the SPD InfoFrame is only generated
>   for connectors implementing the related hooks, which none of the
>   existing test funcs provides.
> 
>   Add a connector variant supplying those hooks, along with parametrized
>   tests covering both the padded and the exact length cases.

I'm not sure why we need to add a new test here. It's exactly what the
test above is supposed to check. Making it a shell of what it was
testing and then adding yet another one that tests what the former used
to test seems suboptimal to me.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2026-09-08 12:26 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 16:19 [PATCH v10 00/69] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 01/69] video/hdmi: Introduce HDMI version enum Cristian Ciocaltea
2026-07-31 16:25   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 02/69] drm/connector: hdmi: Handle reset() state allocation failure Cristian Ciocaltea
2026-07-31 16:37   ` sashiko-bot
2026-08-13 13:45   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 03/69] drm/display: hdmi: Rename drmm_connector_hdmi_init() to *_ini2() Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 04/69] drm/connector: Add drmm_connector_hdmi_init() with new signature Cristian Ciocaltea
2026-08-19 10:08   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 05/69] drm/display: bridge_connector: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-08-19 10:06   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 06/69] drm/probe-helper: Introduce .force_ctx() connector callback Cristian Ciocaltea
2026-07-31 17:06   ` sashiko-bot
2026-08-19  9:53   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 07/69] drm/connector: Add HDMI 2.0 scrambler infrastructure Cristian Ciocaltea
2026-08-19 10:12   ` Maxime Ripard
2026-08-19 19:33     ` Cristian Ciocaltea
2026-08-20 16:56       ` Maxime Ripard
2026-08-21 19:04         ` Cristian Ciocaltea
2026-08-25  9:29           ` Maxime Ripard
2026-08-25 10:11             ` Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 08/69] drm/display: scdc-helper: Add macro for connector-prefixed debug messages Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 09/69] drm/display: scdc-helper: Add helper to set SCDC version information Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 10/69] drm/display: hdmi: Add HDMI 2.0 scrambling management helpers Cristian Ciocaltea
2026-07-31 17:33   ` sashiko-bot
2026-08-19 12:37   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 11/69] drm/display: hdmi: Advertise SCDC source version when scrambling Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 12/69] drm/bridge: Fix unlocked list_del in drm_bridge_add() Cristian Ciocaltea
2026-07-31 17:50   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 13/69] drm/bridge: Fix unlocked list access in drm_bridge_attach() Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 14/69] drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc() Cristian Ciocaltea
2026-07-31 18:01   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 15/69] drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling Cristian Ciocaltea
2026-07-31 18:09   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 16/69] drm/display: bridge_connector: Use cached connector status in .get_modes() Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 17/69] drm/display: bridge_connector: Switch to .detect_ctx() connector helper Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 18/69] drm/display: bridge_connector: Switch to .force_ctx() " Cristian Ciocaltea
2026-07-31 18:31   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 19/69] drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks Cristian Ciocaltea
2026-08-19 12:38   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 20/69] drm/display: hdmi-state-helper: Add source TMDS rate validation Cristian Ciocaltea
2026-08-13 13:35   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 21/69] drm/display: hdmi-state-helper: Pass acquire ctx to hotplug helpers Cristian Ciocaltea
2026-08-19 12:39   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 22/69] drm/display: hdmi-state-helper: Sync SCDC state on hotplug Cristian Ciocaltea
2026-07-31 19:02   ` sashiko-bot
2026-08-20  8:53   ` Maxime Ripard
2026-08-20 14:44     ` Cristian Ciocaltea
2026-08-25  9:25       ` Maxime Ripard
2026-08-25 10:26         ` Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 23/69] drm/display: hdmi-state-helper: Set HDMI scrambling requirement Cristian Ciocaltea
2026-07-31 19:20   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 24/69] drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 25/69] drm/bridge: dw-hdmi-qp: Provide .{enable,disable}_hpd() PHY ops Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 26/69] drm/bridge: dw-hdmi-qp: Remove unused workqueue include and define Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 27/69] drm/bridge: dw-hdmi-qp: Add HDMI 2.0 scrambling support Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 28/69] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 29/69] drm/rockchip: dw_hdmi_qp: Fix invalid drvdata access in PM ops Cristian Ciocaltea
2026-07-31 20:19   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 30/69] drm/rockchip: dw_hdmi_qp: Cancel pending HPD work on suspend Cristian Ciocaltea
2026-07-31 20:30   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 31/69] drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages Cristian Ciocaltea
2026-07-31 20:38   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 32/69] drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind() Cristian Ciocaltea
2026-07-31 20:47   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 33/69] drm/rockchip: dw_hdmi_qp: Avoid spurious HPD IRQ thread wakeups Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 34/69] drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init Cristian Ciocaltea
2026-07-31 21:14   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 35/69] drm/rockchip: dw_hdmi_qp: Implement .{enable,disable}_hpd() PHY ops Cristian Ciocaltea
2026-07-31 21:27   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 36/69] drm/rockchip: dw_hdmi_qp: Factor out HPD interrupt (un)mask helpers Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 37/69] drm/rockchip: dw_hdmi_qp: Control the HPD IRQ line via the bridge HPD ops Cristian Ciocaltea
2026-07-31 21:47   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 38/69] drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports Cristian Ciocaltea
2026-07-31 22:04   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 39/69] drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 40/69] drm/vc4: hdmi: Use common TMDS char rate constants Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 41/69] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling() Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 42/69] drm/vc4: hdmi: Switch to .force_ctx() connector helper Cristian Ciocaltea
2026-08-13 13:28   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 43/69] drm/vc4: hdmi: Propagate -EDEADLK to the top level Cristian Ciocaltea
2026-08-20  8:55   ` Maxime Ripard
2026-08-20 18:23     ` Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 44/69] drm/vc4: hdmi: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-08-20 11:25   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 45/69] drm/vc4: hdmi: Convert to common HDMI 2.0 scrambling infrastructure Cristian Ciocaltea
2026-07-31 22:44   ` sashiko-bot
2026-08-20 11:24   ` Maxime Ripard
2026-08-20 19:23     ` Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 46/69] drm/vc4: hdmi: Defer pixel clock validation to HDMI helpers Cristian Ciocaltea
2026-08-20 10:16   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 47/69] drm/display: hdmi-state-helper: Drop drm_atomic_helper_connector_hdmi_force() Cristian Ciocaltea
2026-08-20 10:16   ` Maxime Ripard
2026-07-31 16:19 ` [PATCH v10 48/69] drm/bridge: adv7511: Advertise HDMI 1.2 capabilities Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 49/69] drm/bridge: inno-hdmi: " Cristian Ciocaltea
2026-07-31 23:10   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 50/69] drm/bridge: ite-it6263: Drop redundant .mode_valid hook Cristian Ciocaltea
2026-07-31 16:19 ` [PATCH v10 51/69] drm/bridge: ite-it6263: Advertise HDMI 1.3 capabilities Cristian Ciocaltea
2026-07-31 23:24   ` sashiko-bot
2026-07-31 16:19 ` [PATCH v10 52/69] drm/bridge: ite-it66121: Advertise HDMI 1.2 capabilities Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 53/69] drm/bridge: lontium-lt9611: Advertise HDMI 1.4 capabilities Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 54/69] drm/rockchip: rk3066_hdmi: " Cristian Ciocaltea
2026-07-31 23:41   ` sashiko-bot
2026-08-19 10:36   ` Heiko Stübner
2026-07-31 16:20 ` [PATCH v10 55/69] drm/sun4i: hdmi: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-07-31 23:47   ` sashiko-bot
2026-08-13 13:29   ` Maxime Ripard
2026-07-31 16:20 ` [PATCH v10 56/69] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 57/69] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 58/69] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 59/69] drm/tests: bridge: Set supported HDMI version Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 60/69] drm/tests: connector: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 61/69] drm/tests: connector: Add HDMI max_tmds_char_rate init coverage Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 62/69] drm/tests: connector: Add HDMI source-side scrambler coverage Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 63/69] drm/tests: hdmi_state_helper: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 64/69] drm/tests: hdmi_state_helper: Add connector-provided max_tmds_char_rate coverage Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 65/69] drm/tests: hdmi_state_helper: Cover source-side scrambling decision Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 66/69] drm/connector: Remove drmm_connector_hdmi_ini2() Cristian Ciocaltea
2026-07-31 16:20 ` [PATCH v10 67/69] drm/connector: Drop redundant hdmi vendor/product fields Cristian Ciocaltea
2026-08-20 10:10   ` Maxime Ripard
2026-08-21 15:30     ` Cristian Ciocaltea
2026-09-08 12:26       ` Maxime Ripard [this message]
2026-07-31 16:20 ` [PATCH v10 68/69] drm/connector: Drop redundant hdmi supported_formats field Cristian Ciocaltea
2026-08-20 10:20   ` Maxime Ripard
2026-07-31 16:20 ` [PATCH v10 69/69] drm/connector: Drop redundant max_bpc field Cristian Ciocaltea
2026-08-20 10:20   ` Maxime Ripard

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=ap_-wHX6nw5IbFkH@houat \
    --to=mripard@kernel.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=algea.cao@rock-chips.com \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=cristian.ciocaltea@collabora.com \
    --cc=daniels@collabora.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=diederik@cknow-tech.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel-list@raspberrypi.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mcanal@igalia.com \
    --cc=neil.armstrong@linaro.org \
    --cc=ple@baylibre.com \
    --cc=rfoss@kernel.org \
    --cc=samuel@sholland.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=victor.liu@nxp.com \
    --cc=wens@kernel.org \
    /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