All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shankar, Uma" <uma.shankar@intel.com>
To: "sebastian@sebastianwick.net" <sebastian@sebastianwick.net>,
	"Harry Wentland" <harry.wentland@amd.com>
Cc: Brian Starkey <brian.starkey@arm.com>,
	"Sharma, Shashank" <shashank.sharma@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"ppaalanen@gmail.com" <ppaalanen@gmail.com>,
	"mcasas@google.com" <mcasas@google.com>,
	"jshargo@google.com" <jshargo@google.com>,
	"Deepak.Sharma@amd.com" <Deepak.Sharma@amd.com>,
	"Shirish.S@amd.com" <Shirish.S@amd.com>,
	"Vitaly.Prosyak@amd.com" <Vitaly.Prosyak@amd.com>,
	"aric.cyr@amd.com" <aric.cyr@amd.com>,
	"Bhawanpreet.Lakha@amd.com" <Bhawanpreet.Lakha@amd.com>,
	"Krunoslav.Kovac@amd.com" <Krunoslav.Kovac@amd.com>,
	"hersenxs.wu@amd.com" <hersenxs.wu@amd.com>,
	"Nicholas.Kazlauskas@amd.com" <Nicholas.Kazlauskas@amd.com>,
	"laurentiu.palcu@oss.nxp.com" <laurentiu.palcu@oss.nxp.com>,
	"ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"nd@arm.com" <nd@arm.com>
Subject: RE: [RFC PATCH v3 1/6] drm/doc: Color Management and HDR10 RFC
Date: Mon, 6 Sep 2021 21:20:38 +0000	[thread overview]
Message-ID: <caa90157957445828ecfe2f609f3bfcf@intel.com> (raw)
In-Reply-To: <a2fc2bd00af431a4f6e3842c6db072a2@sebastianwick.net>



> -----Original Message-----
> From: sebastian@sebastianwick.net <sebastian@sebastianwick.net>
> Sent: Monday, August 16, 2021 7:07 PM
> To: Harry Wentland <harry.wentland@amd.com>
> Cc: Brian Starkey <brian.starkey@arm.com>; Sharma, Shashank
> <shashank.sharma@amd.com>; amd-gfx@lists.freedesktop.org; dri-
> devel@lists.freedesktop.org; ppaalanen@gmail.com; mcasas@google.com;
> jshargo@google.com; Deepak.Sharma@amd.com; Shirish.S@amd.com;
> Vitaly.Prosyak@amd.com; aric.cyr@amd.com; Bhawanpreet.Lakha@amd.com;
> Krunoslav.Kovac@amd.com; hersenxs.wu@amd.com;
> Nicholas.Kazlauskas@amd.com; laurentiu.palcu@oss.nxp.com;
> ville.syrjala@linux.intel.com; nd@arm.com; Shankar, Uma
> <uma.shankar@intel.com>
> Subject: Re: [RFC PATCH v3 1/6] drm/doc: Color Management and HDR10 RFC
> 
> On 2021-08-16 14:40, Harry Wentland wrote:
> > On 2021-08-16 7:10 a.m., Brian Starkey wrote:
> >> On Fri, Aug 13, 2021 at 10:42:12AM +0530, Sharma, Shashank wrote:
> >>> Hello Brian,
> >>> (+Uma in cc)
> >>>

Thanks Shashank for cc'ing me. Apologies for being late here. Now seems
all stakeholders are back so we can resume the UAPI discussion on color.

> >>> Thanks for your comments, Let me try to fill-in for Harry to keep
> >>> the design discussion going. Please find my comments inline.
> >>>
> >
> > Thanks, Shashank. I'm back at work now. Had to cut my trip short due
> > to rising Covid cases and concern for my kids.
> >
> >>> On 8/2/2021 10:00 PM, Brian Starkey wrote:
> >>>>
> >>
> >> -- snip --
> >>
> >>>>
> >>>> Android doesn't blend in linear space, so any API shouldn't be
> >>>> built around an assumption of linear blending.
> >>>>
> >
> > This seems incorrect but I guess ultimately the OS is in control of
> > this. If we want to allow blending in non-linear space with the new
> > API we would either need to describe the blending space or the
> > pre/post-blending gamma/de-gamma.
> >
> > Any idea if this blending behavior in Android might get changed in the
> > future?
> 
> There is lots of software which blends in sRGB space and designers adjusted to the
> incorrect blending in a way that the result looks right.
> Blending in linear space would result in incorrectly looking images.
> 

