summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/dri2.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-21 00:34:12 +0200
committerMarek Olšák <[email protected]>2017-06-23 19:50:20 +0200
commit6b0f6e693ba4b682679e31cc528974bbf0291e45 (patch)
tree4ec75fa80f5f7b2bd5c13157a054f3ea156a8c5e /src/gallium/state_trackers/dri/dri2.c
parent76f379330acc3993f865ea77dfb0b5bcf47b6697 (diff)
st/dri: get drirc options before creating pipe_screen
dri_init_options_get_screen_flags will return the flags for create_screen(). Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/dri2.c')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 2d0e78cfdda..2402c61bd85 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -2025,8 +2025,13 @@ dri2_init_screen(__DRIscreen * sPriv)
if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto free_screen;
- if (pipe_loader_drm_probe_fd(&screen->dev, fd))
- pscreen = pipe_loader_create_screen(screen->dev, 0);
+
+ if (pipe_loader_drm_probe_fd(&screen->dev, fd)) {
+ unsigned flags =
+ dri_init_options_get_screen_flags(screen, screen->dev->driver_name);
+
+ pscreen = pipe_loader_create_screen(screen->dev, flags);
+ }
if (!pscreen)
goto release_pipe;
@@ -2064,7 +2069,7 @@ dri2_init_screen(__DRIscreen * sPriv)
else
sPriv->extensions = dri_screen_extensions;
- configs = dri_init_screen_helper(screen, pscreen, screen->dev->driver_name);
+ configs = dri_init_screen_helper(screen, pscreen);
if (!configs)
goto destroy_screen;
@@ -2116,8 +2121,10 @@ dri_kms_init_screen(__DRIscreen * sPriv)
if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto free_screen;
+ unsigned flags = dri_init_options_get_screen_flags(screen, "swrast");
+
if (pipe_loader_sw_probe_kms(&screen->dev, fd))
- pscreen = pipe_loader_create_screen(screen->dev, 0);
+ pscreen = pipe_loader_create_screen(screen->dev, flags);
if (!pscreen)
goto release_pipe;
@@ -2137,7 +2144,7 @@ dri_kms_init_screen(__DRIscreen * sPriv)
sPriv->extensions = dri_screen_extensions;
- configs = dri_init_screen_helper(screen, pscreen, "swrast");
+ configs = dri_init_screen_helper(screen, pscreen);
if (!configs)
goto destroy_screen;