Commit 89d5efcc authored by Chris Wilson's avatar Chris Wilson

drm/i915: Replace some open-coded i915_coherent_map_type()

A few callsites were deciding on using WC or WB maps based on
HAS_LLC(), so replace them with the equivalent helper function
i915_coherent_map_type().
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181001194447.29910-1-chris@chris-wilson.co.uk
parent b2081525
...@@ -1023,8 +1023,7 @@ i915_emit_bb_start(struct i915_request *rq, ...@@ -1023,8 +1023,7 @@ i915_emit_bb_start(struct i915_request *rq,
int intel_ring_pin(struct intel_ring *ring) int intel_ring_pin(struct intel_ring *ring)
{ {
struct i915_vma *vma = ring->vma; struct i915_vma *vma = ring->vma;
enum i915_map_type map = enum i915_map_type map = i915_coherent_map_type(vma->vm->i915);
HAS_LLC(vma->vm->i915) ? I915_MAP_WB : I915_MAP_WC;
unsigned int flags; unsigned int flags;
void *addr; void *addr;
int ret; int ret;
......
...@@ -76,7 +76,7 @@ static int hang_init(struct hang *h, struct drm_i915_private *i915) ...@@ -76,7 +76,7 @@ static int hang_init(struct hang *h, struct drm_i915_private *i915)
h->seqno = memset(vaddr, 0xff, PAGE_SIZE); h->seqno = memset(vaddr, 0xff, PAGE_SIZE);
vaddr = i915_gem_object_pin_map(h->obj, vaddr = i915_gem_object_pin_map(h->obj,
HAS_LLC(i915) ? I915_MAP_WB : I915_MAP_WC); i915_coherent_map_type(i915));
if (IS_ERR(vaddr)) { if (IS_ERR(vaddr)) {
err = PTR_ERR(vaddr); err = PTR_ERR(vaddr);
goto err_unpin_hws; goto err_unpin_hws;
...@@ -234,7 +234,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine) ...@@ -234,7 +234,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)
return ERR_CAST(obj); return ERR_CAST(obj);
vaddr = i915_gem_object_pin_map(obj, vaddr = i915_gem_object_pin_map(obj,
HAS_LLC(h->i915) ? I915_MAP_WB : I915_MAP_WC); i915_coherent_map_type(h->i915));
if (IS_ERR(vaddr)) { if (IS_ERR(vaddr)) {
i915_gem_object_put(obj); i915_gem_object_put(obj);
return ERR_CAST(vaddr); return ERR_CAST(vaddr);
......
...@@ -49,7 +49,7 @@ static int spinner_init(struct spinner *spin, struct drm_i915_private *i915) ...@@ -49,7 +49,7 @@ static int spinner_init(struct spinner *spin, struct drm_i915_private *i915)
} }
spin->seqno = memset(vaddr, 0xff, PAGE_SIZE); spin->seqno = memset(vaddr, 0xff, PAGE_SIZE);
mode = HAS_LLC(i915) ? I915_MAP_WB : I915_MAP_WC; mode = i915_coherent_map_type(i915);
vaddr = i915_gem_object_pin_map(spin->obj, mode); vaddr = i915_gem_object_pin_map(spin->obj, mode);
if (IS_ERR(vaddr)) { if (IS_ERR(vaddr)) {
err = PTR_ERR(vaddr); err = PTR_ERR(vaddr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment