From: Sean Paul <seanpaul@chromium.org>
To: Daniele Castagna <dcastagna@chromium.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 03/10] drm: Add Plane CTM property
Date: Tue, 27 Feb 2018 10:22:53 -0500 [thread overview]
Message-ID: <20180227152253.GC223881@art_vandelay> (raw)
In-Reply-To: <20180215053300.70482-4-dcastagna@chromium.org>
On Thu, Feb 15, 2018 at 12:32:53AM -0500, Daniele Castagna wrote:
> From: "uma.shankar at intel.com (Uma Shankar)" <uma.shankar@intel.com>
>
> Add a blob property for plane CSC usage.
>
> (am from https://patchwork.kernel.org/patch/9971339/)
>
> Change-Id: I688ce7c95c20d307cb0aa35c5eba5ce2e1e88314
> Signed-off-by: Uma Shankar <uma.shankar at intel.com>
> ---
> drivers/gpu/drm/drm_atomic.c | 10 ++++++++++
> drivers/gpu/drm/drm_atomic_helper.c | 3 +++
> drivers/gpu/drm/drm_mode_config.c | 6 ++++++
> include/drm/drm_mode_config.h | 6 ++++++
> include/drm/drm_plane.h | 8 ++++++++
> 5 files changed, 33 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 4a06ff2fd1a5e..d4b8c6cc84128 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -770,6 +770,14 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
> val, -1, &replaced);
> state->color_mgmt_changed |= replaced;
> return ret;
> + } else if (property == config->plane_ctm_property) {
> + ret = drm_atomic_replace_property_blob_from_id(dev,
> + &state->ctm,
> + val,
> + sizeof(struct drm_color_ctm),
> + &replaced);
> + state->color_mgmt_changed |= replaced;
> + return ret;
> } else {
> return -EINVAL;
> }
> @@ -831,6 +839,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
> } else if (property == config->plane_degamma_lut_property) {
> *val = (state->degamma_lut) ?
> state->degamma_lut->base.id : 0;
> + } else if (property == config->plane_ctm_property) {
> + *val = (state->ctm) ? state->ctm->base.id : 0;
> } else {
> return -EINVAL;
> }
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index d3eaf4d397681..17e137a529a0e 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -3493,6 +3493,8 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
>
> if (state->degamma_lut)
> drm_property_reference_blob(state->degamma_lut);
> + if (state->ctm)
> + drm_property_reference_blob(state->ctm);
> state->color_mgmt_changed = false;
> }
> EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state);
> @@ -3540,6 +3542,7 @@ void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)
> drm_crtc_commit_put(state->commit);
>
> drm_property_unreference_blob(state->degamma_lut);
> + drm_property_unreference_blob(state->ctm);
> }
> EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state);
>
> diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> index 7d8e74715b565..c8763977413e7 100644
> --- a/drivers/gpu/drm/drm_mode_config.c
> +++ b/drivers/gpu/drm/drm_mode_config.c
> @@ -361,6 +361,12 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)
> if (!prop)
> return -ENOMEM;
> dev->mode_config.plane_degamma_lut_size_property = prop;
> + prop = drm_property_create(dev,
> + DRM_MODE_PROP_BLOB,
> + "PLANE_CTM", 0);
> + if (!prop)
> + return -ENOMEM;
> + dev->mode_config.plane_ctm_property = prop;
>
> return 0;
> }
> diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
> index dcec93d062b4d..ad7235ced531b 100644
> --- a/include/drm/drm_mode_config.h
> +++ b/include/drm/drm_mode_config.h
> @@ -734,6 +734,12 @@ struct drm_mode_config {
> * size of the degamma LUT as supported by the driver (read-only).
> */
> struct drm_property *plane_degamma_lut_size_property;
> + /**
> + * @plane_ctm_property: Optional CRTC property to set the
> + * matrix used to convert colors after the lookup in the
> + * degamma LUT.
> + */
> + struct drm_property *plane_ctm_property;
Same comments re: puttting the property in drm_plane and adding a helper to
create it.
Sean
> /**
> * @ctm_property: Optional CRTC property to set the
> * matrix used to convert colors after the lookup in the
> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
> index 2f8f5db77a406..21aecc9c91a09 100644
> --- a/include/drm/drm_plane.h
> +++ b/include/drm/drm_plane.h
> @@ -139,6 +139,14 @@ struct drm_plane_state {
> */
> struct drm_property_blob *degamma_lut;
>
> + /**
> + * @ctm:
> + *
> + * Color transformation matrix. See drm_plane_enable_color_mgmt(). The
> + * blob (if not NULL) is a &struct drm_color_ctm.
> + */
> + struct drm_property_blob *ctm;
> +
> struct drm_atomic_state *state;
>
> bool color_mgmt_changed : 1;
> --
> 2.16.1.291.g4437f3f132-goog
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-02-27 15:22 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 5:32 [PATCH 00/10] drm: Add plane color matrix on rockchip Daniele Castagna
2018-02-15 5:32 ` [PATCH 01/10] drm/rockchip: YUV overlays BT.601 color conversion Daniele Castagna
2018-02-16 17:55 ` kbuild test robot
2018-02-27 15:03 ` Sean Paul
2018-12-14 16:29 ` [PATCH v2] drm/rockchip: Fix YUV buffers color rendering Ezequiel Garcia
2019-01-03 16:28 ` Ezequiel Garcia
2019-01-07 13:26 ` Heiko Stuebner
2019-01-07 20:07 ` Ezequiel Garcia
2019-01-08 17:17 ` Ezequiel Garcia
2019-01-08 21:46 ` [PATCH v3] " Ezequiel Garcia
2019-01-10 22:55 ` Heiko Stuebner
2018-02-15 5:32 ` [PATCH 02/10] drm: Add Plane Degamma properties Daniele Castagna
2018-02-16 19:38 ` kbuild test robot
2018-02-19 15:15 ` Daniel Vetter
2018-02-27 15:13 ` Sean Paul
2018-02-28 14:54 ` Shankar, Uma
2018-02-15 5:32 ` [PATCH 03/10] drm: Add Plane CTM property Daniele Castagna
2018-02-27 15:22 ` Sean Paul [this message]
2018-02-28 14:55 ` Shankar, Uma
2018-02-15 5:32 ` [PATCH 04/10] drm: Add Plane Gamma properties Daniele Castagna
2018-02-15 19:29 ` Harry Wentland
2018-02-15 19:45 ` Daniele Castagna
2018-02-16 20:10 ` Ville Syrjälä
2018-02-16 21:36 ` Harry Wentland
2018-02-18 6:43 ` Shankar, Uma
2018-02-19 15:14 ` Daniel Vetter
2018-02-27 15:26 ` Sean Paul
2018-02-27 16:52 ` Ville Syrjälä
2018-02-15 5:32 ` [PATCH 05/10] drm: Define helper function for plane color enabling Daniele Castagna
2018-02-27 15:28 ` Sean Paul
2018-02-28 14:57 ` Shankar, Uma
2018-02-15 5:32 ` [PATCH 06/10] drm: Define helper to set legacy gamma table size Daniele Castagna
2018-02-16 22:17 ` kbuild test robot
2018-02-27 15:35 ` Sean Paul
2018-02-27 16:20 ` Emil Velikov
2018-02-15 5:32 ` [PATCH 07/10] drm/rockchip: Add yuv2yuv registers to vop_lit Daniele Castagna
2018-02-27 15:36 ` Sean Paul
2018-02-15 5:32 ` [PATCH 08/10] drm/rockchip: Add R2R registers Daniele Castagna
2018-02-27 15:41 ` Sean Paul
2018-02-15 5:32 ` [PATCH 09/10] drm/rockchip: Implement drm plane->ctm property Daniele Castagna
2018-02-27 16:09 ` Sean Paul
2018-02-15 5:33 ` [PATCH 10/10] drm/rockchip: Enable 'PLANE_CTM' drm property Daniele Castagna
2018-02-27 16:10 ` Sean Paul
2018-02-19 15:16 ` [PATCH 00/10] drm: Add plane color matrix on rockchip Daniel Vetter
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=20180227152253.GC223881@art_vandelay \
--to=seanpaul@chromium.org \
--cc=dcastagna@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox