diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2013-03-28 12:55:38 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-04-02 14:31:06 -0400 |
commit | 19332d7aab1e38eb01fb387266f493d335d9931c (patch) | |
tree | 72b37c875590acd83c2e31acad64c0563cdcf146 /drivers/gpu/drm | |
parent | 7f1f3851feb0b2d29fed61b22fc1604fff053483 (diff) |
drm/i915: add sprite assertion function for VLV
Need to make sure sprites are disabled before shutting off a pipe.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2ee38660a5a5..59d52b729a68 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1288,6 +1288,25 @@ static void assert_planes_disabled(struct drm_i915_private *dev_priv, | |||
1288 | } | 1288 | } |
1289 | } | 1289 | } |
1290 | 1290 | ||
1291 | static void assert_sprites_disabled(struct drm_i915_private *dev_priv, | ||
1292 | enum pipe pipe) | ||
1293 | { | ||
1294 | int reg, i; | ||
1295 | u32 val; | ||
1296 | |||
1297 | if (!IS_VALLEYVIEW(dev_priv->dev)) | ||
1298 | return; | ||
1299 | |||
1300 | /* Need to check both planes against the pipe */ | ||
1301 | for (i = 0; i < dev_priv->num_plane; i++) { | ||
1302 | reg = SPCNTR(pipe, i); | ||
1303 | val = I915_READ(reg); | ||
1304 | WARN((val & SP_ENABLE), | ||
1305 | "sprite %d assertion failure, should be off on pipe %c but is still active\n", | ||
1306 | pipe * 2 + i, pipe_name(pipe)); | ||
1307 | } | ||
1308 | } | ||
1309 | |||
1291 | static void assert_pch_refclk_enabled(struct drm_i915_private *dev_priv) | 1310 | static void assert_pch_refclk_enabled(struct drm_i915_private *dev_priv) |
1292 | { | 1311 | { |
1293 | u32 val; | 1312 | u32 val; |
@@ -1872,6 +1891,7 @@ static void intel_disable_pipe(struct drm_i915_private *dev_priv, | |||
1872 | * or we might hang the display. | 1891 | * or we might hang the display. |
1873 | */ | 1892 | */ |
1874 | assert_planes_disabled(dev_priv, pipe); | 1893 | assert_planes_disabled(dev_priv, pipe); |
1894 | assert_sprites_disabled(dev_priv, pipe); | ||
1875 | 1895 | ||
1876 | /* Don't disable pipe A or pipe A PLLs if needed */ | 1896 | /* Don't disable pipe A or pipe A PLLs if needed */ |
1877 | if (pipe == PIPE_A && (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | 1897 | if (pipe == PIPE_A && (dev_priv->quirks & QUIRK_PIPEA_FORCE)) |