Commit 5dd8e50c authored by Chris Wilson's avatar Chris Wilson

drm/i915: Replace manual barrier() with READ_ONCE() in HWS accessor

When reading from the HWS page, we use barrier() to prevent the compiler
optimising away the read from the volatile (may be updated by the GPU)
memory address. This is more suited to READ_ONCE(); make it so.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1460195877-20520-5-git-send-email-chris@chris-wilson.co.uk
parent 0d317ce9
...@@ -391,12 +391,10 @@ intel_flush_status_page(struct intel_engine_cs *engine, int reg) ...@@ -391,12 +391,10 @@ intel_flush_status_page(struct intel_engine_cs *engine, int reg)
} }
static inline u32 static inline u32
intel_read_status_page(struct intel_engine_cs *engine, intel_read_status_page(struct intel_engine_cs *engine, int reg)
int reg)
{ {
/* Ensure that the compiler doesn't optimize away the load. */ /* Ensure that the compiler doesn't optimize away the load. */
barrier(); return READ_ONCE(engine->status_page.page_addr[reg]);
return engine->status_page.page_addr[reg];
} }
static inline void static inline void
......
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