diff options
author | Nicolai Hähnle <[email protected]> | 2017-06-28 14:47:32 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-08-02 09:50:57 +0200 |
commit | bc7f41e11d325280db12e7b9444501357bc13922 (patch) | |
tree | 418517dd1010fd545e4059610b2a63541f823dd5 /src/gallium/state_trackers | |
parent | 781375ac6f4025d8af729fc3886ea9995f184667 (diff) |
gallium: add pipe_screen_config to screen_create functions
This allows a more generic mechanism for passing user configurations
into drivers by accessing the dri options directly.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/clover/core/device.cpp | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/dri2.c | 12 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/drisw.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/xa/xa_tracker.c | 2 |
4 files changed, 14 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp index 2ad9e49cf8d..bd07670f384 100644 --- a/src/gallium/state_trackers/clover/core/device.cpp +++ b/src/gallium/state_trackers/clover/core/device.cpp @@ -42,7 +42,7 @@ namespace { device::device(clover::platform &platform, pipe_loader_device *ldev) : platform(platform), ldev(ldev) { - pipe = pipe_loader_create_screen(ldev, 0); + pipe = pipe_loader_create_screen(ldev, NULL); if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE)) { if (pipe) pipe->destroy(pipe); diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index e4e2a534fd1..ab85cc2452e 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -2056,10 +2056,12 @@ dri2_init_screen(__DRIscreen * sPriv) if (pipe_loader_drm_probe_fd(&screen->dev, fd)) { - unsigned flags = + struct pipe_screen_config config = {}; + + config.flags = dri_init_options_get_screen_flags(screen, screen->dev->driver_name); - pscreen = pipe_loader_create_screen(screen->dev, flags); + pscreen = pipe_loader_create_screen(screen->dev, &config); } if (!pscreen) @@ -2150,10 +2152,12 @@ 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"); + struct pipe_screen_config config = {}; + + config.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, flags); + pscreen = pipe_loader_create_screen(screen->dev, &config); if (!pscreen) goto release_pipe; diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c index ac4095618c0..10d1c8d1e4d 100644 --- a/src/gallium/state_trackers/dri/drisw.c +++ b/src/gallium/state_trackers/dri/drisw.c @@ -400,10 +400,12 @@ drisw_init_screen(__DRIscreen * sPriv) sPriv->driverPrivate = (void *)screen; sPriv->extensions = drisw_screen_extensions; - unsigned flags = dri_init_options_get_screen_flags(screen, "swrast"); + struct pipe_screen_config config; + + config.flags = dri_init_options_get_screen_flags(screen, "swrast"); if (pipe_loader_sw_probe_dri(&screen->dev, &drisw_lf)) - pscreen = pipe_loader_create_screen(screen->dev, flags); + pscreen = pipe_loader_create_screen(screen->dev, &config); if (!pscreen) goto fail; diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c index e5addcf8fef..d4114ab5591 100644 --- a/src/gallium/state_trackers/xa/xa_tracker.c +++ b/src/gallium/state_trackers/xa/xa_tracker.c @@ -162,7 +162,7 @@ xa_tracker_create(int drm_fd) goto out_no_fd; if (pipe_loader_drm_probe_fd(&xa->dev, fd)) - xa->screen = pipe_loader_create_screen(xa->dev, 0); + xa->screen = pipe_loader_create_screen(xa->dev, NULL); if (!xa->screen) goto out_no_screen; |