All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Extract ilk_lut_10()
Date: Thu, 28 Mar 2019 17:15:01 -0700	[thread overview]
Message-ID: <20190329001501.GV4773@mdroper-desk.amr.corp.intel.com> (raw)
In-Reply-To: <20190328210505.10429-2-ville.syrjala@linux.intel.com>

On Thu, Mar 28, 2019 at 11:05:00PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Extract a helper to calculate the ILK+ 10it gamma LUT entry.

Missing a 'b' in '10it' but otherwise:

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> It's already duplicated twice, and soon we'll have more.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_color.c | 27 +++++++++++----------------
>  1 file changed, 11 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index ff910ed08468..d7c38a2bbd8f 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -359,6 +359,13 @@ static void cherryview_load_csc_matrix(const struct intel_crtc_state *crtc_state
>  	I915_WRITE(CGM_PIPE_MODE(pipe), crtc_state->cgm_mode);
>  }
>  
> +static u32 ilk_lut_10(const struct drm_color_lut *color)
> +{
> +	return drm_color_lut_extract(color->red, 10) << 20 |
> +		drm_color_lut_extract(color->green, 10) << 10 |
> +		drm_color_lut_extract(color->blue, 10);
> +}
> +
>  /* Loads the legacy palette/gamma unit for the CRTC. */
>  static void i9xx_load_luts_internal(const struct intel_crtc_state *crtc_state,
>  				    const struct drm_property_blob *blob)
> @@ -473,14 +480,8 @@ static void bdw_load_degamma_lut(const struct intel_crtc_state *crtc_state)
>  	if (degamma_lut) {
>  		const struct drm_color_lut *lut = degamma_lut->data;
>  
> -		for (i = 0; i < lut_size; i++) {
> -			u32 word =
> -			drm_color_lut_extract(lut[i].red, 10) << 20 |
> -			drm_color_lut_extract(lut[i].green, 10) << 10 |
> -			drm_color_lut_extract(lut[i].blue, 10);
> -
> -			I915_WRITE(PREC_PAL_DATA(pipe), word);
> -		}
> +		for (i = 0; i < lut_size; i++)
> +			I915_WRITE(PREC_PAL_DATA(pipe), ilk_lut_10(&lut[i]));
>  	} else {
>  		for (i = 0; i < lut_size; i++) {
>  			u32 v = (i * ((1 << 10) - 1)) / (lut_size - 1);
> @@ -509,14 +510,8 @@ static void bdw_load_gamma_lut(const struct intel_crtc_state *crtc_state, u32 of
>  	if (gamma_lut) {
>  		const struct drm_color_lut *lut = gamma_lut->data;
>  
> -		for (i = 0; i < lut_size; i++) {
> -			u32 word =
> -			(drm_color_lut_extract(lut[i].red, 10) << 20) |
> -			(drm_color_lut_extract(lut[i].green, 10) << 10) |
> -			drm_color_lut_extract(lut[i].blue, 10);
> -
> -			I915_WRITE(PREC_PAL_DATA(pipe), word);
> -		}
> +		for (i = 0; i < lut_size; i++)
> +			I915_WRITE(PREC_PAL_DATA(pipe), ilk_lut_10(&lut[i]));
>  
>  		/* Program the max register to clamp values > 1.0. */
>  		i = lut_size - 1;
> -- 
> 2.19.2
> 

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

  reply	other threads:[~2019-03-29  0:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 21:04 [PATCH 0/6] drm/i915: Finish the GAMMA_LUT stuff Ville Syrjala
2019-03-28 21:05 ` [PATCH 1/6] drm/i915: Extract ilk_lut_10() Ville Syrjala
2019-03-29  0:15   ` Matt Roper [this message]
2019-03-28 21:05 ` [PATCH 2/6] drm/i915: Don't use split gamma when we don't have to Ville Syrjala
2019-03-29  0:16   ` Matt Roper
2019-03-29 10:47     ` Ville Syrjälä
2019-03-29 12:25       ` Shankar, Uma
2019-03-29 13:49       ` Ville Syrjälä
2019-03-29 14:14   ` [PATCH v2 " Ville Syrjala
2019-03-28 21:05 ` [PATCH 3/6] drm/i915: Implement split/10bit gamma for ivb/hsw Ville Syrjala
2019-03-29  0:16   ` Matt Roper
2019-03-28 21:05 ` [PATCH 4/6] drm/i915: Add 10bit LUT for ilk/snb Ville Syrjala
2019-03-29  0:17   ` Matt Roper
2019-03-29 10:07   ` Maarten Lankhorst
2019-03-28 21:05 ` [PATCH 5/6] drm/i915: Add "10.6" LUT mode for i965+ Ville Syrjala
2019-04-04 23:52   ` Sripada, Radhakrishna
2019-03-28 21:05 ` [PATCH 6/6] drm/i915: Expose the legacy LUT via the GAMMA_LUT/GAMMA_LUT_SIZE props on gen2/3 Ville Syrjala
2019-04-04 16:52   ` Sripada, Radhakrishna
2019-03-28 22:06 ` ✓ Fi.CI.BAT: success for drm/i915: Finish the GAMMA_LUT stuff Patchwork
2019-03-29  8:34 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-03-29 10:57   ` Ville Syrjälä
2019-03-29 15:26 ` ✓ Fi.CI.BAT: success for drm/i915: Finish the GAMMA_LUT stuff (rev2) Patchwork
2019-03-29 19:13 ` ✗ Fi.CI.IGT: failure " 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=20190329001501.GV4773@mdroper-desk.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.