Commit fb4e1486 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Markup __iomem for igt_gem_coherency

Silence sparse warnings by using __iomem markup and io accessors.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171114191842.19063-1-chris@chris-wilson.co.uk
parent b099a445
...@@ -33,7 +33,7 @@ static int cpu_set(struct drm_i915_gem_object *obj, ...@@ -33,7 +33,7 @@ static int cpu_set(struct drm_i915_gem_object *obj,
{ {
unsigned int needs_clflush; unsigned int needs_clflush;
struct page *page; struct page *page;
typeof(v) *map; u32 *map;
int err; int err;
err = i915_gem_obj_prepare_shmem_write(obj, &needs_clflush); err = i915_gem_obj_prepare_shmem_write(obj, &needs_clflush);
...@@ -59,7 +59,7 @@ static int cpu_get(struct drm_i915_gem_object *obj, ...@@ -59,7 +59,7 @@ static int cpu_get(struct drm_i915_gem_object *obj,
{ {
unsigned int needs_clflush; unsigned int needs_clflush;
struct page *page; struct page *page;
typeof(v) map; u32 *map;
int err; int err;
err = i915_gem_obj_prepare_shmem_read(obj, &needs_clflush); err = i915_gem_obj_prepare_shmem_read(obj, &needs_clflush);
...@@ -82,7 +82,7 @@ static int gtt_set(struct drm_i915_gem_object *obj, ...@@ -82,7 +82,7 @@ static int gtt_set(struct drm_i915_gem_object *obj,
u32 v) u32 v)
{ {
struct i915_vma *vma; struct i915_vma *vma;
typeof(v) *map; u32 __iomem *map;
int err; int err;
err = i915_gem_object_set_to_gtt_domain(obj, true); err = i915_gem_object_set_to_gtt_domain(obj, true);
...@@ -98,7 +98,7 @@ static int gtt_set(struct drm_i915_gem_object *obj, ...@@ -98,7 +98,7 @@ static int gtt_set(struct drm_i915_gem_object *obj,
if (IS_ERR(map)) if (IS_ERR(map))
return PTR_ERR(map); return PTR_ERR(map);
map[offset / sizeof(*map)] = v; iowrite32(v, &map[offset / sizeof(*map)]);
i915_vma_unpin_iomap(vma); i915_vma_unpin_iomap(vma);
return 0; return 0;
...@@ -109,7 +109,7 @@ static int gtt_get(struct drm_i915_gem_object *obj, ...@@ -109,7 +109,7 @@ static int gtt_get(struct drm_i915_gem_object *obj,
u32 *v) u32 *v)
{ {
struct i915_vma *vma; struct i915_vma *vma;
typeof(v) map; u32 __iomem *map;
int err; int err;
err = i915_gem_object_set_to_gtt_domain(obj, false); err = i915_gem_object_set_to_gtt_domain(obj, false);
...@@ -125,7 +125,7 @@ static int gtt_get(struct drm_i915_gem_object *obj, ...@@ -125,7 +125,7 @@ static int gtt_get(struct drm_i915_gem_object *obj,
if (IS_ERR(map)) if (IS_ERR(map))
return PTR_ERR(map); return PTR_ERR(map);
*v = map[offset / sizeof(*map)]; *v = ioread32(&map[offset / sizeof(*map)]);
i915_vma_unpin_iomap(vma); i915_vma_unpin_iomap(vma);
return 0; return 0;
...@@ -135,7 +135,7 @@ static int wc_set(struct drm_i915_gem_object *obj, ...@@ -135,7 +135,7 @@ static int wc_set(struct drm_i915_gem_object *obj,
unsigned long offset, unsigned long offset,
u32 v) u32 v)
{ {
typeof(v) *map; u32 *map;
int err; int err;
err = i915_gem_object_set_to_wc_domain(obj, true); err = i915_gem_object_set_to_wc_domain(obj, true);
...@@ -156,7 +156,7 @@ static int wc_get(struct drm_i915_gem_object *obj, ...@@ -156,7 +156,7 @@ static int wc_get(struct drm_i915_gem_object *obj,
unsigned long offset, unsigned long offset,
u32 *v) u32 *v)
{ {
typeof(v) map; u32 *map;
int err; int err;
err = i915_gem_object_set_to_wc_domain(obj, false); err = i915_gem_object_set_to_wc_domain(obj, false);
......
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