Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] i965: alloc cached bo for query object on Sandybridge
Date: Tue, 14 Dec 2010 12:56:02 +0800	[thread overview]
Message-ID: <1292302562-5800-4-git-send-email-zhenyuw@linux.intel.com> (raw)
In-Reply-To: <1292302562-5800-1-git-send-email-zhenyuw@linux.intel.com>

Use new interface for cached bo create for query object on Sandybridge,
which is required for PIPE_CONTROL store buffer to be CPU cacheable.
---
 src/mesa/drivers/dri/i965/brw_queryobj.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index f28f286..8c639de 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -231,7 +231,11 @@ brw_prepare_query_begin(struct brw_context *brw)
       drm_intel_bo_unreference(brw->query.bo);
       brw->query.bo = NULL;
 
-      brw->query.bo = drm_intel_bo_alloc(intel->bufmgr, "query", 4096, 1);
+      /* Sandybridge requires PIPE_CONTROL write DW to be LLC cached. */
+      if (intel->gen >= 6)
+	  brw->query.bo = drm_intel_gem_bo_alloc_cached(intel->bufmgr, "query", 4096, 1);
+      else
+	  brw->query.bo = drm_intel_bo_alloc(intel->bufmgr, "query", 4096, 1);
       brw->query.index = 0;
    }
 
-- 
1.7.1

  parent reply	other threads:[~2010-12-14  4:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14  4:55 patches for occlusion query fix on sandybridge Zhenyu Wang
2010-12-14  4:56 ` [PATCH] drm/i915: Add cached bo create interface Zhenyu Wang
2010-12-14  4:56 ` [PATCH] intel: new interface for cached bo create Zhenyu Wang
2010-12-14  9:35   ` Chris Wilson
2010-12-14  4:56 ` Zhenyu Wang [this message]
2010-12-14 17:58 ` patches for occlusion query fix on sandybridge Eric Anholt
2010-12-14 20:59   ` david may
2010-12-14 21:47     ` Chris Wilson
2010-12-15  1:18       ` Zhenyu Wang
2010-12-14 18:13 ` Daniel Vetter
2010-12-15  1:29   ` Zhenyu Wang

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=1292302562-5800-4-git-send-email-zhenyuw@linux.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox