From 082ca33d0fe5d6ddb6153e0890e32495833b49b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Thu, 29 Feb 2024 10:50:25 -0800 Subject: [PATCH] iris/xe: Consider pat_index while unbinding the bo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xe KMD also checks if cpu_caching caching set during bo creationg matches with caching of the PAT index set in the VM unbind. This was being unnoticed until now by luck and lack of testing in MTL. So here always setting PAT index for all VM operations that has a bo associated. Fixes: eb18a92ef94e ("iris: Fill PAT fields in Xe KMD gem_create and vm_bind uAPIs") Signed-off-by: José Roberto de Souza Reviewed-by: Sagar Ghuge Part-of: (cherry picked from commit 963c08b623aa47b460586429f4bcd5dd494e9900) --- .pick_status.json | 2 +- src/gallium/drivers/iris/xe/iris_kmd_backend.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 1e625fb2c5b..26979d88971 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1894,7 +1894,7 @@ "description": "iris/xe: Consider pat_index while unbinding the bo", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "eb18a92ef94e721407527c6c66ffff324772a610", "notes": null diff --git a/src/gallium/drivers/iris/xe/iris_kmd_backend.c b/src/gallium/drivers/iris/xe/iris_kmd_backend.c index 2f49c4d8bea..ea49f6da8db 100644 --- a/src/gallium/drivers/iris/xe/iris_kmd_backend.c +++ b/src/gallium/drivers/iris/xe/iris_kmd_backend.c @@ -138,10 +138,6 @@ xe_gem_vm_bind_op(struct iris_bo *bo, uint32_t op) op = DRM_XE_VM_BIND_OP_MAP_USERPTR; } - uint16_t pat_index = 0; - if (op != DRM_XE_VM_BIND_OP_UNMAP) - pat_index = iris_heap_to_pat_entry(devinfo, bo->real.heap)->index; - struct drm_xe_vm_bind args = { .vm_id = iris_bufmgr_get_global_vm_id(bo->bufmgr), .num_syncs = 1, @@ -152,7 +148,7 @@ xe_gem_vm_bind_op(struct iris_bo *bo, uint32_t op) .bind.range = range, .bind.addr = intel_48b_address(bo->address), .bind.op = op, - .bind.pat_index = pat_index, + .bind.pat_index = iris_heap_to_pat_entry(devinfo, bo->real.heap)->index, }; ret = intel_ioctl(fd, DRM_IOCTL_XE_VM_BIND, &args); if (ret == 0) {