summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-05-07 13:51:29 -0700
committerEric Anholt <eric@anholt.net>2008-05-07 13:51:29 -0700
commitab50ddaa9173ae108833db0edb209045788efc41 (patch)
tree83212955a79d5b74bc0d368988f9bbb38fe8ec00 /src/mesa/drivers/dri/i965/brw_wm_surface_state.c
parent8b2a7f08bc446deef497f2a0d3b54d9b70bdaf9c (diff)
GEM: Make dri_emit_reloc take GEM domain flags instead of TTM flags.
The GEM flags are much more descriptive for what we need. Since this makes bufmgr_fake rather device-specific, move it to the intel common directory. We've wanted to do device-specific stuff to it before.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_surface_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 0d91391964..73f4b2b4a3 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -204,7 +204,7 @@ brw_create_texture_surface( struct brw_context *brw,
/* Emit relocation to surface contents */
dri_emit_reloc(bo,
- DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ DRM_GEM_DOMAIN_I915_SAMPLER, 0,
0,
offsetof(struct brw_surface_state, ss1),
key->bo);
@@ -337,10 +337,14 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
&surf, sizeof(surf),
NULL, NULL);
if (region_bo != NULL) {
+ /* We might sample from it, and we might render to it, so flag
+ * them both. We might be able to figure out from other state
+ * a more restrictive relocation to emit.
+ */
dri_emit_reloc(brw->wm.surf_bo[unit],
- DRM_BO_FLAG_MEM_TT |
- DRM_BO_FLAG_READ |
- DRM_BO_FLAG_WRITE,
+ DRM_GEM_DOMAIN_I915_RENDER |
+ DRM_GEM_DOMAIN_I915_SAMPLER,
+ DRM_GEM_DOMAIN_I915_RENDER,
0,
offsetof(struct brw_surface_state, ss1),
region_bo);
@@ -388,9 +392,7 @@ brw_wm_get_binding_table(struct brw_context *brw)
for (i = 0; i < BRW_WM_MAX_SURF; i++) {
if (brw->wm.surf_bo[i] != NULL) {
dri_emit_reloc(bind_bo,
- DRM_BO_FLAG_MEM_TT |
- DRM_BO_FLAG_READ |
- DRM_BO_FLAG_WRITE,
+ DRM_GEM_DOMAIN_I915_INSTRUCTION, 0,
0,
i * sizeof(GLuint),
brw->wm.surf_bo[i]);