Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/dg1: Fix mapping type for default state object

Use I915_MAP_WC when default state object is allocated in LMEM.

Signed-off-by: Venkata Ramana Nayana <venkata.ramana.nayana@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210427085417.120246-1-matthew.auld@intel.com

authored by

Venkata Ramana Nayana and committed by
Matthew Auld
c27d642b ac69496f

+3 -1
+3 -1
drivers/gpu/drm/i915/gt/shmem_utils.c
··· 8 8 #include <linux/shmem_fs.h> 9 9 10 10 #include "gem/i915_gem_object.h" 11 + #include "gem/i915_gem_lmem.h" 11 12 #include "shmem_utils.h" 12 13 13 14 struct file *shmem_create_from_data(const char *name, void *data, size_t len) ··· 40 39 return file; 41 40 } 42 41 43 - ptr = i915_gem_object_pin_map_unlocked(obj, I915_MAP_WB); 42 + ptr = i915_gem_object_pin_map_unlocked(obj, i915_gem_object_is_lmem(obj) ? 43 + I915_MAP_WC : I915_MAP_WB); 44 44 if (IS_ERR(ptr)) 45 45 return ERR_CAST(ptr); 46 46