2011/6/24 Chia-I Wu <olva...@gmail.com>:
> On Fri, Jun 24, 2011 at 8:38 AM, Chia-I Wu <olva...@gmail.com> wrote:
>> On Thu, Jun 23, 2011 at 8:07 PM, Benjamin Franzke
>> <benjaminfran...@googlemail.com> wrote:
>>> 2011/6/23 Chia-I Wu <olva...@gmail.com>:
>>>> On Thu, Jun 23, 2011 at 7:46 PM, Benjamin Franzke
>>>> <benjaminfran...@googlemail.com> wrote:
>>>>> 2011/6/23 Chia-I Wu <olva...@gmail.com>:
>>>>>> On Wed, Jun 22, 2011 at 10:30 PM, Benjamin Franzke
>>>>>> <benjaminfran...@googlemail.com> wrote:
>>>>>>> Hi List,
>>>>>>>
>>>>>>> This series adds a graphics buffer management library which is
>>>>>>> targeted to be used as native (drm) platform for egl on kms or openwfd,
>>>>>>> and thus replaces the current mechanism of using a fd as 
>>>>>>> EGLNativeDisplay
>>>>>>> and EGL_MESA_drm_image to create buffers.
>>>>>>> GBM uses the mesas internal dri interface or acts as a gallium state 
>>>>>>> tracker.
>>>>>>>
>>>>>>> The mapping to EGL types is:
>>>>>>>
>>>>>>> gbm_device - EGLNativeDisplayType
>>>>>>> gbm_bo     - EGLNativePixmapType / EGL_NATIVE_PIXMAP_KHR
>>>>>>>
>>>>>>> This integrates better with the idea of EGL, which assumes there is
>>>>>>> some kind of native library thats responsible for allocating buffers.
>>>>>>>
>>>>>>> We wanted to use libkms, but since that's explicitly designed to no
>>>>>>> support hw renderable buffers we have to go a different route.
>>>>>> The idea looks good to me in general.  But would it make sense to
>>>>>> replace st/gbm and targets/gdm by another backend that uses st/xa,
>>>>>> which is supposed to have a stable ABI, instead (currently only on
>>>>>> xa_branch)?
>>>>>
>>>>> For the reason of a stable ABI we dont need it, since all of gbm is 
>>>>> inside mesa.
>>>>> Maybe it could be used at some point to ease driver loading/sharing or
>>>>> so, dont know,
>>>>> but right now I think its easier to just have this small state tracker.
>>>>> Since its inside mesa we could change it later if it feels better then.
>>>> Ok.  From a quick look I thought there was gbm_gallium_drm.so which
>>>> loads egl_gallium's pipe drivers.  As the pipe drivers should not
>>>> exist, I'd like to see no external use of them.  Maybe I was wrong.
>>> Well, thats done, but i think thats not a problem.
>>> I like to see a general drm-pipe in future, which is used only by
>>> gallium state-trackers that need to load drivers, like egl, gbm(, xa),
>>> so no external use.
>> I meant external to egl_gallium.  I plan to switch over to
>> targets/egl-static for egl_gallium soon, and there will be no
>> pipe_*.so anymore.
> Does this patch work for you?  I don't know an easy way to test gbm.
>

The pipe targets need start/end-group for the libs.
Updated patch attached.

> I'd like to commit it and then remove targets/egl (in favor of
> targets/egl-static) before 7.11 branched.

Oh, since the driver name lookup changed in targets/egl we have to port
that to egl-static target then.
See commit a433755ec5c48088a0d8a340851a1a8be9e58897.

>
>> Another thing I just noticed is that gbm(_dri) is enabled by default
>> and depends on --enable-shared-glapi, which is disabled by default.
>> They should have the same default.  Since shared glapi solves many
>> linking issues, I'd like to see it enabled by default.  But the thing
>> is that it changes libGL and the change hasn't really been discussed
>> or reviewed.  It should deserve its own thread on the list.

Right, I would prefer shared glapi by default as well.
If we dont get that, we could just remove drm from the default egl platforms,
and so gbm would be disabled by default.

