mbox series

[v7,00/16] Add Plane Color Properties

Message ID 1553804174-2651-1-git-send-email-uma.shankar@intel.com (mailing list archive)
Headers show
Series Add Plane Color Properties | expand

Message

Shankar, Uma March 28, 2019, 8:15 p.m. UTC
This is how a typical display color hardware pipeline looks like:
 +-------------------------------------------+
 |                RAM                        |
 |  +------+    +---------+    +---------+   |
 |  | FB 1 |    |  FB 2   |    | FB N    |   |
 |  +------+    +---------+    +---------+   |
 +-------------------------------------------+
       |  Plane Color Hardware Block |
 +--------------------------------------------+
 | +---v-----+   +---v-------+   +---v------+ |
 | | Plane A |   | Plane B   |   | Plane N  | |
 | | DeGamma |   | Degamma   |   | Degamma  | |
 | +---+-----+   +---+-------+   +---+------+ |
 |     |             |               |        |
 | +---v-----+   +---v-------+   +---v------+ |
 | |Plane A  |   | Plane B   |   | Plane N  | |
 | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
 | +---+-----+   +----+------+   +----+-----+ |
 |     |              |               |       |
 | +---v-----+   +----v------+   +----v-----+ |
 | | Plane A |   | Plane B   |   | Plane N  | |
 | | Gamma   |   | Gamma     |   | Gamma    | |
 | +---+-----+   +----+------+   +----+-----+ |
 |     |              |               |       |
 +--------------------------------------------+
+------v--------------v---------------v-------|
||                                           ||
||           Pipe Blender                    ||
+--------------------+------------------------+
|                    |                        |
|        +-----------v----------+             |
|        |  Pipe DeGamma        |             |
|        |                      |             |
|        +-----------+----------+             |
|                    |            Pipe Color  |
|        +-----------v----------+ Hardware    |
|        |  Pipe CSC/CTM        |             |
|        |                      |             |
|        +-----------+----------+             |
|                    |                        |
|        +-----------v----------+             |
|        |  Pipe Gamma          |             |
|        |                      |             |
|        +-----------+----------+             |
|                    |                        |
+---------------------------------------------+
                     |
                     v
               Pipe Output

This patch series adds properties for plane color features. It adds
properties for degamma used to linearize data, CSC used for gamut
conversion, and gamma used to again non-linearize data as per panel
supported color space. These can be utilize by user space to convert
planes from one format to another, one color space to another etc.

Usersapce can take smart blending decisions and utilize these hardware
supported plane color features to get accurate color profile. The same
can help in consistent color quality from source to panel taking
advantage of advanced color features in hardware.

These patches just add the property interfaces and enable helper
functions.

This series adds Intel Gen9 specific plane gamma feature. We can
build up and add other platform/hardware specific implementation
on top of this series

Note: This is just to get a design feedback whether these interfaces
look ok. Based on community feedback on interfaces, we will implement
IGT tests to validate plane color features. This is un-tested currently.

Userspace implementation using these properties have been done in drm
hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-Cosmin.Gheorghe@arm.com"
from ARM. A merge request has been opened by Alexandru for drm_hwcomposer,
implementing the property changes for the same. Please review that as well:
https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_requests/25

v2: Dropped legacy gamma table for plane as suggested by Maarten. Added
Gen9/BDW plane gamma feature and rebase on tot.

v3: Added a new drm_color_lut_ext structure to accommodate 32 bit precision
entries, pointed to by Brian, Starkey for HDR usecases. Addressed Sean,Paul
comments and moved plane color properties to drm_plane instead of
mode_config. Added property documentation as suggested by Daniel, Vetter.
Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.

v4: Rebase

v5: Added "Display Color Hardware Pipeline" flow to kernel
documentation as suggested by "Ville Syrjala" and "Brian Starkey".
Moved the property creation to drm_color_mgmt.c file to consolidate
all color operations at one place. Addressed Alexandru's review comments.

v6: Rebase. Added support for ICL Color features. Enhanced Lut precision to
accept input values in u32.32 format. This is needed for higher precision
required in HDR data processing.

v7: Fixed Lut roundup and extraction function in patch 1 and address
definitions for Degamma index in patch 10. Rest of the patches are just
rebased.

Uma Shankar (16):
  drm: Add Enhanced Gamma LUT precision structure
  drm: Add Plane Degamma properties
  drm: Add Plane CTM property
  drm: Add Plane Gamma properties
  drm: Define helper function for plane color enabling
  drm/i915: Enable plane color features
  drm/i915: Implement Plane Gamma for Bdw and Gen9 platforms
  drm/i915: Load plane color luts from atomic flip
  drm/i915: Add plane color capabilities
  drm/i915/icl: Add ICL Plane Degamma Register definition
  drm/i915/icl: Enable Plane Degamma
  drm/i915/icl: Add Plane Gamma Register Definitions
  drm/i915/icl: Implement Plane Gamma
  drm/i915: Enable Plane Gamma/Degamma
  drm/i915: Define Plane CSC Registers
  drm/i915: Enable Plane CSC

 Documentation/gpu/drm-kms.rst             |  99 +++++++++
 drivers/gpu/drm/drm_atomic.c              |   1 +
 drivers/gpu/drm/drm_atomic_state_helper.c |  12 ++
 drivers/gpu/drm/drm_atomic_uapi.c         |  29 +++
 drivers/gpu/drm/drm_color_mgmt.c          | 138 ++++++++++++-
 drivers/gpu/drm/i915/i915_drv.h           |   6 +
 drivers/gpu/drm/i915/i915_pci.c           |   5 +-
 drivers/gpu/drm/i915/i915_reg.h           | 153 ++++++++++++++
 drivers/gpu/drm/i915/intel_atomic_plane.c |   3 +
 drivers/gpu/drm/i915/intel_color.c        | 331 ++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_device_info.h  |   5 +
 drivers/gpu/drm/i915/intel_display.c      |  13 +-
 drivers/gpu/drm/i915/intel_drv.h          |  11 +
 drivers/gpu/drm/i915/intel_sprite.c       |  11 +
 include/drm/drm_color_mgmt.h              |   6 +
 include/drm/drm_plane.h                   |  61 ++++++
 include/uapi/drm/drm_mode.h               |  15 ++
 17 files changed, 894 insertions(+), 5 deletions(-)

Comments

