summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gt/intel_ring.c
diff options
context:
space:
mode:
authorVenkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>2021-04-27 09:54:12 +0100
committerMatthew Auld <matthew.auld@intel.com>2021-04-27 16:21:11 +0100
commitfa85bfd19c26739c4cc02afbbab2588332648e9d (patch)
tree9fa0ee917688fd9e75295e95cc2cdece6fceb8f0 /drivers/gpu/drm/i915/gt/intel_ring.c
parentc27d642b8edbbb112bdc3ca2f219d7c98cc026e1 (diff)
downloadlinux-fa85bfd19c26739c4cc02afbbab2588332648e9d.tar.gz
drm/i915: Update the helper to set correct mapping
Determine the possible coherent map type based on object location, and if target has llc or if user requires an always coherent mapping. Cc: Matthew Auld <matthew.auld@intel.com> Cc: CQ Tang <cq.tang@intel.com> Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210427085417.120246-2-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_ring.c')
-rw-r--r--drivers/gpu/drm/i915/gt/intel_ring.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_ring.c b/drivers/gpu/drm/i915/gt/intel_ring.c
index aee0a77c77e0..7c4d5158e03b 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring.c
@@ -51,11 +51,14 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)
if (unlikely(ret))
goto err_unpin;
- if (i915_vma_is_map_and_fenceable(vma))
+ if (i915_vma_is_map_and_fenceable(vma)) {
addr = (void __force *)i915_vma_pin_iomap(vma);
- else
- addr = i915_gem_object_pin_map(vma->obj,
- i915_coherent_map_type(vma->vm->i915));
+ } else {
+ int type = i915_coherent_map_type(vma->vm->i915, vma->obj, false);
+
+ addr = i915_gem_object_pin_map(vma->obj, type);
+ }
+
if (IS_ERR(addr)) {
ret = PTR_ERR(addr);
goto err_ring;