summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/drm
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-04-14 21:28:12 +0100
committerJakob Bornecrantz <[email protected]>2010-04-16 10:17:31 +0100
commit39c81dada01585a6030f03d215842a1a2ae87d86 (patch)
tree8fce5b6861f86b0844c1d384ace7c7748ba447c1 /src/gallium/state_trackers/dri/drm
parent6c954dd12871aae2c34854498eaf696b67e3680b (diff)
st/dri: Refactor init code a bit
Reviewed-by: George Sapountzis <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/drm')
-rw-r--r--src/gallium/state_trackers/dri/drm/dri1.c6
-rw-r--r--src/gallium/state_trackers/dri/drm/dri2.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/dri/drm/dri1.c b/src/gallium/state_trackers/dri/drm/dri1.c
index a6f40394b69..bdf251653d9 100644
--- a/src/gallium/state_trackers/dri/drm/dri1.c
+++ b/src/gallium/state_trackers/dri/drm/dri1.c
@@ -469,6 +469,7 @@ const __DRIconfig **
dri1_init_screen(__DRIscreen * sPriv)
{
const __DRIconfig **configs;
+ struct pipe_screen *pscreen;
struct dri_screen *screen;
struct dri1_create_screen_arg arg;
@@ -500,7 +501,10 @@ dri1_init_screen(__DRIscreen * sPriv)
* using.
*/
- configs = dri_init_screen_helper(screen, &arg.base, sPriv->fbBPP);
+ pscreen = screen->api->create_screen(screen->api, screen->fd, &arg.base);
+ /* dri_init_screen_helper checks pscreen for us */
+
+ configs = dri_init_screen_helper(screen, pscreen, sPriv->fbBPP);
if (!configs)
goto fail;
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index c6655847e9c..0d15b5c9b85 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -499,7 +499,7 @@ dri2_init_screen(__DRIscreen * sPriv)
{
const __DRIconfig **configs;
struct dri_screen *screen;
- struct drm_create_screen_arg arg;
+ struct pipe_screen *pscreen;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
@@ -512,9 +512,10 @@ dri2_init_screen(__DRIscreen * sPriv)
sPriv->private = (void *)screen;
sPriv->extensions = dri_screen_extensions;
- arg.mode = DRM_CREATE_NORMAL;
+ pscreen = screen->api->create_screen(screen->api, screen->fd, NULL);
+ /* dri_init_screen_helper checks pscreen for us */
- configs = dri_init_screen_helper(screen, &arg, 32);
+ configs = dri_init_screen_helper(screen, pscreen, 32);
if (!configs)
goto fail;