diff options
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 26 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_winsys.h | 19 |
2 files changed, 19 insertions, 26 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index b55eb809d2d..4ce1717ecc9 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -313,6 +313,14 @@ static unsigned radeon_drm_cs_add_reloc(struct radeon_winsys_cs *rcs, return index; } +static int radeon_drm_cs_get_reloc(struct radeon_winsys_cs *rcs, + struct radeon_winsys_cs_handle *buf) +{ + struct radeon_drm_cs *cs = radeon_drm_cs(rcs); + + return radeon_get_reloc(cs->csc, (struct radeon_bo*)buf, NULL); +} + static boolean radeon_drm_cs_validate(struct radeon_winsys_cs *rcs) { struct radeon_drm_cs *cs = radeon_drm_cs(rcs); @@ -359,22 +367,6 @@ static boolean radeon_drm_cs_memory_below_limit(struct radeon_winsys_cs *rcs, ui return status; } -static void radeon_drm_cs_write_reloc(struct radeon_winsys_cs *rcs, - struct radeon_winsys_cs_handle *buf) -{ - struct radeon_drm_cs *cs = radeon_drm_cs(rcs); - struct radeon_bo *bo = (struct radeon_bo*)buf; - unsigned index = radeon_get_reloc(cs->csc, bo, NULL); - - if (index == -1) { - fprintf(stderr, "radeon: Cannot get a relocation in %s.\n", __func__); - return; - } - - OUT_CS(&cs->base, 0xc0001000); - OUT_CS(&cs->base, index * RELOC_DWORDS); -} - void radeon_drm_cs_emit_ioctl_oneshot(struct radeon_drm_cs *cs, struct radeon_cs_context *csc) { unsigned i; @@ -650,9 +642,9 @@ void radeon_drm_cs_init_functions(struct radeon_drm_winsys *ws) ws->base.cs_create = radeon_drm_cs_create; ws->base.cs_destroy = radeon_drm_cs_destroy; ws->base.cs_add_reloc = radeon_drm_cs_add_reloc; + ws->base.cs_get_reloc = radeon_drm_cs_get_reloc; ws->base.cs_validate = radeon_drm_cs_validate; ws->base.cs_memory_below_limit = radeon_drm_cs_memory_below_limit; - ws->base.cs_write_reloc = radeon_drm_cs_write_reloc; ws->base.cs_flush = radeon_drm_cs_flush; ws->base.cs_set_flush_callback = radeon_drm_cs_set_flush; ws->base.cs_is_buffer_referenced = radeon_bo_is_referenced; diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h index 485e9259be3..320989c0788 100644 --- a/src/gallium/winsys/radeon/drm/radeon_winsys.h +++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h @@ -450,6 +450,16 @@ struct radeon_winsys { enum radeon_bo_priority priority); /** + * Return the index of an already-added buffer. + * + * \param cs Command stream + * \param buf Buffer + * \return The buffer index, or -1 if the buffer has not been added. + */ + int (*cs_get_reloc)(struct radeon_winsys_cs *cs, + struct radeon_winsys_cs_handle *buf); + + /** * Return TRUE if there is enough memory in VRAM and GTT for the relocs * added so far. If the validation fails, all the relocations which have * been added since the last call of cs_validate will be removed and @@ -470,15 +480,6 @@ struct radeon_winsys { boolean (*cs_memory_below_limit)(struct radeon_winsys_cs *cs, uint64_t vram, uint64_t gtt); /** - * Write a relocated dword to a command buffer. - * - * \param cs A command stream the relocation is written to. - * \param buf A winsys buffer to write the relocation for. - */ - void (*cs_write_reloc)(struct radeon_winsys_cs *cs, - struct radeon_winsys_cs_handle *buf); - - /** * Flush a command stream. * * \param cs A command stream to flush. |