Ezequiel Garcia June 14, 2019, 4:17 p.m. UTC | #1
On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com> wrote:
>
> This is how a typical display color hardware pipeline looks like:
>  +-------------------------------------------+
>  |                RAM                        |
>  |  +------+    +---------+    +---------+   |
>  |  | FB 1 |    |  FB 2   |    | FB N    |   |
>  |  +------+    +---------+    +---------+   |
>  +-------------------------------------------+
>        |  Plane Color Hardware Block |
>  +--------------------------------------------+
>  | +---v-----+   +---v-------+   +---v------+ |
>  | | Plane A |   | Plane B   |   | Plane N  | |
>  | | DeGamma |   | Degamma   |   | Degamma  | |
>  | +---+-----+   +---+-------+   +---+------+ |
>  |     |             |               |        |
>  | +---v-----+   +---v-------+   +---v------+ |
>  | |Plane A  |   | Plane B   |   | Plane N  | |
>  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
>  | +---+-----+   +----+------+   +----+-----+ |
>  |     |              |               |       |
>  | +---v-----+   +----v------+   +----v-----+ |
>  | | Plane A |   | Plane B   |   | Plane N  | |
>  | | Gamma   |   | Gamma     |   | Gamma    | |
>  | +---+-----+   +----+------+   +----+-----+ |
>  |     |              |               |       |
>  +--------------------------------------------+
> +------v--------------v---------------v-------|
> ||                                           ||
> ||           Pipe Blender                    ||
> +--------------------+------------------------+
> |                    |                        |
> |        +-----------v----------+             |
> |        |  Pipe DeGamma        |             |
> |        |                      |             |
> |        +-----------+----------+             |
> |                    |            Pipe Color  |
> |        +-----------v----------+ Hardware    |
> |        |  Pipe CSC/CTM        |             |
> |        |                      |             |
> |        +-----------+----------+             |
> |                    |                        |
> |        +-----------v----------+             |
> |        |  Pipe Gamma          |             |
> |        |                      |             |
> |        +-----------+----------+             |
> |                    |                        |
> +---------------------------------------------+
>                      |
>                      v
>                Pipe Output
>
> This patch series adds properties for plane color features. It adds
> properties for degamma used to linearize data, CSC used for gamut
> conversion, and gamma used to again non-linearize data as per panel
> supported color space. These can be utilize by user space to convert
> planes from one format to another, one color space to another etc.
>
> Usersapce can take smart blending decisions and utilize these hardware
> supported plane color features to get accurate color profile. The same
> can help in consistent color quality from source to panel taking
> advantage of advanced color features in hardware.
>
> These patches just add the property interfaces and enable helper
> functions.
>
> This series adds Intel Gen9 specific plane gamma feature. We can
> build up and add other platform/hardware specific implementation
> on top of this series
>
> Note: This is just to get a design feedback whether these interfaces
> look ok. Based on community feedback on interfaces, we will implement
> IGT tests to validate plane color features. This is un-tested currently.
>
> Userspace implementation using these properties have been done in drm
> hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-Cosmin.Gheorghe@arm.com"
> from ARM. A merge request has been opened by Alexandru for drm_hwcomposer,
> implementing the property changes for the same. Please review that as well:
> https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_requests/25
>
> v2: Dropped legacy gamma table for plane as suggested by Maarten. Added
> Gen9/BDW plane gamma feature and rebase on tot.
>
> v3: Added a new drm_color_lut_ext structure to accommodate 32 bit precision
> entries, pointed to by Brian, Starkey for HDR usecases. Addressed Sean,Paul
> comments and moved plane color properties to drm_plane instead of
> mode_config. Added property documentation as suggested by Daniel, Vetter.
> Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
>
> v4: Rebase
>
> v5: Added "Display Color Hardware Pipeline" flow to kernel
> documentation as suggested by "Ville Syrjala" and "Brian Starkey".
> Moved the property creation to drm_color_mgmt.c file to consolidate
> all color operations at one place. Addressed Alexandru's review comments.
>
> v6: Rebase. Added support for ICL Color features. Enhanced Lut precision to
> accept input values in u32.32 format. This is needed for higher precision
> required in HDR data processing.
>
> v7: Fixed Lut roundup and extraction function in patch 1 and address
> definitions for Degamma index in patch 10. Rest of the patches are just
> rebased.
>

I can't find any comments on this one.

What's the status of this?

Thanks,
Eze
Ezequiel Garcia June 14, 2019, 9:22 p.m. UTC | #2
(+ Boris, + Sean)

