summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.h3
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c9
-rw-r--r--src/gallium/state_trackers/dri/dri2.c4
-rw-r--r--src/gallium/targets/dri/dri.sym1
4 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 690d088..19d269f 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -180,6 +180,9 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev);
bool
pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd);
+struct pipe_screen *
+load_pipe_screen(struct pipe_loader_device **dev, int fd);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 2b7ab27..f72a94f 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -294,3 +294,12 @@ static const struct pipe_loader_ops pipe_loader_drm_ops = {
.configuration = pipe_loader_drm_configuration,
.release = pipe_loader_drm_release
};
+
+PUBLIC struct pipe_screen *load_pipe_screen(struct pipe_loader_device **dev, int fd)
+{
+ struct pipe_screen *pscreen = NULL;
+ if (pipe_loader_drm_probe_fd(dev, fd)) {
+ pscreen = pipe_loader_create_screen(*dev);
+ }
+ return pscreen;
+}
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 9ec069b..db8f70e 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1881,9 +1881,7 @@ 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);
-
+ pscreen = load_pipe_screen(&screen->dev, screen->fd);
if (!pscreen)
goto release_pipe;
diff --git a/src/gallium/targets/dri/dri.sym b/src/gallium/targets/dri/dri.sym
index 1fdf18b..1d86c88 100644
--- a/src/gallium/targets/dri/dri.sym
+++ b/src/gallium/targets/dri/dri.sym
@@ -2,6 +2,7 @@
global:
__driDriverExtensions;
__driDriverGetExtensions*;
+ load_pipe_screen;
nouveau_drm_screen_create;
radeon_drm_winsys_create;
amdgpu_winsys_create;