>>
>>
>>>>>>>
>>>>>>> Benjamin Franzke (8):
>>>>>>>  dri: Add dupImage to DRIimageExtension
>>>>>>>  intel: Implement DRIimageExtension::dupImage
>>>>>>>  st/dri: Implement DRIimageExtension::dupImage
>>>>>>>  Add gbm (generic/graphics buffer manager)
>>>>>>>  gbm: Add dri backend
>>>>>>>  gbm: Add gallium (drm) backend
>>>>>>>  egl_dri2: Hookup gbm as drm platform
>>>>>>>  st/egl: Hookup gbm for drm backend
>>>>>>>
>>>>>>>  Makefile                                           |   11 +
>>>>>>>  configs/autoconf.in                                |   10 +-
>>>>>>>  configs/default                                    |   14 +-
>>>>>>>  configure.ac                                       |   70 ++++
>>>>>>>  include/EGL/eglplatform.h                          |    6 +
>>>>>>>  include/GL/internal/dri_interface.h                |    2 +
>>>>>>>  src/egl/drivers/dri2/Makefile                      |    2 +
>>>>>>>  src/egl/drivers/dri2/egl_dri2.c                    |   76 +++--
>>>>>>>  src/egl/drivers/dri2/egl_dri2.h                    |   11 +
>>>>>>>  src/egl/drivers/dri2/platform_drm.c                |   99 ++++--
>>>>>>>  src/egl/main/Makefile                              |    4 +
>>>>>>>  src/gallium/state_trackers/dri/drm/dri2.c          |   19 +
>>>>>>>  src/gallium/state_trackers/egl/Makefile            |    3 +-
>>>>>>>  src/gallium/state_trackers/egl/common/egl_g3d.c    |   18 +-
>>>>>>>  src/gallium/state_trackers/egl/common/native.h     |    3 +
>>>>>>>  src/gallium/state_trackers/egl/drm/modeset.c       |   36 ++
>>>>>>>  src/gallium/state_trackers/egl/drm/native_drm.c    |   77 ++---
>>>>>>>  src/gallium/state_trackers/egl/drm/native_drm.h    |    4 +
>>>>>>>  src/gallium/state_trackers/gbm/Makefile            |   46 +++
>>>>>>>  src/gallium/state_trackers/gbm/gbm_drm.c           |  225 ++++++++++++
>>>>>>>  .../state_trackers/gbm/gbm_gallium_drmint.h        |   74 ++++
>>>>>>>  src/gallium/targets/egl/Makefile                   |    2 +-
>>>>>>>  src/gallium/targets/gbm/Makefile                   |   32 ++
>>>>>>>  src/gallium/targets/gbm/gbm.c                      |   61 ++++
>>>>>>>  src/gallium/targets/gbm/pipe_loader.c              |  192 ++++++++++
>>>>>>>  src/gallium/targets/gbm/pipe_loader.h              |   48 +++
>>>>>>>  src/gbm/Makefile                                   |   14 +
>>>>>>>  src/gbm/backends/Makefile                          |   14 +
>>>>>>>  src/gbm/backends/Makefile.template                 |   65 ++++
>>>>>>>  src/gbm/backends/dri/Makefile                      |   22 ++
>>>>>>>  src/gbm/backends/dri/driver_name.c                 |   89 +++++
>>>>>>>  src/gbm/backends/dri/gbm_dri.c                     |  377 
>>>>>>> ++++++++++++++++++++
>>>>>>>  src/gbm/backends/dri/gbm_driint.h                  |   78 ++++
>>>>>>>  src/gbm/main/Makefile                              |   90 +++++
>>>>>>>  src/gbm/main/backend.c                             |  128 +++++++
>>>>>>>  src/gbm/main/backend.h                             |   36 ++
>>>>>>>  src/gbm/main/common.c                              |   88 +++++
>>>>>>>  src/gbm/main/common.h                              |   42 +++
>>>>>>>  src/gbm/main/common_drm.h                          |   48 +++
>>>>>>>  src/gbm/main/gbm.c                                 |  189 ++++++++++
>>>>>>>  src/gbm/main/gbm.h                                 |   99 +++++
>>>>>>>  src/gbm/main/gbm.pc.in                             |   12 +
>>>>>>>  src/gbm/main/gbmint.h                              |   81 +++++
>>>>>>>  src/mesa/drivers/dri/intel/intel_screen.c          |   27 ++-
>>>>>>>  44 files changed, 2536 insertions(+), 108 deletions(-)
>>>>>>>  create mode 100644 src/gallium/state_trackers/gbm/Makefile
>>>>>>>  create mode 100644 src/gallium/state_trackers/gbm/gbm_drm.c
>>>>>>>  create mode 100644 src/gallium/state_trackers/gbm/gbm_gallium_drmint.h
>>>>>>>  create mode 100644 src/gallium/targets/gbm/Makefile
>>>>>>>  create mode 100644 src/gallium/targets/gbm/gbm.c
>>>>>>>  create mode 100644 src/gallium/targets/gbm/pipe_loader.c
>>>>>>>  create mode 100644 src/gallium/targets/gbm/pipe_loader.h
>>>>>>>  create mode 100644 src/gbm/Makefile
>>>>>>>  create mode 100644 src/gbm/backends/Makefile
>>>>>>>  create mode 100644 src/gbm/backends/Makefile.template
>>>>>>>  create mode 100644 src/gbm/backends/dri/Makefile
>>>>>>>  create mode 100644 src/gbm/backends/dri/driver_name.c
>>>>>>>  create mode 100644 src/gbm/backends/dri/gbm_dri.c
>>>>>>>  create mode 100644 src/gbm/backends/dri/gbm_driint.h
>>>>>>>  create mode 100644 src/gbm/main/Makefile
>>>>>>>  create mode 100644 src/gbm/main/backend.c
>>>>>>>  create mode 100644 src/gbm/main/backend.h
>>>>>>>  create mode 100644 src/gbm/main/common.c
>>>>>>>  create mode 100644 src/gbm/main/common.h
>>>>>>>  create mode 100644 src/gbm/main/common_drm.h
>>>>>>>  create mode 100644 src/gbm/main/gbm.c
>>>>>>>  create mode 100644 src/gbm/main/gbm.h
>>>>>>>  create mode 100644 src/gbm/main/gbm.pc.in
>>>>>>>  create mode 100644 src/gbm/main/gbmint.h
>>>>>>>
>>>>>>> --
>>>>>>> 1.7.3.4
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> mesa-dev mailing list
>>>>>>> mesa-dev@lists.freedesktop.org
>>>>>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> o...@lunarg.com
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> o...@lunarg.com
>>>>
>>>
>>
>>
>>
>> --
>> o...@lunarg.com
>>
>
>
>
> --
> o...@lunarg.com
>
From aab3093315135393cd4c25c8d298195b8b3fae09 Mon Sep 17 00:00:00 2001
From: Chia-I Wu <o...@lunarg.com>
Date: Fri, 24 Jun 2011 10:39:06 +0900
Subject: [PATCH] targets/gbm: build pipe drivers

