Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Subject: Re: [PATCH] drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original
Date: Fri, 8 Dec 2023 20:41:43 +0200	[thread overview]
Message-ID: <ZXNjZ6i0lMbSc5nx@intel.com> (raw)
In-Reply-To: <20231204202443.31247-1-ville.syrjala@linux.intel.com>

On Mon, Dec 04, 2023 at 10:24:43PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> plane_view_scanout_stride() currently assumes that we had to pad the
> mapping stride with dummy pages in order to align it. But that is not
> the case if the original fb stride exceeds the aligned stride used
> to populate the remapped view, which is calculated from the user
> specified framebuffer width rather than the user specified framebuffer
> stride.
> 
> Ignore the original fb stride in this case and just stick to the POT
> aligned stride. Getting this wrong will cause the plane to fetch the
> wrong data, and can lead to fault errors if the page tables at the
> bogus location aren't even populated.
> 
> TODO: figure out if this is OK for CCS, or if we should instead increase
> the width of the view to cover the entire user specified fb stride
> instead...
> 
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Doh. Apparently I forgot to tag this for stable...

Jani, can you include this w/ cc:stable in the next -fixes pull please?

commit 01a39f1c4f12 ("drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original")

> ---
>  drivers/gpu/drm/i915/display/intel_fb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> index 33a693460420..ab634a4c86d1 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -1381,7 +1381,8 @@ plane_view_scanout_stride(const struct intel_framebuffer *fb, int color_plane,
>  	struct drm_i915_private *i915 = to_i915(fb->base.dev);
>  	unsigned int stride_tiles;
>  
> -	if (IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14)
> +	if ((IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14) &&
> +	    src_stride_tiles < dst_stride_tiles)
>  		stride_tiles = src_stride_tiles;
>  	else
>  		stride_tiles = dst_stride_tiles;
> -- 
> 2.41.0

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2023-12-08 18:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 20:24 [Intel-gfx] [PATCH] drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original Ville Syrjala
2023-12-05  5:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-12-05 10:21 ` [Intel-gfx] [PATCH] " Imre Deak
2023-12-05 13:29 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2023-12-05 13:59 ` [Intel-gfx] [PATCH] " Juha-Pekka Heikkila
2023-12-08 18:41 ` Ville Syrjälä [this message]
2023-12-11 12:40   ` Jani Nikula

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=ZXNjZ6i0lMbSc5nx@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.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