public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 15/15] drm/i915: Use more atomic state in intel_color.c
Date: Thu, 18 Aug 2016 16:02:38 +0200	[thread overview]
Message-ID: <20160818140238.GQ6232@phenom.ffwll.local> (raw)
In-Reply-To: <1470755054-32699-16-git-send-email-maarten.lankhorst@linux.intel.com>

On Tue, Aug 09, 2016 at 05:04:14PM +0200, Maarten Lankhorst wrote:
> crtc_state is already passed around, use it instead of crtc->config.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_color.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index bc0fef3d3335..95a72771eea6 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -100,13 +100,14 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
>  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  	int i, pipe = intel_crtc->pipe;
>  	uint16_t coeffs[9] = { 0, };
> +	struct intel_crtc_state *intel_crtc_state = to_intel_crtc_state(crtc_state);
>  
>  	if (crtc_state->ctm) {
>  		struct drm_color_ctm *ctm =
>  			(struct drm_color_ctm *)crtc_state->ctm->data;
>  		uint64_t input[9] = { 0, };
>  
> -		if (intel_crtc->config->limited_color_range) {
> +		if (intel_crtc_state->limited_color_range) {
>  			ctm_mult_by_limited(input, ctm->matrix);
>  		} else {
>  			for (i = 0; i < ARRAY_SIZE(input); i++)
> @@ -158,7 +159,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
>  		 * into consideration.
>  		 */
>  		for (i = 0; i < 3; i++) {
> -			if (intel_crtc->config->limited_color_range)
> +			if (intel_crtc_state->limited_color_range)
>  				coeffs[i * 3 + i] =
>  					I9XX_CSC_COEFF_LIMITED_RANGE;
>  			else
> @@ -182,7 +183,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
>  	if (INTEL_INFO(dev)->gen > 6) {
>  		uint16_t postoff = 0;
>  
> -		if (intel_crtc->config->limited_color_range)
> +		if (intel_crtc_state->limited_color_range)
>  			postoff = (16 * (1 << 12) / 255) & 0x1fff;
>  
>  		I915_WRITE(PIPE_CSC_POSTOFF_HI(pipe), postoff);
> @@ -193,7 +194,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
>  	} else {
>  		uint32_t mode = CSC_MODE_YUV_TO_RGB;
>  
> -		if (intel_crtc->config->limited_color_range)
> +		if (intel_crtc_state->limited_color_range)
>  			mode |= CSC_BLACK_SCREEN_OFFSET;
>  
>  		I915_WRITE(PIPE_CSC_MODE(pipe), mode);
> @@ -263,7 +264,8 @@ void intel_color_set_csc(struct drm_crtc_state *crtc_state)
>  
>  /* Loads the legacy palette/gamma unit for the CRTC. */
>  static void i9xx_load_luts_internal(struct drm_crtc *crtc,
> -				    struct drm_property_blob *blob)
> +				    struct drm_property_blob *blob,
> +				    struct intel_crtc_state *crtc_state)
>  {
>  	struct drm_device *dev = crtc->dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> @@ -272,7 +274,7 @@ static void i9xx_load_luts_internal(struct drm_crtc *crtc,
>  	int i;
>  
>  	if (HAS_GMCH_DISPLAY(dev)) {
> -		if (intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI))
> +		if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI))
>  			assert_dsi_pll_enabled(dev_priv);
>  		else
>  			assert_pll_enabled(dev_priv, pipe);
> @@ -305,7 +307,8 @@ static void i9xx_load_luts_internal(struct drm_crtc *crtc,
>  
>  static void i9xx_load_luts(struct drm_crtc_state *crtc_state)
>  {
> -	i9xx_load_luts_internal(crtc_state->crtc, crtc_state->gamma_lut);
> +	i9xx_load_luts_internal(crtc_state->crtc, crtc_state->gamma_lut,
> +				to_intel_crtc_state(crtc_state));
>  }
>  
>  /* Loads the legacy palette/gamma unit for the CRTC on Haswell. */
> @@ -323,7 +326,7 @@ static void haswell_load_luts(struct drm_crtc_state *crtc_state)
>  	 * Workaround : Do not read or write the pipe palette/gamma data while
>  	 * GAMMA_MODE is configured for split gamma and IPS_CTL has IPS enabled.
>  	 */
> -	if (IS_HASWELL(dev) && intel_crtc->config->ips_enabled &&
> +	if (IS_HASWELL(dev) && intel_crtc_state->ips_enabled &&
>  	    (intel_crtc_state->gamma_mode == GAMMA_MODE_MODE_SPLIT)) {
>  		hsw_disable_ips(intel_crtc);
>  		reenable_ips = true;
> @@ -436,7 +439,8 @@ static void cherryview_load_luts(struct drm_crtc_state *state)
>  		/* Turn off degamma/gamma on CGM block. */
>  		I915_WRITE(CGM_PIPE_MODE(pipe),
>  			   (state->ctm ? CGM_PIPE_MODE_CSC : 0));
> -		i9xx_load_luts_internal(crtc, state->gamma_lut);
> +		i9xx_load_luts_internal(crtc, state->gamma_lut,
> +					to_intel_crtc_state(state));
>  		return;
>  	}
>  
> @@ -479,7 +483,7 @@ static void cherryview_load_luts(struct drm_crtc_state *state)
>  	 * Also program a linear LUT in the legacy block (behind the
>  	 * CGM block).
>  	 */
> -	i9xx_load_luts_internal(crtc, NULL);
> +	i9xx_load_luts_internal(crtc, NULL, to_intel_crtc_state(state));
>  }
>  
>  void intel_color_load_luts(struct drm_crtc_state *crtc_state)
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-08-18 14:02 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 15:03 [PATCH 00/15] drm/i915: Use connector atomic state in encoders Maarten Lankhorst
2016-08-09 15:04 ` [PATCH 01/15] drm/i915: handle DP_MST correctly in bxt_get_dpll Maarten Lankhorst
2016-08-18 13:17   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 02/15] drm/i915: Pass atomic state to crtc enable/disable functions Maarten Lankhorst
2016-08-18 13:19   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 03/15] drm/i915: Remove unused mode_set hook from encoder Maarten Lankhorst
2016-08-18 13:20   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 04/15] drm/i915: Walk over encoders in crtc enable/disable using atomic state Maarten Lankhorst
2016-08-22 14:28   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions Maarten Lankhorst
2016-08-18 13:30   ` Daniel Vetter
2016-08-22  8:06     ` Maarten Lankhorst
2016-08-22 14:32       ` Daniel Vetter
2016-08-23  8:18         ` Maarten Lankhorst
2016-08-23  8:33           ` Daniel Vetter
2016-08-23 11:48         ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 06/15] drm/i915: Make encoder->compute_config take the connector state Maarten Lankhorst
2016-08-18 13:31   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 07/15] drm/i915: Remove unused loop from intel_dp_mst_compute_config Maarten Lankhorst
2016-08-18 13:34   ` Daniel Vetter
2016-08-22 12:43     ` Maarten Lankhorst
2016-08-22 14:33       ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 08/15] drm/i915: Convert intel_crt to use atomic state Maarten Lankhorst
2016-08-18 13:35   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 09/15] drm/i915: Convert intel_dvo " Maarten Lankhorst
2016-08-18 13:36   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 10/15] drm/i915: Convert intel_dsi " Maarten Lankhorst
2016-08-18 13:43   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 11/15] drm/i915: Convert intel_sdvo " Maarten Lankhorst
2016-08-18 13:44   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 12/15] drm/i915: Convert intel_lvds " Maarten Lankhorst
2016-08-18 13:47   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 13/15] drm/i915: Convert intel_dp_mst " Maarten Lankhorst
2016-08-18 13:54   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 14/15] drm/i915: Convert intel_dp " Maarten Lankhorst
2016-08-18 14:01   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 15/15] drm/i915: Use more atomic state in intel_color.c Maarten Lankhorst
2016-08-18 14:02   ` Daniel Vetter [this message]
2016-08-09 15:55 ` ✗ Ro.CI.BAT: failure for drm/i915: Use connector atomic state in encoders Patchwork
2016-08-10  7:53 ` Patchwork
2016-08-18 14:04 ` [PATCH 00/15] " Daniel Vetter
2016-08-22  8:12   ` Maarten Lankhorst
  -- strict thread matches above, loose matches on Subject: below --
2016-07-07 11:55 [PATCH 01/15] drm/i915: handle DP_MST correctly in bxt_get_dpll Maarten Lankhorst
2016-07-07 11:55 ` [PATCH 15/15] drm/i915: Use more atomic state in intel_color.c Maarten Lankhorst

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=20160818140238.GQ6232@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox