@@ -34,6 +34,7 @@
#include "intel_bios.h"
#include "intel_ringbuffer.h"
#include <linux/io-mapping.h>
+#include <linux/intel-gtt.h>
/* General customization:
*/
@@ -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) {