All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: "Sebastian Wick" <sebastian.wick@redhat.com>,
	"Michel Dänzer" <michel.daenzer@mailbox.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Jonas Ådahl" <jadahl@redhat.com>,
	"Vitaly Prosyak" <vitaly.prosyak@amd.com>
Subject: How should "max bpc" and "Colorspace" KMS property work?
Date: Wed, 1 Jun 2022 10:21:26 +0300	[thread overview]
Message-ID: <20220601102126.4f3602fd@eldfell> (raw)
In-Reply-To: <YpZSWwVkhJOalM4M@intel.com>

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

On Tue, 31 May 2022 20:37:31 +0300
Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:

> On Wed, May 25, 2022 at 01:36:47PM +0300, Pekka Paalanen wrote:
> > On Wed, 25 May 2022 09:23:51 +0000
> > Simon Ser <contact@emersion.fr> wrote:
> >   
> > > On Wednesday, May 25th, 2022 at 10:35, Michel Dänzer <michel.daenzer@mailbox.org> wrote:
> > >   
> > > > > Mind that "max bpc" is always in auto. It's only an upper limit, with
> > > > > the assumption that the driver can choose less.    
> > > >
> > > > It seems to me like the "max bpc" property is just kind of bad API,
> > > > and trying to tweak it to cater to more use cases as we discover them
> > > > will take us down a rabbit hole. It seems better to replace it with
> > > > new properties which allow user space to determine the current
> > > > effective bpc and to explicitly control it.    
> > > 
> > > +1, this sounds much more robust, and allows better control by user-space.
> > > User-space needs to have fallback logic for other state as well anyways.
> > > If the combinatorial explosion is too much, we should think about optimizing
> > > the KMS implementation, or improve the uAPI.  
> > 
> > +1 as well, with some recommendations added and the running off to the
> > sunset:
> > 
> > Use two separate KMS properties for reporting current vs.
> > programming desired. The KMS property reporting the current value
> > must be read-only (immutable). This preserves the difference between
> > what userspace wanted and what it got, making it possible to read
> > back both without confusing them. It also allows preserving driver behaviour  
> 
> I don't see much real point in a property to report the current bpc.
> That can't be used to do anything atomically. So I suppose plymouth
> would be the only user.

Hi Ville,

I think also professional color managed display servers would need it.

If they detect that the link bpc is no longer the same as it was when
the monitor was profiled, the profile will need to be re-verified by
measuring the monitor again.

See "Color calibration auditing system" notes in
https://gitlab.freedesktop.org/wayland/weston/-/issues/467 description.

> So IMO if someone really need explicit control over this then we 
> should just expose properties to set things explicitly. So we'd
> need at least props for the actual bpc and some kind of color 
> encoding property (RGB/YCbCr 4:4:4/4:2:2:/4:2:0, etc.). And someone
> would really need to figure out how DSC would interact with those.

I believe there still must be "auto" setting for bpc, and a separate
feedback property, so that userspace can use "auto" to see what it can
get without doing thousands of TEST_ONLY commits plus a few "link
status" failure handlings in order to find a working configuration (I'm
assuming we have many more properties than just "max bpc" to figure
out). After "auto" has told userspace what actually works without blind
trial and error, then userspace can program than value explicitly to
make sure it doesn't change accidentally in the future.

What's DSC?

Now that you mentioned some kind of color encoding property (I assume
you referred mostly to the sub-sampling aspect), how does the connector
property "Colorspace" factor in?

The enum values (which are not documented in KMS docs, btw.) are tuples
of color space + color model, e.g. on Intel:

"Colorspace": enum {Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601,
XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB,
BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater}

Reading the KMS docs from
https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
they say:

> Basically the expectation from userspace is:
> 
>         Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink
> colorspace
> 
>         Set this new property to let the sink know what it converted
> the CRTC output to.
> 
>         This property is just to inform sink what colorspace source
> is trying to drive. 

However, where does userspace program the actual conversion from RGB to
NNN? Is it expected to be embedded in CTM?

Or does setting "Colorspace" imply some additional automatic
conversion? If so, where does it happen and how is it chosen?

> For just the plymouth case I guess the easiest thing would be to
> just clamp "max bpc" to the current value. The problem with that
> is that we'd potentially break existing userspace. Eg. I don't think
> the modesetting ddx or perhaps even most of the wayland compositors
> set "max bpc" at all. So we'd need to roll out a bunch of userspace
> updates first. And the "current bpc" prop idea would also have this
> same problem since plymouth would just clamp "max bpc" based on the
> current bpc before the real userspace starts.

True, but I believe once color management spreads through Wayland, so
will KMS clients also learn to set it.

Besides, any KMS client that does not set absolutely all KMS properties
will be at the mercy of any other KMS client they temporarily switch
with. So every KMS client should learn to program all possible KMS
properties anyway.


Thanks,
pq

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

  reply	other threads:[~2022-06-01  7:21 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26  8:35 How should "max bpc" KMS property work? Pekka Paalanen
2022-04-26 17:55 ` Ville Syrjälä
2022-04-27 10:52   ` Pekka Paalanen
2022-04-27 15:02     ` Michel Dänzer
2022-04-27 15:41     ` Harry Wentland
2022-04-27 21:29       ` Sebastian Wick
2022-04-28  7:50         ` Pekka Paalanen
2022-04-28  7:52           ` Simon Ser
2022-04-28 14:50             ` Ville Syrjälä
2022-04-28 19:00               ` Sebastian Wick
2022-05-20 15:20   ` Hans de Goede
2022-05-23  8:22     ` Pekka Paalanen
2022-05-23 11:54       ` Sebastian Wick
2022-05-24  9:36         ` Hans de Goede
2022-05-24 15:43           ` Ville Syrjälä
2022-05-24 22:03             ` Alex Deucher
2022-05-25  6:04               ` Simon Ser
2022-05-25  7:17                 ` Pekka Paalanen
2022-05-25  8:42               ` Michel Dänzer
2022-05-25  7:28         ` Pekka Paalanen
2022-05-25  8:35           ` Michel Dänzer
2022-05-25  9:23             ` Simon Ser
2022-05-25 10:36               ` Pekka Paalanen
2022-05-30 10:21                 ` Jani Nikula
2022-05-31 17:37                 ` Ville Syrjälä
2022-06-01  7:21                   ` Pekka Paalanen [this message]
2022-06-01  7:26                     ` How should "max bpc" and "Colorspace" " Simon Ser
2022-06-01 14:06                     ` Ville Syrjälä
2022-06-01 22:25                       ` Sebastian Wick
2022-06-02  7:47                       ` Pekka Paalanen
2022-06-02 16:40                         ` Ville Syrjälä
2022-06-02 17:08                           ` Sebastian Wick
2022-06-02 17:20                             ` Ville Syrjälä
2022-06-03  7:19                           ` Pekka Paalanen
2022-06-03 16:27                             ` Ville Syrjälä
2022-04-26 19:38 ` How should "max bpc" " Alex Deucher
2022-04-26 19:55   ` Ville Syrjälä

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=20220601102126.4f3602fd@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=jadahl@redhat.com \
    --cc=michel.daenzer@mailbox.org \
    --cc=sebastian.wick@redhat.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=vitaly.prosyak@amd.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.