]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/bo: optimise CCS case for WB pages
authorMatthew Auld <matthew.auld@intel.com>
Fri, 16 May 2025 15:38:11 +0000 (16:38 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Thu, 29 May 2025 10:54:45 +0000 (11:54 +0100)
commit338ec84deefdaf8e479455ee7d55434571799cf0
tree1f22b2f8bc303b506271a477c3b0bdf0b1de23f9
parent2cb38bb0add9b81f89ccdb2db88af89e99925880
drm/xe/bo: optimise CCS case for WB pages

Dealing with CCS state is significant on LNL+, where we end up clearing
the compression state on every page alloc using the blitter for user
buffers, including also saving and restoring it when moving between
domains, plus we need to alloc extra pages to hold the raw CCS state for
the save step.

However all compression PAT modes, on platforms like LNL, also require
coh_none, meaning that only WC memory can use compression in the first
place. With this we can be sneaky and completely ignore CCS for WB
buffers, which is likely the common case anyway. This would then skip
all blitter moves/clears between sys <-> tt and then also means we can
drop the extra CCS pages.

This should be safe since there is no way to interact with the
compression state (potentially uncleared) without using a PAT enabled
index (which is rejected at bind), including if trying to be malicious
and copy the raw CCS state from userpace, which should give back all
zeroes if the src surface (indirect) is lacking compressed PAT index.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Link: https://lore.kernel.org/r/20250516153810.223530-2-matthew.auld@intel.com
drivers/gpu/drm/xe/xe_bo.c
drivers/gpu/drm/xe/xe_pat.c