Commit e97d8fbe authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Add NEEDS_FORCEWAKE() checks for vlv/chv

Include an early NEEDS_FORCEWAKE() check for vlv and chv.
Hopefully that will avoid doing so many range checks in for many
register accesses (at least for all display registers).

Note that vlv already had the check in the write path since it shares
the gen6+ code for that.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1445517300-28173-6-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 6a42d0f4
...@@ -726,7 +726,9 @@ static u##x \ ...@@ -726,7 +726,9 @@ static u##x \
vlv_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ vlv_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \
enum forcewake_domains fw_engine = 0; \ enum forcewake_domains fw_engine = 0; \
GEN6_READ_HEADER(x); \ GEN6_READ_HEADER(x); \
if (FORCEWAKE_VLV_RENDER_RANGE_OFFSET(reg)) \ if (!NEEDS_FORCE_WAKE(reg)) \
fw_engine = 0; \
else if (FORCEWAKE_VLV_RENDER_RANGE_OFFSET(reg)) \
fw_engine = FORCEWAKE_RENDER; \ fw_engine = FORCEWAKE_RENDER; \
else if (FORCEWAKE_VLV_MEDIA_RANGE_OFFSET(reg)) \ else if (FORCEWAKE_VLV_MEDIA_RANGE_OFFSET(reg)) \
fw_engine = FORCEWAKE_MEDIA; \ fw_engine = FORCEWAKE_MEDIA; \
...@@ -741,7 +743,9 @@ static u##x \ ...@@ -741,7 +743,9 @@ static u##x \
chv_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ chv_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \
enum forcewake_domains fw_engine = 0; \ enum forcewake_domains fw_engine = 0; \
GEN6_READ_HEADER(x); \ GEN6_READ_HEADER(x); \
if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(reg)) \ if (!NEEDS_FORCE_WAKE(reg)) \
fw_engine = 0; \
else if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(reg)) \
fw_engine = FORCEWAKE_RENDER; \ fw_engine = FORCEWAKE_RENDER; \
else if (FORCEWAKE_CHV_MEDIA_RANGE_OFFSET(reg)) \ else if (FORCEWAKE_CHV_MEDIA_RANGE_OFFSET(reg)) \
fw_engine = FORCEWAKE_MEDIA; \ fw_engine = FORCEWAKE_MEDIA; \
...@@ -935,7 +939,8 @@ static void \ ...@@ -935,7 +939,8 @@ static void \
chv_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace) { \ chv_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace) { \
enum forcewake_domains fw_engine = 0; \ enum forcewake_domains fw_engine = 0; \
GEN6_WRITE_HEADER; \ GEN6_WRITE_HEADER; \
if (is_gen8_shadowed(dev_priv, reg)) \ if (!NEEDS_FORCE_WAKE(reg) || \
is_gen8_shadowed(dev_priv, reg)) \
fw_engine = 0; \ fw_engine = 0; \
else if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(reg)) \ else if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(reg)) \
fw_engine = FORCEWAKE_RENDER; \ fw_engine = FORCEWAKE_RENDER; \
......
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