dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org, Sekhar Nori <nsekhar@ti.com>,
	Jyri Sarha <jsarha@ti.com>, Nikhil Devshatwar <nikhil.nd@ti.com>
Subject: Re: [PATCH v2 2/5] drm/omap: use degamma property for gamma table
Date: Mon, 30 Nov 2020 12:39:03 +0200	[thread overview]
Message-ID: <20201130103903.GA7220@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20201103080310.164453-3-tomi.valkeinen@ti.com>

Hi Tomi,

Thank you for the patch.

On Tue, Nov 03, 2020 at 10:03:07AM +0200, Tomi Valkeinen wrote:
> omapdrm supports gamma via GAMMA_LUT property. However, the HW we have
> is:
> 
> gamma -> ctm -> out
> 
> instead of what the model DRM framework uses:
> 
> ctm -> gamma -> out
> 
> As the following patches add CTM support for omapdrm, lets first fix the
> gamma.
> 
> This patch changes the property from GAMMA_LUT to DEGAMMA_LUT, and uses
> drm_atomic_helper_legacy_degamma_set for gamma_set helper. Thus we will
> have:
> 
> degamma -> ctm -> out
> 
> and the legacy ioctl will continue working as before.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/omapdrm/omap_crtc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
> index d7442aa55f89..d40220b2f312 100644
> --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
> +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
> @@ -575,8 +575,8 @@ static int omap_crtc_atomic_check(struct drm_crtc *crtc,
>  									  crtc);
>  	struct drm_plane_state *pri_state;
>  
> -	if (crtc_state->color_mgmt_changed && crtc_state->gamma_lut) {
> -		unsigned int length = crtc_state->gamma_lut->length /
> +	if (crtc_state->color_mgmt_changed && crtc_state->degamma_lut) {
> +		unsigned int length = crtc_state->degamma_lut->length /
>  			sizeof(struct drm_color_lut);
>  
>  		if (length < 2)
> @@ -617,10 +617,10 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
>  		struct drm_color_lut *lut = NULL;
>  		unsigned int length = 0;
>  
> -		if (crtc->state->gamma_lut) {
> +		if (crtc->state->degamma_lut) {
>  			lut = (struct drm_color_lut *)
> -				crtc->state->gamma_lut->data;
> -			length = crtc->state->gamma_lut->length /
> +				crtc->state->degamma_lut->data;
> +			length = crtc->state->degamma_lut->length /
>  				sizeof(*lut);
>  		}
>  		priv->dispc_ops->mgr_set_gamma(priv->dispc, omap_crtc->channel,
> @@ -741,7 +741,7 @@ static const struct drm_crtc_funcs omap_crtc_funcs = {
>  	.set_config = drm_atomic_helper_set_config,
>  	.destroy = omap_crtc_destroy,
>  	.page_flip = drm_atomic_helper_page_flip,
> -	.gamma_set = drm_atomic_helper_legacy_gamma_set,
> +	.gamma_set = drm_atomic_helper_legacy_degamma_set,
>  	.atomic_duplicate_state = omap_crtc_duplicate_state,
>  	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
>  	.atomic_set_property = omap_crtc_atomic_set_property,
> @@ -842,7 +842,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
>  	if (priv->dispc_ops->mgr_gamma_size(priv->dispc, channel)) {
>  		unsigned int gamma_lut_size = 256;
>  
> -		drm_crtc_enable_color_mgmt(crtc, 0, false, gamma_lut_size);
> +		drm_crtc_enable_color_mgmt(crtc, gamma_lut_size, false, 0);
>  		drm_mode_crtc_set_gamma_size(crtc, gamma_lut_size);
>  	}
>  
> 

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-11-30 10:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  8:03 [PATCH v2 0/5] drm/omap: add color mgmt support Tomi Valkeinen
2020-11-03  8:03 ` [PATCH v2 1/5] drm: add legacy support for using degamma for gamma Tomi Valkeinen
2020-11-30 10:38   ` Laurent Pinchart
2020-11-30 12:12     ` Tomi Valkeinen
2020-11-30 14:10       ` Daniel Vetter
2020-12-02 11:52         ` Tomi Valkeinen
2020-12-02 12:38           ` Daniel Vetter
2020-12-03 12:31             ` Ville Syrjälä
2020-12-03 12:35               ` Tomi Valkeinen
2020-11-03  8:03 ` [PATCH v2 2/5] drm/omap: use degamma property for gamma table Tomi Valkeinen
2020-11-30 10:39   ` Laurent Pinchart [this message]
2020-11-03  8:03 ` [PATCH v2 3/5] drm/omap: Implement CTM property for CRTC using OVL managers CPR matrix Tomi Valkeinen
2020-11-30 10:41   ` Laurent Pinchart
2020-11-30 11:39     ` Tomi Valkeinen
2020-11-03  8:03 ` [PATCH v2 4/5] drm/omap: rearrange includes in omapdss.h Tomi Valkeinen
2020-11-30 10:42   ` Laurent Pinchart
2020-11-03  8:03 ` [PATCH v2 5/5] drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes Tomi Valkeinen
2020-11-30 10:50   ` Laurent Pinchart
2020-11-30 11:53     ` Tomi Valkeinen
2020-11-30 14:19       ` Laurent Pinchart
2020-11-30 14:36         ` Tomi Valkeinen

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=20201130103903.GA7220@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=nikhil.nd@ti.com \
    --cc=nsekhar@ti.com \
    --cc=pekka.paalanen@collabora.com \
    --cc=tomi.valkeinen@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox