dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Malladi, Kausal" <Kausal.Malladi@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: dhanya.p.r@intel.com, annie.j.matheson@intel.com,
	dri-devel@lists.freedesktop.org, vijay.a.purushothaman@intel.com,
	hverkuil@xs4all.nl, jesse.barnes@intel.com,
	daniel.vetter@intel.com, susanta.bhattacharjee@intel.com,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 10/16] drm/i915: Add set_property handler for pipe Gamma correction on CHV/BSW
Date: Tue, 21 Jul 2015 16:34:29 +0530	[thread overview]
Message-ID: <55AE273D.4040404@intel.com> (raw)
In-Reply-To: <20150721000307.GJ18641@intel.com>

On Tuesday 21 July 2015 05:33 AM, Matt Roper wrote:
> On Wed, Jul 15, 2015 at 06:39:34PM +0530, Kausal Malladi wrote:
>> This patch adds set_property handler for Gamma color correction and
>> enhancement capability at Pipe level on CHV/BSW platform. The set
>> function just attaches the Gamma blob to CRTC state, that later gets
>> committed using atomic path.
>>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> Signed-off-by: Kausal Malladi <Kausal.Malladi@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_atomic.c        |  7 +++++++
>>   drivers/gpu/drm/i915/intel_color_manager.c | 19 +++++++++++++++++++
>>   drivers/gpu/drm/i915/intel_drv.h           |  3 +++
>>   3 files changed, 29 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
>> index d873bda..72d6b37 100644
>> --- a/drivers/gpu/drm/i915/intel_atomic.c
>> +++ b/drivers/gpu/drm/i915/intel_atomic.c
>> @@ -473,6 +473,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->prop_palette_after_ctm)
>> +		return intel_color_manager_set_pipe_gamma(dev, state,
>> +				&crtc->base, val);
>> +
>>   	DRM_DEBUG_KMS("Unknown crtc property '%s'\n", property->name);
>>   	return -EINVAL;
>>   }
>> diff --git a/drivers/gpu/drm/i915/intel_color_manager.c b/drivers/gpu/drm/i915/intel_color_manager.c
>> index def20d0f..70c0d42 100644
>> --- a/drivers/gpu/drm/i915/intel_color_manager.c
>> +++ b/drivers/gpu/drm/i915/intel_color_manager.c
>> @@ -27,6 +27,25 @@
>>   
>>   #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");
>> +		return -EINVAL;
>> +	}
> I'm not terribly familiar the semantics of the color correction
> stuff...this prevents userspace from removing the gamma setting by
> passing a 0; is that expected that gamma can't be disabled once set?
> Same question for your degamma patch later in the series.
If you mean to say this is preventing user space from disabling gamma, 
we have another provision for the same. During set property, if 
num_samples is 0 in the blob that was passed, it will disable gamma 
correction.

This check is just preventing user space to pass garbage blob ID.

Thanks
Kausal
>
> Matt
>
>> +
>> +	if (crtc_state->palette_after_ctm_blob)
>> +		drm_property_unreference_blob(crtc_state->palette_after_ctm_blob);
>> +
>> +	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 1e61036..45c42f0 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -1453,5 +1453,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__ */
>> -- 
>> 2.4.5
>>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-21 11:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 13:09 [PATCH 00/16] Color Manager Implementation Kausal Malladi
2015-07-15 13:09 ` [PATCH 01/16] drm/i915: Atomic commit path fix for CRTC properties Kausal Malladi
2015-07-15 13:09 ` [PATCH 02/16] drm: Create Color Management DRM properties Kausal Malladi
2015-07-15 13:25   ` Thierry Reding
2015-07-15 15:14     ` Sharma, Shashank
2015-07-15 13:09 ` [PATCH 03/16] drm/i915: Attach color properties to CRTC Kausal Malladi
2015-07-21  0:02   ` Matt Roper
2015-07-15 13:09 ` [PATCH 04/16] drm: Add structure for querying palette color capabilities Kausal Malladi
2015-07-15 13:09 ` [PATCH 05/16] drm: Export drm_property_replace_global_blob function Kausal Malladi
2015-07-15 13:09 ` [PATCH 06/16] drm/i915: Load gamma color capabilities for CHV CRTC Kausal Malladi
2015-07-21  0:02   ` Matt Roper
2015-07-15 13:09 ` [PATCH 07/16] drm/i915: Add atomic set property interface for CRTC Kausal Malladi
2015-07-21  0:02   ` Matt Roper
2015-07-15 13:09 ` [PATCH 08/16] drm: Add blob properties to CRTC state for color properties Kausal Malladi
2015-07-15 13:09 ` [PATCH 09/16] drm: Add structures to set/get a palette color property Kausal Malladi
2015-07-15 13:09 ` [PATCH 10/16] drm/i915: Add set_property handler for pipe Gamma correction on CHV/BSW Kausal Malladi
2015-07-21  0:03   ` Matt Roper
2015-07-21 11:04     ` Malladi, Kausal [this message]
2015-07-15 13:09 ` [PATCH 11/16] drm/i915: Add pipe level Gamma correction for CHV/BSW Kausal Malladi
2015-07-21  0:03   ` Matt Roper
2015-07-21 11:10     ` Malladi, Kausal
2015-07-21 23:34       ` Matt Roper
2015-07-15 13:09 ` [PATCH 12/16] drm/i915: Add set_property handler for pipe deGamma correction on CHV/BSW Kausal Malladi
2015-07-15 13:09 ` [PATCH 13/16] drm/i915: Add DeGamma correction for CHV/BSW Kausal Malladi
2015-07-15 13:09 ` [PATCH 14/16] drm: Add structure for set/get a CTM color property Kausal Malladi
2015-07-15 13:09 ` [PATCH 15/16] drm/i915: Add set_property handler for CSC correction on CHV/BSW Kausal Malladi
2015-07-15 13:09 ` [PATCH 16/16] drm/i915: Add CSC correction for CHV/BSW Kausal Malladi

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=55AE273D.4040404@intel.com \
    --to=kausal.malladi@intel.com \
    --cc=annie.j.matheson@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dhanya.p.r@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hverkuil@xs4all.nl \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jesse.barnes@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=susanta.bhattacharjee@intel.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;
as well as URLs for NNTP newsgroup(s).