summaryrefslogtreecommitdiff
path: root/src/gallium/targets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/targets')
-rw-r--r--src/gallium/targets/SConscript.dri1
-rw-r--r--src/gallium/targets/dri-i915/Makefile4
-rw-r--r--src/gallium/targets/dri-i915/SConscript4
-rw-r--r--src/gallium/targets/dri-i915/dummy.c0
-rw-r--r--src/gallium/targets/dri-i915/target.c26
-rw-r--r--src/gallium/targets/dri-i965/Makefile6
-rw-r--r--src/gallium/targets/dri-i965/SConscript8
-rw-r--r--src/gallium/targets/dri-i965/dummy.c0
-rw-r--r--src/gallium/targets/dri-i965/target.c30
-rw-r--r--src/gallium/targets/dri-nouveau/Makefile6
-rw-r--r--src/gallium/targets/dri-nouveau/target.c20
-rw-r--r--src/gallium/targets/dri-r600/Makefile4
-rw-r--r--src/gallium/targets/dri-r600/SConscript4
-rw-r--r--src/gallium/targets/dri-r600/dummy.c0
-rw-r--r--src/gallium/targets/dri-r600/target.c26
-rw-r--r--src/gallium/targets/dri-radeong/Makefile4
-rw-r--r--src/gallium/targets/dri-radeong/SConscript4
-rw-r--r--src/gallium/targets/dri-radeong/dummy.c0
-rw-r--r--src/gallium/targets/dri-radeong/target.c26
-rw-r--r--src/gallium/targets/dri-swrast/Makefile4
-rw-r--r--src/gallium/targets/dri-swrast/SConscript6
-rw-r--r--src/gallium/targets/dri-swrast/swrast_drm_api.c58
-rw-r--r--src/gallium/targets/dri-vmwgfx/Makefile4
-rw-r--r--src/gallium/targets/dri-vmwgfx/SConscript4
-rw-r--r--src/gallium/targets/dri-vmwgfx/dummy.c0
-rw-r--r--src/gallium/targets/dri-vmwgfx/target.c26
-rw-r--r--src/gallium/targets/egl-i915/Makefile5
-rw-r--r--src/gallium/targets/egl-i915/dummy.c3
-rw-r--r--src/gallium/targets/egl-i915/target.c30
-rw-r--r--src/gallium/targets/egl-i965/Makefile6
-rw-r--r--src/gallium/targets/egl-i965/dummy.c3
-rw-r--r--src/gallium/targets/egl-i965/target.c34
-rw-r--r--src/gallium/targets/egl-nouveau/Makefile7
-rw-r--r--src/gallium/targets/egl-nouveau/dummy.c3
-rw-r--r--src/gallium/targets/egl-nouveau/target.c24
-rw-r--r--src/gallium/targets/egl-radeon/Makefile5
-rw-r--r--src/gallium/targets/egl-radeon/dummy.c3
-rw-r--r--src/gallium/targets/egl-radeon/target.c30
-rw-r--r--src/gallium/targets/egl-swrast/swrast_glue.c13
-rw-r--r--src/gallium/targets/egl-vmwgfx/Makefile5
-rw-r--r--src/gallium/targets/egl-vmwgfx/dummy.c3
-rw-r--r--src/gallium/targets/egl-vmwgfx/target.c30
-rw-r--r--src/gallium/targets/xorg-i915/Makefile3
-rw-r--r--src/gallium/targets/xorg-i915/intel_target.c26
-rw-r--r--src/gallium/targets/xorg-i965/Makefile5
-rw-r--r--src/gallium/targets/xorg-i965/intel_target.c30
-rw-r--r--src/gallium/targets/xorg-nouveau/Makefile5
-rw-r--r--src/gallium/targets/xorg-nouveau/nouveau_target.c20
-rw-r--r--src/gallium/targets/xorg-radeon/Makefile3
-rw-r--r--src/gallium/targets/xorg-radeon/radeon_target.c26
-rw-r--r--src/gallium/targets/xorg-vmwgfx/Makefile4
-rw-r--r--src/gallium/targets/xorg-vmwgfx/vmw_target.c26
52 files changed, 534 insertions, 93 deletions
diff --git a/src/gallium/targets/SConscript.dri b/src/gallium/targets/SConscript.dri
index 74b53e5023..e5981c2461 100644
--- a/src/gallium/targets/SConscript.dri
+++ b/src/gallium/targets/SConscript.dri
@@ -13,6 +13,7 @@ drienv.Replace(CPPPATH = [
'#src/gallium/include',
'#src/gallium/auxiliary',
'#src/gallium/drivers',
+ '#src/gallium/winsys',
'#src/mesa',
'#src/mesa/main',
'#src/mesa/glapi',
diff --git a/src/gallium/targets/dri-i915/Makefile b/src/gallium/targets/dri-i915/Makefile
index fdcfd08c22..26726b24a0 100644
--- a/src/gallium/targets/dri-i915/Makefile
+++ b/src/gallium/targets/dri-i915/Makefile
@@ -13,9 +13,13 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/i915/libi915.a
C_SOURCES = \
+ target.c \
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
+DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
include ../Makefile.dri
DRI_LIB_DEPS += -ldrm_intel
diff --git a/src/gallium/targets/dri-i915/SConscript b/src/gallium/targets/dri-i915/SConscript
index 65c4239887..5659bc8027 100644
--- a/src/gallium/targets/dri-i915/SConscript
+++ b/src/gallium/targets/dri-i915/SConscript
@@ -8,6 +8,8 @@ env = drienv.Clone()
env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
+env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE'])
+
env.Prepend(LIBS = [
st_dri,
i915drm,
@@ -22,6 +24,6 @@ env.Prepend(LIBS = [
env.LoadableModule(
target = 'i915_dri.so',
- source = 'dummy.c',
+ source = 'target.c',
SHLIBPREFIX = '',
)
diff --git a/src/gallium/targets/dri-i915/dummy.c b/src/gallium/targets/dri-i915/dummy.c
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/gallium/targets/dri-i915/dummy.c
+++ /dev/null
diff --git a/src/gallium/targets/dri-i915/target.c b/src/gallium/targets/dri-i915/target.c
new file mode 100644
index 0000000000..8c8ef7e02b
--- /dev/null
+++ b/src/gallium/targets/dri-i915/target.c
@@ -0,0 +1,26 @@
+
+#include "state_tracker/drm_driver.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "i915/drm/i915_drm_public.h"
+#include "i915/i915_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct i915_winsys *iws;
+ struct pipe_screen *screen;
+
+ iws = i915_drm_winsys_create(fd);
+ if (!iws)
+ return NULL;
+
+ screen = i915_screen_create(iws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
diff --git a/src/gallium/targets/dri-i965/Makefile b/src/gallium/targets/dri-i965/Makefile
index 13987c643e..3679c075b2 100644
--- a/src/gallium/targets/dri-i965/Makefile
+++ b/src/gallium/targets/dri-i965/Makefile
@@ -8,16 +8,18 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(TOP)/src/gallium/winsys/sw/drm/libswdrm.a \
$(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/identity/libidentity.a \
$(TOP)/src/gallium/drivers/i965/libi965.a
C_SOURCES = \
+ target.c \
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
+DRIVER_DEFINES = \
+ -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
+
include ../Makefile.dri
DRI_LIB_DEPS += -ldrm_intel
diff --git a/src/gallium/targets/dri-i965/SConscript b/src/gallium/targets/dri-i965/SConscript
index 13ac5a2d8e..7eb3c436a3 100644
--- a/src/gallium/targets/dri-i965/SConscript
+++ b/src/gallium/targets/dri-i965/SConscript
@@ -8,6 +8,12 @@ env = drienv.Clone()
env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
+env.Append(CPPDEFINES = [
+ 'GALLIUM_SOFTPIPE',
+ 'GALLIUM_RBUG',
+ 'GALLIUM_TRACE'
+])
+
env.Prepend(LIBS = [
st_dri,
i965drm,
@@ -24,6 +30,6 @@ env.Prepend(LIBS = [
env.LoadableModule(
target = 'i965_dri.so',
- source = 'dummy.c',
+ source = 'target.c',
SHLIBPREFIX = '',
)
diff --git a/src/gallium/targets/dri-i965/dummy.c b/src/gallium/targets/dri-i965/dummy.c
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/gallium/targets/dri-i965/dummy.c
+++ /dev/null
diff --git a/src/gallium/targets/dri-i965/target.c b/src/gallium/targets/dri-i965/target.c
new file mode 100644
index 0000000000..ce97f82027
--- /dev/null
+++ b/src/gallium/targets/dri-i965/target.c
@@ -0,0 +1,30 @@
+
+#include "target-helpers/inline_wrapper_sw_helper.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "i965/drm/i965_drm_public.h"
+#include "i965/brw_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct brw_winsys_screen *bws;
+ struct pipe_screen *screen;
+
+ bws = i965_drm_winsys_screen_create(fd);
+ if (!bws)
+ return NULL;
+
+ screen = brw_screen_create(bws);
+ if (!screen)
+ return NULL;
+
+ if (debug_get_bool_option("BRW_SOFTPIPE", FALSE))
+ screen = sw_screen_wrap(screen);
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen)
diff --git a/src/gallium/targets/dri-nouveau/Makefile b/src/gallium/targets/dri-nouveau/Makefile
index 74d352c6a7..2f64f312b8 100644
--- a/src/gallium/targets/dri-nouveau/Makefile
+++ b/src/gallium/targets/dri-nouveau/Makefile
@@ -6,14 +6,20 @@ LIBNAME = nouveau_dri.so
PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \
$(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
+ $(TOP)/src/gallium/drivers/rbug/librbug.a \
$(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
$(TOP)/src/gallium/drivers/nv50/libnv50.a \
$(TOP)/src/gallium/drivers/nouveau/libnouveau.a
C_SOURCES = \
+ target.c \
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
+DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
include ../Makefile.dri
DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs)
diff --git a/src/gallium/targets/dri-nouveau/target.c b/src/gallium/targets/dri-nouveau/target.c
new file mode 100644
index 0000000000..e725a4d9b7
--- /dev/null
+++ b/src/gallium/targets/dri-nouveau/target.c
@@ -0,0 +1,20 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "nouveau/drm/nouveau_drm_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct pipe_screen *screen;
+
+ screen = nouveau_drm_screen_create(fd);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen)
diff --git a/src/gallium/targets/dri-r600/Makefile b/src/gallium/targets/dri-r600/Makefile
index 0213200fbc..932303d194 100644
--- a/src/gallium/targets/dri-r600/Makefile
+++ b/src/gallium/targets/dri-r600/Makefile
@@ -12,9 +12,13 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/r600/libr600.a
C_SOURCES = \
+ target.c \
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
+DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
include ../Makefile.dri
DRI_LIB_DEPS += -ldrm_radeon
diff --git a/src/gallium/targets/dri-r600/SConscript b/src/gallium/targets/dri-r600/SConscript
index 6c23c050eb..97c5df01fe 100644
--- a/src/gallium/targets/dri-r600/SConscript
+++ b/src/gallium/targets/dri-r600/SConscript
@@ -8,6 +8,8 @@ env = drienv.Clone()
env.ParseConfig('pkg-config --cflags --libs libdrm_radeon')
+env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE'])
+
env.Prepend(LIBS = [
st_dri,
r600drm,
@@ -22,6 +24,6 @@ env.Prepend(LIBS = [
env.SharedLibrary(
target ='r600_dri.so',
- source = 'dummy.c',
+ source = 'target.c',
SHLIBPREFIX = '',
)
diff --git a/src/gallium/targets/dri-r600/dummy.c b/src/gallium/targets/dri-r600/dummy.c
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/gallium/targets/dri-r600/dummy.c
+++ /dev/null
diff --git a/src/gallium/targets/dri-r600/target.c b/src/gallium/targets/dri-r600/target.c
new file mode 100644
index 0000000000..a01f4ed49f
--- /dev/null
+++ b/src/gallium/targets/dri-r600/target.c
@@ -0,0 +1,26 @@
+
+#include "state_tracker/drm_driver.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "r600/drm/r600_drm_public.h"
+#include "r600/r600_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct radeon *rw;
+ struct pipe_screen *screen;
+
+ rw = r600_drm_winsys_create(fd);
+ if (!rw)
+ return NULL;
+
+ screen = r600_screen_create(rw);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen)
diff --git a/src/gallium/targets/dri-radeong/Makefile b/src/gallium/targets/dri-radeong/Makefile
index 8ba1972ffa..a0ee9f1d18 100644
--- a/src/gallium/targets/dri-radeong/Makefile
+++ b/src/gallium/targets/dri-radeong/Makefile
@@ -13,9 +13,13 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/r300/libr300.a
C_SOURCES = \
+ target.c \
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
+DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
include ../Makefile.dri
DRI_LIB_DEPS += -ldrm_radeon
diff --git a/src/gallium/targets/dri-radeong/SConscript b/src/gallium/targets/dri-radeong/SConscript
index 4c6cfb84eb..ffac73af84 100644
--- a/src/gallium/targets/dri-radeong/SConscript
+++ b/src/gallium/targets/dri-radeong/SConscript
@@ -8,6 +8,8 @@ env = drienv.Clone()
env.ParseConfig('pkg-config --cflags --libs libdrm_radeon')
+env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE'])
+
env.Prepend(LIBS = [
st_dri,
radeonwinsys,
@@ -22,6 +24,6 @@ env.Prepend(LIBS = [
env.SharedLibrary(
target ='radeon_dri.so',
- source = 'dummy.c',
+ source = 'target.c',
SHLIBPREFIX = '',
)
diff --git a/src/gallium/targets/dri-radeong/dummy.c b/src/gallium/targets/dri-radeong/dummy.c
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/gallium/targets/dri-radeong/dummy.c
+++ /dev/null
diff --git a/src/gallium/targets/dri-radeong/target.c b/src/gallium/targets/dri-radeong/target.c
new file mode 100644
index 0000000000..5a0a8dc573
--- /dev/null
+++ b/src/gallium/targets/dri-radeong/target.c
@@ -0,0 +1,26 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "radeon/drm/radeon_drm_public.h"
+#include "r300/r300_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct r300_winsys_screen *sws;
+ struct pipe_screen *screen;
+
+ sws = r300_drm_winsys_screen_create(fd);
+ if (!sws)
+ return NULL;
+
+ screen = r300_screen_create(sws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen)
diff --git a/src/gallium/targets/dri-swrast/Makefile b/src/gallium/targets/dri-swrast/Makefile
index 0a53eb56c4..948c45abe5 100644
--- a/src/gallium/targets/dri-swrast/Makefile
+++ b/src/gallium/targets/dri-swrast/Makefile
@@ -3,7 +3,9 @@ include $(TOP)/configs/current
LIBNAME = swrastg_dri.so
-DRIVER_DEFINES = -D__NOT_HAVE_DRM_H -DGALLIUM_SOFTPIPE
+DRIVER_DEFINES = \
+ -D__NOT_HAVE_DRM_H -DGALLIUM_SOFTPIPE \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/dri/sw/libdrisw.a \
diff --git a/src/gallium/targets/dri-swrast/SConscript b/src/gallium/targets/dri-swrast/SConscript
index 679afab41c..d814347119 100644
--- a/src/gallium/targets/dri-swrast/SConscript
+++ b/src/gallium/targets/dri-swrast/SConscript
@@ -18,7 +18,11 @@ env.Prepend(LIBS = [
])
if True:
- env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
+ env.Append(CPPDEFINES = [
+ 'GALLIUM_SOFTPIPE',
+ 'GALLIUM_RBUG',
+ 'GALLIUM_TRACE',
+ ])
env.Prepend(LIBS = [softpipe])
if env['llvm']:
diff --git a/src/gallium/targets/dri-swrast/swrast_drm_api.c b/src/gallium/targets/dri-swrast/swrast_drm_api.c
index 84142be80c..8d741c6343 100644
--- a/src/gallium/targets/dri-swrast/swrast_drm_api.c
+++ b/src/gallium/targets/dri-swrast/swrast_drm_api.c
@@ -28,61 +28,11 @@
#include "pipe/p_compiler.h"
#include "util/u_memory.h"
-#include "state_tracker/drm_api.h"
-#include "state_tracker/sw_winsys.h"
#include "dri_sw_winsys.h"
-#include "trace/tr_public.h"
-/* Copied from targets/libgl-xlib */
+#include "target-helpers/inline_debug_helper.h"
+#include "target-helpers/inline_sw_helper.h"
-#ifdef GALLIUM_SOFTPIPE
-#include "softpipe/sp_public.h"
-#endif
-
-#ifdef GALLIUM_LLVMPIPE
-#include "llvmpipe/lp_public.h"
-#endif
-
-#ifdef GALLIUM_CELL
-#include "cell/ppu/cell_public.h"
-#endif
-
-static struct pipe_screen *
-swrast_create_screen(struct sw_winsys *winsys)
-{
- const char *default_driver;
- const char *driver;
- struct pipe_screen *screen = NULL;
-
-#if defined(GALLIUM_CELL)
- default_driver = "cell";
-#elif defined(GALLIUM_LLVMPIPE)
- default_driver = "llvmpipe";
-#elif defined(GALLIUM_SOFTPIPE)
- default_driver = "softpipe";
-#else
- default_driver = "";
-#endif
-
- driver = debug_get_option("GALLIUM_DRIVER", default_driver);
-
-#if defined(GALLIUM_CELL)
- if (screen == NULL && strcmp(driver, "cell") == 0)
- screen = cell_create_screen( winsys );
-#endif
-
-#if defined(GALLIUM_LLVMPIPE)
- if (screen == NULL && strcmp(driver, "llvmpipe") == 0)
- screen = llvmpipe_create_screen( winsys );
-#endif
-
-#if defined(GALLIUM_SOFTPIPE)
- if (screen == NULL)
- screen = softpipe_create_screen( winsys );
-#endif
-
- return trace_screen_create(screen);;
-}
struct pipe_screen *
drisw_create_screen(struct drisw_loader_funcs *lf)
@@ -94,10 +44,12 @@ drisw_create_screen(struct drisw_loader_funcs *lf)
if (winsys == NULL)
return NULL;
- screen = swrast_create_screen(winsys);
+ screen = sw_screen_create(winsys);
if (!screen)
goto fail;
+ screen = debug_screen_wrap(screen);
+
return screen;
fail:
diff --git a/src/gallium/targets/dri-vmwgfx/Makefile b/src/gallium/targets/dri-vmwgfx/Makefile
index b5b679f3c7..97c703b373 100644
--- a/src/gallium/targets/dri-vmwgfx/Makefile
+++ b/src/gallium/targets/dri-vmwgfx/Makefile
@@ -11,8 +11,12 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/svga/libsvga.a
C_SOURCES = \
+ target.c \
$(COMMON_GALLIUM_SOURCES)
+DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
include ../Makefile.dri
symlinks:
diff --git a/src/gallium/targets/dri-vmwgfx/SConscript b/src/gallium/targets/dri-vmwgfx/SConscript
index 09a0c254c3..7afabc7429 100644
--- a/src/gallium/targets/dri-vmwgfx/SConscript
+++ b/src/gallium/targets/dri-vmwgfx/SConscript
@@ -6,6 +6,8 @@ if not 'svga' in env['drivers']:
env = drienv.Clone()
+env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE'])
+
env.Prepend(LIBS = [
st_dri,
svgadrm,
@@ -20,6 +22,6 @@ env.Prepend(LIBS = [
env.LoadableModule(
target = 'vmwgfx_dri.so',
- source = 'dummy.c',
+ source = 'target.c',
SHLIBPREFIX = '',
)
diff --git a/src/gallium/targets/dri-vmwgfx/dummy.c b/src/gallium/targets/dri-vmwgfx/dummy.c
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/gallium/targets/dri-vmwgfx/dummy.c
+++ /dev/null
diff --git a/src/gallium/targets/dri-vmwgfx/target.c b/src/gallium/targets/dri-vmwgfx/target.c
new file mode 100644
index 0000000000..15089d6db2
--- /dev/null
+++ b/src/gallium/targets/dri-vmwgfx/target.c
@@ -0,0 +1,26 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "svga/drm/svga_drm_public.h"
+#include "svga/svga_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct svga_winsys_screen *sws;
+ struct pipe_screen *screen;
+
+ sws = svga_drm_winsys_screen_create(fd);
+ if (!sws)
+ return NULL;
+
+ screen = svga_screen_create(sws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen)
diff --git a/src/gallium/targets/egl-i915/Makefile b/src/gallium/targets/egl-i915/Makefile
index a4b41842ff..c3ffe78029 100644
--- a/src/gallium/targets/egl-i915/Makefile
+++ b/src/gallium/targets/egl-i915/Makefile
@@ -2,9 +2,12 @@ TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER_NAME = i915
-EGL_DRIVER_SOURCES = dummy.c
+EGL_DRIVER_SOURCES = target.c
EGL_DRIVER_LIBS = -ldrm_intel
+EGL_DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
EGL_DRIVER_PIPES = \
$(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
diff --git a/src/gallium/targets/egl-i915/dummy.c b/src/gallium/targets/egl-i915/dummy.c
deleted file mode 100644
index 3181d0ba7e..0000000000
--- a/src/gallium/targets/egl-i915/dummy.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* A poor man's --whole-archive for EGL drivers */
-void *_eglMain(void *);
-void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-i915/target.c b/src/gallium/targets/egl-i915/target.c
new file mode 100644
index 0000000000..070e2c0964
--- /dev/null
+++ b/src/gallium/targets/egl-i915/target.c
@@ -0,0 +1,30 @@
+
+#include "state_tracker/drm_driver.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "i915/drm/i915_drm_public.h"
+#include "i915/i915_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct i915_winsys *iws;
+ struct pipe_screen *screen;
+
+ iws = i915_drm_winsys_create(fd);
+ if (!iws)
+ return NULL;
+
+ screen = i915_screen_create(iws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
+
+/* A poor man's --whole-archive for EGL drivers */
+void *_eglMain(void *);
+void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-i965/Makefile b/src/gallium/targets/egl-i965/Makefile
index d4730824a5..44e435452e 100644
--- a/src/gallium/targets/egl-i965/Makefile
+++ b/src/gallium/targets/egl-i965/Makefile
@@ -2,15 +2,17 @@ TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER_NAME = i965
-EGL_DRIVER_SOURCES = dummy.c
+EGL_DRIVER_SOURCES = target.c
EGL_DRIVER_LIBS = -ldrm_intel
+EGL_DRIVER_DEFINES = \
+ -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
+
EGL_DRIVER_PIPES = \
$(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
$(TOP)/src/gallium/drivers/i965/libi965.a \
- $(TOP)/src/gallium/winsys/sw/drm/libswdrm.a \
$(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
diff --git a/src/gallium/targets/egl-i965/dummy.c b/src/gallium/targets/egl-i965/dummy.c
deleted file mode 100644
index 3181d0ba7e..0000000000
--- a/src/gallium/targets/egl-i965/dummy.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* A poor man's --whole-archive for EGL drivers */
-void *_eglMain(void *);
-void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-i965/target.c b/src/gallium/targets/egl-i965/target.c
new file mode 100644
index 0000000000..1195b510a0
--- /dev/null
+++ b/src/gallium/targets/egl-i965/target.c
@@ -0,0 +1,34 @@
+
+#include "target-helpers/inline_wrapper_sw_helper.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "i965/drm/i965_drm_public.h"
+#include "i965/brw_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct brw_winsys_screen *bws;
+ struct pipe_screen *screen;
+
+ bws = i965_drm_winsys_screen_create(fd);
+ if (!bws)
+ return NULL;
+
+ screen = brw_screen_create(bws);
+ if (!screen)
+ return NULL;
+
+ if (debug_get_bool_option("BRW_SOFTPIPE", FALSE))
+ screen = sw_screen_wrap(screen);
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen)
+
+/* A poor man's --whole-archive for EGL drivers */
+void *_eglMain(void *);
+void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-nouveau/Makefile b/src/gallium/targets/egl-nouveau/Makefile
index e3fa8937e8..0e16f11324 100644
--- a/src/gallium/targets/egl-nouveau/Makefile
+++ b/src/gallium/targets/egl-nouveau/Makefile
@@ -2,11 +2,16 @@ TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER_NAME = nouveau
-EGL_DRIVER_SOURCES = dummy.c
+EGL_DRIVER_SOURCES = target.c
EGL_DRIVER_LIBS = -ldrm_nouveau
+EGL_DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
EGL_DRIVER_PIPES = \
$(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
+ $(TOP)/src/gallium/drivers/rbug/librbug.a \
$(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
$(TOP)/src/gallium/drivers/nv50/libnv50.a \
$(TOP)/src/gallium/drivers/nouveau/libnouveau.a
diff --git a/src/gallium/targets/egl-nouveau/dummy.c b/src/gallium/targets/egl-nouveau/dummy.c
deleted file mode 100644
index 3181d0ba7e..0000000000
--- a/src/gallium/targets/egl-nouveau/dummy.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* A poor man's --whole-archive for EGL drivers */
-void *_eglMain(void *);
-void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-nouveau/target.c b/src/gallium/targets/egl-nouveau/target.c
new file mode 100644
index 0000000000..cf569ea62c
--- /dev/null
+++ b/src/gallium/targets/egl-nouveau/target.c
@@ -0,0 +1,24 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "nouveau/drm/nouveau_drm_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct pipe_screen *screen;
+
+ screen = nouveau_drm_screen_create(fd);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen)
+
+/* A poor man's --whole-archive for EGL drivers */
+void *_eglMain(void *);
+void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-radeon/Makefile b/src/gallium/targets/egl-radeon/Makefile
index 64c20afc2b..79426836db 100644
--- a/src/gallium/targets/egl-radeon/Makefile
+++ b/src/gallium/targets/egl-radeon/Makefile
@@ -2,9 +2,12 @@ TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER_NAME = radeon
-EGL_DRIVER_SOURCES = dummy.c
+EGL_DRIVER_SOURCES = target.c
EGL_DRIVER_LIBS = -ldrm_radeon
+EGL_DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
EGL_DRIVER_PIPES = \
$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/galahad/libgalahad.a \
diff --git a/src/gallium/targets/egl-radeon/dummy.c b/src/gallium/targets/egl-radeon/dummy.c
deleted file mode 100644
index 3181d0ba7e..0000000000
--- a/src/gallium/targets/egl-radeon/dummy.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* A poor man's --whole-archive for EGL drivers */
-void *_eglMain(void *);
-void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-radeon/target.c b/src/gallium/targets/egl-radeon/target.c
new file mode 100644
index 0000000000..ce07327b8f
--- /dev/null
+++ b/src/gallium/targets/egl-radeon/target.c
@@ -0,0 +1,30 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "radeon/drm/radeon_drm_public.h"
+#include "r300/r300_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct r300_winsys_screen *sws;
+ struct pipe_screen *screen;
+
+ sws = r300_drm_winsys_screen_create(fd);
+ if (!sws)
+ return NULL;
+
+ screen = r300_screen_create(sws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen)
+
+/* A poor man's --whole-archive for EGL drivers */
+void *_eglMain(void *);
+void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-swrast/swrast_glue.c b/src/gallium/targets/egl-swrast/swrast_glue.c
index defd11c687..24f77826d4 100644
--- a/src/gallium/targets/egl-swrast/swrast_glue.c
+++ b/src/gallium/targets/egl-swrast/swrast_glue.c
@@ -1,10 +1,11 @@
-#include "state_tracker/drm_api.h"
-struct drm_api *
-drm_api_create()
-{
- return NULL;
-}
+#include "state_tracker/drm_driver.h"
+
+struct drm_driver_descriptor drm_driver = {
+ .name = "swrast",
+ .driver_name = NULL,
+ .create_screen = NULL,
+};
/* A poor man's --whole-archive for EGL drivers */
void *_eglMain(void *);
diff --git a/src/gallium/targets/egl-vmwgfx/Makefile b/src/gallium/targets/egl-vmwgfx/Makefile
index a9f6874b98..92ec4cbdd6 100644
--- a/src/gallium/targets/egl-vmwgfx/Makefile
+++ b/src/gallium/targets/egl-vmwgfx/Makefile
@@ -2,9 +2,12 @@ TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER_NAME = vmwgfx
-EGL_DRIVER_SOURCES = dummy.c
+EGL_DRIVER_SOURCES = target.c
EGL_DRIVER_LIBS =
+EGL_DRIVER_DEFINES = \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
+
EGL_DRIVER_PIPES = \
$(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
diff --git a/src/gallium/targets/egl-vmwgfx/dummy.c b/src/gallium/targets/egl-vmwgfx/dummy.c
deleted file mode 100644
index 3181d0ba7e..0000000000
--- a/src/gallium/targets/egl-vmwgfx/dummy.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* A poor man's --whole-archive for EGL drivers */
-void *_eglMain(void *);
-void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/egl-vmwgfx/target.c b/src/gallium/targets/egl-vmwgfx/target.c
new file mode 100644
index 0000000000..4e9f51c5dc
--- /dev/null
+++ b/src/gallium/targets/egl-vmwgfx/target.c
@@ -0,0 +1,30 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "svga/drm/svga_drm_public.h"
+#include "svga/svga_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct svga_winsys_screen *sws;
+ struct pipe_screen *screen;
+
+ sws = svga_drm_winsys_screen_create(fd);
+ if (!sws)
+ return NULL;
+
+ screen = svga_screen_create(sws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen)
+
+/* A poor man's --whole-archive for EGL drivers */
+void *_eglMain(void *);
+void *_eglWholeArchive = (void *) _eglMain;
diff --git a/src/gallium/targets/xorg-i915/Makefile b/src/gallium/targets/xorg-i915/Makefile
index 18f07d6d8f..3ab7285fb9 100644
--- a/src/gallium/targets/xorg-i915/Makefile
+++ b/src/gallium/targets/xorg-i915/Makefile
@@ -4,10 +4,11 @@ include $(TOP)/configs/current
LIBNAME = modesetting_drv.so
C_SOURCES = \
+ intel_target.c \
intel_xorg.c
DRIVER_DEFINES = \
- -DHAVE_CONFIG_H
+ -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE
DRIVER_LINKS = \
$(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
diff --git a/src/gallium/targets/xorg-i915/intel_target.c b/src/gallium/targets/xorg-i915/intel_target.c
new file mode 100644
index 0000000000..8c8ef7e02b
--- /dev/null
+++ b/src/gallium/targets/xorg-i915/intel_target.c
@@ -0,0 +1,26 @@
+
+#include "state_tracker/drm_driver.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "i915/drm/i915_drm_public.h"
+#include "i915/i915_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct i915_winsys *iws;
+ struct pipe_screen *screen;
+
+ iws = i915_drm_winsys_create(fd);
+ if (!iws)
+ return NULL;
+
+ screen = i915_screen_create(iws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
diff --git a/src/gallium/targets/xorg-i965/Makefile b/src/gallium/targets/xorg-i965/Makefile
index 2b0c7d6fdf..9bb8252be2 100644
--- a/src/gallium/targets/xorg-i965/Makefile
+++ b/src/gallium/targets/xorg-i965/Makefile
@@ -4,10 +4,12 @@ include $(TOP)/configs/current
LIBNAME = i965g_drv.so
C_SOURCES = \
+ intel_target.c \
intel_xorg.c
DRIVER_DEFINES = \
- -DHAVE_CONFIG_H
+ -DHAVE_CONFIG_H -DGALLIUM_SOFTPIPE \
+ -DGALLIUM_RBUG -DGALLIUM_TRACE
DRIVER_LINKS = \
$(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
@@ -15,6 +17,7 @@ DRIVER_LINKS = \
$(TOP)/src/gallium/drivers/i965/libi965.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
+ $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
$(GALLIUM_AUXILIARIES) \
$(shell pkg-config --libs libdrm libdrm_intel)
diff --git a/src/gallium/targets/xorg-i965/intel_target.c b/src/gallium/targets/xorg-i965/intel_target.c
new file mode 100644
index 0000000000..ce97f82027
--- /dev/null
+++ b/src/gallium/targets/xorg-i965/intel_target.c
@@ -0,0 +1,30 @@
+
+#include "target-helpers/inline_wrapper_sw_helper.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "i965/drm/i965_drm_public.h"
+#include "i965/brw_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct brw_winsys_screen *bws;
+ struct pipe_screen *screen;
+
+ bws = i965_drm_winsys_screen_create(fd);
+ if (!bws)
+ return NULL;
+
+ screen = brw_screen_create(bws);
+ if (!screen)
+ return NULL;
+
+ if (debug_get_bool_option("BRW_SOFTPIPE", FALSE))
+ screen = sw_screen_wrap(screen);
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen)
diff --git a/src/gallium/targets/xorg-nouveau/Makefile b/src/gallium/targets/xorg-nouveau/Makefile
index f50872362f..93f53e63bf 100644
--- a/src/gallium/targets/xorg-nouveau/Makefile
+++ b/src/gallium/targets/xorg-nouveau/Makefile
@@ -4,14 +4,17 @@ include $(TOP)/configs/current
LIBNAME = modesetting_drv.so
C_SOURCES = \
+ nouveau_target.c \
nouveau_xorg.c
DRIVER_DEFINES = \
- -DHAVE_CONFIG_H
+ -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE
DRIVER_LINKS = \
$(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
$(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
+ $(TOP)/src/gallium/drivers/rbug/librbug.a \
$(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
$(TOP)/src/gallium/drivers/nv50/libnv50.a \
$(TOP)/src/gallium/drivers/nouveau/libnouveau.a \
diff --git a/src/gallium/targets/xorg-nouveau/nouveau_target.c b/src/gallium/targets/xorg-nouveau/nouveau_target.c
new file mode 100644
index 0000000000..e725a4d9b7
--- /dev/null
+++ b/src/gallium/targets/xorg-nouveau/nouveau_target.c
@@ -0,0 +1,20 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "nouveau/drm/nouveau_drm_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct pipe_screen *screen;
+
+ screen = nouveau_drm_screen_create(fd);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen)
diff --git a/src/gallium/targets/xorg-radeon/Makefile b/src/gallium/targets/xorg-radeon/Makefile
index 6cbc61e7ae..caf2ac98b9 100644
--- a/src/gallium/targets/xorg-radeon/Makefile
+++ b/src/gallium/targets/xorg-radeon/Makefile
@@ -4,10 +4,11 @@ include $(TOP)/configs/current
LIBNAME = radeon_drv.so
C_SOURCES = \
+ radeon_target.c \
radeon_xorg.c
DRIVER_DEFINES = \
- -DHAVE_CONFIG_H
+ -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE
DRIVER_LINKS = \
$(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
diff --git a/src/gallium/targets/xorg-radeon/radeon_target.c b/src/gallium/targets/xorg-radeon/radeon_target.c
new file mode 100644
index 0000000000..5a0a8dc573
--- /dev/null
+++ b/src/gallium/targets/xorg-radeon/radeon_target.c
@@ -0,0 +1,26 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "radeon/drm/radeon_drm_public.h"
+#include "r300/r300_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct r300_winsys_screen *sws;
+ struct pipe_screen *screen;
+
+ sws = r300_drm_winsys_screen_create(fd);
+ if (!sws)
+ return NULL;
+
+ screen = r300_screen_create(sws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen)
diff --git a/src/gallium/targets/xorg-vmwgfx/Makefile b/src/gallium/targets/xorg-vmwgfx/Makefile
index c0ff999116..73a2cea232 100644
--- a/src/gallium/targets/xorg-vmwgfx/Makefile
+++ b/src/gallium/targets/xorg-vmwgfx/Makefile
@@ -8,6 +8,7 @@ C_SOURCES = \
vmw_video.c \
vmw_ioctl.c \
vmw_ctrl.c \
+ vmw_target.c \
vmw_screen.c
DRIVER_INCLUDES = \
@@ -15,8 +16,11 @@ DRIVER_INCLUDES = \
DRIVER_DEFINES = \
-std=gnu99 \
+ -DGALLIUM_RBUG \
+ -DGALLIUM_TRACE \
-DHAVE_CONFIG_H
+
DRIVER_LINKS = \
$(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
$(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_target.c b/src/gallium/targets/xorg-vmwgfx/vmw_target.c
new file mode 100644
index 0000000000..15089d6db2
--- /dev/null
+++ b/src/gallium/targets/xorg-vmwgfx/vmw_target.c
@@ -0,0 +1,26 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "svga/drm/svga_drm_public.h"
+#include "svga/svga_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct svga_winsys_screen *sws;
+ struct pipe_screen *screen;
+
+ sws = svga_drm_winsys_screen_create(fd);
+ if (!sws)
+ return NULL;
+
+ screen = svga_screen_create(sws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen)