aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f3e706c2bd31..5fa1476cbfc6 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -944,19 +944,24 @@ void assert_pipe(struct drm_i915_private *dev_priv,
944 pipe_name(pipe), state_string(state), state_string(cur_state)); 944 pipe_name(pipe), state_string(state), state_string(cur_state));
945} 945}
946 946
947static void assert_plane_enabled(struct drm_i915_private *dev_priv, 947static void assert_plane(struct drm_i915_private *dev_priv,
948 enum plane plane) 948 enum plane plane, bool state)
949{ 949{
950 int reg; 950 int reg;
951 u32 val; 951 u32 val;
952 bool cur_state;
952 953
953 reg = DSPCNTR(plane); 954 reg = DSPCNTR(plane);
954 val = I915_READ(reg); 955 val = I915_READ(reg);
955 WARN(!(val & DISPLAY_PLANE_ENABLE), 956 cur_state = !!(val & DISPLAY_PLANE_ENABLE);
956 "plane %c assertion failure, should be active but is disabled\n", 957 WARN(cur_state != state,
957 plane_name(plane)); 958 "plane %c assertion failure (expected %s, current %s)\n",
959 plane_name(plane), state_string(state), state_string(cur_state));
958} 960}
959 961
962#define assert_plane_enabled(d, p) assert_plane(d, p, true)
963#define assert_plane_disabled(d, p) assert_plane(d, p, false)
964
960static void assert_planes_disabled(struct drm_i915_private *dev_priv, 965static void assert_planes_disabled(struct drm_i915_private *dev_priv,
961 enum pipe pipe) 966 enum pipe pipe)
962{ 967{
@@ -3335,6 +3340,8 @@ static void intel_crtc_disable(struct drm_crtc *crtc)
3335 struct drm_device *dev = crtc->dev; 3340 struct drm_device *dev = crtc->dev;
3336 3341
3337 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF); 3342 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
3343 assert_plane_disabled(dev->dev_private, to_intel_crtc(crtc)->plane);
3344 assert_pipe_disabled(dev->dev_private, to_intel_crtc(crtc)->pipe);
3338 3345
3339 if (crtc->fb) { 3346 if (crtc->fb) {
3340 mutex_lock(&dev->struct_mutex); 3347 mutex_lock(&dev->struct_mutex);