On Fri, 2019-06-14 at 13:17 -0300, Ezequiel Garcia wrote:
> On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com> wrote:
> > This is how a typical display color hardware pipeline looks like:
> >  +-------------------------------------------+
> >  |                RAM                        |
> >  |  +------+    +---------+    +---------+   |
> >  |  | FB 1 |    |  FB 2   |    | FB N    |   |
> >  |  +------+    +---------+    +---------+   |
> >  +-------------------------------------------+
> >        |  Plane Color Hardware Block |
> >  +--------------------------------------------+
> >  | +---v-----+   +---v-------+   +---v------+ |
> >  | | Plane A |   | Plane B   |   | Plane N  | |
> >  | | DeGamma |   | Degamma   |   | Degamma  | |
> >  | +---+-----+   +---+-------+   +---+------+ |
> >  |     |             |               |        |
> >  | +---v-----+   +---v-------+   +---v------+ |
> >  | |Plane A  |   | Plane B   |   | Plane N  | |
> >  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
> >  | +---+-----+   +----+------+   +----+-----+ |
> >  |     |              |               |       |
> >  | +---v-----+   +----v------+   +----v-----+ |
> >  | | Plane A |   | Plane B   |   | Plane N  | |
> >  | | Gamma   |   | Gamma     |   | Gamma    | |
> >  | +---+-----+   +----+------+   +----+-----+ |
> >  |     |              |               |       |
> >  +--------------------------------------------+
> > +------v--------------v---------------v-------|
> > > >                                           ||
> > > >           Pipe Blender                    ||
> > +--------------------+------------------------+
> > >                    |                        |
> > >        +-----------v----------+             |
> > >        |  Pipe DeGamma        |             |
> > >        |                      |             |
> > >        +-----------+----------+             |
> > >                    |            Pipe Color  |
> > >        +-----------v----------+ Hardware    |
> > >        |  Pipe CSC/CTM        |             |
> > >        |                      |             |
> > >        +-----------+----------+             |
> > >                    |                        |
> > >        +-----------v----------+             |
> > >        |  Pipe Gamma          |             |
> > >        |                      |             |
> > >        +-----------+----------+             |
> > >                    |                        |
> > +---------------------------------------------+
> >                      |
> >                      v
> >                Pipe Output
> > 
> > This patch series adds properties for plane color features. It adds
> > properties for degamma used to linearize data, CSC used for gamut
> > conversion, and gamma used to again non-linearize data as per panel
> > supported color space. These can be utilize by user space to convert
> > planes from one format to another, one color space to another etc.
> > 
> > Usersapce can take smart blending decisions and utilize these hardware
> > supported plane color features to get accurate color profile. The same
> > can help in consistent color quality from source to panel taking
> > advantage of advanced color features in hardware.
> > 
> > These patches just add the property interfaces and enable helper
> > functions.
> > 
> > This series adds Intel Gen9 specific plane gamma feature. We can
> > build up and add other platform/hardware specific implementation
> > on top of this series
> > 
> > Note: This is just to get a design feedback whether these interfaces
> > look ok. Based on community feedback on interfaces, we will implement
> > IGT tests to validate plane color features. This is un-tested currently.
> > 
> > Userspace implementation using these properties have been done in drm
> > hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-Cosmin.Gheorghe@arm.com"
> > from ARM. A merge request has been opened by Alexandru for drm_hwcomposer,
> > implementing the property changes for the same. Please review that as well:
> > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_requests/25
> > 
> > v2: Dropped legacy gamma table for plane as suggested by Maarten. Added
> > Gen9/BDW plane gamma feature and rebase on tot.
> > 
> > v3: Added a new drm_color_lut_ext structure to accommodate 32 bit precision
> > entries, pointed to by Brian, Starkey for HDR usecases. Addressed Sean,Paul
> > comments and moved plane color properties to drm_plane instead of
> > mode_config. Added property documentation as suggested by Daniel, Vetter.
> > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
> > 
> > v4: Rebase
> > 
> > v5: Added "Display Color Hardware Pipeline" flow to kernel
> > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
> > Moved the property creation to drm_color_mgmt.c file to consolidate
> > all color operations at one place. Addressed Alexandru's review comments.
> > 
> > v6: Rebase. Added support for ICL Color features. Enhanced Lut precision to
> > accept input values in u32.32 format. This is needed for higher precision
> > required in HDR data processing.
> > 
> > v7: Fixed Lut roundup and extraction function in patch 1 and address
> > definitions for Degamma index in patch 10. Rest of the patches are just
> > rebased.
> > 
> 
> I can't find any comments on this one.
> 
> What's the status of this?
> 
> Thanks,
> Eze
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Shankar, Uma June 19, 2019, 6:20 a.m. UTC | #3
>-----Original Message-----
>From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
>Ezequiel Garcia
>Sent: Friday, June 14, 2019 9:48 PM
>To: Shankar, Uma <uma.shankar@intel.com>
>Cc: Emil Velikov <emil.l.velikov@gmail.com>; intel-gfx@lists.freedesktop.org; Syrjala,
>Ville <ville.syrjala@intel.com>; Lankhorst, Maarten <maarten.lankhorst@intel.com>;
>dri-devel <dri-devel@lists.freedesktop.org>
>Subject: Re: [v7 00/16] Add Plane Color Properties
>
>On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com> wrote:
>>
>> This is how a typical display color hardware pipeline looks like:
>>  +-------------------------------------------+
>>  |                RAM                        |
>>  |  +------+    +---------+    +---------+   |
>>  |  | FB 1 |    |  FB 2   |    | FB N    |   |
>>  |  +------+    +---------+    +---------+   |
>>  +-------------------------------------------+
>>        |  Plane Color Hardware Block |
>> +--------------------------------------------+
>>  | +---v-----+   +---v-------+   +---v------+ |
>>  | | Plane A |   | Plane B   |   | Plane N  | |
>>  | | DeGamma |   | Degamma   |   | Degamma  | |
>>  | +---+-----+   +---+-------+   +---+------+ |
>>  |     |             |               |        |
>>  | +---v-----+   +---v-------+   +---v------+ |
>>  | |Plane A  |   | Plane B   |   | Plane N  | |
>>  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
>>  | +---+-----+   +----+------+   +----+-----+ |
>>  |     |              |               |       |
>>  | +---v-----+   +----v------+   +----v-----+ |
>>  | | Plane A |   | Plane B   |   | Plane N  | |
>>  | | Gamma   |   | Gamma     |   | Gamma    | |
>>  | +---+-----+   +----+------+   +----+-----+ |
>>  |     |              |               |       |
>>  +--------------------------------------------+
>> +------v--------------v---------------v-------|
>> ||                                           ||
>> ||           Pipe Blender                    ||
>> +--------------------+------------------------+
>> |                    |                        |
>> |        +-----------v----------+             |
>> |        |  Pipe DeGamma        |             |
>> |        |                      |             |
>> |        +-----------+----------+             |
>> |                    |            Pipe Color  |
>> |        +-----------v----------+ Hardware    |
>> |        |  Pipe CSC/CTM        |             |
>> |        |                      |             |
>> |        +-----------+----------+             |
>> |                    |                        |
>> |        +-----------v----------+             |
>> |        |  Pipe Gamma          |             |
>> |        |                      |             |
>> |        +-----------+----------+             |
>> |                    |                        |
>> +---------------------------------------------+
>>                      |
>>                      v
>>                Pipe Output
>>
>> This patch series adds properties for plane color features. It adds
>> properties for degamma used to linearize data, CSC used for gamut
>> conversion, and gamma used to again non-linearize data as per panel
>> supported color space. These can be utilize by user space to convert
>> planes from one format to another, one color space to another etc.
>>
>> Usersapce can take smart blending decisions and utilize these hardware
>> supported plane color features to get accurate color profile. The same
>> can help in consistent color quality from source to panel taking
>> advantage of advanced color features in hardware.
>>
>> These patches just add the property interfaces and enable helper
>> functions.
>>
>> This series adds Intel Gen9 specific plane gamma feature. We can build
>> up and add other platform/hardware specific implementation on top of
>> this series
>>
>> Note: This is just to get a design feedback whether these interfaces
>> look ok. Based on community feedback on interfaces, we will implement
>> IGT tests to validate plane color features. This is un-tested currently.
>>
>> Userspace implementation using these properties have been done in drm
>> hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-
>Cosmin.Gheorghe@arm.com"
>> from ARM. A merge request has been opened by Alexandru for
>> drm_hwcomposer, implementing the property changes for the same. Please review
>that as well:
>> https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_req
>> uests/25
>>
>> v2: Dropped legacy gamma table for plane as suggested by Maarten.
>> Added Gen9/BDW plane gamma feature and rebase on tot.
>>
>> v3: Added a new drm_color_lut_ext structure to accommodate 32 bit
>> precision entries, pointed to by Brian, Starkey for HDR usecases.
>> Addressed Sean,Paul comments and moved plane color properties to
>> drm_plane instead of mode_config. Added property documentation as suggested by
>Daniel, Vetter.
>> Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
>>
>> v4: Rebase
>>
>> v5: Added "Display Color Hardware Pipeline" flow to kernel
>> documentation as suggested by "Ville Syrjala" and "Brian Starkey".
>> Moved the property creation to drm_color_mgmt.c file to consolidate
>> all color operations at one place. Addressed Alexandru's review comments.
>>
>> v6: Rebase. Added support for ICL Color features. Enhanced Lut
>> precision to accept input values in u32.32 format. This is needed for
>> higher precision required in HDR data processing.
>>
>> v7: Fixed Lut roundup and extraction function in patch 1 and address
>> definitions for Degamma index in patch 10. Rest of the patches are
>> just rebased.
>>
>
>I can't find any comments on this one.
>
>What's the status of this?

Hi Eze,
This was blocked due to lack of a userspace consumer. Since its adds a new UAPI, we need a userspace
consumer using this for it to get merge. We have some folks signed up in Intel who can help here.
Hopefully we can see some movement on this soon.

Regards,
Uma Shankar

