public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Shashank Sharma <shashank.sharma@intel.com>
Cc: annie.j.matheson@intel.com, kausalmalladi@gmail.com,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	vijay.a.purushothaman@intel.com, hverkuil@xs4all.nl,
	thierry.reding@gmail.com, jesse.barnes@intel.com,
	daniel.vetter@intel.com, susanta.bhattacharjee@intel.com
Subject: Re: [PATCH 08/18] drm/i915: Add pipe gamma correction handlers
Date: Fri, 21 Aug 2015 15:40:54 -0700	[thread overview]
Message-ID: <20150821224054.GI13406@intel.com> (raw)
In-Reply-To: <1438879107-22819-9-git-send-email-shashank.sharma@intel.com>

On Thu, Aug 06, 2015 at 10:08:17PM +0530, Shashank Sharma wrote:
> From: Kausal Malladi <kausalmalladi@gmail.com>
> 
> I915 driver registers gamma correction as palette correction
> property with DRM layer. This patch adds set_property() and get_property()
> handlers for pipe level gamma correction.
> 
> The set function attaches the Gamma correction blob to CRTC state, these
> values will be committed during atomic commit.
> 
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> Signed-off-by: Kausal Malladi <kausalmalladi@gmail.com>
> ---
>  drivers/gpu/drm/i915/intel_atomic.c        | 14 ++++++++++++++
>  drivers/gpu/drm/i915/intel_color_manager.c | 20 ++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_drv.h           |  3 +++
>  3 files changed, 37 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 8d04ee8..9f55e6c 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -324,6 +324,13 @@ int intel_crtc_atomic_set_property(struct drm_crtc *crtc,
>  				   struct drm_property *property,
>  				   uint64_t val)
>  {
> +	struct drm_device *dev = crtc->dev;
> +	struct drm_mode_config *config = &dev->mode_config;
> +
> +	if (property == config->cm_palette_after_ctm_property)
> +		return intel_color_manager_set_pipe_gamma(dev, state,
> +				&crtc->base, val);
> +
>  	DRM_DEBUG_KMS("Unknown crtc property '%s'\n", property->name);
>  	return -EINVAL;
>  }
> @@ -333,5 +340,12 @@ int intel_crtc_atomic_get_property(struct drm_crtc *crtc,
>  				   struct drm_property *property,
>  				   uint64_t *val)
>  {
> +	struct drm_device *dev = crtc->dev;
> +	struct drm_mode_config *config = &dev->mode_config;
> +
> +	if (property == config->cm_palette_after_ctm_property)
> +		*val = (state->palette_after_ctm_blob) ?
> +			state->palette_after_ctm_blob->base.id : 0;
> +
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/intel_color_manager.c b/drivers/gpu/drm/i915/intel_color_manager.c
> index 1c9c477..9a6126c 100644
> --- a/drivers/gpu/drm/i915/intel_color_manager.c
> +++ b/drivers/gpu/drm/i915/intel_color_manager.c
> @@ -27,6 +27,26 @@
>  
>  #include "intel_color_manager.h"
>  
> +int intel_color_manager_set_pipe_gamma(struct drm_device *dev,
> +		struct drm_crtc_state *crtc_state,
> +		struct drm_mode_object *obj, uint32_t blob_id)
> +{
> +	struct drm_property_blob *blob;
> +
> +	blob = drm_property_lookup_blob(dev, blob_id);
> +	if (!blob) {
> +		DRM_ERROR("Invalid Blob ID\n");

A user can trigger this error on demand, so I think we want to keep this
as DRM_DEBUG_KMS (same on patches #10 and 13).


Matt

> +		return -EINVAL;
> +	}
> +
> +	if (crtc_state->palette_after_ctm_blob)
> +		drm_property_unreference_blob(crtc_state->palette_after_ctm_blob);
> +
> +	/* Attach the blob to be commited in state */
> +	crtc_state->palette_after_ctm_blob = blob;
> +	return 0;
> +}
> +
>  int get_chv_pipe_gamma_capabilities(struct drm_device *dev,
>  		struct drm_palette_caps *palette_caps, struct drm_crtc *crtc)
>  {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index dee5f91..820ded7 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1441,5 +1441,8 @@ extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
>  /* intel_color_manager.c */
>  void intel_attach_color_properties_to_crtc(struct drm_device *dev,
>  		struct drm_mode_object *mode_obj);
> +int intel_color_manager_set_pipe_gamma(struct drm_device *dev,
> +		struct drm_crtc_state *crtc_state,
> +		struct drm_mode_object *obj, uint32_t blob_id);
>  
>  #endif /* __INTEL_DRV_H__ */
> -- 
> 1.9.1
> 

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-08-21 22:40 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 16:38 [PATCH 00/18] Color Management for DRM Shashank Sharma
2015-08-06 16:38 ` [PATCH 01/18] drm: Create Color Management DRM properties Shashank Sharma
2015-08-06 16:38 ` [PATCH 02/18] drm/i915: Add atomic set property interface for CRTC Shashank Sharma
2015-08-06 16:38 ` [PATCH 03/18] drm/i915: Add atomic get " Shashank Sharma
2015-08-21 22:40   ` Matt Roper
2015-08-22  6:00     ` Sharma, Shashank
2015-08-25  7:16       ` Daniel Vetter
2015-08-06 16:38 ` [PATCH 04/18] drm: Add structure for querying palette color capabilities Shashank Sharma
2015-08-06 16:38 ` [PATCH 05/18] drm/i915: Initialize color manager and add gamma correction Shashank Sharma
2015-08-21 22:40   ` Matt Roper
2015-08-22  6:08     ` Sharma, Shashank
2015-08-06 16:38 ` [PATCH 06/18] drm: Add color correction blobs in CRTC state Shashank Sharma
2015-08-21 22:40   ` Matt Roper
2015-08-22  6:09     ` Sharma, Shashank
2015-08-06 16:38 ` [PATCH 07/18] drm: Add drm structures for palette color property Shashank Sharma
2015-08-06 16:38 ` [PATCH 08/18] drm/i915: Add pipe gamma correction handlers Shashank Sharma
2015-08-21 22:40   ` Matt Roper [this message]
2015-08-22  6:11     ` Sharma, Shashank
2015-08-25  7:18       ` Daniel Vetter
2015-08-06 16:38 ` [PATCH 09/18] drm/i915: Pipe level Gamma correction for CHV/BSW Shashank Sharma
2015-08-21 22:41   ` Matt Roper
2015-08-22  6:18     ` Sharma, Shashank
2015-08-06 16:38 ` [PATCH 10/18] drm/i915: Add pipe deGamma correction handlers Shashank Sharma
2015-08-06 16:38 ` [PATCH 11/18] drm/i915: Add DeGamma correction for CHV/BSW Shashank Sharma
2015-08-06 16:38 ` [PATCH 12/18] drm: Add structure for set/get a CTM color property Shashank Sharma
2015-08-06 16:38 ` [PATCH 13/18] drm/i915: Add set/get property handlers for CSC correction Shashank Sharma
2015-08-06 16:38 ` [PATCH 14/18] drm/i915: Add CSC correction for CHV/BSW Shashank Sharma
2015-08-06 16:38 ` [PATCH 15/18] drm/i915: Initialize Gen8 pipe gamma correction Shashank Sharma
2015-08-21 22:41   ` Matt Roper
2015-08-22  6:31     ` Sharma, Shashank
2015-08-06 16:38 ` [PATCH 16/18] drm/i915: Gen8 pipe level Gamma correction Shashank Sharma
2015-08-06 16:38 ` [PATCH 17/18] drm/i915: Add DeGamma correction for BDW/SKL/BXT Shashank Sharma
2015-08-06 16:38 ` [PATCH 18/18] drm/i915: Add CSC " Shashank Sharma
2015-08-13  0:28   ` shuang.he
2015-09-30 17:49   ` Rob Bradford
2015-09-08 10:49 ` [PATCH 00/18] Color Management for DRM Rob Bradford
2015-09-08 11:10   ` Sharma, Shashank

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=20150821224054.GI13406@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=annie.j.matheson@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hverkuil@xs4all.nl \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jesse.barnes@intel.com \
    --cc=kausalmalladi@gmail.com \
    --cc=shashank.sharma@intel.com \
    --cc=susanta.bhattacharjee@intel.com \
    --cc=thierry.reding@gmail.com \
    --cc=vijay.a.purushothaman@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox