if (r300->radeon.radeonScreen->driScreen->dri2.enabled) {
int fd = r300->radeon.radeonScreen->driScreen->fd;
- r300->cmdbuf.csm = radeon_cs_manager_gem(fd);
+ r300->cmdbuf.csm = radeon_cs_manager_gem_ctor(fd);
} else {
- r300->cmdbuf.csm = radeon_cs_manager_legacy(&r300->radeon);
+ r300->cmdbuf.csm = radeon_cs_manager_legacy_ctor(&r300->radeon);
}
if (r300->cmdbuf.csm == NULL) {
/* FIXME: fatal error */
FREE(atom->cmd);
}
if (r300->radeon.radeonScreen->driScreen->dri2.enabled) {
- radeon_cs_manager_gem_shutdown(r300->cmdbuf.csm);
+ radeon_cs_manager_gem_dtor(r300->cmdbuf.csm);
} else {
- radeon_cs_manager_legacy_shutdown(r300->cmdbuf.csm);
+ radeon_cs_manager_legacy_dtor(r300->cmdbuf.csm);
}
}
{
}
-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;
if (!bo_legacy->is_pending) {
bo_free(bo_legacy);
}
+ return NULL;
}
+ return bo;
}
static int bo_map(struct radeon_bo *bo, int write)
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;
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;
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;
}
/* 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) {
/* 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) {
/* 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;
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);
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;
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);
}
#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
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;
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;
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 );