summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2016-02-10 16:56:56 -0600
committerMauro Rossi <issor.oruam@gmail.com>2016-11-01 20:41:59 +0100
commit7618870ed442a6b1f4fc60888403c0bbbbfa35b5 (patch)
treea55e864c57e0beaee5eeeeda2a7c375b2b78f677 /src/gallium/auxiliary
parent6ba00e6acd0f9fa19fd240ddbc25bc656fbd7f17 (diff)
downloadexternal_mesa3d-7618870ed442a6b1f4fc60888403c0bbbbfa35b5.zip
external_mesa3d-7618870ed442a6b1f4fc60888403c0bbbbfa35b5.tar.gz
external_mesa3d-7618870ed442a6b1f4fc60888403c0bbbbfa35b5.tar.bz2
gallium: introduce load_pipe_screen()
Introduce load_pipe_screen() public entry point for other code which dlopen()'s gralloc_dri.so for purposes of loading a pipe_screen. This way drm_gralloc can avoid static linking of each gallium winsys and driver, and avoid duplicated logic to figure out which pipe driver to load. This is based on Rob Clark's work. I moved it into pipe_loader which seems to be a better spot. Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.h3
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c9
2 files changed, 12 insertions, 0 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;
+}