>Thanks,
>Eze
>_______________________________________________
>dri-devel mailing list
>dri-devel@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/dri-devel
Ezequiel Garcia June 19, 2019, 1:18 p.m. UTC | #4
On Wed, 2019-06-19 at 06:20 +0000, Shankar, Uma wrote:
> > -----Original Message-----
> > From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
> > Ezequiel Garcia
> > Sent: Friday, June 14, 2019 9:48 PM
> > To: Shankar, Uma <uma.shankar@intel.com>
> > Cc: Emil Velikov <emil.l.velikov@gmail.com>; intel-gfx@lists.freedesktop.org; Syrjala,
> > Ville <ville.syrjala@intel.com>; Lankhorst, Maarten <maarten.lankhorst@intel.com>;
> > dri-devel <dri-devel@lists.freedesktop.org>
> > Subject: Re: [v7 00/16] Add Plane Color Properties
> > 
> > On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com> wrote:
> > > This is how a typical display color hardware pipeline looks like:
> > >  +-------------------------------------------+
> > >  |                RAM                        |
> > >  |  +------+    +---------+    +---------+   |
> > >  |  | FB 1 |    |  FB 2   |    | FB N    |   |
> > >  |  +------+    +---------+    +---------+   |
> > >  +-------------------------------------------+
> > >        |  Plane Color Hardware Block |
> > > +--------------------------------------------+
> > >  | +---v-----+   +---v-------+   +---v------+ |
> > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > >  | | DeGamma |   | Degamma   |   | Degamma  | |
> > >  | +---+-----+   +---+-------+   +---+------+ |
> > >  |     |             |               |        |
> > >  | +---v-----+   +---v-------+   +---v------+ |
> > >  | |Plane A  |   | Plane B   |   | Plane N  | |
> > >  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
> > >  | +---+-----+   +----+------+   +----+-----+ |
> > >  |     |              |               |       |
> > >  | +---v-----+   +----v------+   +----v-----+ |
> > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > >  | | Gamma   |   | Gamma     |   | Gamma    | |
> > >  | +---+-----+   +----+------+   +----+-----+ |
> > >  |     |              |               |       |
> > >  +--------------------------------------------+
> > > +------v--------------v---------------v-------|
> > > > >                                           ||
> > > > >           Pipe Blender                    ||
> > > +--------------------+------------------------+
> > > >                    |                        |
> > > >        +-----------v----------+             |
> > > >        |  Pipe DeGamma        |             |
> > > >        |                      |             |
> > > >        +-----------+----------+             |
> > > >                    |            Pipe Color  |
> > > >        +-----------v----------+ Hardware    |
> > > >        |  Pipe CSC/CTM        |             |
> > > >        |                      |             |
> > > >        +-----------+----------+             |
> > > >                    |                        |
> > > >        +-----------v----------+             |
> > > >        |  Pipe Gamma          |             |
> > > >        |                      |             |
> > > >        +-----------+----------+             |
> > > >                    |                        |
> > > +---------------------------------------------+
> > >                      |
> > >                      v
> > >                Pipe Output
> > > 
> > > This patch series adds properties for plane color features. It adds
> > > properties for degamma used to linearize data, CSC used for gamut
> > > conversion, and gamma used to again non-linearize data as per panel
> > > supported color space. These can be utilize by user space to convert
> > > planes from one format to another, one color space to another etc.
> > > 
> > > Usersapce can take smart blending decisions and utilize these hardware
> > > supported plane color features to get accurate color profile. The same
> > > can help in consistent color quality from source to panel taking
> > > advantage of advanced color features in hardware.
> > > 
> > > These patches just add the property interfaces and enable helper
> > > functions.
> > > 
> > > This series adds Intel Gen9 specific plane gamma feature. We can build
> > > up and add other platform/hardware specific implementation on top of
> > > this series
> > > 
> > > Note: This is just to get a design feedback whether these interfaces
> > > look ok. Based on community feedback on interfaces, we will implement
> > > IGT tests to validate plane color features. This is un-tested currently.
> > > 
> > > Userspace implementation using these properties have been done in drm
> > > hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-
> > Cosmin.Gheorghe@arm.com"
> > > from ARM. A merge request has been opened by Alexandru for
> > > drm_hwcomposer, implementing the property changes for the same. Please review
> > that as well:
> > > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_req
> > > uests/25
> > > 
> > > v2: Dropped legacy gamma table for plane as suggested by Maarten.
> > > Added Gen9/BDW plane gamma feature and rebase on tot.
> > > 
> > > v3: Added a new drm_color_lut_ext structure to accommodate 32 bit
> > > precision entries, pointed to by Brian, Starkey for HDR usecases.
> > > Addressed Sean,Paul comments and moved plane color properties to
> > > drm_plane instead of mode_config. Added property documentation as suggested by
> > Daniel, Vetter.
> > > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
> > > 
> > > v4: Rebase
> > > 
> > > v5: Added "Display Color Hardware Pipeline" flow to kernel
> > > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
> > > Moved the property creation to drm_color_mgmt.c file to consolidate
> > > all color operations at one place. Addressed Alexandru's review comments.
> > > 
> > > v6: Rebase. Added support for ICL Color features. Enhanced Lut
> > > precision to accept input values in u32.32 format. This is needed for
> > > higher precision required in HDR data processing.
> > > 
> > > v7: Fixed Lut roundup and extraction function in patch 1 and address
> > > definitions for Degamma index in patch 10. Rest of the patches are
> > > just rebased.
> > > 
> > 
> > I can't find any comments on this one.
> > 
> > What's the status of this?
> 
> Hi Eze,
> This was blocked due to lack of a userspace consumer. Since its adds a new UAPI, we need a userspace
> consumer using this for it to get merge. We have some folks signed up in Intel who can help here.
> Hopefully we can see some movement on this soon.
> 

Hi Uma,

Thanks a lot for your reply.

We do have a userspace consumer in chromeos [1]. This is being shipped
since some time now, and I have been (perhaps too silently) waiting
for this series to be merged.

Let me try to rebase at least the uAPI bits, on top of rockchip changes
and re-submit.

Do we have IGT tests already written for it? Otherwise, I'll take care
of that as well.

Thanks,
Eze

