All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lisovskiy, Stanislav" <stanislav.lisovskiy@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 4/4] drm/i915: Split pipe+output CSC programming to noarm+arm pair
Date: Tue, 29 Mar 2022 12:29:32 +0300	[thread overview]
Message-ID: <20220329092932.GC1336@intel.com> (raw)
In-Reply-To: <20220224165103.15682-5-ville.syrjala@linux.intel.com>

On Thu, Feb 24, 2022 at 06:51:03PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Move most of the pipe+output CSC programming to the
> .color_commit_noarm() hook which runs before vblank evasion.
> Only PIPE_CSC_MODE (the arming register) needs to remain in
> inside the critical section.
> 

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

> A test case that just updates the CTM in a loop produces
> the following i915_update_info numbers on ilk (w/o lockdep):
> old                                 new
> Updates: 10012			    Updates: 10008
>        |			    	   |
>    1us |**			       1us |**********
>        |*************		    	   |*************
>    4us |*********		       4us |*
>        |*			    	   |**
>   16us |			      16us |
>        |			    	   |
>   66us |			      66us |
>        |			    	   |
>  262us |			     262us |
>        |			    	   |
>    1ms |			       1ms |
>        |			    	   |
>    4ms |			       4ms |
>        |			    	   |
>   17ms |			      17ms |
>        |			    	   |
> Min update: 1345ns		    Min update: 1268ns
> Max update: 16672ns		    Max update: 15656ns
> Average update: 3914ns		    Average update: 2185ns
> Overruns > 100us: 0		    Overruns > 100us: 0
> 
> And here is tgl (forced to update both pipe CSC and
> output CSC, and with lockdep enabled):
> old                                 new
> Updates: 10012			    Updates: 10012
>        |			    	   |
>    1us |			       1us |
>        |			    	   |
>    4us |*			       4us |**
>        |**			    	   |**********
>   16us |*************		      16us |*************
>        |*			    	   |
>   66us |			      66us |
>        |			    	   |
>  262us |			     262us |
>        |			    	   |
>    1ms |			       1ms |
>        |			    	   |
>    4ms |			       4ms |
>        |			    	   |
>   17ms |			      17ms |
>        |			    	   |
> Min update: 5204ns		    Min update: 5176ns
> Max update: 176038ns		    Max update: 186685ns
> Average update: 23931ns		    Average update: 16654ns
> Overruns > 250us: 0		    Overruns > 250us: 0
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_color.c | 36 ++++++++++++++--------
>  1 file changed, 23 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index df775c6179b2..34128c9c635c 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -346,15 +346,11 @@ static void ilk_load_csc_matrix(const struct intel_crtc_state *crtc_state)
>  				    ilk_csc_coeff_identity,
>  				    ilk_csc_off_zero);
>  	}
> -
> -	intel_de_write_fw(dev_priv, PIPE_CSC_MODE(crtc->pipe),
> -			  crtc_state->csc_mode);
>  }
>  
>  static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> -	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
>  
>  	if (crtc_state->hw.ctm) {
>  		u16 coeff[9];
> @@ -373,9 +369,6 @@ static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state)
>  				      ilk_csc_coeff_limited_range,
>  				      ilk_csc_postoff_limited_range);
>  	}
> -
> -	intel_de_write_fw(dev_priv, PIPE_CSC_MODE(crtc->pipe),
> -			  crtc_state->csc_mode);
>  }
>  
>  static void chv_load_cgm_csc(struct intel_crtc *crtc,
> @@ -500,6 +493,16 @@ static void icl_lut_multi_seg_pack(struct drm_color_lut *entry, u32 ldw, u32 udw
>  				    REG_FIELD_GET(PAL_PREC_MULTI_SEG_BLUE_LDW_MASK, ldw);
>  }
>  
> +static void icl_color_commit_noarm(const struct intel_crtc_state *crtc_state)
> +{
> +	icl_load_csc_matrix(crtc_state);
> +}
> +
> +static void ilk_color_commit_noarm(const struct intel_crtc_state *crtc_state)
> +{
> +	ilk_load_csc_matrix(crtc_state);
> +}
> +
>  static void i9xx_color_commit_arm(const struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> @@ -525,7 +528,8 @@ static void ilk_color_commit_arm(const struct intel_crtc_state *crtc_state)
>  	val |= PIPECONF_GAMMA_MODE(crtc_state->gamma_mode);
>  	intel_de_write(dev_priv, PIPECONF(pipe), val);
>  
> -	ilk_load_csc_matrix(crtc_state);
> +	intel_de_write_fw(dev_priv, PIPE_CSC_MODE(pipe),
> +			  crtc_state->csc_mode);
>  }
>  
>  static void hsw_color_commit_arm(const struct intel_crtc_state *crtc_state)
> @@ -536,7 +540,8 @@ static void hsw_color_commit_arm(const struct intel_crtc_state *crtc_state)
>  	intel_de_write(dev_priv, GAMMA_MODE(crtc->pipe),
>  		       crtc_state->gamma_mode);
>  
> -	ilk_load_csc_matrix(crtc_state);
> +	intel_de_write_fw(dev_priv, PIPE_CSC_MODE(crtc->pipe),
> +			  crtc_state->csc_mode);
>  }
>  
>  static void skl_color_commit_arm(const struct intel_crtc_state *crtc_state)
> @@ -560,10 +565,8 @@ static void skl_color_commit_arm(const struct intel_crtc_state *crtc_state)
>  	intel_de_write(dev_priv, GAMMA_MODE(crtc->pipe),
>  		       crtc_state->gamma_mode);
>  
> -	if (DISPLAY_VER(dev_priv) >= 11)
> -		icl_load_csc_matrix(crtc_state);
> -	else
> -		ilk_load_csc_matrix(crtc_state);
> +	intel_de_write_fw(dev_priv, PIPE_CSC_MODE(crtc->pipe),
> +			  crtc_state->csc_mode);
>  }
>  
>  static void i9xx_load_lut_8(struct intel_crtc *crtc,
> @@ -2170,6 +2173,7 @@ static const struct intel_color_funcs i9xx_color_funcs = {
>  
>  static const struct intel_color_funcs icl_color_funcs = {
>  	.color_check = icl_color_check,
> +	.color_commit_noarm = icl_color_commit_noarm,
>  	.color_commit_arm = skl_color_commit_arm,
>  	.load_luts = icl_load_luts,
>  	.read_luts = icl_read_luts,
> @@ -2177,6 +2181,7 @@ static const struct intel_color_funcs icl_color_funcs = {
>  
>  static const struct intel_color_funcs glk_color_funcs = {
>  	.color_check = glk_color_check,
> +	.color_commit_noarm = ilk_color_commit_noarm,
>  	.color_commit_arm = skl_color_commit_arm,
>  	.load_luts = glk_load_luts,
>  	.read_luts = glk_read_luts,
> @@ -2184,6 +2189,7 @@ static const struct intel_color_funcs glk_color_funcs = {
>  
>  static const struct intel_color_funcs skl_color_funcs = {
>  	.color_check = ivb_color_check,
> +	.color_commit_noarm = ilk_color_commit_noarm,
>  	.color_commit_arm = skl_color_commit_arm,
>  	.load_luts = bdw_load_luts,
>  	.read_luts = NULL,
> @@ -2191,6 +2197,7 @@ static const struct intel_color_funcs skl_color_funcs = {
>  
>  static const struct intel_color_funcs bdw_color_funcs = {
>  	.color_check = ivb_color_check,
> +	.color_commit_noarm = ilk_color_commit_noarm,
>  	.color_commit_arm = hsw_color_commit_arm,
>  	.load_luts = bdw_load_luts,
>  	.read_luts = NULL,
> @@ -2198,6 +2205,7 @@ static const struct intel_color_funcs bdw_color_funcs = {
>  
>  static const struct intel_color_funcs hsw_color_funcs = {
>  	.color_check = ivb_color_check,
> +	.color_commit_noarm = ilk_color_commit_noarm,
>  	.color_commit_arm = hsw_color_commit_arm,
>  	.load_luts = ivb_load_luts,
>  	.read_luts = NULL,
> @@ -2205,6 +2213,7 @@ static const struct intel_color_funcs hsw_color_funcs = {
>  
>  static const struct intel_color_funcs ivb_color_funcs = {
>  	.color_check = ivb_color_check,
> +	.color_commit_noarm = ilk_color_commit_noarm,
>  	.color_commit_arm = ilk_color_commit_arm,
>  	.load_luts = ivb_load_luts,
>  	.read_luts = NULL,
> @@ -2212,6 +2221,7 @@ static const struct intel_color_funcs ivb_color_funcs = {
>  
>  static const struct intel_color_funcs ilk_color_funcs = {
>  	.color_check = ilk_color_check,
> +	.color_commit_noarm = ilk_color_commit_noarm,
>  	.color_commit_arm = ilk_color_commit_arm,
>  	.load_luts = ilk_load_luts,
>  	.read_luts = ilk_read_luts,
> -- 
> 2.34.1
> 

  reply	other threads:[~2022-03-29  9:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 16:50 [Intel-gfx] [PATCH 0/4] drm/i915: Optimize CSC updates for ilk+ Ville Syrjala
2022-02-24 16:51 ` [Intel-gfx] [PATCH 1/4] drm/i915: Remove locks around skl+ scaler programming Ville Syrjala
2022-03-29  9:28   ` Lisovskiy, Stanislav
2022-02-24 16:51 ` [Intel-gfx] [PATCH 2/4] drm/i915: Make ilk+ pfit regiser unlocked Ville Syrjala
2022-03-29  9:28   ` Lisovskiy, Stanislav
2022-02-24 16:51 ` [Intel-gfx] [PATCH 3/4] drm/i915: Split color_commit() into noarm+arm pair Ville Syrjala
2022-03-29  9:29   ` Lisovskiy, Stanislav
2022-02-24 16:51 ` [Intel-gfx] [PATCH 4/4] drm/i915: Split pipe+output CSC programming to " Ville Syrjala
2022-03-29  9:29   ` Lisovskiy, Stanislav [this message]
2022-02-25  3:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Optimize CSC updates for ilk+ Patchwork
2022-02-25 19:27 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20220329092932.GC1336@intel.com \
    --to=stanislav.lisovskiy@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.