Build pipe drivers here instead of using those built by the
soon-to-be-removed targets/egl.
---
 src/gallium/targets/gbm/Makefile       |  126 +++++++++++++++++++++++++++++++-
 src/gallium/targets/gbm/pipe_i915.c    |   27 +++++++
 src/gallium/targets/gbm/pipe_i965.c    |   30 ++++++++
 src/gallium/targets/gbm/pipe_loader.c  |    6 +-
 src/gallium/targets/gbm/pipe_nouveau.c |   21 +++++
 src/gallium/targets/gbm/pipe_r300.c    |   27 +++++++
 src/gallium/targets/gbm/pipe_r600.c    |   27 +++++++
 src/gallium/targets/gbm/pipe_swrast.c  |   22 ++++++
 src/gallium/targets/gbm/pipe_vmwgfx.c  |   27 +++++++
 src/gbm/backends/Makefile.template     |   10 +-
 10 files changed, 314 insertions(+), 9 deletions(-)
 create mode 100644 src/gallium/targets/gbm/pipe_i915.c
 create mode 100644 src/gallium/targets/gbm/pipe_i965.c
 create mode 100644 src/gallium/targets/gbm/pipe_nouveau.c
 create mode 100644 src/gallium/targets/gbm/pipe_r300.c
 create mode 100644 src/gallium/targets/gbm/pipe_r600.c
 create mode 100644 src/gallium/targets/gbm/pipe_swrast.c
 create mode 100644 src/gallium/targets/gbm/pipe_vmwgfx.c

