drm/xe/migrate: Add kunit to test clear functionality
authorAkshata Jahagirdar <akshata.jahagirdar@intel.com>
Wed, 17 Jul 2024 21:10:03 +0000 (21:10 +0000)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 18 Jul 2024 00:02:28 +0000 (17:02 -0700)
commit54f07cfc016226c3959e0b3b7ed306124d986ce4
treee0baca617afea6140fdb93510ec449f02361f392
parent108c972a11c5f6e37be58207460d9bcac06698db
drm/xe/migrate: Add kunit to test clear functionality

This test verifies if the main and ccs data are cleared during bo creation.
The motivation to use Kunit instead of IGT is that, although we can verify
whether the data is zero following bo creation,
we cannot confirm whether the zero value after bo creation is the result of
our clear function or simply because the initial data present was zero.

v2: Updated the mutex_lock and unlock logic,
    Changed out_unlock to out_put. (Matt)

v3: Added missing dma_fence_put(). (Nirmoy)

v4: Rebase.

v5: Add missing bo_put(), bo_unlock() calls. (Matt Auld)

Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Acked-by: Nirmoy Das <nirmoy.das@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c07603439b88cfc99e78c0e2069327e65d5aa87d.1721250309.git.akshata.jahagirdar@intel.com
drivers/gpu/drm/xe/tests/xe_migrate.c