[1] https://chromium.googlesource.com/chromium/src/+/lkgr/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.cc#203
Ville Syrjälä June 19, 2019, 3:03 p.m. UTC | #5
On Wed, Jun 19, 2019 at 10:18:18AM -0300, Ezequiel Garcia wrote:
> On Wed, 2019-06-19 at 06:20 +0000, Shankar, Uma wrote:
> > > -----Original Message-----
> > > From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
> > > Ezequiel Garcia
> > > Sent: Friday, June 14, 2019 9:48 PM
> > > To: Shankar, Uma <uma.shankar@intel.com>
> > > Cc: Emil Velikov <emil.l.velikov@gmail.com>; intel-gfx@lists.freedesktop.org; Syrjala,
> > > Ville <ville.syrjala@intel.com>; Lankhorst, Maarten <maarten.lankhorst@intel.com>;
> > > dri-devel <dri-devel@lists.freedesktop.org>
> > > Subject: Re: [v7 00/16] Add Plane Color Properties
> > > 
> > > On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com> wrote:
> > > > This is how a typical display color hardware pipeline looks like:
> > > >  +-------------------------------------------+
> > > >  |                RAM                        |
> > > >  |  +------+    +---------+    +---------+   |
> > > >  |  | FB 1 |    |  FB 2   |    | FB N    |   |
> > > >  |  +------+    +---------+    +---------+   |
> > > >  +-------------------------------------------+
> > > >        |  Plane Color Hardware Block |
> > > > +--------------------------------------------+
> > > >  | +---v-----+   +---v-------+   +---v------+ |
> > > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > > >  | | DeGamma |   | Degamma   |   | Degamma  | |
> > > >  | +---+-----+   +---+-------+   +---+------+ |
> > > >  |     |             |               |        |
> > > >  | +---v-----+   +---v-------+   +---v------+ |
> > > >  | |Plane A  |   | Plane B   |   | Plane N  | |
> > > >  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
> > > >  | +---+-----+   +----+------+   +----+-----+ |
> > > >  |     |              |               |       |
> > > >  | +---v-----+   +----v------+   +----v-----+ |
> > > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > > >  | | Gamma   |   | Gamma     |   | Gamma    | |
> > > >  | +---+-----+   +----+------+   +----+-----+ |
> > > >  |     |              |               |       |
> > > >  +--------------------------------------------+
> > > > +------v--------------v---------------v-------|
> > > > > >                                           ||
> > > > > >           Pipe Blender                    ||
> > > > +--------------------+------------------------+
> > > > >                    |                        |
> > > > >        +-----------v----------+             |
> > > > >        |  Pipe DeGamma        |             |
> > > > >        |                      |             |
> > > > >        +-----------+----------+             |
> > > > >                    |            Pipe Color  |
> > > > >        +-----------v----------+ Hardware    |
> > > > >        |  Pipe CSC/CTM        |             |
> > > > >        |                      |             |
> > > > >        +-----------+----------+             |
> > > > >                    |                        |
> > > > >        +-----------v----------+             |
> > > > >        |  Pipe Gamma          |             |
> > > > >        |                      |             |
> > > > >        +-----------+----------+             |
> > > > >                    |                        |
> > > > +---------------------------------------------+
> > > >                      |
> > > >                      v
> > > >                Pipe Output
> > > > 
> > > > This patch series adds properties for plane color features. It adds
> > > > properties for degamma used to linearize data, CSC used for gamut
> > > > conversion, and gamma used to again non-linearize data as per panel
> > > > supported color space. These can be utilize by user space to convert
> > > > planes from one format to another, one color space to another etc.
> > > > 
> > > > Usersapce can take smart blending decisions and utilize these hardware
> > > > supported plane color features to get accurate color profile. The same
> > > > can help in consistent color quality from source to panel taking
> > > > advantage of advanced color features in hardware.
> > > > 
> > > > These patches just add the property interfaces and enable helper
> > > > functions.
> > > > 
> > > > This series adds Intel Gen9 specific plane gamma feature. We can build
> > > > up and add other platform/hardware specific implementation on top of
> > > > this series
> > > > 
> > > > Note: This is just to get a design feedback whether these interfaces
> > > > look ok. Based on community feedback on interfaces, we will implement
> > > > IGT tests to validate plane color features. This is un-tested currently.
> > > > 
> > > > Userspace implementation using these properties have been done in drm
> > > > hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-
> > > Cosmin.Gheorghe@arm.com"
> > > > from ARM. A merge request has been opened by Alexandru for
> > > > drm_hwcomposer, implementing the property changes for the same. Please review
> > > that as well:
> > > > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_req
> > > > uests/25
> > > > 
> > > > v2: Dropped legacy gamma table for plane as suggested by Maarten.
> > > > Added Gen9/BDW plane gamma feature and rebase on tot.
> > > > 
> > > > v3: Added a new drm_color_lut_ext structure to accommodate 32 bit
> > > > precision entries, pointed to by Brian, Starkey for HDR usecases.
> > > > Addressed Sean,Paul comments and moved plane color properties to
> > > > drm_plane instead of mode_config. Added property documentation as suggested by
> > > Daniel, Vetter.
> > > > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
> > > > 
> > > > v4: Rebase
> > > > 
> > > > v5: Added "Display Color Hardware Pipeline" flow to kernel
> > > > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
> > > > Moved the property creation to drm_color_mgmt.c file to consolidate
> > > > all color operations at one place. Addressed Alexandru's review comments.
> > > > 
> > > > v6: Rebase. Added support for ICL Color features. Enhanced Lut
> > > > precision to accept input values in u32.32 format. This is needed for
> > > > higher precision required in HDR data processing.
> > > > 
> > > > v7: Fixed Lut roundup and extraction function in patch 1 and address
> > > > definitions for Degamma index in patch 10. Rest of the patches are
> > > > just rebased.
> > > > 
> > > 
> > > I can't find any comments on this one.
> > > 
> > > What's the status of this?
> > 
> > Hi Eze,
> > This was blocked due to lack of a userspace consumer. Since its adds a new UAPI, we need a userspace
> > consumer using this for it to get merge. We have some folks signed up in Intel who can help here.
> > Hopefully we can see some movement on this soon.
> > 
> 
> Hi Uma,
> 
> Thanks a lot for your reply.
> 
> We do have a userspace consumer in chromeos [1]. This is being shipped
> since some time now, and I have been (perhaps too silently) waiting
> for this series to be merged.

I don't think the proposed uapi will be good enough and instead we
need something like the gamma_mode prop for planes as well. Eg. even
bunch of Intel platforms have plane gamma where the input points are
not evenly spaced, so we again have the problem of either lying to
userspace and throwing away a bunch of the user provided LUT entries,
or we add the gamma_mode prop that actually describes the LUT
capabilities.

