]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/dg1: Fix mapping type for default state object
authorVenkata Ramana Nayana <venkata.ramana.nayana@intel.com>
Tue, 27 Apr 2021 08:54:11 +0000 (09:54 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Tue, 27 Apr 2021 15:19:52 +0000 (16:19 +0100)
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
drivers/gpu/drm/i915/gt/shmem_utils.c

index f8f02aab842b6dd5f3d304807c3868e511c0cd0c..0683b27a38905891663ee8739521edc68a612f94 100644 (file)
@@ -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);