diff options
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_bo_legacy.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_bo_legacy.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_cs_legacy.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_cs_legacy.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 8 |
5 files changed, 19 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index d57b19de8d..3aa1d869f1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -407,7 +407,7 @@ static void bo_ref(struct radeon_bo *bo) { } -static void bo_unref(struct radeon_bo *bo) +static struct radeon_bo *bo_unref(struct radeon_bo *bo) { struct bo_legacy *bo_legacy = (struct bo_legacy*)bo; @@ -419,7 +419,9 @@ static void bo_unref(struct radeon_bo *bo) if (!bo_legacy->is_pending) { bo_free(bo_legacy); } + return NULL; } + return bo; } static int bo_map(struct radeon_bo *bo, int write) @@ -589,7 +591,7 @@ void radeon_bo_legacy_pending(struct radeon_bo *bo, uint32_t pending) boml->cpendings++; } -void radeon_bo_manager_legacy_shutdown(struct radeon_bo_manager *bom) +void radeon_bo_manager_legacy_dtor(struct radeon_bo_manager *bom) { struct bo_manager_legacy *boml = (struct bo_manager_legacy *)bom; struct bo_legacy *bo_legacy; @@ -609,7 +611,7 @@ void radeon_bo_manager_legacy_shutdown(struct radeon_bo_manager *bom) free(boml); } -struct radeon_bo_manager *radeon_bo_manager_legacy(struct radeon_screen *scrn) +struct radeon_bo_manager *radeon_bo_manager_legacy_ctor(struct radeon_screen *scrn) { struct bo_manager_legacy *bom; struct bo_legacy *bo; @@ -646,7 +648,7 @@ struct radeon_bo_manager *radeon_bo_manager_legacy(struct radeon_screen *scrn) bom->nfree_handles = 0x400; bom->free_handles = (uint32_t*)malloc(bom->nfree_handles * 4); if (bom->free_handles == NULL) { - radeon_bo_manager_legacy_shutdown((struct radeon_bo_manager*)bom); + radeon_bo_manager_legacy_dtor((struct radeon_bo_manager*)bom); return NULL; } @@ -655,7 +657,7 @@ struct radeon_bo_manager *radeon_bo_manager_legacy(struct radeon_screen *scrn) /* allocate front */ bo = bo_allocate(bom, size, 0, RADEON_GEM_DOMAIN_VRAM, 0); if (bo == NULL) { - radeon_bo_manager_legacy_shutdown((struct radeon_bo_manager*)bom); + radeon_bo_manager_legacy_dtor((struct radeon_bo_manager*)bom); return NULL; } if (scrn->sarea->tiling_enabled) { @@ -671,7 +673,7 @@ struct radeon_bo_manager *radeon_bo_manager_legacy(struct radeon_screen *scrn) /* allocate back */ bo = bo_allocate(bom, size, 0, RADEON_GEM_DOMAIN_VRAM, 0); if (bo == NULL) { - radeon_bo_manager_legacy_shutdown((struct radeon_bo_manager*)bom); + radeon_bo_manager_legacy_dtor((struct radeon_bo_manager*)bom); return NULL; } if (scrn->sarea->tiling_enabled) { @@ -687,7 +689,7 @@ struct radeon_bo_manager *radeon_bo_manager_legacy(struct radeon_screen *scrn) /* allocate depth */ bo = bo_allocate(bom, size, 0, RADEON_GEM_DOMAIN_VRAM, 0); if (bo == NULL) { - radeon_bo_manager_legacy_shutdown((struct radeon_bo_manager*)bom); + radeon_bo_manager_legacy_dtor((struct radeon_bo_manager*)bom); return NULL; } bo->base.flags = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h index 316b023fb0..208171e372 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h @@ -39,8 +39,8 @@ void radeon_bo_legacy_pending(struct radeon_bo *bo, uint32_t pending); int radeon_bo_legacy_validate(struct radeon_bo *bo, uint32_t *soffset, uint32_t *eoffset); -struct radeon_bo_manager *radeon_bo_manager_legacy(struct radeon_screen *scrn); -void radeon_bo_manager_legacy_shutdown(struct radeon_bo_manager *bom); +struct radeon_bo_manager *radeon_bo_manager_legacy_ctor(struct radeon_screen *scrn); +void radeon_bo_manager_legacy_dtor(struct radeon_bo_manager *bom); void radeon_bo_legacy_texture_age(struct radeon_bo_manager *bom); unsigned radeon_bo_legacy_relocs_size(struct radeon_bo *bo); diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index b69537bc65..6bc41bca3b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -397,7 +397,7 @@ static struct radeon_cs_funcs radeon_cs_legacy_funcs = { cs_need_flush }; -struct radeon_cs_manager *radeon_cs_manager_legacy(struct radeon_context *ctx) +struct radeon_cs_manager *radeon_cs_manager_legacy_ctor(struct radeon_context *ctx) { struct cs_manager_legacy *csm; @@ -413,7 +413,7 @@ struct radeon_cs_manager *radeon_cs_manager_legacy(struct radeon_context *ctx) return (struct radeon_cs_manager*)csm; } -void radeon_cs_manager_legacy_shutdown(struct radeon_cs_manager *csm) +void radeon_cs_manager_legacy_dtor(struct radeon_cs_manager *csm) { free(csm); } diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h index cf0f20ec30..71a4dad58d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h @@ -35,7 +35,7 @@ #include "radeon_cs.h" #include "radeon_context.h" -struct radeon_cs_manager *radeon_cs_manager_legacy(struct radeon_context *ctx); -void radeon_cs_manager_legacy_shutdown(struct radeon_cs_manager *csm); +struct radeon_cs_manager *radeon_cs_manager_legacy_ctor(struct radeon_context *ctx); +void radeon_cs_manager_legacy_dtor(struct radeon_cs_manager *csm); #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 93131d269c..79cc4c8c8e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -973,7 +973,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) screen->sarea_priv_offset = dri_priv->sarea_priv_offset; screen->sarea = (drm_radeon_sarea_t *) ((GLubyte *) sPriv->pSAREA + screen->sarea_priv_offset); - screen->bom = radeon_bo_manager_legacy(screen); + screen->bom = radeon_bo_manager_legacy_ctor(screen); if (screen->bom == NULL) { free(screen); return NULL; @@ -1040,7 +1040,7 @@ radeonCreateScreen2(__DRIscreenPrivate *sPriv) sPriv->extensions = screen->extensions; screen->driScreen = sPriv; - screen->bom = radeon_bo_manager_gem(sPriv->fd); + screen->bom = radeon_bo_manager_gem_ctor(sPriv->fd); if (screen->bom == NULL) { free(screen); return NULL; @@ -1060,9 +1060,9 @@ radeonDestroyScreen( __DRIscreenPrivate *sPriv ) if (sPriv->dri2.enabled) { radeon_tracker_print(&screen->bom->tracker, stderr); - radeon_bo_manager_gem_shutdown(screen->bom); + radeon_bo_manager_gem_dtor(screen->bom); } else { - radeon_bo_manager_legacy_shutdown(screen->bom); + radeon_bo_manager_legacy_dtor(screen->bom); if ( screen->gartTextures.map ) { drmUnmap( screen->gartTextures.map, screen->gartTextures.size ); |