drm/xe: Fix xe_vma_set_pte_size
authorMatthew Brost <matthew.brost@intel.com>
Mon, 19 Feb 2024 21:19:40 +0000 (13:19 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Tue, 20 Feb 2024 16:39:33 +0000 (08:39 -0800)
xe_vma_set_pte_size had a return value and did not set the 4k VMA flag.
Both of these were incorrect. Fix these.

Fixes: c47794bdd63d ("drm/xe: Set max pte size when skipping rebinds")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240219211942.3633795-2-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_vm.c

index 836a6e849cda82ccf6bd788bb6ad1fde9d19dd5c..2b0c76c663e57914790e5e875fbe6cc14085e9ef 100644 (file)
@@ -2198,7 +2198,7 @@ static u64 xe_vma_max_pte_size(struct xe_vma *vma)
        return SZ_1G;   /* Uninitialized, used max size */
 }
 
-static u64 xe_vma_set_pte_size(struct xe_vma *vma, u64 size)
+static void xe_vma_set_pte_size(struct xe_vma *vma, u64 size)
 {
        switch (size) {
        case SZ_1G:
@@ -2207,9 +2207,10 @@ static u64 xe_vma_set_pte_size(struct xe_vma *vma, u64 size)
        case SZ_2M:
                vma->gpuva.flags |= XE_VMA_PTE_2M;
                break;
+       case SZ_4K:
+               vma->gpuva.flags |= XE_VMA_PTE_4K;
+               break;
        }
-
-       return SZ_4K;
 }
 
 static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op)