Commit 8d4ba9fc authored by Nirmoy Das's avatar Nirmoy Das Committed by Andi Shyti

drm/i915/selftests: Pick correct caching mode.

Caching mode is HW dependent so pick a correct one using
intel_gt_coherent_map_type().

Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10249Signed-off-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Acked-by: default avatarJonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240312111815.18083-1-nirmoy.das@intel.com
parent af7c4a64
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "i915_drv.h" #include "i915_drv.h"
#include "i915_selftest.h" #include "i915_selftest.h"
#include "gem/i915_gem_context.h" #include "gem/i915_gem_context.h"
#include "gt/intel_gt.h"
#include "mock_context.h" #include "mock_context.h"
#include "mock_dmabuf.h" #include "mock_dmabuf.h"
...@@ -155,6 +156,7 @@ static int verify_access(struct drm_i915_private *i915, ...@@ -155,6 +156,7 @@ static int verify_access(struct drm_i915_private *i915,
struct file *file; struct file *file;
u32 *vaddr; u32 *vaddr;
int err = 0, i; int err = 0, i;
unsigned int mode;
file = mock_file(i915); file = mock_file(i915);
if (IS_ERR(file)) if (IS_ERR(file))
...@@ -194,7 +196,8 @@ static int verify_access(struct drm_i915_private *i915, ...@@ -194,7 +196,8 @@ static int verify_access(struct drm_i915_private *i915,
if (err) if (err)
goto out_file; goto out_file;
vaddr = i915_gem_object_pin_map_unlocked(native_obj, I915_MAP_WB); mode = intel_gt_coherent_map_type(to_gt(i915), native_obj, true);
vaddr = i915_gem_object_pin_map_unlocked(native_obj, mode);
if (IS_ERR(vaddr)) { if (IS_ERR(vaddr)) {
err = PTR_ERR(vaddr); err = PTR_ERR(vaddr);
goto out_file; goto out_file;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment