diff options
author | Jonathan Cavitt <jonathan.cavitt@intel.com> | 2023-08-07 14:19:55 +0200 |
---|---|---|
committer | Andi Shyti <andi.shyti@linux.intel.com> | 2023-08-10 14:13:52 +0200 |
commit | 8a612b2d2e53dc0b869344e5558271b0d7fd4a23 (patch) | |
tree | 043a4b04cbb3483c86fc20f952465e369aa8d178 | |
parent | 9f771739a04919226081a107167596de75108fbb (diff) | |
download | linux-stable-8a612b2d2e53dc0b869344e5558271b0d7fd4a23.tar.gz linux-stable-8a612b2d2e53dc0b869344e5558271b0d7fd4a23.tar.bz2 linux-stable-8a612b2d2e53dc0b869344e5558271b0d7fd4a23.zip |
drm/i915/gt: Simplify shmem_create_from_object map_type selection
The object pin created for shmem_create_from_object is just a
single use mapping with the sole purpose of reading the contents
of the whole object in bulk. And the whole source object is also
even a throw-away. Ergo, the additional logic required by
i915_coherent_map_type can be safely dropped and simplified.
Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230801153242.2445478-2-jonathan.cavitt@intel.com
Link: https://patchwork.freedesktop.org/patch/msgid/20230807121957.598420-2-andi.shyti@linux.intel.com
-rw-r--r-- | drivers/gpu/drm/i915/gt/shmem_utils.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index 449c9ed44382..bccc3a1200bc 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -33,7 +33,6 @@ struct file *shmem_create_from_data(const char *name, void *data, size_t len) struct file *shmem_create_from_object(struct drm_i915_gem_object *obj) { - struct drm_i915_private *i915 = to_i915(obj->base.dev); enum i915_map_type map_type; struct file *file; void *ptr; @@ -44,7 +43,7 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj) return file; } - map_type = i915_coherent_map_type(i915, obj, true); + map_type = i915_gem_object_is_lmem(obj) ? I915_MAP_WC : I915_MAP_WB; ptr = i915_gem_object_pin_map_unlocked(obj, map_type); if (IS_ERR(ptr)) return ERR_CAST(ptr); |