All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marius Vlad <marius.vlad@collabora.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org, wse@tuxedocomputers.com,
	andri@yngvason.is, sebastian.wick@redhat.com, mripard@kernel.org,
	daniel.stone@collabora.com, jani.nikula@linux.intel.com,
	tzimmermann@suse.de, simona.vetter@ffwll.ch,
	harry.wentland@amd.com, christian.koenig@amd.com,
	derek.foreman@collabora.com
Subject: Re: [PATCH 3/8] drm: Add new general DRM property "color format"
Date: Thu, 11 Sep 2025 20:15:48 +0300	[thread overview]
Message-ID: <aMMDxIWN9TadgVyw@xpredator> (raw)
In-Reply-To: <ssvxorsrhum2eo2uiieradrrmytemivr6m5c3mskalehzaj4ci@nc74epxgjq5w>

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

On Thu, Sep 11, 2025 at 04:50:59PM +0300, Dmitry Baryshkov wrote:
> On Thu, Sep 11, 2025 at 04:07:34PM +0300, Marius Vlad wrote:
> > From: Andri Yngvason <andri@yngvason.is>
> > 
> > Adds a new general DRM property named "color format" which can be used by
> > userspace to force the display driver output a particular color format.
> > 
> > Possible options are:
> >     - auto (setup by default, driver internally picks the color format)
> >     - rgb
> >     - ycbcr444
> >     - ycbcr422
> >     - ycbcr420
> > 
> > Drivers should advertise from this list the formats which they support.
> > Together with this list and EDID data from the sink we should be able
> > to relay a list of usable color formats to users to pick from.
> 
> It's unclear, who should be combining this data: should it be the kernel
> or the userspace.
Userspace. I've went a bit into why that is in the cover letter. That
was a pain point in the previous versions raised by other folks. Drivers
are free to advertise whatever color formats their HW supports. To
filter what panel/display supports userspace would look at the EDID and do an
intersection with the ones with the driver. This not uncommon, userspace
already looks today at the EDID for color management / HDR purposes. There's
just too much for the kernel to handle and rather than offloading that
to the kernel, people suggested previously to let userspace handle that.
> 
> From my POV deferring this to the userspace doesn't make sense: there
> will be different quirks for monitors / panels, e.g. the EDID wrongly
> advertising YUV or not advertising a knowlingly-working capability.
Yeah, for sure. There have been some folks also raising that and discussing 
that a bit further in previous thread on similar topic:
https://lore.kernel.org/dri-devel/TY4PR01MB14432B688209B2AA416A95228983EA@TY4PR01MB14432.jpnprd01.prod.outlook.com/

Note that people have added quirks into libdisplay-info library to
overcome these limitations. It is far more easier to that into a library
than in the kernel.

I think to some extent 'Auto' can fill up this task. Drivers can perform
these checks on their own, including the ability to look at the EDID data.
Most likely some of them do that today and performs actions based on
that (all the Y420 checks for instance).

> 
> I think that the property should reflect the kernel view on the possible
> formats, which should be updated during get_modes() (or every time EDID
> is being read).
The property advertises the supported color formats by display driver.
Userspace just filters these out based on what the sink supports. This
could just a policy in the compositor / UI.  There's nothing preventing
you to force push from those advertised formats.
> 
> And that's not to mention that there are enough use-cases where the
> connector doesn't have EDID at all.
Totally. But what would be the expectation in that case? Drivers can
still advertise 'Auto' if they'd like.
> 
> > 
> > Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
> > Signed-off-by: Andri Yngvason <andri@yngvason.is>
> > Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
> > ---
> >  drivers/gpu/drm/drm_atomic_helper.c |   5 +
> >  drivers/gpu/drm/drm_atomic_uapi.c   |   4 +
> >  drivers/gpu/drm/drm_connector.c     | 177 ++++++++++++++++++++++++++++
> >  include/drm/drm_connector.h         |  54 ++++++++-
> >  4 files changed, 235 insertions(+), 5 deletions(-)
> > 
> 
> -- 
> With best wishes
> Dmitry

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

  reply	other threads:[~2025-09-11 17:15 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11 13:07 [PATCH v3 0/8] Add new general DRM property "color format" Marius Vlad
2025-09-11 13:07 ` [PATCH 1/8] drm/amd/display: Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A check Marius Vlad
2025-09-11 13:07 ` [PATCH 2/8] hdmi: Add HDMI_COLORSPACE_AUTO enum option Marius Vlad
2025-09-12 15:17   ` Maxime Ripard
2025-09-12 18:39     ` Marius Vlad
2025-09-17 14:42       ` Maxime Ripard
2025-09-11 13:07 ` [PATCH 3/8] drm: Add new general DRM property "color format" Marius Vlad
2025-09-11 13:50   ` Dmitry Baryshkov
2025-09-11 17:15     ` Marius Vlad [this message]
2025-09-15  0:57       ` Dmitry Baryshkov
2025-09-15 10:33         ` Daniel Stone
2025-09-15 10:46           ` Dmitry Baryshkov
2025-09-16 11:04             ` Daniel Stone
2025-09-16  8:29           ` Maxime Ripard
2025-09-16 10:46             ` Daniel Stone
2025-09-16 10:48               ` Daniel Stone
2025-09-16 10:57                 ` Dmitry Baryshkov
2025-09-16 11:11                   ` Daniel Stone
2025-09-16 11:15                     ` Dmitry Baryshkov
2025-09-16 11:35                       ` Daniel Stone
2025-09-16 16:13                         ` Dmitry Baryshkov
2025-09-11 13:07 ` [PATCH 4/8] drm: Add enum conversion from/to HDMI_COLORSPACE to DRM_COLOR_FORMAT Marius Vlad
2025-09-12 15:19   ` Maxime Ripard
2025-09-26 14:50     ` Cristian Ciocaltea
2025-09-30 11:40       ` Maxime Ripard
2025-09-11 13:07 ` [PATCH 5/8] drm: Pass supported color formats straight onto drm_bridge Marius Vlad
2025-09-11 13:55   ` Dmitry Baryshkov
2025-09-11 17:34     ` Marius Vlad
2025-09-12 15:31       ` Maxime Ripard
2025-09-12 18:57         ` Marius Vlad
2025-09-12 21:17           ` Dmitry Baryshkov
2025-09-12 15:33   ` Maxime Ripard
2025-09-12 19:09     ` Marius Vlad
2025-09-15  0:59       ` Dmitry Baryshkov
2025-09-11 13:07 ` [PATCH 6/8] drm/i915: Implement the "color format" DRM property Marius Vlad
2025-09-11 13:07 ` [PATCH 7/8] drm/amdgpu: Implement " Marius Vlad
2025-09-11 13:07 ` [PATCH 8/8] drm/rockchip: " Marius Vlad
2025-09-26 17:58   ` Cristian Ciocaltea

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=aMMDxIWN9TadgVyw@xpredator \
    --to=marius.vlad@collabora.com \
    --cc=andri@yngvason.is \
    --cc=christian.koenig@amd.com \
    --cc=daniel.stone@collabora.com \
    --cc=derek.foreman@collabora.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sebastian.wick@redhat.com \
    --cc=simona.vetter@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=wse@tuxedocomputers.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.