From f0310f76363712dcd6c5b89373330aef50b07efb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 24 Jan 2008 13:00:13 -0800 Subject: [PATCH] Bufmgr cleanup from intel-batchbuffer branch of 2d driver. --- src/mesa/drivers/dri/common/dri_bufmgr.c | 3 +++ src/mesa/drivers/dri/common/dri_bufmgr.h | 5 ----- src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c | 21 ++++++++++--------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c index 18b12c63f72..8413a51577c 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr.c +++ b/src/mesa/drivers/dri/common/dri_bufmgr.c @@ -25,6 +25,9 @@ * */ +#include +#include +#include #include "mtypes.h" #include "dri_bufmgr.h" diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.h b/src/mesa/drivers/dri/common/dri_bufmgr.h index 36340d4d57d..08cf8ca3e15 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr.h +++ b/src/mesa/drivers/dri/common/dri_bufmgr.h @@ -197,9 +197,6 @@ void dri_bo_subdata(dri_bo *bo, unsigned long offset, void dri_bo_get_subdata(dri_bo *bo, unsigned long offset, unsigned long size, void *data); -dri_bufmgr *dri_bufmgr_ttm_init(int fd, unsigned int fence_type, - unsigned int fence_type_flush); - void dri_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr); dri_bufmgr *dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, unsigned long size, @@ -213,8 +210,6 @@ void dri_bo_fake_disable_backing_store(dri_bo *bo, void *ptr), void *ptr); void dri_bufmgr_destroy(dri_bufmgr *bufmgr); -dri_bo *dri_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name, - unsigned int handle); void dri_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta, GLuint offset, dri_bo *target_buf); diff --git a/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c b/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c index 745dbc8a3e0..043447b1864 100644 --- a/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c +++ b/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c @@ -35,9 +35,12 @@ */ #include +#include #include +#include #include -#include "glthread.h" +#include + #include "errno.h" #include "mtypes.h" #include "dri_bufmgr.h" @@ -50,7 +53,7 @@ #define DBG(...) do { \ if (bufmgr_ttm->bufmgr.debug) \ - _mesa_printf(__VA_ARGS__); \ + fprintf(stderr, __VA_ARGS__); \ } while (0) /* @@ -150,7 +153,7 @@ static void dri_ttm_dump_validation_list(dri_bufmgr_ttm *bufmgr_ttm) bufmgr_ttm->validate_array[reloc_entry[2]].bo; dri_bo_ttm *target_ttm = (dri_bo_ttm *)target_bo; - DBG("%2d: %s@0x%08x -> %s@0x%08x + 0x%08x\n", + DBG("%2d: %s@0x%08x -> %s@0x%08lx + 0x%08x\n", i, bo_ttm->name, reloc_entry[0], target_ttm->name, target_bo->offset, @@ -369,7 +372,7 @@ dri_ttm_alloc(dri_bufmgr *bufmgr, const char *name, ttm_buf->delayed_unmap = GL_FALSE; ttm_buf->validate_index = -1; - DBG("bo_create: %p (%s) %db\n", &ttm_buf->bo, ttm_buf->name, size); + DBG("bo_create: %p (%s) %ldb\n", &ttm_buf->bo, ttm_buf->name, size); return &ttm_buf->bo; } @@ -619,8 +622,8 @@ dri_ttm_fence_wait(dri_fence *fence) ret = drmFenceWait(bufmgr_ttm->fd, DRM_FENCE_FLAG_WAIT_LAZY, &fence_ttm->drm_fence, 0); if (ret != 0) { - _mesa_printf("%s:%d: Error %d waiting for fence %s.\n", - __FILE__, __LINE__, ret, fence_ttm->name); + fprintf(stderr, "%s:%d: Error %d waiting for fence %s.\n", + __FILE__, __LINE__, ret, fence_ttm->name); abort(); } @@ -705,8 +708,6 @@ dri_ttm_bo_process_reloc(dri_bo *bo) for (i = 0; i < nr_relocs; i++) { struct dri_ttm_reloc *r = &bo_ttm->relocs[i]; - dri_bo_ttm *target_ttm = (dri_bo_ttm *)r->target_buf; - uint32_t *reloc_entry; /* Continue walking the tree depth-first. */ dri_ttm_bo_process_reloc(r->target_buf); @@ -786,8 +787,8 @@ intel_update_buffer_offsets (dri_bufmgr_ttm *bufmgr_ttm) } /* Update the buffer offset */ if (rep->bo_info.offset != bo->offset) { - DBG("BO %s migrated: 0x%08x -> 0x%08x\n", - bo_ttm->name, bo->offset, rep->bo_info.offset); + DBG("BO %s migrated: 0x%08lx -> 0x%08lx\n", + bo_ttm->name, bo->offset, (unsigned long)rep->bo_info.offset); bo->offset = rep->bo_info.offset; } } -- 2.30.2