I feel we should just leave it to userspace to decide rather than forcing linear or non
Linear blending in driver.

> >>>
> >>> If I am not wrong, we still need linear buffers for accurate Gamut
> >>> transformation (SRGB -> BT2020 or other way around) isn't it ?
> >>
> >> Yeah, you need to transform the buffer to linear for color gamut
> >> conversions, but then back to non-linear (probably sRGB or gamma 2.2)
> >> for actual blending.
> >>
> >> This is why I'd like to have the per-plane "OETF/GAMMA" separate from
> >> tone-mapping, so that the composition transfer function is
> >> independent.
> >>
> >>>
> >>
> >> ...
> >>
> >>>>> +
> >>>>> +Tonemapping in this case could be a simple nits value or `EDR`_
> >>>>> +to
> >>>>> describe
> >>>>> +how to scale the :ref:`SDR luminance`.
> >>>>> +
> >>>>> +Tonemapping could also include the ability to use a 3D LUT which
> >>>>> might be
> >>>>> +accompanied by a 1D shaper LUT. The shaper LUT is required in
> >>>>> order to
> >>>>> +ensure a 3D LUT with limited entries (e.g. 9x9x9, or 17x17x17)
> >>>>> operates
> >>>>> +in perceptual (non-linear) space, so as to evenly spread the
> >>>>> limited
> >>>>> +entries evenly across the perceived space.
> >>>>
> >>>> Some terminology care may be needed here - up until this point, I
> >>>> think you've been talking about "tonemapping" being luminance
> >>>> adjustment, whereas I'd expect 3D LUTs to be used for gamut
> >>>> adjustment.
> >>>>
> >>>
> >>> IMO, what harry wants to say here is that, which HW block gets
> >>> picked and how tone mapping is achieved can be a very driver/HW
> >>> specific thing, where one driver can use a 1D/Fixed function block,
> >>> whereas another one can choose more complex HW like a 3D LUT for the
> >>> same.
> >>>
> >>> DRM layer needs to define only the property to hook the API with
> >>> core driver, and the driver can decide which HW to pick and
> >>> configure for the activity. So when we have a tonemapping property,
> >>> we might not have a separate 3D-LUT property, or the driver may fail
> >>> the atomic_check() if both of them are programmed for different
> >>> usages.
> >>
> >> I still think that directly exposing the HW blocks and their
> >> capabilities is the right approach, rather than a "magic" tonemapping
> >> property.
> >>
> >> Yes, userspace would need to have a good understanding of how to use
> >> that hardware, but if the pipeline model is standardised that's the
> >> kind of thing a cross-vendor library could handle.
> >>
> >
> > One problem with cross-vendor libraries is that they might struggle to
> > really be cross-vendor when it comes to unique HW behavior. Or they
> > might pick sub-optimal configurations as they're not aware of the
> > power impact of a configuration. What's an optimal configuration might
> > differ greatly between different HW.
> >
> > We're seeing this problem with "universal" planes as well.
> 
> I'm repeating what has been said before but apparently it has to be said
> again: if a property can't be replicated exactly in a shader the property is useless. If
> your hardware is so unique that it can't give us the exact formula we expect you
> cannot expose the property.
> 
> Maybe my view on power consumption is simplistic but I would expect enum < 1d lut
> < 3d lut < shader. Is there more to it?
> 
> Either way if the fixed KMS pixel pipeline is not sufficient to expose the intricacies of
> real hardware the right move would be to make the KMS pixel pipeline more
> dynamic, expose more hardware specifics and create a hardware specific user space
> like mesa. Moving the whole compositing with all its policies and decision making
> into the kernel is exactly the wrong way to go.
> 

I agree here, we can give flexibility to userspace to decide how it wants to use the hardware
blocks. So exposing the hardware capability to userspace and then servicing on its behalf would be
the right way to go for driver I believe. Any compositor or userspace can define its own policy and
drive the hardware.

We already have done that with crtc level color properties. We can do the same for plane color. HDR
will be just be an extension that way.

> Laurent Pinchart put this very well:
> https://lists.freedesktop.org/archives/dri-devel/2021-June/311689.html
> 
> >> It would definitely be good to get some compositor opinions here.
> >>
> >
> > For this we'll probably have to wait for Pekka's input when he's back
> > from his vacation.
> >
Yeah, Pekka's input would be really useful here.

