summaryrefslogtreecommitdiff
path: root/src/i830_batchbuffer.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-06-06 15:27:44 -0700
committerEric Anholt <eric@anholt.net>2008-06-10 11:37:03 -0700
commitecf19e1cda60a938d41413075ae6e00f24e0ec1a (patch)
tree52cc63541edf693bf518a55f7bf4b67bf69110d4 /src/i830_batchbuffer.h
parentbade7d7d2505a10a8a7d24b084aff9742e2d6d64 (diff)
Change most usage of pixmap offsets to using a reloc macro.
This is based on airlied's RING->BATCH commit. The 965 code still needs to be fixed up for relocations.
Diffstat (limited to 'src/i830_batchbuffer.h')
-rw-r--r--src/i830_batchbuffer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 91793264..2b898c26 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -59,8 +59,21 @@ intel_batch_emit_dword(I830Ptr pI830, uint32_t dword)
pI830->batch_used += 4;
}
+static inline void
+intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap, uint32_t delta)
+{
+ assert(pI830->batch_ptr != NULL);
+ assert(intel_batch_space(pI830) >= 4);
+ *(uint32_t *)(pI830->batch_ptr + pI830->batch_used) =
+ intel_get_pixmap_offset(pPixmap) + delta;
+ pI830->batch_used += 4;
+}
+
#define OUT_BATCH(dword) intel_batch_emit_dword(pI830, dword)
+#define OUT_RELOC_PIXMAP(pPixmap, delta) \
+ intel_batch_emit_reloc_pixmap(pI830, pPixmap, delta)
+
union intfloat {
float f;
unsigned int ui;