summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-04-20 22:05:54 -0700
committerEric Anholt <eric@anholt.net>2009-04-27 17:05:59 -0700
commit4653a7db622ad54a3182d93c81331765d930db34 (patch)
tree6de6c39b08dd82452a2c34d5a4325ad151ae5217
parent1784efc1f0c74edda8c78fb1b0cdd989f0a088ad (diff)
Rely on BO pixmaps being present in acceleration paths.
-rw-r--r--src/i830_batchbuffer.h9
-rw-r--r--src/i965_render.c32
2 files changed, 15 insertions, 26 deletions
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 81e84e2a..6e0aaa79 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -102,16 +102,9 @@ intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap,
uint32_t delta)
{
dri_bo *bo = i830_get_pixmap_bo(pPixmap);
- uint32_t offset;
assert(pI830->batch_ptr != NULL);
assert(intel_batch_space(pI830) >= 4);
- if (bo) {
- intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
- return;
- }
- offset = intel_get_pixmap_offset(pPixmap);
- *(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = offset + delta;
- pI830->batch_used += 4;
+ intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
}
#define OUT_BATCH(dword) intel_batch_emit_dword(pI830, dword)
diff --git a/src/i965_render.c b/src/i965_render.c
index e527f11c..7583af17 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -923,6 +923,7 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
struct brw_surface_state_padded *ss;
struct brw_surface_state local_ss;
dri_bo *pixmap_bo = i830_get_pixmap_bo(pPixmap);
+ uint32_t write_domain, read_domains;
ss = (struct brw_surface_state_padded *)ss_bo->virtual + ss_index;
@@ -952,10 +953,7 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
local_ss.ss0.vert_line_stride_ofs = 0;
local_ss.ss0.mipmap_layout_mode = 0;
local_ss.ss0.render_cache_read_mode = 0;
- if (pixmap_bo != NULL)
- local_ss.ss1.base_addr = pixmap_bo->offset;
- else
- local_ss.ss1.base_addr = intel_get_pixmap_offset(pPixmap);
+ local_ss.ss1.base_addr = pixmap_bo->offset;
local_ss.ss2.mip_count = 0;
local_ss.ss2.render_target_rotation = 0;
@@ -967,22 +965,20 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
memcpy(ss, &local_ss, sizeof(local_ss));
- if (pixmap_bo != NULL) {
- uint32_t write_domain, read_domains;
- if (is_dst) {
- write_domain = I915_GEM_DOMAIN_RENDER;
- read_domains = I915_GEM_DOMAIN_RENDER;
- } else {
- write_domain = 0;
- read_domains = I915_GEM_DOMAIN_SAMPLER;
- }
- dri_bo_emit_reloc(ss_bo, read_domains, write_domain,
- 0,
- ss_index * sizeof(*ss) +
- offsetof(struct brw_surface_state, ss1),
- pixmap_bo);
+ if (is_dst) {
+ write_domain = I915_GEM_DOMAIN_RENDER;
+ read_domains = I915_GEM_DOMAIN_RENDER;
+ } else {
+ write_domain = 0;
+ read_domains = I915_GEM_DOMAIN_SAMPLER;
}
+ drm_intel_bo_emit_reloc(ss_bo,
+ ss_index * sizeof(*ss) +
+ offsetof(struct brw_surface_state, ss1),
+ pixmap_bo,
+ 0,
+ read_domains, write_domain);
}
static void