gma500: Workaround for Medfield/Cedarview cursor bug
authorAlan Cox <alan@linux.intel.com>
Tue, 5 Jul 2011 14:44:46 +0000 (15:44 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Jul 2011 15:20:45 +0000 (08:20 -0700)
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/gma500/psb_intel_display.c

index 65426682c44c2825ca9f61085db5fbc0db6c1471..cc7237e2d6b0c067f7ff9ed860453e941cd483e5 100644 (file)
@@ -1278,6 +1278,19 @@ const struct drm_crtc_funcs psb_intel_crtc_funcs = {
        .destroy = psb_intel_crtc_destroy,
 };
 
+/*
+ * Set the default value of cursor control and base register
+ * to zero. This is a workaround for h/w defect on Oaktrail
+ */
+static void psb_intel_cursor_init(struct drm_device *dev, int pipe)
+{
+        u32 control[3] = { CURACNTR, CURBCNTR, CURCCNTR };
+        u32 base[3] = { CURABASE, CURBBASE, CURCBASE };
+        
+       REG_WRITE(control[pipe], 0);
+       REG_WRITE(base[pipe], 0);
+}
+
 void psb_intel_crtc_init(struct drm_device *dev, int pipe,
                     struct psb_intel_mode_device *mode_dev)
 {
@@ -1341,6 +1354,7 @@ void psb_intel_crtc_init(struct drm_device *dev, int pipe,
        psb_intel_crtc->mode_set.connectors =
            (struct drm_connector **) (psb_intel_crtc + 1);
        psb_intel_crtc->mode_set.num_connectors = 0;
+       psb_intel_cursor_init(dev, pipe);
 }
 
 int psb_intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,