]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe: Align all VRAM scanout buffers to 64k physical pages when needed.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 26 Aug 2024 17:01:16 +0000 (19:01 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 27 Aug 2024 22:15:20 +0000 (18:15 -0400)
commitc66f4711f79c937832b6c0e0b1805061667d99ea
tree890ca73e3e294b67f643387ae02efe17f78c813b
parent97c6efb3649724e6163774f0e7405c5ca8b1097a
drm/xe: Align all VRAM scanout buffers to 64k physical pages when needed.

For CCS formats on affected platforms, CCS can be used freely, but
display engine requires a multiple of 64k physical pages. No other
changes are needed.

At the BO creation time we don't know if the BO will be used for CCS
or not. If the scanout flag is set, and the BO is a multiple of 64k,
we take the safe route and force the physical alignment of 64k pages.

If the BO is not a multiple of 64k, or the scanout flag was not set
at BO creation, we reject it for usage as CCS in display. The physical
pages are likely not aligned correctly, and this will cause corruption
when used as FB.

The scanout flag and size being a multiple of 64k are used together
to enforce 64k physical placement.

VM_BIND is completely unaffected, mappings to a VM can still be aligned
to 4k, just like for normal buffers.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240826170117.327709-3-maarten.lankhorst@linux.intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/display/intel_fb_bo.c
drivers/gpu/drm/xe/xe_bo.c
drivers/gpu/drm/xe/xe_vm.c