Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Anshuman Gupta <anshuman.gupta@intel.com>,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	Juston Li <juston.li@intel.com>,
	Uma Shankar <uma.shankar@intel.com>
Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915: Fix up skl_program_plane() pxp stuff
Date: Thu, 7 Oct 2021 14:36:47 -0400	[thread overview]
Message-ID: <YV8+P2TOWhD4nukJ@intel.com> (raw)
In-Reply-To: <20211006235704.28894-3-ville.syrjala@linux.intel.com>

On Thu, Oct 07, 2021 at 02:57:02AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> There's lots of expensive stuff inserted between the PLANE_CTL
> and  PLANE_SURF writes even though the comment before the PLANE_CTL
> write says not to put stuff there. Move it all to a more apporiate
> place.

Yeap, the comment was ignored by all, including me during reviews. Sorry.

I'm wondering now if this entire block deserves a separated function
with more emphasis on the "do not put anything between plane_ctl and
plane_srf...

> 
> There's also a weird PLANE_COLOR_CTL RMW in there. I guess because
> force_black was computed way too late originally, but that is now
> sorted.

I would be hesitant in removing that, but since Juston confirmed that
everything works well for him with these patches, it is fine by me.

Great clean-up.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Thanks for this and all the other patches.

> 
> Cc: Anshuman Gupta <anshuman.gupta@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Juston Li <juston.li@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  .../drm/i915/display/skl_universal_plane.c    | 30 +++++++++----------
>  1 file changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index 1fcb41942c7e..55dae8c8fcad 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -985,6 +985,9 @@ static u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
>  			plane_color_ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;
>  	}
>  
> +	if (plane_state->force_black)
> +		plane_color_ctl |= PLANE_COLOR_PLANE_CSC_ENABLE;
> +
>  	return plane_color_ctl;
>  }
>  
> @@ -1090,8 +1093,19 @@ skl_program_plane(struct intel_plane *plane,
>  			aux_dist |= skl_plane_stride(plane_state, aux_plane);
>  	}
>  
> +	plane_surf = intel_plane_ggtt_offset(plane_state) + surf_addr;
> +	if (plane_state->decrypt)
> +		plane_surf |= PLANE_SURF_DECRYPT;
> +
>  	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>  
> +	/*
> +	 * FIXME: pxp session invalidation can hit any time even at time of commit
> +	 * or after the commit, display content will be garbage.
> +	 */
> +	if (plane_state->force_black)
> +		intel_load_plane_csc_black(plane);
> +
>  	intel_de_write_fw(dev_priv, PLANE_STRIDE(pipe, plane_id), stride);
>  	intel_de_write_fw(dev_priv, PLANE_POS(pipe, plane_id),
>  			  (crtc_y << 16) | crtc_x);
> @@ -1146,22 +1160,6 @@ skl_program_plane(struct intel_plane *plane,
>  	 * the control register just before the surface register.
>  	 */
>  	intel_de_write_fw(dev_priv, PLANE_CTL(pipe, plane_id), plane_ctl);
> -	plane_surf = intel_plane_ggtt_offset(plane_state) + surf_addr;
> -	plane_color_ctl = intel_de_read_fw(dev_priv, PLANE_COLOR_CTL(pipe, plane_id));
> -
> -	/*
> -	 * FIXME: pxp session invalidation can hit any time even at time of commit
> -	 * or after the commit, display content will be garbage.
> -	 */
> -	if (plane_state->decrypt) {
> -		plane_surf |= PLANE_SURF_DECRYPT;
> -	} else if (plane_state->force_black) {
> -		intel_load_plane_csc_black(plane);
> -		plane_color_ctl |= PLANE_COLOR_PLANE_CSC_ENABLE;
> -	}
> -
> -	intel_de_write_fw(dev_priv, PLANE_COLOR_CTL(pipe, plane_id),
> -			  plane_color_ctl);
>  	intel_de_write_fw(dev_priv, PLANE_SURF(pipe, plane_id), plane_surf);
>  
>  	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
> -- 
> 2.32.0
> 

  reply	other threads:[~2021-10-07 18:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 23:57 [Intel-gfx] [PATCH 0/4] drm/i915: Clean up the pxp stuff Ville Syrjala
2021-10-06 23:57 ` [Intel-gfx] [PATCH 1/4] drm/i915: Move the pxp plane state computation Ville Syrjala
2021-10-07  5:52   ` Li, Juston
2021-10-07  6:41     ` Ville Syrjälä
2021-10-06 23:57 ` [Intel-gfx] [PATCH 2/4] drm/i915: Fix up skl_program_plane() pxp stuff Ville Syrjala
2021-10-07 18:36   ` Rodrigo Vivi [this message]
2021-10-06 23:57 ` [Intel-gfx] [PATCH 3/4] drm/i915: Remove the drm_dbg() from the vblank evade critical section Ville Syrjala
2021-10-07  5:54   ` Li, Juston
2021-10-06 23:57 ` [Intel-gfx] [PATCH 4/4] drm/i915: Rename intel_load_plane_csc_black() Ville Syrjala
2021-10-07  5:55   ` Li, Juston
2021-10-07  7:14   ` Ville Syrjälä
2021-10-07  1:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Clean up the pxp stuff Patchwork
2021-10-07  3:53 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-10-07  5:59 ` [Intel-gfx] [PATCH 0/4] " Li, Juston

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=YV8+P2TOWhD4nukJ@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=juston.li@intel.com \
    --cc=uma.shankar@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox