]> Gentwo Git Trees - linux/.git/commit
drm/xe: rework PDE PAT index selection
authorMatthew Auld <matthew.auld@intel.com>
Fri, 8 Aug 2025 10:34:56 +0000 (11:34 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Mon, 11 Aug 2025 16:41:02 +0000 (17:41 +0100)
commit17593a69b75f098280ad88b625f2d8c5bfe4c6a1
tree86e8cf35b161377d062524e247edfede97b1114a
parentedb660ad79ffe81a982c2eca02360a6ffac83e46
drm/xe: rework PDE PAT index selection

For non-leaf paging structures we end up selecting a random index
between [0, 3], depending on the first user if the page-table is shared,
since non-leaf structures only have two bits in the HW for encoding the
PAT index, and here we are just passing along the full user provided
index, which can be an index as large as ~31 on xe2+. The user provided
index is meant for the leaf node, which maps the actual BO pages where
we have more PAT bits, and not the non-leaf nodes which are only mapping
other paging structures, and so only needs a minimal PAT index range.
Also the chosen index might need to consider how the driver mapped the
paging structures on the host side, like wc vs wb, which is separate
from the user provided index.

With that move the PDE PAT index selection under driver control. For now
just use a coherent index on platforms with page-tables that are cached
on host side, and incoherent otherwise. Using a coherent index could
potentially be expensive, and would be overkill if we know the page-table
is always uncached on host side.

v2 (Stuart):
  - Add some documentation and split into separate helper.

BSpec: 59510
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Stuart Summers <stuart.summers@intel.com>
Link: https://lore.kernel.org/r/20250808103455.462424-2-matthew.auld@intel.com
drivers/gpu/drm/xe/xe_migrate.c
drivers/gpu/drm/xe/xe_pt.c
drivers/gpu/drm/xe/xe_pt_types.h
drivers/gpu/drm/xe/xe_vm.c