Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org, Sagar Ghuge <sagar.ghuge@intel.com>,
	Nanley Chery <nanley.g.chery@intel.com>,
	Xi Ruoyao <xry111@xry111.site>
Subject: [PATCH 1/4] drm/i915/fb: Relax clear color alignment to 64 bytes
Date: Fri, 29 Nov 2024 08:50:11 +0200	[thread overview]
Message-ID: <20241129065014.8363-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20241129065014.8363-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Mesa changed its clear color alignment from 4k to 64 bytes
without informing the kernel side about the change. This
is now likely to cause framebuffer creation to fail.

The only thing we do with the clear color buffer in i915 is:
1. map a single page
2. read out bytes 16-23 from said page
3. unmap the page

So the only requirement we really have is that those 8 bytes
are all contained within one page. Thus we can deal with the
Mesa regression by reducing the alignment requiment from 4k
to the same 64 bytes in the kernel. We could even go as low as
32 bytes, but IIRC 64 bytes is the hardware requirement on
the 3D engine side so matching that seems sensible.

Cc: stable@vger.kernel.org
Cc: Sagar Ghuge <sagar.ghuge@intel.com>
Cc: Nanley Chery <nanley.g.chery@intel.com>
Reported-by: Xi Ruoyao <xry111@xry111.site>
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13057
Closes: https://lore.kernel.org/all/45a5bba8de009347262d86a4acb27169d9ae0d9f.camel@xry111.site/
Link: https://gitlab.freedesktop.org/mesa/mesa/-/commit/17f97a69c13832a6c1b0b3aad45b06f07d4b852f
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 6a7060889f40..223c4218c019 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -1694,7 +1694,7 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer *
 		 * arithmetic related to alignment and offset calculation.
 		 */
 		if (is_gen12_ccs_cc_plane(&fb->base, i)) {
-			if (IS_ALIGNED(fb->base.offsets[i], PAGE_SIZE))
+			if (IS_ALIGNED(fb->base.offsets[i], 64))
 				continue;
 			else
 				return -EINVAL;
-- 
2.45.2


  reply	other threads:[~2024-11-29  6:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29  6:50 [PATCH 0/4] drm/i915/fb: Deal with Mesa clear color alignment regression Ville Syrjala
2024-11-29  6:50 ` Ville Syrjala [this message]
2024-11-29 13:45   ` [PATCH 1/4] drm/i915/fb: Relax clear color alignment to 64 bytes Xi Ruoyao
2024-11-29  6:50 ` [PATCH 2/4] drm/i915/fb: Add debug spew for misaligned CC plane Ville Syrjala
2024-11-29  6:50 ` [PATCH 3/4] drm/i915/fb: Check that the clear color fits within the BO Ville Syrjala
2024-11-29  6:50 ` [PATCH 4/4] drm/uapi/fourcc: Document the Intel clear color alignment better Ville Syrjala
2025-01-10 15:43   ` Chery, Nanley G
2025-01-13 16:38     ` Ville Syrjälä
2024-11-29  7:11 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/fb: Deal with Mesa clear color alignment regression Patchwork
2024-11-29  7:11 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-29  7:27 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-29  8:45 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/fb: Deal with Mesa clear color alignment regression (rev2) Patchwork
2024-11-29  8:45 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-29  8:57 ` ✓ i915.CI.BAT: success " Patchwork
2024-11-29 11:17 ` ✗ i915.CI.Full: failure " Patchwork
2025-01-07 19:44 ` [PATCH 0/4] drm/i915/fb: Deal with Mesa clear color alignment regression Souza, Jose

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=20241129065014.8363-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=nanley.g.chery@intel.com \
    --cc=sagar.ghuge@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=xry111@xry111.site \
    /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