diff options
author | Nicolai Haehnle <nhaehnle@gmail.com> | 2008-09-28 19:20:40 +0200 |
---|---|---|
committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2008-09-28 19:20:40 +0200 |
commit | 8d42990244a196b85ceb1439ad2b5eef6c559d61 (patch) | |
tree | 0ed80509e82826d101de1335ed48fd6e0ad35a20 | |
parent | 3dba9178ec5dbf8183a5ceee701c9a36606ad464 (diff) |
r300: Remove radeon_bufmgr
Since the bufmgr is now driver-specific anyway, there's no point in having
the additional indirection around.
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_cmdbuf.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_context.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_ioctl.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_mem.c | 30 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_mem.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_mipmap_tree.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_context.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_context.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_buffer.h | 4 |
10 files changed, 27 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index c8e49ea7c6..728df48ee4 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -133,7 +133,7 @@ int r300FlushCmdBufLocked(r300ContextPtr r300, const char *caller) dri_bo_unreference(r300->cmdbuf.buf); r300->dma.nr_released_bufs = 0; - r300->cmdbuf.buf = dri_bo_alloc(&r300->radeon.bufmgr->base, "cmdbuf", + r300->cmdbuf.buf = dri_bo_alloc(r300->radeon.bufmgr, "cmdbuf", r300->cmdbuf.size*4, 16, DRM_BO_MEM_CMDBUF); r300->cmdbuf.written = 0; r300->cmdbuf.reserved = 0; @@ -732,7 +732,7 @@ void r300InitCmdBuf(r300ContextPtr r300) size * 4, r300->hw.max_state_size * 4); } - r300->cmdbuf.buf = dri_bo_alloc(&r300->radeon.bufmgr->base, "cmdbuf", + r300->cmdbuf.buf = dri_bo_alloc(r300->radeon.bufmgr, "cmdbuf", size*4, 16, DRM_BO_MEM_CMDBUF); r300->cmdbuf.size = size; r300->cmdbuf.written = 0; diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 3854976d56..75cbebe65e 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -420,7 +420,7 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) /* the memory manager might be accessed when Mesa frees the shared * state, so don't destroy it earlier */ - dri_bufmgr_destroy(&r300->radeon.bufmgr->base); + dri_bufmgr_destroy(r300->radeon.bufmgr); r300->radeon.bufmgr = 0; /* free the option cache */ diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 65d3403386..037d0e612d 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -51,7 +51,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. struct r300_context; typedef struct r300_context r300ContextRec; typedef struct r300_context *r300ContextPtr; -typedef struct radeon_bufmgr radeon_bufmgr; #include "radeon_lock.h" #include "main/mm.h" diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 1b3fc58d85..36a273638a 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -572,7 +572,7 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) if (rmesa->dma.nr_released_bufs > 4) r300FlushCmdBuf(rmesa, __FUNCTION__); - rmesa->dma.current = dri_bo_alloc(&rmesa->radeon.bufmgr->base, "DMA regions", + rmesa->dma.current = dri_bo_alloc(rmesa->radeon.bufmgr, "DMA regions", size, 4, DRM_BO_MEM_DMA); rmesa->dma.current_used = 0; rmesa->dma.current_vertexptr = 0; diff --git a/src/mesa/drivers/dri/r300/r300_mem.c b/src/mesa/drivers/dri/r300/r300_mem.c index 91076136b0..d03b3b5bc4 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.c +++ b/src/mesa/drivers/dri/r300/r300_mem.c @@ -52,7 +52,7 @@ typedef struct _radeon_reloc radeon_reloc; typedef struct _radeon_bo_vram radeon_bo_vram; struct _radeon_bufmgr_classic { - radeon_bufmgr base; + dri_bufmgr base; r300ContextPtr rmesa; radeon_bo_classic *buffers; /** Unsorted linked list of all buffer objects */ @@ -258,7 +258,7 @@ static void track_pending_buffers(radeon_bufmgr_classic *bufmgr) */ static void init_buffer(radeon_bufmgr_classic *bufmgr, radeon_bo_classic *bo, unsigned long size) { - bo->base.bufmgr = &bufmgr->base.base; + bo->base.bufmgr = &bufmgr->base; bo->base.size = size; bo->refcount = 1; @@ -859,21 +859,21 @@ static void bufmgr_classic_destroy(dri_bufmgr *bufmgr_ctx) free(bufmgr); } -radeon_bufmgr* radeonBufmgrClassicInit(r300ContextPtr rmesa) +dri_bufmgr* radeonBufmgrClassicInit(r300ContextPtr rmesa) { radeon_bufmgr_classic* bufmgr = (radeon_bufmgr_classic*)calloc(1, sizeof(radeon_bufmgr_classic)); bufmgr->rmesa = rmesa; - bufmgr->base.base.bo_alloc = &bufmgr_classic_bo_alloc; - bufmgr->base.base.bo_alloc_static = bufmgr_classic_bo_alloc_static; - bufmgr->base.base.bo_reference = &bufmgr_classic_bo_reference; - bufmgr->base.base.bo_unreference = &bufmgr_classic_bo_unreference; - bufmgr->base.base.bo_map = &bufmgr_classic_bo_map; - bufmgr->base.base.bo_unmap = &bufmgr_classic_bo_unmap; - bufmgr->base.base.emit_reloc = &bufmgr_classic_emit_reloc; - bufmgr->base.base.process_relocs = &bufmgr_classic_process_relocs; - bufmgr->base.base.post_submit = &bufmgr_classic_post_submit; - bufmgr->base.base.destroy = &bufmgr_classic_destroy; + bufmgr->base.bo_alloc = &bufmgr_classic_bo_alloc; + bufmgr->base.bo_alloc_static = bufmgr_classic_bo_alloc_static; + bufmgr->base.bo_reference = &bufmgr_classic_bo_reference; + bufmgr->base.bo_unreference = &bufmgr_classic_bo_unreference; + bufmgr->base.bo_map = &bufmgr_classic_bo_map; + bufmgr->base.bo_unmap = &bufmgr_classic_bo_unmap; + bufmgr->base.emit_reloc = &bufmgr_classic_emit_reloc; + bufmgr->base.process_relocs = &bufmgr_classic_process_relocs; + bufmgr->base.post_submit = &bufmgr_classic_post_submit; + bufmgr->base.destroy = &bufmgr_classic_destroy; bufmgr->pending_tail = &bufmgr->pending; @@ -890,9 +890,9 @@ radeon_bufmgr* radeonBufmgrClassicInit(r300ContextPtr rmesa) return &bufmgr->base; } -void radeonBufmgrContendedLockTake(radeon_bufmgr* bufmgr_ctx) +void radeonBufmgrContendedLockTake(dri_bufmgr* bufmgr_ctx) { - radeon_bufmgr_classic *bufmgr = get_bufmgr_classic(&bufmgr_ctx->base); + radeon_bufmgr_classic *bufmgr = get_bufmgr_classic(bufmgr_ctx); DRI_AGE_TEXTURES(bufmgr->texture_heap); } diff --git a/src/mesa/drivers/dri/r300/r300_mem.h b/src/mesa/drivers/dri/r300/r300_mem.h index 734aef9bc6..9651d429ba 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.h +++ b/src/mesa/drivers/dri/r300/r300_mem.h @@ -16,7 +16,7 @@ #define DRM_RELOC_BLITTER (1 << 23) /** Offset overwrites lower 22 bits (used with blit packet3) */ #define DRM_RELOC_TXOFFSET (1 << 24) /** Offset overwrites everything but low bits (used for texture offsets) */ -radeon_bufmgr* radeonBufmgrClassicInit(r300ContextPtr rmesa); -void radeonBufmgrContendedLockTake(radeon_bufmgr* bufmgr_ctx); +dri_bufmgr* radeonBufmgrClassicInit(r300ContextPtr rmesa); +void radeonBufmgrContendedLockTake(dri_bufmgr* bufmgr_ctx); #endif diff --git a/src/mesa/drivers/dri/r300/r300_mipmap_tree.c b/src/mesa/drivers/dri/r300/r300_mipmap_tree.c index bfd46b8bd1..49fc16193c 100644 --- a/src/mesa/drivers/dri/r300/r300_mipmap_tree.c +++ b/src/mesa/drivers/dri/r300/r300_mipmap_tree.c @@ -164,7 +164,7 @@ r300_mipmap_tree* r300_miptree_create(r300ContextPtr rmesa, r300TexObj *t, calculate_miptree_layout(mt); - mt->bo = dri_bo_alloc(&rmesa->radeon.bufmgr->base, "texture", mt->totalsize, 1024, 0); + mt->bo = dri_bo_alloc(rmesa->radeon.bufmgr, "texture", mt->totalsize, 1024, 0); return mt; } diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 0d531716c1..4901a2328d 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -275,7 +275,7 @@ radeon_make_renderbuffer_current(radeonContextPtr radeon, if ((rb = (void *)draw->Attachment[BUFFER_FRONT_LEFT].Renderbuffer)) { if (!rb->bo) - rb->bo = dri_bo_alloc_static(&radeon->bufmgr->base, "front buffer", + rb->bo = dri_bo_alloc_static(radeon->bufmgr, "front buffer", radeon->radeonScreen->frontOffset, size, map, DRM_BO_FLAG_MEM_VRAM); rb->cpp = radeon->radeonScreen->cpp; @@ -283,7 +283,7 @@ radeon_make_renderbuffer_current(radeonContextPtr radeon, } if ((rb = (void *)draw->Attachment[BUFFER_BACK_LEFT].Renderbuffer)) { if (!rb->bo) - rb->bo = dri_bo_alloc_static(&radeon->bufmgr->base, "back buffer", + rb->bo = dri_bo_alloc_static(radeon->bufmgr, "back buffer", radeon->radeonScreen->backOffset, size, map, DRM_BO_FLAG_MEM_VRAM); rb->cpp = radeon->radeonScreen->cpp; @@ -291,7 +291,7 @@ radeon_make_renderbuffer_current(radeonContextPtr radeon, } if ((rb = (void *)draw->Attachment[BUFFER_DEPTH].Renderbuffer)) { if (!rb->bo) - rb->bo = dri_bo_alloc_static(&radeon->bufmgr->base, "depth buffer", + rb->bo = dri_bo_alloc_static(radeon->bufmgr, "depth buffer", radeon->radeonScreen->depthOffset, size, map, DRM_BO_FLAG_MEM_VRAM); rb->cpp = radeon->radeonScreen->cpp; diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index effca13ea1..a1f02253f3 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -45,6 +45,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/mtypes.h" #include "main/colormac.h" +#include "radeon_dri_bufmgr.h" #include "radeon_screen.h" #include "drm.h" #include "dri_util.h" @@ -187,7 +188,7 @@ struct radeon_context { */ driOptionCache optionCache; - struct radeon_bufmgr *bufmgr; + dri_bufmgr *bufmgr; }; #define RADEON_CONTEXT(glctx) ((radeonContextPtr)(ctx->DriverCtx)) diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer.h b/src/mesa/drivers/dri/radeon/radeon_buffer.h index 621e39a4b1..1f9fdff5f3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer.h +++ b/src/mesa/drivers/dri/radeon/radeon_buffer.h @@ -44,8 +44,4 @@ struct radeon_renderbuffer __DRIdrawablePrivate *dPriv; }; -struct radeon_bufmgr { - dri_bufmgr base; -}; - #endif |