We can work together Harry to come up with unified UAPI's which caters to general purpose color hardware
pipeline. Just floated a RFC series with a UAPI proposal, link below:
https://patchwork.freedesktop.org/series/90826/

Please check and share your feedback.

Regards,
Uma Shankar
> >> Cheers,
> >> -Brian
> >>

  reply	other threads:[~2021-09-06 21:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 20:41 [RFC PATCH v3 0/6] A drm_plane API to support HDR planes Harry Wentland
2021-07-30 20:41 ` [RFC PATCH v3 1/6] drm/doc: Color Management and HDR10 RFC Harry Wentland
2021-08-02 16:30   ` Brian Starkey
2021-08-13  5:12     ` Sharma, Shashank
2021-08-16 11:10       ` Brian Starkey
2021-08-16 12:40         ` Harry Wentland
2021-08-16 13:37           ` sebastian
2021-09-06 21:20             ` Shankar, Uma [this message]
2021-09-15 14:36             ` Pekka Paalanen
2021-09-21  1:55               ` Harry Wentland
2021-09-15 14:01   ` Pekka Paalanen
2021-09-15 15:50     ` Jeremy Cline
2021-09-21  0:14     ` Harry Wentland
2021-09-21 13:31       ` Pekka Paalanen
2021-09-21 18:05         ` Harry Wentland
2021-09-22  8:31           ` Pekka Paalanen
2021-09-22 15:28             ` Harry Wentland
2021-09-23  7:43               ` Pekka Paalanen
2021-09-30 13:04                 ` Repository for additional color and HDR related documentation (Re: [RFC PATCH v3 1/6] drm/doc: Color Management and HDR10 RFC) Pekka Paalanen
2021-09-22 15:06       ` [RFC PATCH v3 1/6] drm/doc: Color Management and HDR10 RFC Harry Wentland
2021-09-23  8:01         ` Pekka Paalanen
2021-09-23 13:40           ` Harry Wentland
2021-09-23 15:50             ` Vitaly Prosyak
2021-07-30 20:41 ` [RFC PATCH v3 2/6] drm/color: Add transfer functions for HDR/SDR on drm_plane Harry Wentland
2021-07-30 23:33   ` kernel test robot
2021-07-31  1:18   ` kernel test robot
2021-07-31  1:18   ` [RFC PATCH] drm/color: drm_get_transfer_function_name() can be static kernel test robot
2021-07-31  1:31   ` [RFC PATCH v3 2/6] drm/color: Add transfer functions for HDR/SDR on drm_plane kernel test robot
2021-07-30 20:41 ` [RFC PATCH v3 3/6] drm/color: Add output transfer function to crtc Harry Wentland
2021-07-31  2:13   ` kernel test robot
2021-07-31  3:42   ` kernel test robot
2021-07-30 20:41 ` [RFC PATCH v3 4/6] drm/color: Add sdr boost property Harry Wentland
2021-07-31  0:42   ` kernel test robot
2021-07-31  2:13   ` kernel test robot
2021-07-30 20:41 ` [RFC PATCH v3 5/6] drm/color: Add color space plane property Harry Wentland
2021-07-31  3:47   ` kernel test robot
2021-07-31  3:47   ` [RFC PATCH] drm/color: drm_get_color_space_name() can be static kernel test robot
2021-07-30 20:41 ` [RFC PATCH v3 6/6] drm/amd/display: reformat YCbCr-RGB conversion matrix Harry Wentland

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=caa90157957445828ecfe2f609f3bfcf@intel.com \
    --to=uma.shankar@intel.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Deepak.Sharma@amd.com \
    --cc=Krunoslav.Kovac@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=Shirish.S@amd.com \
    --cc=Vitaly.Prosyak@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aric.cyr@amd.com \
    --cc=brian.starkey@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=hersenxs.wu@amd.com \
    --cc=jshargo@google.com \
    --cc=laurentiu.palcu@oss.nxp.com \
    --cc=mcasas@google.com \
    --cc=nd@arm.com \
    --cc=ppaalanen@gmail.com \
    --cc=sebastian@sebastianwick.net \
    --cc=shashank.sharma@amd.com \
    --cc=ville.syrjala@linux.intel.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.