drm/i915: Disable the cursor for DPMS_OFF
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Aug 2010 11:24:42 +0000 (12:24 +0100)
committerEric Anholt <eric@anholt.net>
Mon, 9 Aug 2010 18:24:30 +0000 (11:24 -0700)
The comments have long desired that we should switch off the cursor
along with the display plane, make it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h

index 22966bd9aa9697ae399ee659dd7dd63104b8084f..24fbd0f245078754c26f6e199dc851d2dfc7a0ea 100644 (file)
@@ -2470,9 +2470,6 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
 
 /**
  * Sets the power management mode of the pipe and plane.
- *
- * This code should probably grow support for turning the cursor off and back
- * on appropriately at the same time as we're turning the pipe off/on.
  */
 static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
 {
@@ -2487,6 +2484,9 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
 
        intel_crtc->dpms_mode = mode;
 
+       intel_crtc->cursor_on = mode == DRM_MODE_DPMS_ON;
+       intel_crtc_update_cursor(crtc);
+
        if (!dev->primary->master)
                return;
 
@@ -4242,7 +4242,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc)
 
        pos = 0;
 
-       if (crtc->fb) {
+       if (intel_crtc->cursor_on && crtc->fb) {
                base = intel_crtc->cursor_addr;
                if (x > (int) crtc->fb->width)
                        base = 0;
index 1075d4386b87a6fb56805f9e5804cf66060af07d..a44b8cb4d2cc100de7fb0a406adffb19e2835a38 100644 (file)
@@ -154,7 +154,7 @@ struct intel_crtc {
        uint32_t cursor_addr;
        int16_t cursor_x, cursor_y;
        int16_t cursor_width, cursor_height;
-       bool cursor_visble;
+       bool cursor_visble, cursor_on;
 };
 
 #define to_intel_crtc(x) container_of(x, struct intel_crtc, base)