Skip to content

Commit 6603aca

Browse files
vsyrjalagregkh
authored andcommitted
drm/i915/fb: Relax clear color alignment to 64 bytes
commit 1a5401ec3018c101c456cdbda2eaef9482db6786 upstream. 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. Note that the Mesa alignment chages were partially undone so the regression itself was already fixed on userspace side. Cc: [email protected] Cc: Sagar Ghuge <[email protected]> Cc: Nanley Chery <[email protected]> Reported-by: Xi Ruoyao <[email protected]> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13057 Closes: https://lore.kernel.org/all/[email protected]/ Link: https://gitlab.freedesktop.org/mesa/mesa/-/commit/17f97a69c13832a6c1b0b3aad45b06f07d4b852f Link: https://gitlab.freedesktop.org/mesa/mesa/-/commit/888f63cf1baf34bc95e847a30a041dc7798edddb Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Tested-by: Xi Ruoyao <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> (cherry picked from commit ed3a892e5e3d6b3f6eeb76db7c92a968aeb52f3d) Signed-off-by: Tvrtko Ursulin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3d41dbf commit 6603aca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/display/intel_fb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer *
15711571
* arithmetic related to alignment and offset calculation.
15721572
*/
15731573
if (is_gen12_ccs_cc_plane(&fb->base, i)) {
1574-
if (IS_ALIGNED(fb->base.offsets[i], PAGE_SIZE))
1574+
if (IS_ALIGNED(fb->base.offsets[i], 64))
15751575
continue;
15761576
else
15771577
return -EINVAL;

0 commit comments

Comments
 (0)