diff options
author | George Sapountzis <[email protected]> | 2010-03-19 02:38:11 +0200 |
---|---|---|
committer | George Sapountzis <[email protected]> | 2010-03-21 13:21:46 +0200 |
commit | f87a5f6499f51f651c2a9f2d4682875b22926905 (patch) | |
tree | 700f75997c24ecfca2728c6a0e65bfaf7e960f4f /src/gallium/winsys | |
parent | c28f5f98d6d57d3dd74fc6c1205a36ed584d1c93 (diff) |
gallium: add soft screen helper
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/drm/sw/Makefile | 3 | ||||
l--------- | src/gallium/winsys/drm/sw/soft_screen.c | 1 | ||||
-rw-r--r-- | src/gallium/winsys/drm/sw/sw_drm_api.c | 32 |
3 files changed, 31 insertions, 5 deletions
diff --git a/src/gallium/winsys/drm/sw/Makefile b/src/gallium/winsys/drm/sw/Makefile index 5f3c3ec325d..12b20cbd454 100644 --- a/src/gallium/winsys/drm/sw/Makefile +++ b/src/gallium/winsys/drm/sw/Makefile @@ -4,11 +4,12 @@ include $(TOP)/configs/current LIBNAME = swdrm C_SOURCES = \ + soft_screen.c \ wrapper_sw_winsys.c \ sw_drm_api.c LIBRARY_INCLUDES = -LIBRARY_DEFINES = +LIBRARY_DEFINES = -DGALLIUM_SOFTPIPE include ../../../Makefile.template diff --git a/src/gallium/winsys/drm/sw/soft_screen.c b/src/gallium/winsys/drm/sw/soft_screen.c new file mode 120000 index 00000000000..423597ba31f --- /dev/null +++ b/src/gallium/winsys/drm/sw/soft_screen.c @@ -0,0 +1 @@ +../../../auxiliary/target-helpers/soft_screen.c
\ No newline at end of file diff --git a/src/gallium/winsys/drm/sw/sw_drm_api.c b/src/gallium/winsys/drm/sw/sw_drm_api.c index 9c5933c73af..ed3ce146eb1 100644 --- a/src/gallium/winsys/drm/sw/sw_drm_api.c +++ b/src/gallium/winsys/drm/sw/sw_drm_api.c @@ -24,8 +24,11 @@ **********************************************************/ +#include "pipe/p_screen.h" #include "util/u_memory.h" -#include "softpipe/sp_public.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" @@ -60,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; + + 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 softpipe_create_screen(sww); + return NULL; } static void |