All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 09/10] drm/doc: Document color space handling
Date: Tue, 6 Sep 2016 12:59:09 -0400	[thread overview]
Message-ID: <CAOw6vb+bmF9=rJXhHed5GcF=TZSoBYPN5YFbXJRpq3CDDFZYbw@mail.gmail.com> (raw)
In-Reply-To: <20160831160913.12991-10-daniel.vetter@ffwll.ch>

On Wed, Aug 31, 2016 at 12:09 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Again move it from the unmaintainable csv into DOC free-form overview
> sections.
>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

A few more comment nits, after those are fixed,

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  Documentation/gpu/drm-kms.rst        | 12 +++++++++
>  Documentation/gpu/kms-properties.csv |  5 ----
>  drivers/gpu/drm/drm_color_mgmt.c     | 48 ++++++++++++++++++++++++++++++++++++
>  include/drm/drm_color_mgmt.h         | 11 ++++++---
>  4 files changed, 68 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
> index 6be8d3359620..53b872c105d2 100644
> --- a/Documentation/gpu/drm-kms.rst
> +++ b/Documentation/gpu/drm-kms.rst
> @@ -296,6 +296,18 @@ Plane Composition Properties
>  .. kernel-doc:: drivers/gpu/drm/drm_blend.c
>     :export:
>
> +Color Management Properties
> +---------------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c
> +   :doc: overview
> +
> +.. kernel-doc:: include/drm/drm_color_mgmt.h
> +   :internal:
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c
> +   :export:
> +
>  Existing KMS Properties
>  -----------------------
>
> diff --git a/Documentation/gpu/kms-properties.csv b/Documentation/gpu/kms-properties.csv
> index 1aa2493d1ef9..1a5729c4af65 100644
> --- a/Documentation/gpu/kms-properties.csv
> +++ b/Documentation/gpu/kms-properties.csv
> @@ -24,11 +24,6 @@ Owner Module/Drivers,Group,Property Name,Type,Property Values,Object attached,De
>  ,,“suggested Y”,RANGE,"Min=0, Max=0xffffffff",Connector,property to suggest an Y offset for a connector
>  ,Optional,"""aspect ratio""",ENUM,"{ ""None"", ""4:3"", ""16:9"" }",Connector,TDB
>  ,,“dirty”,ENUM | IMMUTABLE,"{ ""Off"", ""On"", ""Annotate"" }",Connector,TBD
> -,,“DEGAMMA_LUT”,BLOB,0,CRTC,DRM property to set the degamma lookup table (LUT) mapping pixel data from the framebuffer before it is given to the transformation matrix. The data is an interpreted as an array of struct drm_color_lut elements. Hardware might choose not to use the full precision of the LUT elements nor use all the elements of the LUT (for example the hardware might choose to interpolate between LUT[0] and LUT[4]).
> -,,“DEGAMMA_LUT_SIZE”,RANGE | IMMUTABLE,"Min=0, Max=UINT_MAX",CRTC,DRM property to gives the size of the lookup table to be set on the DEGAMMA_LUT property (the size depends on the underlying hardware).
> -,,“CTM”,BLOB,0,CRTC,DRM property to set the current transformation matrix (CTM) apply to pixel data after the lookup through the degamma LUT and before the lookup through the gamma LUT. The data is an interpreted as a struct drm_color_ctm.
> -,,“GAMMA_LUT”,BLOB,0,CRTC,DRM property to set the gamma lookup table (LUT) mapping pixel data after to the transformation matrix to data sent to the connector. The data is an interpreted as an array of struct drm_color_lut elements. Hardware might choose not to use the full precision of the LUT elements nor use all the elements of the LUT (for example the hardware might choose to interpolate between LUT[0] and LUT[4]).
> -,,“GAMMA_LUT_SIZE”,RANGE | IMMUTABLE,"Min=0, Max=UINT_MAX",CRTC,DRM property to gives the size of the lookup table to be set on the GAMMA_LUT property (the size depends on the underlying hardware).
>  i915,Generic,"""Broadcast RGB""",ENUM,"{ ""Automatic"", ""Full"", ""Limited 16:235"" }",Connector,"When this property is set to Limited 16:235 and CTM is set, the hardware will be programmed with the result of the multiplication of CTM by the limited range matrix to ensure the pixels normaly in the range 0..1.0 are remapped to the range 16/255..235/255."
>  ,,“audio”,ENUM,"{ ""force-dvi"", ""off"", ""auto"", ""on"" }",Connector,TBD
>  ,SDVO-TV,“mode”,ENUM,"{ ""NTSC_M"", ""NTSC_J"", ""NTSC_443"", ""PAL_B"" } etc.",Connector,TBD
> diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
> index aca1b7a6397c..23b792746cfd 100644
> --- a/drivers/gpu/drm/drm_color_mgmt.c
> +++ b/drivers/gpu/drm/drm_color_mgmt.c
> @@ -26,6 +26,54 @@
>
>  #include "drm_crtc_internal.h"
>
> +/**
> + * DOC: overview
> + *
> + * Color management or color space adjustements is supported through a set of 5

s/adjustements/adjustments/

> + * properties on the &drm_crtc object. They are set up by calling
> + * drm_crtc_enable_color_mgmt().
> + *
> + * "DEGAMMA_LUT”:
> + *     Blob property to set the degamma lookup table (LUT) mapping pixel data
> + *     from the framebuffer before it is given to the transformation matrix.
> + *     The data is an interpreted as an array of struct &drm_color_lut elements.
> + *     Hardware might choose not to use the full precision of the LUT elements
> + *     nor use all the elements of the LUT (for example the hardware might
> + *     choose to interpolate between LUT[0] and LUT[4]).
> + *
> + * “DEGAMMA_LUT_SIZE”:
> + *     Unsinged range property to gives the size of the lookup table to be set

s/to gives/to give/

s/Unsinged/Unsigned/

> + *     on the DEGAMMA_LUT property (the size depends on the underlying
> + *     hardware). If drivers support multiple LUT sizes then they should
> + *     publish the largest size, and sub-sample smaller sized LUTs (e.g. for
> + *     split-gamma modes) appropriately.
> + *
> + * “CTM”:
> + *     Blob property to set the current transformation matrix (CTM) apply to
> + *     pixel data after the lookup through the degamma LUT and before the
> + *     lookup through the gamma LUT. The data is an interpreted as a struct

s/an interpreted/interpreted/

> + *     &drm_color_ctm.
> + *
> + * “GAMMA_LUT”:
> + *     Blob property to set the gamma lookup table (LUT) mapping pixel data
> + *     after to the transformation matrix to data sent to the connector. The
> + *     data is an interpreted as an array of struct &drm_color_lut elements.

s/an interpreted/interpreted/

> + *     Hardware might choose not to use the full precision of the LUT elements
> + *     nor use all the elements of the LUT (for example the hardware might
> + *     choose to interpolate between LUT[0] and LUT[4]).
> + *
> + * “GAMMA_LUT_SIZE”:
> + *     Unsigned range property to gives the size of the lookup table to be set

s/to gives/to give/

> + *     on the GAMMA_LUT property (the size depends on the underlying hardware).
> + *     If drivers support multiple LUT sizes then they should publish the
> + *     largest size, and sub-sample smaller sized LUTs (e.g. for split-gamma
> + *     modes) appropriately.
> + *
> + * There is also support for a legacy gamma table, which is set up by calling
> + * drm_mode_crtc_set_gamma_size(). Drivers which support both should use
> + * drm_atomic_helper_legacy_gamma_set() to alias the legacy gamma ramp with the
> + * "GAMMA_LUT" property above.
> + */
>
>  /**
>   * drm_crtc_enable_color_mgmt - enable color management properties
> diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
> index 1e01c58bbe81..c767238ac9d5 100644
> --- a/include/drm/drm_color_mgmt.h
> +++ b/include/drm/drm_color_mgmt.h
> @@ -33,9 +33,14 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
>  int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
>                                  int gamma_size);
>
> -/*
> - * Extract a degamma/gamma LUT value provided by user and round it to the
> - * precision supported by the hardware.
> +/**
> + * drm_color_lut_extract - clamp&round LUT entries
> + * @user_input: input value
> + * @bit_precision: number of bits the hw LUT supports
> + *
> + * Extract a degamma/gamma LUT value provided by user (in the form of
> + * &drm_color_lut entries) and round it to the precision supported by the
> + * hardware.
>   */
>  static inline uint32_t drm_color_lut_extract(uint32_t user_input,
>                                              uint32_t bit_precision)
> --
> 2.9.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-09-06 16:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 16:09 [PATCH 00/10] More splitting&documenting for drm_crtc.c Daniel Vetter
2016-08-31 16:09 ` [PATCH 01/10] drm: Move a few macros away from drm_crtc.h Daniel Vetter
2016-09-06 16:59   ` [Intel-gfx] " Sean Paul
2016-09-08  0:05   ` Carlos Santa
2016-08-31 16:09 ` [PATCH 02/10] drm: Extract drm_bridge.h Daniel Vetter
2016-09-02  9:25   ` Archit Taneja
2016-08-31 16:09 ` [PATCH 03/10] drm: Move all decl for drm_edid.c to drm_edid.h Daniel Vetter
2016-09-06 16:59   ` Sean Paul
2016-09-19 14:28     ` Daniel Vetter
2016-08-31 16:09 ` [PATCH 04/10] drm: Extract drm_plane.[hc] Daniel Vetter
2016-09-06 16:59   ` [Intel-gfx] " Sean Paul
2016-09-19 13:11     ` Daniel Vetter
2016-09-21  7:32       ` Sean Paul
2016-08-31 16:09 ` [PATCH 05/10] drm/doc: Polish for drm_plane.[hc] Daniel Vetter
2016-09-02  9:30   ` Archit Taneja
2016-09-19 13:13     ` Daniel Vetter
2016-09-21  6:38       ` Archit Taneja
2016-08-31 16:09 ` [PATCH 06/10] drm: Conslidate blending properties in drm_blend.[hc] Daniel Vetter
2016-09-06 16:59   ` Sean Paul
2016-08-31 16:09 ` [PATCH 07/10] drm/doc: Polish plane composition property docs Daniel Vetter
2016-09-06 16:59   ` Sean Paul
2016-08-31 16:09 ` [PATCH 08/10] drm: Extract drm_color_mgmt.[hc] Daniel Vetter
2016-09-01  9:51   ` [Intel-gfx] " Lionel Landwerlin
2016-08-31 16:09 ` [PATCH 09/10] drm/doc: Document color space handling Daniel Vetter
2016-09-01 10:16   ` Lionel Landwerlin
2016-09-06 16:59   ` Sean Paul [this message]
2016-08-31 16:09 ` [PATCH 10/10] drm: Remove dirty property from docs Daniel Vetter
2016-09-06 16:59   ` Sean Paul
2016-09-01  9:20 ` ✗ Fi.CI.BAT: failure for More splitting&documenting for drm_crtc.c Patchwork

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='CAOw6vb+bmF9=rJXhHed5GcF=TZSoBYPN5YFbXJRpq3CDDFZYbw@mail.gmail.com' \
    --to=seanpaul@chromium.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --subject='Re: [Intel-gfx] [PATCH 09/10] drm/doc: Document color space handling' \
    /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

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.