public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@intel.com>
To: "Lankhorst, Maarten" <maarten.lankhorst@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [RFC v1 3/7] drm/i915: Add Support for Multi Segment Gamma Mode
Date: Tue, 19 Mar 2019 18:59:22 +0200	[thread overview]
Message-ID: <20190319165922.GG3888@intel.com> (raw)
In-Reply-To: <1552985186.2455.2.camel@intel.com>

On Tue, Mar 19, 2019 at 10:46:27AM +0200, Lankhorst, Maarten wrote:
> tis 2019-03-19 klockan 14:00 +0530 skrev Uma Shankar:
> > Multi Segment Gamma Mode is added in Gen11+ platforms.
> > Added a property interface to enable that.
> > 
> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h    |  1 +
> >  drivers/gpu/drm/i915/intel_color.c | 23 +++++++++++++++++++++++
> >  include/uapi/drm/i915_drm.h        | 14 ++++++++++++++
> >  3 files changed, 38 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h
> > b/drivers/gpu/drm/i915/i915_drv.h
> > index 02231ae..f20d418 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1736,6 +1736,7 @@ struct drm_i915_private {
> >  	struct drm_property *force_audio_property;
> >  
> >  	struct drm_property *gamma_mode_property;
> > +	struct drm_property *multi_segment_gamma_mode_property;
> 
> Seems to me both properties should be part of drm core?
> 
> >  	/* hda/i915 audio component */
> >  	struct i915_audio_component *audio_component;
> > diff --git a/drivers/gpu/drm/i915/intel_color.c
> > b/drivers/gpu/drm/i915/intel_color.c
> > index 9d43d19..399d63d 100644
> > --- a/drivers/gpu/drm/i915/intel_color.c
> > +++ b/drivers/gpu/drm/i915/intel_color.c
> > @@ -149,6 +149,26 @@ static bool crtc_state_is_legacy_gamma(const
> > struct intel_crtc_state *crtc_state
> >  	drm_object_attach_property(&crtc->base.base, prop, 0);
> >  }
> >  
> > +void
> > +intel_attach_multi_segment_gamma_mode_property(struct intel_crtc
> > *crtc)
> > +{
> > +	struct drm_device *dev = crtc->base.dev;
> > +	struct drm_i915_private *dev_priv = to_i915(dev);
> > +	struct drm_property *prop;
> > +
> > +	prop = dev_priv->multi_segment_gamma_mode_property;
> > +	if (!prop) {
> > +		prop = drm_property_create(dev, DRM_MODE_PROP_BLOB,
> > +					   "Multi-segment Gamma",
> > 0);
> > +		if (!prop)
> > +			return;
> > +
> > +		dev_priv->multi_segment_gamma_mode_property = prop;
> > +	}
> > +
> > +	drm_object_attach_property(&crtc->base.base, prop, 0);
> > +}
> > +
> >  /*
> >   * When using limited range, multiply the matrix given by userspace
> > by
> >   * the matrix that we would use for the limited range.
> > @@ -953,4 +973,7 @@ void intel_color_init(struct intel_crtc *crtc)
> >  					   INTEL_INFO(dev_priv)-
> > >color.gamma_lut_size);
> >  
> >  	intel_attach_gamma_mode_property(crtc);
> > +
> > +	if (INTEL_GEN(dev_priv) >= 11)
> > +		intel_attach_multi_segment_gamma_mode_property(crtc)
> > ;
> >  }
> > diff --git a/include/uapi/drm/i915_drm.h
> > b/include/uapi/drm/i915_drm.h
> > index aa2d4c7..8f1974e 100644
> > --- a/include/uapi/drm/i915_drm.h
> > +++ b/include/uapi/drm/i915_drm.h
> > @@ -1842,6 +1842,20 @@ struct drm_i915_query_topology_info {
> >  	__u8 data[];
> >  };
> >  
> > +/*
> > + * Structure for muti segmented gamma lut
> > + */
> > +struct multi_segment_gamma_lut {
> > +	/* Number of Lut Segments */
> > +	__u8 segment_cnt;
> > +	/* Precison of LUT entries in bits */
> > +	__u8 precision_bits;
> > +	/* Pointer having number of LUT elements in each segment */
> > +	__u32 *segment_lut_cnt_ptr;
> > +	/* Pointer to store exact lut values for each segment */
> > +	__u32 *segment_lut_ptr;
> > +};
> > 
> And perhaps a variation of this as description for all gamma mode
> types.

This is my old idea how to represent fancier LUTs:
https://github.com/vsyrjala/linux/commit/1aab7625dca77b831e05e32af17904c21300ff95
https://github.com/vsyrjala/linux/commit/74ffa5d441702c53830f6d71bb687bb0ae5aa58f

Each distinct segment of the curve would be just described by
a fixed size range descriptor, and the entire blob would be made up
of however many of those are needed.

That way we don't even need any multi-segment uapi for setting up 
the LUT. The blob for that would just contain as many entries as the
LUT needs in that specific mode.

-- 
Ville Syrjälä
Intel
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

  reply	other threads:[~2019-03-19 16:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  8:30 [RFC v1 0/7] Add Multi Segment Gamma Support Uma Shankar
2019-03-19  8:12 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-03-19  8:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-19  8:30 ` [RFC v1 1/7] drm/i915: Add gamma mode property Uma Shankar
2019-03-21 21:19   ` Matt Roper
2019-03-22 13:06     ` Shankar, Uma
2019-03-22 13:39       ` Brian Starkey
2019-03-22 14:02         ` Ville Syrjälä
2019-03-22 15:42           ` Brian Starkey
2019-03-22 15:51             ` Ville Syrjälä
2019-03-19  8:30 ` [RFC v1 2/7] drm/i915: Add intel crtc set and get property callback Uma Shankar
2019-03-19  8:30 ` [RFC v1 3/7] drm/i915: Add Support for Multi Segment Gamma Mode Uma Shankar
2019-03-19  8:46   ` Lankhorst, Maarten
2019-03-19 16:59     ` Ville Syrjälä [this message]
2019-03-20 17:03       ` Shankar, Uma
2019-03-21 21:52         ` Matt Roper
2019-03-22 13:12           ` Shankar, Uma
2019-03-22 13:52         ` Ville Syrjälä
2019-03-28 19:00           ` Shankar, Uma
2019-03-28 19:28             ` Ville Syrjälä
2019-03-19  8:30 ` [RFC v1 4/7] drm/i915: Implement get set property handler for multi segment gamma Uma Shankar
2019-03-19  8:30 ` [RFC v1 5/7] drm/i915/icl: Add register definitions for Multi Segmented gamma Uma Shankar
2019-03-19  8:30 ` [RFC v1 6/7] drm/i915/icl: Add support for multi segmented gamma mode Uma Shankar
2019-03-19  8:30 ` [RFC v1 7/7] drm/i915: Add multi segment gamma for icl Uma Shankar
2019-03-21 22:04   ` Matt Roper
2019-03-22 13:17     ` Shankar, Uma
2019-03-19  8:31 ` ✗ Fi.CI.BAT: failure for Add Multi Segment Gamma Support 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=20190319165922.GG3888@intel.com \
    --to=ville.syrjala@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@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