drm/i915/selftests: keep same cache settings as timeline
authorFei Yang <fei.yang@intel.com>
Wed, 15 Mar 2023 18:08:00 +0000 (11:08 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Fri, 17 Mar 2023 15:45:50 +0000 (08:45 -0700)
commit91f4228960adb6583a33af310912163469f49da7
tree5324cab347a96e0cd01cc50f6729f3391b74f47e
parentc4252a11131c7f27a158294241466e2a4e7ff94e
drm/i915/selftests: keep same cache settings as timeline

On MTL, objects allocated through i915_gem_object_create_internal() are
mapped as uncached in GPU by default because HAS_LLC is false. However
in the live_hwsp_read selftest these watcher objects are mapped as WB
on CPU side. The conseqence is that the updates done by the GPU are not
immediately visible to CPU, thus the selftest is randomly failing due to
the stale data in CPU cache. Solution can be either setting WC for CPU +
UC for GPU, or WB for CPU + 1-way coherent WB for GPU.
To keep the consistency, let's simply inherit the same cache settings
from the timeline, which is WB for CPU + 1-way coherent WB for GPU,
because this test is supposed to emulate the behavior of the timeline
anyway.

Signed-off-by: Fei Yang <fei.yang@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230315180800.2632766-1-fei.yang@intel.com
drivers/gpu/drm/i915/gt/selftest_timeline.c