diff mbox

drm/i915: set scan-buffer as uncached on Sandybridge

Message ID 1287970951-3677-1-git-send-email-zhenyuw@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhenyu Wang Oct. 25, 2010, 1:42 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3a98bea..5200ee3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -34,6 +34,7 @@ 
 #include "intel_bios.h"
 #include "intel_ringbuffer.h"
 #include <linux/io-mapping.h>
+#include <linux/intel-gtt.h>
 
 /* General customization:
  */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9792285..46d724f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1579,6 +1579,14 @@  intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	obj = intel_fb->obj;
 	obj_priv = to_intel_bo(obj);
 
+	/* 
+	 *  Set uncacheable for scan-out buffer on Sandybridge.
+	 *  Display engine is non-coherent with LLC, and read from
+	 *  main memory only. This ensures data is coherent with display.
+	 */
+	if (IS_GEN6(dev))
+		obj_priv->agp_type = AGP_USER_UNCACHED_MEMORY;
+
 	mutex_lock(&dev->struct_mutex);
 	ret = intel_pin_and_fence_fb_obj(dev, obj);
 	if (ret != 0) {