Linux Documentation
 help / color / mirror / Atom feed
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: "Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"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>,
	"Sandy Huang" <hjc@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Andy Yan" <andy.yan@rock-chips.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>,
	"Dmitry Baryshkov" <lumag@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Rob Herring" <robh@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Jani Nikula" <jani.nikula@linux.intel.com>
Cc: kernel@collabora.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	linux-doc@vger.kernel.org, wayland-devel@lists.freedesktop.org
Subject: Re: [PATCH v17 21/28] drm/tests: bridge: Add KUnit tests for bridge chain format selection
Date: Wed, 10 Jun 2026 13:42:35 +0200	[thread overview]
Message-ID: <gnicb4WkT1S4aQIC2G_naw@collabora.com> (raw)
In-Reply-To: <04ff70850213ae0f75486b1a27a7edb6fb4e71c3@intel.com>

On Wednesday, 10 June 2026 12:32:29 Central European Summer Time Jani Nikula wrote:
> On Tue, 09 Jun 2026, Nicolas Frattaroli <nicolas.frattaroli@collabora.com> wrote:
> > diff --git a/drivers/gpu/drm/tests/drm_bridge_test.c b/drivers/gpu/drm/tests/drm_bridge_test.c
> > index 64b665580a88..92f142ca6695 100644
> > --- a/drivers/gpu/drm/tests/drm_bridge_test.c
> > +++ b/drivers/gpu/drm/tests/drm_bridge_test.c
> > @@ -2,15 +2,23 @@
> >  /*
> >   * Kunit test for drm_bridge functions
> >   */
> > +#include <linux/cleanup.h>
> > +#include <linux/media-bus-format.h>
> > +
> >  #include <drm/drm_atomic_state_helper.h>
> > +#include <drm/drm_atomic_uapi.h>
> >  #include <drm/drm_bridge.h>
> >  #include <drm/drm_bridge_connector.h>
> >  #include <drm/drm_bridge_helper.h>
> > +#include <drm/drm_edid.h>
> >  #include <drm/drm_kunit_helpers.h>
> > +#include <drm/drm_managed.h>
> >  
> >  #include <kunit/device.h>
> >  #include <kunit/test.h>
> >  
> > +#include "drm_kunit_edid.h"
> 
> So here's the problem with adding *any* arrays into headers: every
> compilation unit that includes them duplicates all the arrays. It's only
> really okay for single use.
> 
> And, in this case, most of the included arrays are unused, leading to
> build failures:
> 
>   CC [M]  drivers/gpu/drm/tests/drm_bridge_test.o
> In file included from ../drivers/gpu/drm/tests/drm_bridge_test.c:21:
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:958:28: error: ‘test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz’ defined but not used [-Werror=unused-const-variable=]
>   958 | static const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:726:28: error: ‘test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz’ defined but not used [-Werror=unused-const-variable=]
>   726 | static const unsigned char test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:612:28: error: ‘test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz’ defined but not used [-Werror=unused-const-variable=]
>   612 | static const unsigned char test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:498:28: error: ‘test_edid_hdmi_1080p_rgb_max_340mhz’ defined but not used [-Werror=unused-const-variable=]
>   498 | static const unsigned char test_edid_hdmi_1080p_rgb_max_340mhz[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:390:28: error: ‘test_edid_hdmi_1080p_rgb_max_200mhz_hdr’ defined but not used [-Werror=unused-const-variable=]
>   390 | static const unsigned char test_edid_hdmi_1080p_rgb_max_200mhz_hdr[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:271:28: error: ‘test_edid_hdmi_1080p_rgb_max_200mhz’ defined but not used [-Werror=unused-const-variable=]
>   271 | static const unsigned char test_edid_hdmi_1080p_rgb_max_200mhz[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:163:28: error: ‘test_edid_hdmi_1080p_rgb_max_100mhz’ defined but not used [-Werror=unused-const-variable=]
>   163 | static const unsigned char test_edid_hdmi_1080p_rgb_max_100mhz[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/tests/drm_kunit_edid.h:57:28: error: ‘test_edid_dvi_1080p’ defined but not used [-Werror=unused-const-variable=]
>    57 | static const unsigned char test_edid_dvi_1080p[] = {
>       |                            ^~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> This breaks the build for me, I don't know how it didn't for any of you.

It broke the build for me in the past[1], but then I couldn't repro
it anymore when challenged on my fix[2].

> 
> Reverting these two fixes it:
> 
> ce1d0139adac ("drm/tests: bridge: Add test for HDMI output bus formats helper")
> 082fbc179c01 ("drm/tests: bridge: Add KUnit tests for bridge chain format selection")
> 
> I think the proper fix would be to move the arrays into a .c file, and
> only have declarations in the headers. But that needs to happen real
> soon or the commits need to be reverted.

If you don't want __maybe_unused, then sure, I'll move them into a new
.c file. Though I think the two are roughly equivalent in that I don't
think anyone is really trying to minimise the size of their KUnit
binaries.

I'll send a patch to move them to a .c

[1]: https://lore.kernel.org/dri-devel/20260121-color-format-v7-20-ef790dae780c@collabora.com/
[2]: https://lore.kernel.org/dri-devel/20260210-didactic-okapi-of-modernism-ff00d9@houat/

Kind regards,
Nicolas Frattaroli

> 
> BR,
> Jani.
> 
> 
> 





  reply	other threads:[~2026-06-10 11:43 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 12:43 [PATCH v17 00/28] Add new general DRM property "color format" Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 01/28] drm/amd/display: Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A check Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 02/28] drm/display: hdmi-state-helper: Use default case for unsupported formats Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 03/28] drm: Add new general DRM property "color format" Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 04/28] drm/connector: Let connectors have a say in their color format Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 05/28] drm/display: bridge_connector: Use HDMI color format for HDMI conns Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 06/28] drm/bridge: Act on the DRM color format property Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 07/28] drm/atomic-helper: Add HDMI bridge output bus formats helper Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 08/28] drm/display: hdmi-state-helper: Act on color format DRM property Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 09/28] drm/display: hdmi-state-helper: Try subsampling in mode_valid Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 10/28] drm/amdgpu: Implement "color format" DRM property Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 11/28] drm/rockchip: Add YUV422 output mode constants for VOP2 Nicolas Frattaroli
