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 2/7] drm/connector: hdmi: Add support for YUV420 format verification
Date: Tue, 11 Mar 2025 16:30:13 +0100 [thread overview]
Message-ID: <20250311-spectral-utopian-poodle-4feadb@houat> (raw)
In-Reply-To: <20250311-hdmi-conn-yuv-v2-2-fbdb94f02562@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 2482 bytes --]
On Tue, Mar 11, 2025 at 12:57:34PM +0200, Cristian Ciocaltea wrote:
> Provide the necessary constraints verification in
> sink_supports_format_bpc() in order to support handling of YUV420
> output format.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> drivers/gpu/drm/display/drm_hdmi_state_helper.c | 40 +++++++++++++++++++++++--
> 1 file changed, 37 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 6bc96d5d1ab9115989e208d9899e16cd22254fb6..e99d868edc1854eddc5ebf8692ccffb9e2338268 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -3,6 +3,7 @@
> #include <drm/drm_atomic.h>
> #include <drm/drm_connector.h>
> #include <drm/drm_edid.h>
> +#include <drm/drm_modes.h>
> #include <drm/drm_print.h>
>
> #include <drm/display/drm_hdmi_audio_helper.h>
> @@ -115,6 +116,12 @@ sink_supports_format_bpc(const struct drm_connector *connector,
> return false;
> }
>
> + if (drm_mode_is_420_only(info, mode) && format != HDMI_COLORSPACE_YUV420) {
> + drm_dbg_kms(dev, "%s format unsupported by the sink for VIC%u.\n",
> + drm_hdmi_connector_get_output_format_name(format), vic);
We don't necessarily have a VIC for the mode we pass, so it's not super
useful to pass it. I'd rather mention that the mode is supposed to be
YUV420 only, but the format isn't YUV420.
> + return false;
> + }
> +
> switch (format) {
> case HDMI_COLORSPACE_RGB:
> drm_dbg_kms(dev, "RGB Format, checking the constraints.\n");
> @@ -145,9 +152,36 @@ sink_supports_format_bpc(const struct drm_connector *connector,
> return true;
>
> case HDMI_COLORSPACE_YUV420:
> - /* TODO: YUV420 is unsupported at the moment. */
> - drm_dbg_kms(dev, "YUV420 format isn't supported yet.\n");
> - return false;
> + drm_dbg_kms(dev, "YUV420 format, checking the constraints.\n");
> +
> + if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR420)) {
> + drm_dbg_kms(dev, "Sink doesn't support YUV420.\n");
> + return false;
> + }
> +
> + if (!drm_mode_is_420(info, mode)) {
> + drm_dbg_kms(dev, "Sink doesn't support YUV420 for VIC%u.\n", vic);
Again, we shouldn't print the VIC here. There's a printk format we can
use to print drm_display_mode if you want to, but we should keep things
consistent.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-03-11 15:30 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 [this message]
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
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=20250311-spectral-utopian-poodle-4feadb@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®