diff mbox

drm/i915: Disable the cursor for DPMS_OFF

Message ID 1280921082-21012-1-git-send-email-chris@chris-wilson.co.uk
State Deferred, archived
Headers show

Commit Message

Chris Wilson Aug. 4, 2010, 11:24 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5946c88..7de4ead 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2371,9 +2371,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)
 {
@@ -2388,6 +2385,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;
 
@@ -4127,7 +4127,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;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index b219014..c321d70 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -156,7 +156,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)