All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: stable team <stable@kernel.org>
Subject: [PATCH] drm/i915: set scan-buffer as uncached on Sandybridge
Date: Mon, 25 Oct 2010 09:42:31 +0800	[thread overview]
Message-ID: <1287970951-3677-1-git-send-email-zhenyuw@linux.intel.com> (raw)

Display engine on Sandybridge is not coherent with LLC, so
try to always bind display buffer as uncached on Sandybridge.
This fixed screen artifacts seen by using blit engine on Sandybridge.

Cc: stable team <stable@kernel.org>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      |    1 +
 drivers/gpu/drm/i915/intel_display.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

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) {
-- 
1.7.1

             reply	other threads:[~2010-10-25  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25  1:42 Zhenyu Wang [this message]
2010-10-25  8:22 ` [PATCH] drm/i915: set scan-buffer as uncached on Sandybridge Chris Wilson
2010-10-25  8:50   ` Zou, Nanhai
2010-10-25 10:31     ` Clemens Eisserer
2010-10-26  2:07       ` Zou, Nanhai
2010-10-25 14:52   ` Zhenyu Wang
2010-10-26  7:29 ` Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287970951-3677-1-git-send-email-zhenyuw@linux.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.