diff options
author | George Sapountzis <gsapountzis@gmail.com> | 2010-03-21 19:33:09 +0200 |
---|---|---|
committer | George Sapountzis <gsapountzis@gmail.com> | 2010-03-21 19:33:09 +0200 |
commit | f9c0cbd1ad0c5948ea577edb5c76b0c45976a285 (patch) | |
tree | c9846ad67f1f01095be890a200f2685a1fbdedbe /src/gallium/winsys | |
parent | 63aa8a39c4e7ee996afc87404474cce570ac3729 (diff) |
Revert "drm/sw: just s/softpipe_create_screen/gallium_soft_create_screen/"
This reverts commit 5d524cce9c4fcc18ed977801d59ba7bb911020db.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/drm/sw/sw_drm_api.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/gallium/winsys/drm/sw/sw_drm_api.c b/src/gallium/winsys/drm/sw/sw_drm_api.c index fa16600fe6..ed3ce146eb 100644 --- a/src/gallium/winsys/drm/sw/sw_drm_api.c +++ b/src/gallium/winsys/drm/sw/sw_drm_api.c @@ -24,9 +24,11 @@ **********************************************************/ +#include "pipe/p_screen.h" #include "util/u_memory.h" #include "target-helpers/soft_screen.h" +#include "state_tracker/sw_winsys.h" #include "state_tracker/drm_api.h" #include "wrapper_sw_winsys.h" #include "sw_drm_api.h" @@ -41,7 +43,6 @@ struct sw_drm_api { struct drm_api base; struct drm_api *api; - struct sw_winsys *sw; }; static INLINE struct sw_drm_api * @@ -62,14 +63,35 @@ sw_drm_create_screen(struct drm_api *_api, int drmFD, { struct sw_drm_api *swapi = sw_drm_api(_api); struct drm_api *api = swapi->api; - struct sw_winsys *sww; - struct pipe_screen *screen; + struct sw_winsys *sww = NULL; + struct pipe_screen *screen = NULL; + struct pipe_screen *soft_screen = NULL; screen = api->create_screen(api, drmFD, arg); + if (screen == NULL) + goto fail; sww = wrapper_sw_winsys_warp_pipe_screen(screen); + if (sww == NULL) + goto fail; - return gallium_soft_create_screen(sww); + soft_screen = gallium_soft_create_screen(sww); + if (soft_screen == NULL) + goto fail; + + return soft_screen; + +fail: + if (soft_screen) + soft_screen->destroy(soft_screen); + + if (sww) + sww->destroy(sww); + + if (screen) + screen->destroy(screen); + + return NULL; } static void |