mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
anv: Use set PAT extension on BO creation for MTL
Reworks: * Drop local pat_index var (suggested by José) Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>
This commit is contained in:
parent
45278d1988
commit
463bf13411
1 changed files with 14 additions and 0 deletions
|
|
@ -75,6 +75,20 @@ i915_gem_create(struct anv_device *device,
|
|||
.flags = flags,
|
||||
};
|
||||
|
||||
struct drm_i915_gem_create_ext_set_pat set_pat_param = { 0 };
|
||||
if (device->info->has_set_pat_uapi) {
|
||||
/* Set PAT param */
|
||||
if (alloc_flags & (ANV_BO_ALLOC_SNOOPED))
|
||||
set_pat_param.pat_index = device->info->pat.coherent;
|
||||
else if (alloc_flags & (ANV_BO_ALLOC_EXTERNAL | ANV_BO_ALLOC_SCANOUT))
|
||||
set_pat_param.pat_index = device->info->pat.scanout;
|
||||
else
|
||||
set_pat_param.pat_index = device->info->pat.writeback;
|
||||
intel_gem_add_ext(&gem_create.extensions,
|
||||
I915_GEM_CREATE_EXT_SET_PAT,
|
||||
&set_pat_param.base);
|
||||
}
|
||||
|
||||
if (intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &gem_create))
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue