targets/egl: add pipe_r600
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Sun, 22 Aug 2010 16:24:12 +0000 (18:24 +0200)
committerChia-I Wu <olv@lunarg.com>
Tue, 24 Aug 2010 03:50:36 +0000 (11:50 +0800)
KNOWN ISSUE: eglShowScreenSurfaceMESA in st/egl/kms fails
but st/egl/x11 works

src/gallium/targets/egl/Makefile
src/gallium/targets/egl/pipe_r600.c [new file with mode: 0644]

index 636fceb91f464aef5cb8d8869ba88ae6b0e1612d..2784fd0d100d3da8d61b8bd24f71146752980fec 100644 (file)
@@ -97,6 +97,13 @@ r300_LIBS := \
        $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
        $(TOP)/src/gallium/drivers/r300/libr300.a
 
+# r600 pipe driver
+r600_CPPFLAGS :=
+r600_SYS := -ldrm -ldrm_radeon
+r600_LIBS := \
+       $(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+       $(TOP)/src/gallium/drivers/r600/libr600.a
+
 # vmwgfx pipe driver
 vmwgfx_CPPFLAGS :=
 vmwgfx_SYS :=
@@ -153,6 +160,9 @@ endif
 ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
 OUTPUTS += r300
 endif
+ifneq ($(findstring r600/drm,$(GALLIUM_WINSYS_DIRS)),)
+OUTPUTS += r600
+endif
 ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),)
 OUTPUTS += vmwgfx
 endif
@@ -191,6 +201,9 @@ $(OUTPUT_PATH)/$(PIPE_PREFIX)nouveau.so: pipe_nouveau.o $(nouveau_LIBS)
 $(OUTPUT_PATH)/$(PIPE_PREFIX)r300.so: pipe_r300.o $(r300_LIBS)
        $(call mklib,r300)
 
+$(OUTPUT_PATH)/$(PIPE_PREFIX)r600.so: pipe_r600.o $(r600_LIBS)
+       $(call mklib,r600)
+
 $(OUTPUT_PATH)/$(PIPE_PREFIX)vmwgfx.so: pipe_vmwgfx.o $(vmwgfx_LIBS)
        $(call mklib,vmwgfx)
 
diff --git a/src/gallium/targets/egl/pipe_r600.c b/src/gallium/targets/egl/pipe_r600.c
new file mode 100644 (file)
index 0000000..c35a0b0
--- /dev/null
@@ -0,0 +1,27 @@
+
+#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;
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("r600", "r600", create_screen)