diff options
author | Marek Olšák <[email protected]> | 2011-08-02 20:25:13 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-08-16 09:15:10 +0200 |
commit | 2ce783d8ddec1b1fcadc0798af0ebb045bba1cc4 (patch) | |
tree | 155806fae29db972c4aafcc98c922cf946c401fa /src/gallium/winsys/r600/drm/r600_drm.c | |
parent | 354f76f386afd980e8c1564c0b0502f9768007b5 (diff) |
r600g: put radeon_winsys in screen::winsys, don't include drm_driver in the pipe
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/winsys/r600/drm/r600_drm.c')
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_drm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c index 3a2186c6f4a..1cf905f2575 100644 --- a/src/gallium/winsys/r600/drm/r600_drm.c +++ b/src/gallium/winsys/r600/drm/r600_drm.c @@ -28,6 +28,7 @@ #include "r600_priv.h" #include "r600_drm_public.h" +#include "util/u_memory.h" #include <radeon_drm.h> #include <xf86drm.h> #include <errno.h> @@ -244,22 +245,21 @@ static int handle_compare(void *key1, void *key2) return PTR_TO_UINT(key1) != PTR_TO_UINT(key2); } -struct radeon *r600_drm_winsys_create(struct radeon_winsys *rw) +struct radeon *radeon_create(struct radeon_winsys *ws) { - struct radeon *radeon; int r; - - radeon = calloc(1, sizeof(*radeon)); + struct radeon *radeon = CALLOC_STRUCT(radeon); if (radeon == NULL) { return NULL; } - rw->query_info(rw, &radeon->info); + radeon->ws = ws; + ws->query_info(ws, &radeon->info); radeon->family = radeon_family_from_device(radeon->info.pci_id); if (radeon->family == CHIP_UNKNOWN) { fprintf(stderr, "Unknown chipset 0x%04X\n", radeon->info.pci_id); - return radeon_decref(radeon); + return radeon_destroy(radeon); } /* setup class */ switch (radeon->family) { @@ -323,7 +323,7 @@ struct radeon *r600_drm_winsys_create(struct radeon_winsys *rw) } r = radeon_init_fence(radeon); if (r) { - radeon_decref(radeon); + radeon_destroy(radeon); return NULL; } @@ -332,7 +332,7 @@ struct radeon *r600_drm_winsys_create(struct radeon_winsys *rw) return radeon; } -struct radeon *radeon_decref(struct radeon *radeon) +struct radeon *radeon_destroy(struct radeon *radeon) { if (radeon == NULL) return NULL; @@ -346,6 +346,6 @@ struct radeon *radeon_decref(struct radeon *radeon) if (radeon->bomgr) r600_bomgr_destroy(radeon->bomgr); - free(radeon); + FREE(radeon); return NULL; } |