summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/tests/xe_migrate.c
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2023-03-10 18:41:08 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-20 02:30:13 +0300
commit17a28ea23c4087cf4580744a70105ccc83efc769 (patch)
treef62ea04d568a1c52efb45b79f0d12925730d7f7f /drivers/gpu/drm/xe/tests/xe_migrate.c
parentfc1cc680304db1c452156968f4ab95f9c553f746 (diff)
downloadlinux-17a28ea23c4087cf4580744a70105ccc83efc769.tar.xz
drm/xe/tests: Support CPU page-table updates in the migrate test
The migrate test currently supports only GPU pagetable updates and will thus break if we fix the CPU pagetable update selection. Fix the migrate test first. Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/tests/xe_migrate.c')
-rw-r--r--drivers/gpu/drm/xe/tests/xe_migrate.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c
index ac659b94e7f5..a3bace16282e 100644
--- a/drivers/gpu/drm/xe/tests/xe_migrate.c
+++ b/drivers/gpu/drm/xe/tests/xe_migrate.c
@@ -66,9 +66,16 @@ sanity_populate_cb(struct xe_migrate_pt_update *pt_update,
{
int i;
u64 *ptr = dst;
-
- for (i = 0; i < num_qwords; i++)
- ptr[i] = (qword_ofs + i - update->ofs) * 0x1111111111111111ULL;
+ u64 value;
+
+ for (i = 0; i < num_qwords; i++) {
+ value = (qword_ofs + i - update->ofs) * 0x1111111111111111ULL;
+ if (map)
+ xe_map_wr(gt_to_xe(gt), map, (qword_ofs + i) *
+ sizeof(u64), u64, value);
+ else
+ ptr[i] = value;
+ }
}
static const struct xe_migrate_pt_update_ops sanity_ops = {