2026-06-09 12:43 ` [PATCH v17 12/28] drm/rockchip: vop2: Add RK3576 to the RG swap special case Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 13/28] drm/rockchip: vop2: Recognise 10-bit YUV422 as YUV format Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 14/28] drm/rockchip: vop2: Set correct output format for RK3576 YUV422 Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 15/28] drm/bridge: dw-hdmi-qp: Use common HDMI output bus fmts helper Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 16/28] drm/rockchip: dw_hdmi_qp: Implement "color format" DRM property Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 17/28] drm/rockchip: dw_hdmi_qp: Set supported_formats platdata Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 18/28] drm/connector: Register color format property on HDMI connectors Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 19/28] drm/tests: hdmi: Add tests for the color_format property Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 20/28] drm/tests: hdmi: Add tests for HDMI helper's mode_valid Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 21/28] drm/tests: bridge: Add KUnit tests for bridge chain format selection Nicolas Frattaroli
2026-06-10 10:32   ` Jani Nikula
2026-06-10 11:42     ` Nicolas Frattaroli [this message]
2026-06-10 11:54       ` Jani Nikula
2026-06-09 12:44 ` [PATCH v17 22/28] drm/tests: bridge: Add test for HDMI output bus formats helper Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 23/28] drm/bridge: Document bridge chain format selection Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 24/28] drm/connector: Update docs of "colorspace" for color format prop Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 25/28] drm/i915/hdmi: Add YCBCR444 handling for sink formats Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 26/28] drm/i915/dp: " Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 27/28] drm/i915/hdmi: Implement "color format" DRM property Nicolas Frattaroli
2026-06-09 12:44 ` [PATCH v17 28/28] drm/i915/dp: " Nicolas Frattaroli
2026-06-09 20:11 ` [PATCH v17 00/28] Add new general DRM property "color format" Daniel Stone

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=gnicb4WkT1S4aQIC2G_naw@collabora.com \
    --to=nicolas.frattaroli@collabora.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=christian.koenig@amd.com \
    --cc=corbet@lwn.net \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=skhan@linuxfoundation.org \
    --cc=sunpeng.li@amd.com \
    --cc=tursulin@ursulin.net \
    --cc=tzimmermann@suse.de \
    --cc=wayland-devel@lists.freedesktop.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