Another idea that was thrown around was supporting hardware that
supports only hardcoded gamma curves. We need to describe those
somehow and let userspace select the right one.
Ezequiel Garcia June 19, 2019, 3:33 p.m. UTC | #6
On Wed, 2019-06-19 at 18:03 +0300, Ville Syrjälä wrote:
> On Wed, Jun 19, 2019 at 10:18:18AM -0300, Ezequiel Garcia wrote:
> > On Wed, 2019-06-19 at 06:20 +0000, Shankar, Uma wrote:
> > > > -----Original Message-----
> > > > From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
> > > > Ezequiel Garcia
> > > > Sent: Friday, June 14, 2019 9:48 PM
> > > > To: Shankar, Uma <uma.shankar@intel.com>
> > > > Cc: Emil Velikov <emil.l.velikov@gmail.com>; intel-gfx@lists.freedesktop.org; Syrjala,
> > > > Ville <ville.syrjala@intel.com>; Lankhorst, Maarten <maarten.lankhorst@intel.com>;
> > > > dri-devel <dri-devel@lists.freedesktop.org>
> > > > Subject: Re: [v7 00/16] Add Plane Color Properties
> > > > 
> > > > On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com> wrote:
> > > > > This is how a typical display color hardware pipeline looks like:
> > > > >  +-------------------------------------------+
> > > > >  |                RAM                        |
> > > > >  |  +------+    +---------+    +---------+   |
> > > > >  |  | FB 1 |    |  FB 2   |    | FB N    |   |
> > > > >  |  +------+    +---------+    +---------+   |
> > > > >  +-------------------------------------------+
> > > > >        |  Plane Color Hardware Block |
> > > > > +--------------------------------------------+
> > > > >  | +---v-----+   +---v-------+   +---v------+ |
> > > > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > > > >  | | DeGamma |   | Degamma   |   | Degamma  | |
> > > > >  | +---+-----+   +---+-------+   +---+------+ |
> > > > >  |     |             |               |        |
> > > > >  | +---v-----+   +---v-------+   +---v------+ |
> > > > >  | |Plane A  |   | Plane B   |   | Plane N  | |
> > > > >  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
> > > > >  | +---+-----+   +----+------+   +----+-----+ |
> > > > >  |     |              |               |       |
> > > > >  | +---v-----+   +----v------+   +----v-----+ |
> > > > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > > > >  | | Gamma   |   | Gamma     |   | Gamma    | |
> > > > >  | +---+-----+   +----+------+   +----+-----+ |
> > > > >  |     |              |               |       |
> > > > >  +--------------------------------------------+
> > > > > +------v--------------v---------------v-------|
> > > > > > >                                           ||
> > > > > > >           Pipe Blender                    ||
> > > > > +--------------------+------------------------+
> > > > > >                    |                        |
> > > > > >        +-----------v----------+             |
> > > > > >        |  Pipe DeGamma        |             |
> > > > > >        |                      |             |
> > > > > >        +-----------+----------+             |
> > > > > >                    |            Pipe Color  |
> > > > > >        +-----------v----------+ Hardware    |
> > > > > >        |  Pipe CSC/CTM        |             |
> > > > > >        |                      |             |
> > > > > >        +-----------+----------+             |
> > > > > >                    |                        |
> > > > > >        +-----------v----------+             |
> > > > > >        |  Pipe Gamma          |             |
> > > > > >        |                      |             |
> > > > > >        +-----------+----------+             |
> > > > > >                    |                        |
> > > > > +---------------------------------------------+
> > > > >                      |
> > > > >                      v
> > > > >                Pipe Output
> > > > > 
> > > > > This patch series adds properties for plane color features. It adds
> > > > > properties for degamma used to linearize data, CSC used for gamut
> > > > > conversion, and gamma used to again non-linearize data as per panel
> > > > > supported color space. These can be utilize by user space to convert
> > > > > planes from one format to another, one color space to another etc.
> > > > > 
> > > > > Usersapce can take smart blending decisions and utilize these hardware
> > > > > supported plane color features to get accurate color profile. The same
> > > > > can help in consistent color quality from source to panel taking
> > > > > advantage of advanced color features in hardware.
> > > > > 
> > > > > These patches just add the property interfaces and enable helper
> > > > > functions.
> > > > > 
> > > > > This series adds Intel Gen9 specific plane gamma feature. We can build
> > > > > up and add other platform/hardware specific implementation on top of
> > > > > this series
> > > > > 
> > > > > Note: This is just to get a design feedback whether these interfaces
> > > > > look ok. Based on community feedback on interfaces, we will implement
> > > > > IGT tests to validate plane color features. This is un-tested currently.
> > > > > 
> > > > > Userspace implementation using these properties have been done in drm
> > > > > hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-
> > > > Cosmin.Gheorghe@arm.com"
> > > > > from ARM. A merge request has been opened by Alexandru for
> > > > > drm_hwcomposer, implementing the property changes for the same. Please review
> > > > that as well:
> > > > > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_req
> > > > > uests/25
> > > > > 
> > > > > v2: Dropped legacy gamma table for plane as suggested by Maarten.
> > > > > Added Gen9/BDW plane gamma feature and rebase on tot.
> > > > > 
> > > > > v3: Added a new drm_color_lut_ext structure to accommodate 32 bit
> > > > > precision entries, pointed to by Brian, Starkey for HDR usecases.
> > > > > Addressed Sean,Paul comments and moved plane color properties to
> > > > > drm_plane instead of mode_config. Added property documentation as suggested by
> > > > Daniel, Vetter.
> > > > > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
> > > > > 
> > > > > v4: Rebase
> > > > > 
> > > > > v5: Added "Display Color Hardware Pipeline" flow to kernel
> > > > > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
> > > > > Moved the property creation to drm_color_mgmt.c file to consolidate
> > > > > all color operations at one place. Addressed Alexandru's review comments.
> > > > > 
> > > > > v6: Rebase. Added support for ICL Color features. Enhanced Lut
> > > > > precision to accept input values in u32.32 format. This is needed for
> > > > > higher precision required in HDR data processing.
> > > > > 
> > > > > v7: Fixed Lut roundup and extraction function in patch 1 and address
> > > > > definitions for Degamma index in patch 10. Rest of the patches are
> > > > > just rebased.
> > > > > 
> > > > 
> > > > I can't find any comments on this one.
> > > > 
> > > > What's the status of this?
> > > 
> > > Hi Eze,
> > > This was blocked due to lack of a userspace consumer. Since its adds a new UAPI, we need a userspace
> > > consumer using this for it to get merge. We have some folks signed up in Intel who can help here.
> > > Hopefully we can see some movement on this soon.
> > > 
> > 
> > Hi Uma,
> > 
> > Thanks a lot for your reply.
> > 
> > We do have a userspace consumer in chromeos [1]. This is being shipped
> > since some time now, and I have been (perhaps too silently) waiting
> > for this series to be merged.
> 
> I don't think the proposed uapi will be good enough and instead we
> need something like the gamma_mode prop for planes as well. Eg. even
> bunch of Intel platforms have plane gamma where the input points are
> not evenly spaced, so we again have the problem of either lying to
> userspace and throwing away a bunch of the user provided LUT entries,
> or we add the gamma_mode prop that actually describes the LUT
> capabilities.
> 
> Another idea that was thrown around was supporting hardware that
> supports only hardcoded gamma curves. We need to describe those
> somehow and let userspace select the right one.
> 

Is the uapi "not good enough" or "incorrect"? For the chromeos usage,
it seems this PLANE_CTM property is enough, so it's not clear
to me exactly what we should fix or change.