diff --git a/src/gallium/targets/gbm/Makefile b/src/gallium/targets/gbm/Makefile
index 74a0232..2c096bc 100644
--- a/src/gallium/targets/gbm/Makefile
+++ b/src/gallium/targets/gbm/Makefile
@@ -24,9 +24,133 @@ GBM_LIBS = $(LIBUDEV_LIBS) $(LIBDRM_LIB) \
 
 
 GBM_CFLAGS = \
-	     -D_EGL_GALLIUM_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" \
+	     -DGBM_BACKEND_SEARCH_DIR=\"$(GBM_BACKEND_INSTALL_DIR)\" \
 	     -DPIPE_PREFIX=\"$(PIPE_PREFIX)\" \
 	     $(LIBUDEV_CFLAGS) \
 	     $(LIBDRM_CFLAGS)  
 
+
+pipe_INCLUDES = \
+	-I$(TOP)/include \
+	-I$(TOP)/src/gallium/auxiliary \
+	-I$(TOP)/src/gallium/drivers \
+	-I$(TOP)/src/gallium/include \
+	-I$(TOP)/src/gallium/winsys
+
+pipe_LIBS = $(LIBDRM_LIB) \
+	$(TOP)/src/gallium/drivers/identity/libidentity.a \
+	$(TOP)/src/gallium/drivers/trace/libtrace.a \
+	$(TOP)/src/gallium/drivers/rbug/librbug.a \
+	$(GALLIUM_AUXILIARIES)
+
+pipe_CLFLAGS = $(LIBDRM_CFLAGS)
+
+pipe_LDFLAGS = -Wl,--no-undefined
+
+# i915 pipe driver
+i915_LIBS = -ldrm_intel \
+	$(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
+	$(TOP)/src/gallium/drivers/i915/libi915.a
+
+# i965 pipe driver
+i965_LIBS = -ldrm_intel \
+	$(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
+	$(TOP)/src/gallium/drivers/i965/libi965.a \
+	$(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a
+
+# nouveau pipe driver
+nouveau_LIBS = -ldrm_nouveau \
+	$(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
+	$(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
+	$(TOP)/src/gallium/drivers/nv50/libnv50.a \
+	$(TOP)/src/gallium/drivers/nvc0/libnvc0.a \
+	$(TOP)/src/gallium/drivers/nouveau/libnouveau.a
+
+# r300 pipe driver
+r300_LIBS = -ldrm \
+	$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
+	$(TOP)/src/gallium/drivers/r300/libr300.a
+
+# r600 pipe driver
+r600_LIBS = -ldrm -ldrm_radeon \
+	$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+	$(TOP)/src/gallium/drivers/r600/libr600.a
+
+# vmwgfx pipe driver
+vmwgfx_LIBS = \
+	$(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
+	$(TOP)/src/gallium/drivers/svga/libsvga.a
+
+# LLVM
+ifeq ($(MESA_LLVM),1)
+pipe_LIBS += $(LLVM_LIBS)
+pipe_LDFLAGS += $(LLVM_LDFLAGS)
+endif
+
+# determine the targets/sources
+pipe_TARGETS =
+pipe_SOURCES =
+
+ifneq ($(findstring i915/drm,$(GALLIUM_WINSYS_DIRS)),)
+pipe_TARGETS += $(PIPE_PREFIX)i915.so
+pipe_SOURCES += pipe_i915.c
+endif
+
+ifneq ($(findstring i965/drm,$(GALLIUM_WINSYS_DIRS)),)
+pipe_TARGETS += $(PIPE_PREFIX)i965.so
+pipe_SOURCES += pipe_i965.c
+endif
+
+ifneq ($(findstring nouveau/drm,$(GALLIUM_WINSYS_DIRS)),)
+pipe_TARGETS += $(PIPE_PREFIX)nouveau.so
+pipe_SOURCES += pipe_nouveau.c
+endif
+
+ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
+pipe_TARGETS += $(PIPE_PREFIX)r300.so
+pipe_SOURCES += pipe_r300.c
+endif
+
+ifneq ($(findstring r600/drm,$(GALLIUM_WINSYS_DIRS)),)
+pipe_TARGETS += $(PIPE_PREFIX)r600.so
+pipe_SOURCES += pipe_r600.c
+endif
+
+ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),)
+pipe_TARGETS += $(PIPE_PREFIX)vmwgfx.so
+pipe_SOURCES += pipe_vmwgfx.c
+endif
+
+pipe_OBJECTS = $(pipe_SOURCES:.c=.o)
+
+
+GBM_EXTRA_TARGETS = $(addprefix $(TOP)/$(LIB_DIR)/gbm/, $(pipe_TARGETS))
+GBM_EXTRA_INSTALL = install-pipes
+GBM_EXTRA_CLEAN = clean-pipes
+GBM_EXTRA_SOURCES = $(pipe_SOURCES)
+
 include $(TOP)/src/gbm/backends/Makefile.template
+
+
+$(GBM_EXTRA_TARGETS): $(TOP)/$(LIB_DIR)/gbm/%: %
+	@$(INSTALL) -d $(dir $@)
+	$(INSTALL) $< $(dir $@)
+
+$(pipe_TARGETS): $(PIPE_PREFIX)%.so: pipe_%.o
+	$(MKLIB) -o $@ -noprefix -linker '$(CC)' \
+		-ldflags '-L$(TOP)/$(LIB_DIR) $(pipe_LDFLAGS) $(LDFLAGS)' \
+		$(MKLIB_OPTIONS) $< \
+		-Wl,--start-group $($*_LIBS) $(pipe_LIBS) -Wl,--end-group
+
+$(pipe_OBJECTS): %.o: %.c
+	$(CC) -c -o $@ $< $(pipe_INCLUDES) $(pipe_CFLAGS) $(CFLAGS)
+
+install-pipes: $(GBM_EXTRA_TARGETS)
+	$(INSTALL) -d $(DESTDIR)$(GBM_BACKEND_INSTALL_DIR)
+	for tgt in $(GBM_EXTRA_TARGETS); do \
+		$(MINSTALL) "$$tgt" $(DESTDIR)$(GBM_BACKEND_INSTALL_DIR); \
+	done
+
+clean-pipes:
+	rm -f $(pipe_TARGETS)
+	rm -f $(pipe_OBJECTS)
diff --git a/src/gallium/targets/gbm/pipe_i915.c b/src/gallium/targets/gbm/pipe_i915.c
new file mode 100644
index 0000000..cd74044
--- /dev/null
+++ b/src/gallium/targets/gbm/pipe_i915.c
@@ -0,0 +1,27 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.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;
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
diff --git a/src/gallium/targets/gbm/pipe_i965.c b/src/gallium/targets/gbm/pipe_i965.c
new file mode 100644
index 0000000..f810ecf
--- /dev/null
+++ b/src/gallium/targets/gbm/pipe_i965.c
@@ -0,0 +1,30 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "target-helpers/inline_wrapper_sw_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;
+
+   screen = sw_screen_wrap(screen);
+
+   screen = debug_screen_wrap(screen);
+
+   return screen;
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("i965", "i965", create_screen)
diff --git a/src/gallium/targets/gbm/pipe_loader.c b/src/gallium/targets/gbm/pipe_loader.c
index 472614c..6200541 100644
--- a/src/gallium/targets/gbm/pipe_loader.c
+++ b/src/gallium/targets/gbm/pipe_loader.c
@@ -107,11 +107,11 @@ find_pipe_module(struct pipe_module *pmod, const char *name)
    
    search_paths = NULL;
    if (geteuid() == getuid()) {
-      /* don't allow setuid apps to use EGL_DRIVERS_PATH */
-      search_paths = getenv("EGL_DRIVERS_PATH");
+      /* don't allow setuid apps to use GBM_BACKENDS_PATH */
+      search_paths = getenv("GBM_BACKENDS_PATH");
    }
    if (search_paths == NULL)
-      search_paths = _EGL_GALLIUM_DRIVER_SEARCH_DIR;
+      search_paths = GBM_BACKEND_SEARCH_DIR;
 
    end = search_paths + strlen(search_paths);
    for (p = search_paths; p < end && pmod->lib == NULL; p = next + 1) {
diff --git a/src/gallium/targets/gbm/pipe_nouveau.c b/src/gallium/targets/gbm/pipe_nouveau.c
new file mode 100644
index 0000000..0c9081b
--- /dev/null
+++ b/src/gallium/targets/gbm/pipe_nouveau.c
@@ -0,0 +1,21 @@
+
+#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;
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen)
diff --git a/src/gallium/targets/gbm/pipe_r300.c b/src/gallium/targets/gbm/pipe_r300.c
new file mode 100644
index 0000000..09940f0
--- /dev/null
+++ b/src/gallium/targets/gbm/pipe_r300.c
@@ -0,0 +1,27 @@
+
+#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 radeon_winsys *sws;
+   struct pipe_screen *screen;
+
+   sws = radeon_drm_winsys_create(fd);
+   if (!sws)
+      return NULL;
+
+   screen = r300_screen_create(sws);
+   if (!screen)
+      return NULL;
+
+   screen = debug_screen_wrap(screen);
+
+   return screen;
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen)
diff --git a/src/gallium/targets/gbm/pipe_r600.c b/src/gallium/targets/gbm/pipe_r600.c
new file mode 100644
index 0000000..486a659
--- /dev/null
+++ b/src/gallium/targets/gbm/pipe_r600.c
@@ -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", "radeon", create_screen)
diff --git a/src/gallium/targets/gbm/pipe_swrast.c b/src/gallium/targets/gbm/pipe_swrast.c
new file mode 100644
index 0000000..b2e3289
--- /dev/null
+++ b/src/gallium/targets/gbm/pipe_swrast.c
@@ -0,0 +1,22 @@
+
+#include "target-helpers/inline_sw_helper.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+
+PUBLIC struct pipe_screen *
+swrast_create_screen(struct sw_winsys *ws);
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("swrast", NULL, NULL)
+
+struct pipe_screen *
+swrast_create_screen(struct sw_winsys *ws)
+{
+   struct pipe_screen *screen;
+
+   screen = sw_screen_create(ws);
+   if (screen)
+      screen = debug_screen_wrap(screen);
+
+   return screen;
+}
diff --git a/src/gallium/targets/gbm/pipe_vmwgfx.c b/src/gallium/targets/gbm/pipe_vmwgfx.c
new file mode 100644
index 0000000..22a28fa
--- /dev/null
+++ b/src/gallium/targets/gbm/pipe_vmwgfx.c
@@ -0,0 +1,27 @@
+
+#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;
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen)
diff --git a/src/gbm/backends/Makefile.template b/src/gbm/backends/Makefile.template
index 90b239a..851e5c5 100644
--- a/src/gbm/backends/Makefile.template
+++ b/src/gbm/backends/Makefile.template
@@ -24,7 +24,7 @@ GBM_TARGET = $(GBM_BACKEND_PATH)
 GBM_INSTALL = install-so
 endif
 
-default: depend $(GBM_TARGET)
+default: depend $(GBM_TARGET) $(GBM_EXTRA_TARGETS)
 
 $(GBM_BACKEND_PATH): $(GBM_BACKEND).so
 	@$(INSTALL) -d $(TOP)/$(LIB_DIR)/gbm
@@ -46,20 +46,20 @@ install-so: $(GBM_BACKEND_PATH)
 	$(INSTALL) -d $(DESTDIR)$(GBM_BACKEND_INSTALL_DIR)
 	$(MINSTALL) $(GBM_BACKEND_PATH) $(DESTDIR)$(GBM_BACKEND_INSTALL_DIR)
 
-install: $(GBM_INSTALL)
+install: $(GBM_INSTALL) $(GBM_EXTRA_INSTALL)
 
-clean:
+clean: $(GBM_EXTRA_CLEAN)
 	rm -f $(GBM_BACKEND).so
 	rm -f lib$(GBM_BACKEND).a
 	rm -f $(GBM_OBJECTS)
 	rm -f depend depend.bak
 
-depend: $(GBM_SOURCES)
+depend: $(GBM_SOURCES) $(GBM_EXTRA_SOURCES)
 	@ echo "running $(MKDEP)"
 	@ rm -f depend
 	@ touch depend
 	$(MKDEP) $(MKDEP_OPTIONS) $(GBM_INCLUDES) $(GBM_SOURCES) \
-		>/dev/null 2>/dev/null
+		$(GBM_EXTRA_SOURCES) >/dev/null 2>/dev/null
 
 sinclude depend
 # DO NOT DELETE
-- 
1.7.3.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to