From: Maxime Ripard <mripard@kernel.org>
To: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
kernel@collabora.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/7] drm/connector: hdmi: Use YUV420 output format as an RGB fallback
Date: Fri, 14 Mar 2025 14:57:49 +0100 [thread overview]
Message-ID: <20250314-abstract-brainy-parrot-2a6b93@houat> (raw)
In-Reply-To: <c6f4233f-4a66-44c2-b962-9c80352bb7e1@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 2722 bytes --]
On Tue, Mar 11, 2025 at 08:59:00PM +0200, Cristian Ciocaltea wrote:
> >> +static int
> >> +hdmi_compute_config(const struct drm_connector *connector,
> >> + struct drm_connector_state *conn_state,
> >> + const struct drm_display_mode *mode)
> >> +{
> >> + unsigned int max_bpc = clamp_t(unsigned int,
> >> + conn_state->max_bpc,
> >> + 8, connector->max_bpc);
> >> + int ret;
> >> +
> >> + ret = hdmi_try_format(connector, conn_state, mode, max_bpc,
> >> + HDMI_COLORSPACE_RGB);
> >> + if (!ret)
> >> + return 0;
> >> +
> >> + if (connector->ycbcr_420_allowed)
> >> + ret = hdmi_try_format(connector, conn_state, mode, max_bpc,
> >> + HDMI_COLORSPACE_YUV420);
> >
> > I think that's conditioned on a few more things:
>
> I've actually expected this! :-)
>
> You've already raised some points during v1, but I preferred to restart the
> discussion on updated code instead - sorry for taking so long to respin the
> series. In particular, I worked on [1] to improve handling of
> ycbcr_420_allowed flag and fix some consistency issues with
> HDMI_COLORSPACE_YUV420 advertised in drm_bridge->supported_formats. Hence
> I assumed it's now safe to rely exclusively on this flag to indicate the
> connector is YUV420 capable, without doing any additional checks.
>
> > - That the driver supports HDMI 2.0
>
> Probably I'm missing something obvious here, but is this necessary to
> actually double-check ycbcr_420_allowed has been set correctly?
>
> E.g. for bridges with DRM_BRIDGE_OP_HDMI set in drm_bridge->ops, the
> framework does already adjust ycbcr_420_allowed, hence any additional
> verification would be redundant. When not making use of the framework,
> drivers are not expected to set the flag if they are not HDMI 2.0 compliant
> or not supporting YUV420, right? Are there any other use cases we need to
> handle?
That's what I answered Dmitry as well, we can definitely make
ycbcr_420_allowed conditional on HDMI 2.0 support being implemented.
We'd have to check that it's properly set through
drmm_connector_hdmi_init tests too I guess.
> > - That the display is an HDMI output
>
> I think this should be handled by sink_supports_format_bpc() via:
>
> if (!info->is_hdmi &&
> (format != HDMI_COLORSPACE_RGB || bpc != 8)) {
> drm_dbg_kms(dev, "DVI Monitors require an RGB output at 8 bpc\n");
> return false;
> }
Yeah, that makes sense.
> > - That the mode is allowed YUV420 by the sink EDIDs
>
> And that would be handled via the changes introduced by "drm/connector:
> hdmi: Add support for YUV420 format verification".
ACK
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
next prev parent reply other threads:[~2025-03-14 13:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 10:57 [PATCH v2 0/7] drm/connector: hdmi: Allow using the YUV420 output format Cristian Ciocaltea
2025-03-11 10:57 ` [PATCH v2 1/7] drm/connector: hdmi: Evaluate limited range after computing format Cristian Ciocaltea
2025-03-11 19:36 ` Dmitry Baryshkov
2025-03-11 10:57 ` [PATCH v2 2/7] drm/connector: hdmi: Add support for YUV420 format verification Cristian Ciocaltea
2025-03-11 15:30 ` Maxime Ripard
2025-03-11 17:06 ` Cristian Ciocaltea
2025-03-11 10:57 ` [PATCH v2 3/7] drm/connector: hdmi: Improve debug message for supported format Cristian Ciocaltea
2025-03-11 15:31 ` Maxime Ripard
2025-03-11 10:57 ` [PATCH v2 4/7] drm/connector: hdmi: Use YUV420 output format as an RGB fallback Cristian Ciocaltea
2025-03-11 15:55 ` Maxime Ripard
2025-03-11 18:59 ` Cristian Ciocaltea
2025-03-14 13:57 ` Maxime Ripard [this message]
2025-03-11 19:46 ` Dmitry Baryshkov
2025-03-14 13:47 ` Maxime Ripard
2025-03-14 15:00 ` Dmitry Baryshkov
2025-03-11 10:57 ` [PATCH v2 5/7] drm/tests: hdmi: Add macros to simplify EDID setup Cristian Ciocaltea
2025-03-11 16:12 ` Maxime Ripard
2025-03-11 22:44 ` Cristian Ciocaltea
2025-03-19 15:32 ` Maxime Ripard
2025-03-19 21:33 ` Cristian Ciocaltea
2025-03-11 10:57 ` [PATCH v2 6/7] drm/tests: hdmi: Add limited range tests for YUV420 mode Cristian Ciocaltea
2025-03-11 16:17 ` Maxime Ripard
2025-03-11 22:54 ` Cristian Ciocaltea
2025-03-14 13:52 ` Maxime Ripard
2025-03-11 10:57 ` [PATCH v2 7/7] drm/tests: hdmi: Add max TMDS rate fallback " Cristian Ciocaltea
2025-03-12 12:02 ` kernel test robot
2025-03-12 18:14 ` kernel test robot
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=20250314-abstract-brainy-parrot-2a6b93@houat \
--to=mripard@kernel.org \
--cc=airlied@gmail.com \
--cc=cristian.ciocaltea@collabora.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=simona@ffwll.ch \
--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®