aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/drisw.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-10-14 23:48:15 +0100
committerEmil Velikov <[email protected]>2015-11-21 12:52:20 +0000
commit23fb11455b415238fb9e378fa0ab51f4b6cefd7a (patch)
tree4d9956df30f1a5a26d9f30beecffcfa054a8b014 /src/gallium/state_trackers/dri/drisw.c
parentc4d337146ad1b880834214510f773f10d9ea6556 (diff)
{st,targets}/dri: use static/dynamic pipe-loader
Covert DRI to use only the pipe-loader interface. With drisw_create_screen and kms_swrast_create_screen replaced by their pipe-loader equivalent, we can now drop them. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/drisw.c')
-rw-r--r--src/gallium/state_trackers/dri/drisw.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c
index 1b24f4896ea..06fa9427667 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -34,14 +34,12 @@
* for createImage/destroyImage similar to DRI2 getBuffers.
*/
-/* XXX: Temporary hack, until we get rid of drisw_create_screen() */
-#define DRI_TARGET
-
#include "util/u_format.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_box.h"
#include "pipe/p_context.h"
+#include "pipe-loader/pipe_loader.h"
#include "state_tracker/drisw_api.h"
#include "state_tracker/st_context.h"
@@ -385,7 +383,7 @@ drisw_init_screen(__DRIscreen * sPriv)
{
const __DRIconfig **configs;
struct dri_screen *screen;
- struct pipe_screen *pscreen;
+ struct pipe_screen *pscreen = NULL;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
@@ -399,7 +397,9 @@ drisw_init_screen(__DRIscreen * sPriv)
sPriv->driverPrivate = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
- pscreen = drisw_create_screen(&drisw_lf);
+ if (pipe_loader_sw_probe_dri(&screen->dev, &drisw_lf))
+ pscreen = pipe_loader_create_screen(screen->dev);
+
/* dri_init_screen_helper checks pscreen for us */
configs = dri_init_screen_helper(screen, pscreen, "swrast");
@@ -409,6 +409,8 @@ drisw_init_screen(__DRIscreen * sPriv)
return configs;
fail:
dri_destroy_screen_helper(screen);
+ if (screen->dev)
+ pipe_loader_release(&screen->dev, 1);
FREE(screen);
return NULL;
}