]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Set XE_BO_FLAG_PINNED in migrate selftest BOs
authorMatthew Brost <matthew.brost@intel.com>
Tue, 26 Nov 2024 17:46:14 +0000 (09:46 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 28 Nov 2024 00:38:55 +0000 (16:38 -0800)
We only allow continguous BOs to be vmapped, set XE_BO_FLAG_PINNED on
BOs in migrate selftest as this forces continguous BOs and selftest uses
vmaps.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241126174615.2665852-8-matthew.brost@intel.com
drivers/gpu/drm/xe/tests/xe_migrate.c

index 1a192a2a941b69afb3e1d095111267c4a2355d13..4cef3b20bd17ec4ecc72327ca72ec226ad8fdeab 100644 (file)
@@ -83,7 +83,8 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo,
                                                   bo->size,
                                                   ttm_bo_type_kernel,
                                                   region |
-                                                  XE_BO_FLAG_NEEDS_CPU_ACCESS);
+                                                  XE_BO_FLAG_NEEDS_CPU_ACCESS |
+                                                  XE_BO_FLAG_PINNED);
        if (IS_ERR(remote)) {
                KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %pe\n",
                           str, remote);
@@ -642,7 +643,9 @@ static void validate_ccs_test_run_tile(struct xe_device *xe, struct xe_tile *til
 
        sys_bo = xe_bo_create_user(xe, NULL, NULL, SZ_4M,
                                   DRM_XE_GEM_CPU_CACHING_WC,
-                                  XE_BO_FLAG_SYSTEM | XE_BO_FLAG_NEEDS_CPU_ACCESS);
+                                  XE_BO_FLAG_SYSTEM |
+                                  XE_BO_FLAG_NEEDS_CPU_ACCESS |
+                                  XE_BO_FLAG_PINNED);
 
        if (IS_ERR(sys_bo)) {
                KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n",
@@ -666,7 +669,8 @@ static void validate_ccs_test_run_tile(struct xe_device *xe, struct xe_tile *til
 
        ccs_bo = xe_bo_create_user(xe, NULL, NULL, SZ_4M,
                                   DRM_XE_GEM_CPU_CACHING_WC,
-                                  bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS);
+                                  bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS |
+                                  XE_BO_FLAG_PINNED);
 
        if (IS_ERR(ccs_bo)) {
                KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n",
@@ -690,7 +694,8 @@ static void validate_ccs_test_run_tile(struct xe_device *xe, struct xe_tile *til
 
        vram_bo = xe_bo_create_user(xe, NULL, NULL, SZ_4M,
                                    DRM_XE_GEM_CPU_CACHING_WC,
-                                   bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS);
+                                   bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS |
+                                   XE_BO_FLAG_PINNED);
        if (IS_ERR(vram_bo)) {
                KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n",
                           PTR_ERR(vram_bo));