[Intel-gfx] [PATCH] i965: alloc cached bo for query object on Sandybridge
Zhenyu Wang
zhenyuw at linux.intel.com
Tue Dec 14 05:56:02 CET 2010
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
More information about the Intel-gfx
mailing list