summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xa
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2014-02-10 10:43:11 -0500
committerRob Clark <[email protected]>2014-02-16 08:36:19 -0500
commit42158926c6d7d3ddbe61b9a04d60544ff1b50a96 (patch)
tree13a31743d343a5f31684bbf836d1e4b088e2fe25 /src/gallium/state_trackers/xa
parenta122c75599cf196b7997fbc5ec2854ebd65af408 (diff)
st/xa: use pipe-loader to get screen
This lets multiple gallium drivers use XA. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/xa')
-rw-r--r--src/gallium/state_trackers/xa/Makefile.am3
-rw-r--r--src/gallium/state_trackers/xa/xa_priv.h1
-rw-r--r--src/gallium/state_trackers/xa/xa_tracker.c7
3 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/xa/Makefile.am b/src/gallium/state_trackers/xa/Makefile.am
index 7d0b366e639..72486b9816c 100644
--- a/src/gallium/state_trackers/xa/Makefile.am
+++ b/src/gallium/state_trackers/xa/Makefile.am
@@ -29,6 +29,9 @@ AM_CFLAGS = \
$(VISIBILITY_CFLAGS)
AM_CPPFLAGS = \
+ $(GALLIUM_PIPE_LOADER_DEFINES) \
+ -DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\" \
+ -I$(top_srcdir)/src/gallium/targets/xa \
-I$(top_srcdir)/src/gallium/ \
-I$(top_srcdir)/src/gallium/winsys \
-I$(top_srcdir)/src/gallium/drivers
diff --git a/src/gallium/state_trackers/xa/xa_priv.h b/src/gallium/state_trackers/xa/xa_priv.h
index ee182e79222..b99c2144eb4 100644
--- a/src/gallium/state_trackers/xa/xa_priv.h
+++ b/src/gallium/state_trackers/xa/xa_priv.h
@@ -74,6 +74,7 @@ struct xa_tracker {
unsigned int format_map[XA_LAST_SURFACE_TYPE][2];
int d_depth_bits_last;
int ds_depth_bits_last;
+ struct pipe_loader_device *dev;
struct pipe_screen *screen;
struct xa_context *default_ctx;
};
diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c
index cda6501fcd4..d3601c6bfd3 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -30,6 +30,7 @@
#include "xa_priv.h"
#include "pipe/p_state.h"
#include "pipe/p_format.h"
+#include "pipe-loader/pipe_loader.h"
#include "state_tracker/drm_driver.h"
#include "util/u_inlines.h"
@@ -143,7 +144,8 @@ xa_tracker_create(int drm_fd)
if (!xa)
return NULL;
- xa->screen = driver_descriptor.create_screen(drm_fd);
+ if (pipe_loader_drm_probe_fd(&xa->dev, drm_fd, false))
+ xa->screen = pipe_loader_create_screen(xa->dev, PIPE_SEARCH_DIR);
if (!xa->screen)
goto out_no_screen;
@@ -190,6 +192,8 @@ xa_tracker_create(int drm_fd)
out_no_pipe:
xa->screen->destroy(xa->screen);
out_no_screen:
+ if (xa->dev)
+ pipe_loader_release(&xa->dev, 1);
free(xa);
return NULL;
}
@@ -200,6 +204,7 @@ xa_tracker_destroy(struct xa_tracker *xa)
free(xa->supported_formats);
xa_context_destroy(xa->default_ctx);
xa->screen->destroy(xa->screen);
+ pipe_loader_release(&xa->dev, 1);
free(xa);
}