intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915: Always write both TILEOFF and LINOFF plane registers
Date: Tue, 13 Nov 2018 17:59:59 +0200	[thread overview]
Message-ID: <20181113155959.GZ9144@intel.com> (raw)
In-Reply-To: <20181108150955.23948-1-ville.syrjala@linux.intel.com>

On Thu, Nov 08, 2018 at 05:09:55PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Reduce the clutter in the sprite update functions by writing
> both TILEOFF and LINOFF registers unconditionally. We already
> did this for primary planes so might as well do it for the
> sprites too.
> 
> There is no harm in writing both registers. Which one gets
> used depends on the tilimg mode selected in the plane control
> registers.
> 
> It might even make sense to clear the register that won't
> get used. That could make register dumps a little easier to
> parse. But I'm not sure it's worth the extra hassle.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pushed with Maarten's irc r-b.

> ---
>  drivers/gpu/drm/i915/intel_sprite.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 1293182dbcb0..06e8845b071d 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -792,7 +792,6 @@ vlv_update_plane(struct intel_plane *plane,
>  		 const struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
>  	enum pipe pipe = plane->pipe;
>  	enum plane_id plane_id = plane->id;
>  	u32 sprctl = plane_state->ctl;
> @@ -829,10 +828,8 @@ vlv_update_plane(struct intel_plane *plane,
>  		      plane_state->color_plane[0].stride);
>  	I915_WRITE_FW(SPPOS(pipe, plane_id), (crtc_y << 16) | crtc_x);
>  
> -	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
> -		I915_WRITE_FW(SPTILEOFF(pipe, plane_id), (y << 16) | x);
> -	else
> -		I915_WRITE_FW(SPLINOFF(pipe, plane_id), linear_offset);
> +	I915_WRITE_FW(SPTILEOFF(pipe, plane_id), (y << 16) | x);
> +	I915_WRITE_FW(SPLINOFF(pipe, plane_id), linear_offset);
>  
>  	I915_WRITE_FW(SPCONSTALPHA(pipe, plane_id), 0);
>  
> @@ -950,7 +947,6 @@ ivb_update_plane(struct intel_plane *plane,
>  		 const struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
>  	enum pipe pipe = plane->pipe;
>  	u32 sprctl = plane_state->ctl, sprscale = 0;
>  	u32 sprsurf_offset = plane_state->color_plane[0].offset;
> @@ -990,12 +986,12 @@ ivb_update_plane(struct intel_plane *plane,
>  
>  	/* HSW consolidates SPRTILEOFF and SPRLINOFF into a single SPROFFSET
>  	 * register */
> -	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
> +	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
>  		I915_WRITE_FW(SPROFFSET(pipe), (y << 16) | x);
> -	else if (fb->modifier == I915_FORMAT_MOD_X_TILED)
> +	} else {
>  		I915_WRITE_FW(SPRTILEOFF(pipe), (y << 16) | x);
> -	else
>  		I915_WRITE_FW(SPRLINOFF(pipe), linear_offset);
> +	}
>  
>  	I915_WRITE_FW(SPRSIZE(pipe), (crtc_h << 16) | crtc_w);
>  	if (IS_IVYBRIDGE(dev_priv))
> @@ -1119,7 +1115,6 @@ g4x_update_plane(struct intel_plane *plane,
>  		 const struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
>  	enum pipe pipe = plane->pipe;
>  	u32 dvscntr = plane_state->ctl, dvsscale = 0;
>  	u32 dvssurf_offset = plane_state->color_plane[0].offset;
> @@ -1157,10 +1152,8 @@ g4x_update_plane(struct intel_plane *plane,
>  	I915_WRITE_FW(DVSSTRIDE(pipe), plane_state->color_plane[0].stride);
>  	I915_WRITE_FW(DVSPOS(pipe), (crtc_y << 16) | crtc_x);
>  
> -	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
> -		I915_WRITE_FW(DVSTILEOFF(pipe), (y << 16) | x);
> -	else
> -		I915_WRITE_FW(DVSLINOFF(pipe), linear_offset);
> +	I915_WRITE_FW(DVSTILEOFF(pipe), (y << 16) | x);
> +	I915_WRITE_FW(DVSLINOFF(pipe), linear_offset);
>  
>  	I915_WRITE_FW(DVSSIZE(pipe), (crtc_h << 16) | crtc_w);
>  	I915_WRITE_FW(DVSSCALE(pipe), dvsscale);
> -- 
> 2.18.1

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

      parent reply	other threads:[~2018-11-13 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 15:09 [PATCH] drm/i915: Always write both TILEOFF and LINOFF plane registers Ville Syrjala
2018-11-08 16:00 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-11-09  1:38 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-13 15:59 ` Ville Syrjälä [this message]

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=20181113155959.GZ9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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;
as well as URLs for NNTP newsgroup(s).