[Intel-gfx] [RFC PATCH 159/162] drm/i915/dg1: Fix mapping type for default state object
Matthew Auld
matthew.auld at intel.com
Fri Nov 27 12:07:15 UTC 2020
From: Venkata Ramana Nayana <venkata.ramana.nayana at intel.com>
Use I915_MAP_WC when default state object is allocated on LMEM.
Signed-off-by: Venkata Ramana Nayana <venkata.ramana.nayana at intel.com>
---
drivers/gpu/drm/i915/gt/shmem_utils.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c
index 041e2a50160d..1fbc070a4651 100644
--- a/drivers/gpu/drm/i915/gt/shmem_utils.c
+++ b/drivers/gpu/drm/i915/gt/shmem_utils.c
@@ -8,6 +8,7 @@
#include <linux/shmem_fs.h>
#include "gem/i915_gem_object.h"
+#include "gem/i915_gem_lmem.h"
#include "shmem_utils.h"
struct file *shmem_create_from_data(const char *name, void *data, size_t len)
@@ -39,7 +40,8 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)
return file;
}
- ptr = i915_gem_object_pin_map_unlocked(obj, I915_MAP_WB);
+ ptr = i915_gem_object_pin_map_unlocked(obj, i915_gem_object_is_lmem(obj) ?
+ I915_MAP_WC : I915_MAP_WB);
if (IS_ERR(ptr))
return ERR_CAST(ptr);
--
2.26.2
More information about the Intel-gfx
mailing list