summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/sw
diff options
context:
space:
mode:
authorGeorge Sapountzis <[email protected]>2010-03-26 18:44:39 +0200
committerGeorge Sapountzis <[email protected]>2010-03-26 18:44:39 +0200
commit5b07257fdbb5a93f432b8eaf3a41f39b26bdb1f3 (patch)
tree83a9e7a596607f8600017bc88e05028df3c56700 /src/gallium/state_trackers/dri/sw
parent1fbfc22d8560c9d900832147f504ff64c64358de (diff)
st/dri: factor out common init_screen code
Diffstat (limited to 'src/gallium/state_trackers/dri/sw')
-rw-r--r--src/gallium/state_trackers/dri/sw/drisw.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index d7c6577818f..8999ae530f2 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
+++ b/src/gallium/state_trackers/dri/sw/drisw.c
@@ -282,6 +282,7 @@ static const __DRIextension *drisw_screen_extensions[] = {
const __DRIconfig **
drisw_init_screen(__DRIscreen * sPriv)
{
+ const __DRIconfig **configs;
struct dri_screen *screen;
struct drm_create_screen_arg arg;
@@ -292,26 +293,20 @@ drisw_init_screen(__DRIscreen * sPriv)
screen->api = drm_api_create();
screen->sPriv = sPriv;
screen->fd = -1;
+
sPriv->private = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
- arg.mode = DRM_CREATE_DRISW;
- screen->pipe_screen = screen->api->create_screen(screen->api, -1, &arg);
- if (!screen->pipe_screen) {
- debug_printf("%s: failed to create pipe_screen\n", __FUNCTION__);
- goto fail;
- }
+ arg.mode = DRM_CREATE_DRISW;
- screen->smapi = dri_create_st_manager(screen);
- if (!screen->smapi)
+ configs = dri_init_screen_helper(screen, &arg, 32);
+ if (!configs)
goto fail;
- driParseOptionInfo(&screen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- return dri_fill_in_modes(screen, 32);
+ return configs;
fail:
- dri_destroy_screen(sPriv);
+ dri_destroy_screen_helper(screen);
+ FREE(screen);
return NULL;
}