Thanks!
Eze
Ville Syrjälä June 19, 2019, 4:29 p.m. UTC | #7
On Wed, Jun 19, 2019 at 12:33:33PM -0300, Ezequiel Garcia wrote:
> On Wed, 2019-06-19 at 18:03 +0300, Ville Syrjälä wrote:
> > On Wed, Jun 19, 2019 at 10:18:18AM -0300, Ezequiel Garcia wrote:
> > > On Wed, 2019-06-19 at 06:20 +0000, Shankar, Uma wrote:
> > > > > -----Original Message-----
> > > > > From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
> > > > > Ezequiel Garcia
> > > > > Sent: Friday, June 14, 2019 9:48 PM
> > > > > To: Shankar, Uma <uma.shankar@intel.com>
> > > > > Cc: Emil Velikov <emil.l.velikov@gmail.com>; intel-gfx@lists.freedesktop.org; Syrjala,
> > > > > Ville <ville.syrjala@intel.com>; Lankhorst, Maarten <maarten.lankhorst@intel.com>;
> > > > > dri-devel <dri-devel@lists.freedesktop.org>
> > > > > Subject: Re: [v7 00/16] Add Plane Color Properties
> > > > > 
> > > > > On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com> wrote:
> > > > > > This is how a typical display color hardware pipeline looks like:
> > > > > >  +-------------------------------------------+
> > > > > >  |                RAM                        |
> > > > > >  |  +------+    +---------+    +---------+   |
> > > > > >  |  | FB 1 |    |  FB 2   |    | FB N    |   |
> > > > > >  |  +------+    +---------+    +---------+   |
> > > > > >  +-------------------------------------------+
> > > > > >        |  Plane Color Hardware Block |
> > > > > > +--------------------------------------------+
> > > > > >  | +---v-----+   +---v-------+   +---v------+ |
> > > > > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > > > > >  | | DeGamma |   | Degamma   |   | Degamma  | |
> > > > > >  | +---+-----+   +---+-------+   +---+------+ |
> > > > > >  |     |             |               |        |
> > > > > >  | +---v-----+   +---v-------+   +---v------+ |
> > > > > >  | |Plane A  |   | Plane B   |   | Plane N  | |
> > > > > >  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
> > > > > >  | +---+-----+   +----+------+   +----+-----+ |
> > > > > >  |     |              |               |       |
> > > > > >  | +---v-----+   +----v------+   +----v-----+ |
> > > > > >  | | Plane A |   | Plane B   |   | Plane N  | |
> > > > > >  | | Gamma   |   | Gamma     |   | Gamma    | |
> > > > > >  | +---+-----+   +----+------+   +----+-----+ |
> > > > > >  |     |              |               |       |
> > > > > >  +--------------------------------------------+
> > > > > > +------v--------------v---------------v-------|
> > > > > > > >                                           ||
> > > > > > > >           Pipe Blender                    ||
> > > > > > +--------------------+------------------------+
> > > > > > >                    |                        |
> > > > > > >        +-----------v----------+             |
> > > > > > >        |  Pipe DeGamma        |             |
> > > > > > >        |                      |             |
> > > > > > >        +-----------+----------+             |
> > > > > > >                    |            Pipe Color  |
> > > > > > >        +-----------v----------+ Hardware    |
> > > > > > >        |  Pipe CSC/CTM        |             |
> > > > > > >        |                      |             |
> > > > > > >        +-----------+----------+             |
> > > > > > >                    |                        |
> > > > > > >        +-----------v----------+             |
> > > > > > >        |  Pipe Gamma          |             |
> > > > > > >        |                      |             |
> > > > > > >        +-----------+----------+             |
> > > > > > >                    |                        |
> > > > > > +---------------------------------------------+
> > > > > >                      |
> > > > > >                      v
> > > > > >                Pipe Output
> > > > > > 
> > > > > > This patch series adds properties for plane color features. It adds
> > > > > > properties for degamma used to linearize data, CSC used for gamut
> > > > > > conversion, and gamma used to again non-linearize data as per panel
> > > > > > supported color space. These can be utilize by user space to convert
> > > > > > planes from one format to another, one color space to another etc.
> > > > > > 
> > > > > > Usersapce can take smart blending decisions and utilize these hardware
> > > > > > supported plane color features to get accurate color profile. The same
> > > > > > can help in consistent color quality from source to panel taking
> > > > > > advantage of advanced color features in hardware.
> > > > > > 
> > > > > > These patches just add the property interfaces and enable helper
> > > > > > functions.
> > > > > > 
> > > > > > This series adds Intel Gen9 specific plane gamma feature. We can build
> > > > > > up and add other platform/hardware specific implementation on top of
> > > > > > this series
> > > > > > 
> > > > > > Note: This is just to get a design feedback whether these interfaces
> > > > > > look ok. Based on community feedback on interfaces, we will implement
> > > > > > IGT tests to validate plane color features. This is un-tested currently.
> > > > > > 
> > > > > > Userspace implementation using these properties have been done in drm
> > > > > > hwcomposer by "Alexandru-Cosmin Gheorghe Alexandru-
> > > > > Cosmin.Gheorghe@arm.com"
> > > > > > from ARM. A merge request has been opened by Alexandru for
> > > > > > drm_hwcomposer, implementing the property changes for the same. Please review
> > > > > that as well:
> > > > > > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_req
> > > > > > uests/25
> > > > > > 
> > > > > > v2: Dropped legacy gamma table for plane as suggested by Maarten.
> > > > > > Added Gen9/BDW plane gamma feature and rebase on tot.
> > > > > > 
> > > > > > v3: Added a new drm_color_lut_ext structure to accommodate 32 bit
> > > > > > precision entries, pointed to by Brian, Starkey for HDR usecases.
> > > > > > Addressed Sean,Paul comments and moved plane color properties to
> > > > > > drm_plane instead of mode_config. Added property documentation as suggested by
> > > > > Daniel, Vetter.
> > > > > > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
> > > > > > 
> > > > > > v4: Rebase
> > > > > > 
> > > > > > v5: Added "Display Color Hardware Pipeline" flow to kernel
> > > > > > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
> > > > > > Moved the property creation to drm_color_mgmt.c file to consolidate
> > > > > > all color operations at one place. Addressed Alexandru's review comments.
> > > > > > 
> > > > > > v6: Rebase. Added support for ICL Color features. Enhanced Lut
> > > > > > precision to accept input values in u32.32 format. This is needed for
> > > > > > higher precision required in HDR data processing.
> > > > > > 
> > > > > > v7: Fixed Lut roundup and extraction function in patch 1 and address
> > > > > > definitions for Degamma index in patch 10. Rest of the patches are
> > > > > > just rebased.
> > > > > > 
> > > > > 
> > > > > I can't find any comments on this one.
> > > > > 
> > > > > What's the status of this?
> > > > 
> > > > Hi Eze,
> > > > This was blocked due to lack of a userspace consumer. Since its adds a new UAPI, we need a userspace
> > > > consumer using this for it to get merge. We have some folks signed up in Intel who can help here.
> > > > Hopefully we can see some movement on this soon.
> > > > 
> > > 
> > > Hi Uma,
> > > 
> > > Thanks a lot for your reply.
> > > 
> > > We do have a userspace consumer in chromeos [1]. This is being shipped
> > > since some time now, and I have been (perhaps too silently) waiting
> > > for this series to be merged.
> > 
> > I don't think the proposed uapi will be good enough and instead we
> > need something like the gamma_mode prop for planes as well. Eg. even
> > bunch of Intel platforms have plane gamma where the input points are
> > not evenly spaced, so we again have the problem of either lying to
> > userspace and throwing away a bunch of the user provided LUT entries,
> > or we add the gamma_mode prop that actually describes the LUT
> > capabilities.
> > 
> > Another idea that was thrown around was supporting hardware that
> > supports only hardcoded gamma curves. We need to describe those
> > somehow and let userspace select the right one.
> > 
> 
> Is the uapi "not good enough" or "incorrect"? For the chromeos usage,
> it seems this PLANE_CTM property is enough, so it's not clear
> to me exactly what we should fix or change.

