diff options
author | Carl Worth <cworth@cworth.org> | 2008-07-25 13:44:29 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2008-07-31 11:14:25 -0700 |
commit | e5fab0b7681be06a5a3be4bbd769ba5c435e2128 (patch) | |
tree | 2a0da281b6f5a099c3a6c2b56578346718576c8d | |
parent | e9e6b4738573ffa3822ae68088bd53a645eedbce (diff) |
Add OUT_RELOC macro and backing intel_batch_emit_reloc function
-rw-r--r-- | src/i830_batchbuffer.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h index 2b898c26..c9b84215 100644 --- a/src/i830_batchbuffer.h +++ b/src/i830_batchbuffer.h @@ -60,6 +60,20 @@ intel_batch_emit_dword(I830Ptr pI830, uint32_t dword) } static inline void +intel_batch_emit_reloc (I830Ptr pI830, + dri_bo *bo, + uint32_t read_domains, + uint32_t write_domains, + uint32_t delta) +{ + assert(intel_batch_space(pI830) >= 4); + *(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = bo->offset + delta; + intel_bo_emit_reloc (pI830->batch_bo, read_domains, write_domains, delta, + pI830->batch_used, bo); + pI830->batch_used += 4; +} + +static inline void intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap, uint32_t delta) { assert(pI830->batch_ptr != NULL); @@ -71,6 +85,9 @@ intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap, uint32_t delta) #define OUT_BATCH(dword) intel_batch_emit_dword(pI830, dword) +#define OUT_RELOC(bo, read_domains, write_domains, delta) \ + intel_batch_emit_reloc (pI830, bo, read_domains, write_domains, delta) + #define OUT_RELOC_PIXMAP(pPixmap, delta) \ intel_batch_emit_reloc_pixmap(pI830, pPixmap, delta) |