The ctm is probably OK. Should be the same as what we have for the crtc
I think. The degamma/gamma probably need more work.
Shankar, Uma June 20, 2019, 1:42 p.m. UTC | #8
>-----Original Message-----
>From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of Ville
>Syrjälä
>Sent: Wednesday, June 19, 2019 10:00 PM
>To: Ezequiel Garcia <ezequiel@collabora.com>
>Cc: Syrjala, Ville <ville.syrjala@intel.com>; intel-gfx@lists.freedesktop.org; Emil
>Velikov <emil.l.velikov@gmail.com>; dri-devel <dri-devel@lists.freedesktop.org>;
>Andrzej Pietrasiewicz <andrzej.p@collabora.com>; Shankar, Uma
><uma.shankar@intel.com>; Sean Paul <seanpaul@chromium.org>; Ezequiel Garcia
><ezequiel@vanguardiasur.com.ar>; Boris Brezillon <boris.brezillon@collabora.com>;
>Lankhorst, Maarten <maarten.lankhorst@intel.com>
>Subject: Re: [v7 00/16] Add Plane Color Properties
>
>On Wed, Jun 19, 2019 at 12:33:33PM -0300, Ezequiel Garcia wrote:
>> On Wed, 2019-06-19 at 18:03 +0300, Ville Syrjälä wrote:
>> > On Wed, Jun 19, 2019 at 10:18:18AM -0300, Ezequiel Garcia wrote:
>> > > On Wed, 2019-06-19 at 06:20 +0000, Shankar, Uma wrote:
>> > > > > -----Original Message-----
>> > > > > From: dri-devel
>> > > > > [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
>> > > > > Ezequiel Garcia
>> > > > > Sent: Friday, June 14, 2019 9:48 PM
>> > > > > To: Shankar, Uma <uma.shankar@intel.com>
>> > > > > Cc: Emil Velikov <emil.l.velikov@gmail.com>;
>> > > > > intel-gfx@lists.freedesktop.org; Syrjala, Ville
>> > > > > <ville.syrjala@intel.com>; Lankhorst, Maarten
>> > > > > <maarten.lankhorst@intel.com>; dri-devel
>> > > > > <dri-devel@lists.freedesktop.org>
>> > > > > Subject: Re: [v7 00/16] Add Plane Color Properties
>> > > > >
>> > > > > On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com>
>wrote:
>> > > > > > This is how a typical display color hardware pipeline looks like:
>> > > > > >  +-------------------------------------------+
>> > > > > >  |                RAM                        |
>> > > > > >  |  +------+    +---------+    +---------+   |
>> > > > > >  |  | FB 1 |    |  FB 2   |    | FB N    |   |
>> > > > > >  |  +------+    +---------+    +---------+   |
>> > > > > >  +-------------------------------------------+
>> > > > > >        |  Plane Color Hardware Block |
>> > > > > > +--------------------------------------------+
>> > > > > >  | +---v-----+   +---v-------+   +---v------+ |
>> > > > > >  | | Plane A |   | Plane B   |   | Plane N  | |
>> > > > > >  | | DeGamma |   | Degamma   |   | Degamma  | |
>> > > > > >  | +---+-----+   +---+-------+   +---+------+ |
>> > > > > >  |     |             |               |        |
>> > > > > >  | +---v-----+   +---v-------+   +---v------+ |
>> > > > > >  | |Plane A  |   | Plane B   |   | Plane N  | |
>> > > > > >  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
>> > > > > >  | +---+-----+   +----+------+   +----+-----+ |
>> > > > > >  |     |              |               |       |
>> > > > > >  | +---v-----+   +----v------+   +----v-----+ |
>> > > > > >  | | Plane A |   | Plane B   |   | Plane N  | |
>> > > > > >  | | Gamma   |   | Gamma     |   | Gamma    | |
>> > > > > >  | +---+-----+   +----+------+   +----+-----+ |
>> > > > > >  |     |              |               |       |
>> > > > > >  +--------------------------------------------+
>> > > > > > +------v--------------v---------------v-------|
>> > > > > > > >                                           ||
>> > > > > > > >           Pipe Blender                    ||
>> > > > > > +--------------------+------------------------+
>> > > > > > >                    |                        |
>> > > > > > >        +-----------v----------+             |
>> > > > > > >        |  Pipe DeGamma        |             |
>> > > > > > >        |                      |             |
>> > > > > > >        +-----------+----------+             |
>> > > > > > >                    |            Pipe Color  |
>> > > > > > >        +-----------v----------+ Hardware    |
>> > > > > > >        |  Pipe CSC/CTM        |             |
>> > > > > > >        |                      |             |
>> > > > > > >        +-----------+----------+             |
>> > > > > > >                    |                        |
>> > > > > > >        +-----------v----------+             |
>> > > > > > >        |  Pipe Gamma          |             |
>> > > > > > >        |                      |             |
>> > > > > > >        +-----------+----------+             |
>> > > > > > >                    |                        |
>> > > > > > +---------------------------------------------+
>> > > > > >                      |
>> > > > > >                      v
>> > > > > >                Pipe Output
>> > > > > >
>> > > > > > This patch series adds properties for plane color features.
>> > > > > > It adds properties for degamma used to linearize data, CSC
>> > > > > > used for gamut conversion, and gamma used to again
>> > > > > > non-linearize data as per panel supported color space. These
>> > > > > > can be utilize by user space to convert planes from one format to another,
>one color space to another etc.
>> > > > > >
>> > > > > > Usersapce can take smart blending decisions and utilize
>> > > > > > these hardware supported plane color features to get
>> > > > > > accurate color profile. The same can help in consistent
>> > > > > > color quality from source to panel taking advantage of advanced color
>features in hardware.
>> > > > > >
>> > > > > > These patches just add the property interfaces and enable
>> > > > > > helper functions.
>> > > > > >
>> > > > > > This series adds Intel Gen9 specific plane gamma feature. We
>> > > > > > can build up and add other platform/hardware specific
>> > > > > > implementation on top of this series
>> > > > > >
>> > > > > > Note: This is just to get a design feedback whether these
>> > > > > > interfaces look ok. Based on community feedback on
>> > > > > > interfaces, we will implement IGT tests to validate plane color features.
>This is un-tested currently.
>> > > > > >
>> > > > > > Userspace implementation using these properties have been
>> > > > > > done in drm hwcomposer by "Alexandru-Cosmin Gheorghe
>> > > > > > Alexandru-
>> > > > > Cosmin.Gheorghe@arm.com"
>> > > > > > from ARM. A merge request has been opened by Alexandru for
>> > > > > > drm_hwcomposer, implementing the property changes for the
>> > > > > > same. Please review
>> > > > > that as well:
>> > > > > > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer
>> > > > > > /merge_req
>> > > > > > uests/25
>> > > > > >
>> > > > > > v2: Dropped legacy gamma table for plane as suggested by Maarten.
>> > > > > > Added Gen9/BDW plane gamma feature and rebase on tot.
>> > > > > >
>> > > > > > v3: Added a new drm_color_lut_ext structure to accommodate
>> > > > > > 32 bit precision entries, pointed to by Brian, Starkey for HDR usecases.
>> > > > > > Addressed Sean,Paul comments and moved plane color
>> > > > > > properties to drm_plane instead of mode_config. Added
>> > > > > > property documentation as suggested by
>> > > > > Daniel, Vetter.
>> > > > > > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
>> > > > > >
>> > > > > > v4: Rebase
>> > > > > >
>> > > > > > v5: Added "Display Color Hardware Pipeline" flow to kernel
>> > > > > > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
>> > > > > > Moved the property creation to drm_color_mgmt.c file to
>> > > > > > consolidate all color operations at one place. Addressed Alexandru's
>review comments.
>> > > > > >
>> > > > > > v6: Rebase. Added support for ICL Color features. Enhanced
>> > > > > > Lut precision to accept input values in u32.32 format. This
>> > > > > > is needed for higher precision required in HDR data processing.
>> > > > > >
>> > > > > > v7: Fixed Lut roundup and extraction function in patch 1 and
>> > > > > > address definitions for Degamma index in patch 10. Rest of
>> > > > > > the patches are just rebased.
>> > > > > >
>> > > > >
>> > > > > I can't find any comments on this one.
>> > > > >
>> > > > > What's the status of this?
>> > > >
>> > > > Hi Eze,
>> > > > This was blocked due to lack of a userspace consumer. Since its
>> > > > adds a new UAPI, we need a userspace consumer using this for it to get merge.
>We have some folks signed up in Intel who can help here.
>> > > > Hopefully we can see some movement on this soon.
>> > > >
>> > >
>> > > Hi Uma,
>> > >
>> > > Thanks a lot for your reply.
>> > >
>> > > We do have a userspace consumer in chromeos [1]. This is being
>> > > shipped since some time now, and I have been (perhaps too
>> > > silently) waiting for this series to be merged.
>> >
>> > I don't think the proposed uapi will be good enough and instead we
>> > need something like the gamma_mode prop for planes as well. Eg. even
>> > bunch of Intel platforms have plane gamma where the input points are
>> > not evenly spaced, so we again have the problem of either lying to
>> > userspace and throwing away a bunch of the user provided LUT
>> > entries, or we add the gamma_mode prop that actually describes the
>> > LUT capabilities.
>> >
>> > Another idea that was thrown around was supporting hardware that
>> > supports only hardcoded gamma curves. We need to describe those
>> > somehow and let userspace select the right one.
>> >
>>
>> Is the uapi "not good enough" or "incorrect"? For the chromeos usage,
>> it seems this PLANE_CTM property is enough, so it's not clear to me
>> exactly what we should fix or change.
>
>The ctm is probably OK. Should be the same as what we have for the crtc I think. The
>degamma/gamma probably need more work.

Hi Ville,
Ok, I will try to add gamma mode programming as well so that we can control that from userspace.

Will send out an RFC version for review soon.

Regards,
Uma Shankar

>--
>Ville Syrjälä
>Intel
>_______________________________________________
>dri-devel mailing list
>dri-devel@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/dri-devel