summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/targets')
-rw-r--r--src/gallium/targets/dri-r300/target.c1
-rw-r--r--src/gallium/targets/dri-r600/Makefile1
-rw-r--r--src/gallium/targets/dri-r600/SConscript1
-rw-r--r--src/gallium/targets/dri-r600/target.c6
-rw-r--r--src/gallium/targets/egl-static/Android.mk56
-rw-r--r--src/gallium/targets/egl-static/Makefile17
-rw-r--r--src/gallium/targets/egl-static/egl.c74
-rw-r--r--src/gallium/targets/egl-static/egl_pipe.c5
-rw-r--r--src/gallium/targets/gbm/Makefile16
-rw-r--r--src/gallium/targets/gbm/pipe_r600.c7
-rw-r--r--src/gallium/targets/va-r600/Makefile1
-rw-r--r--src/gallium/targets/va-r600/target.c6
-rw-r--r--src/gallium/targets/vdpau-r600/Makefile1
-rw-r--r--src/gallium/targets/vdpau-r600/target.c6
-rw-r--r--src/gallium/targets/xorg-r600/Makefile25
-rw-r--r--src/gallium/targets/xorg-r600/target.c26
-rw-r--r--src/gallium/targets/xorg-r600/xorg.c148
-rw-r--r--src/gallium/targets/xvmc-r600/Makefile1
-rw-r--r--src/gallium/targets/xvmc-r600/target.c6
19 files changed, 373 insertions, 31 deletions
diff --git a/src/gallium/targets/dri-r300/target.c b/src/gallium/targets/dri-r300/target.c
index b48bcad3710..9b6d816fb62 100644
--- a/src/gallium/targets/dri-r300/target.c
+++ b/src/gallium/targets/dri-r300/target.c
@@ -1,4 +1,3 @@
-
#include "target-helpers/inline_debug_helper.h"
#include "state_tracker/drm_driver.h"
#include "radeon/drm/radeon_drm_public.h"
diff --git a/src/gallium/targets/dri-r600/Makefile b/src/gallium/targets/dri-r600/Makefile
index 0c4de203d35..2d7463008fe 100644
--- a/src/gallium/targets/dri-r600/Makefile
+++ b/src/gallium/targets/dri-r600/Makefile
@@ -7,6 +7,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/r600/libr600.a \
$(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/rbug/librbug.a \
$(TOP)/src/gallium/drivers/noop/libnoop.a
diff --git a/src/gallium/targets/dri-r600/SConscript b/src/gallium/targets/dri-r600/SConscript
index 1df11a8747b..c10d65b595a 100644
--- a/src/gallium/targets/dri-r600/SConscript
+++ b/src/gallium/targets/dri-r600/SConscript
@@ -6,6 +6,7 @@ env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE'])
env.Prepend(LIBS = [
st_dri,
+ radeonwinsys,
r600winsys,
r600,
trace,
diff --git a/src/gallium/targets/dri-r600/target.c b/src/gallium/targets/dri-r600/target.c
index 8753e2bab17..1b8b6816ec1 100644
--- a/src/gallium/targets/dri-r600/target.c
+++ b/src/gallium/targets/dri-r600/target.c
@@ -1,14 +1,14 @@
#include "state_tracker/drm_driver.h"
#include "target-helpers/inline_debug_helper.h"
-#include "r600/drm/r600_drm_public.h"
+#include "radeon/drm/radeon_drm_public.h"
#include "r600/r600_public.h"
static struct pipe_screen *create_screen(int fd)
{
- struct radeon *radeon;
+ struct radeon_winsys *radeon;
struct pipe_screen *screen;
- radeon = r600_drm_winsys_create(fd);
+ radeon = radeon_drm_winsys_create(fd);
if (!radeon)
return NULL;
diff --git a/src/gallium/targets/egl-static/Android.mk b/src/gallium/targets/egl-static/Android.mk
new file mode 100644
index 00000000000..ebc89ead454
--- /dev/null
+++ b/src/gallium/targets/egl-static/Android.mk
@@ -0,0 +1,56 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2010-2011 Chia-I Wu <[email protected]>
+# Copyright (C) 2010-2011 LunarG Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ egl.c \
+ egl_pipe.c \
+ egl_st.c
+
+LOCAL_CFLAGS := \
+ -DFEATURE_ES1=1 \
+ -DFEATURE_ES2=1 \
+ -D_EGL_MAIN=_eglBuiltInDriverGALLIUM
+
+LOCAL_C_INCLUDES := \
+ $(GALLIUM_TOP)/state_trackers/vega \
+ $(GALLIUM_TOP)/state_trackers/egl \
+ $(MESA_TOP)/src/egl/main \
+ $(MESA_TOP)/src/mesa \
+ $(DRM_TOP)/include/drm \
+ $(DRM_TOP)
+
+# swrast
+LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE
+
+ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
+LOCAL_CFLAGS += -D_EGL_PIPE_R600=1
+endif
+
+LOCAL_MODULE := libmesa_egl_gallium
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/targets/egl-static/Makefile b/src/gallium/targets/egl-static/Makefile
index 69e7eecdf0c..1583ab181ea 100644
--- a/src/gallium/targets/egl-static/Makefile
+++ b/src/gallium/targets/egl-static/Makefile
@@ -117,11 +117,12 @@ endif
# r300
ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
+ifneq ($(findstring r300,$(GALLIUM_DRIVERS_DIRS)),)
egl_CPPFLAGS += -D_EGL_PIPE_R300=1
egl_LIBS += \
$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
-egl_SYS += -ldrm_radeon
+endif
endif
# r600
@@ -129,8 +130,8 @@ ifneq ($(findstring r600/drm,$(GALLIUM_WINSYS_DIRS)),)
egl_CPPFLAGS += -D_EGL_PIPE_R600=1
egl_LIBS += \
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/r600/libr600.a
-egl_SYS += -ldrm_radeon
endif
# vmwgfx
@@ -141,10 +142,18 @@ egl_LIBS += \
$(TOP)/src/gallium/drivers/svga/libsvga.a
endif
-# swrast
+# softpipe
+ifneq ($(findstring softpipe,$(GALLIUM_DRIVERS_DIRS)),)
egl_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
egl_LIBS += $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
egl_SYS += -lm
+endif
+
+# llvmpipe
+ifneq ($(findstring llvmpipe,$(GALLIUM_DRIVERS_DIRS)),)
+egl_CPPFLAGS += -DGALLIUM_LLVMPIPE
+egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
+endif
# sort to remove duplicates
egl_CPPFLAGS := $(sort $(egl_CPPFLAGS))
@@ -158,8 +167,6 @@ st_GL_SYS := -lm -lpthread $(DLOPEN_LIBS)
# LLVM
ifeq ($(MESA_LLVM),1)
-egl_CPPFLAGS += -DGALLIUM_LLVMPIPE
-egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
egl_SYS += $(LLVM_LIBS)
LDFLAGS += $(LLVM_LDFLAGS)
diff --git a/src/gallium/targets/egl-static/egl.c b/src/gallium/targets/egl-static/egl.c
index 568f5498dd4..a7aee27238b 100644
--- a/src/gallium/targets/egl-static/egl.c
+++ b/src/gallium/targets/egl-static/egl.c
@@ -109,6 +109,70 @@ out:
return (*chip_id >= 0);
}
+#elif defined(PIPE_OS_ANDROID)
+
+#include <xf86drm.h>
+/* for i915 */
+#include <i915_drm.h>
+/* for radeon */
+#include <radeon_drm.h>
+/* for util_strcmp */
+#include "util/u_string.h"
+
+static boolean
+drm_fd_get_pci_id(int fd, int *vendor_id, int *chip_id)
+{
+ drmVersionPtr version;
+
+ *chip_id = -1;
+
+ version = drmGetVersion(fd);
+ if (!version) {
+ _eglLog(_EGL_WARNING, "invalid drm fd");
+ return FALSE;
+ }
+ if (!version->name) {
+ _eglLog(_EGL_WARNING, "unable to determine the driver name");
+ drmFreeVersion(version);
+ return FALSE;
+ }
+
+ if (util_strcmp(version->name, "i915") == 0) {
+ struct drm_i915_getparam gp;
+ int ret;
+
+ *vendor_id = 0x8086;
+
+ memset(&gp, 0, sizeof(gp));
+ gp.param = I915_PARAM_CHIPSET_ID;
+ gp.value = chip_id;
+ ret = drmCommandWriteRead(fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
+ if (ret) {
+ _eglLog(_EGL_WARNING, "failed to get param for i915");
+ *chip_id = -1;
+ }
+ }
+ else if (util_strcmp(version->name, "radeon") == 0) {
+ struct drm_radeon_info info;
+ int ret;
+
+ *vendor_id = 0x1002;
+
+ memset(&info, 0, sizeof(info));
+ info.request = RADEON_INFO_DEVICE_ID;
+ info.value = (unsigned long) chip_id;
+ ret = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
+ if (ret) {
+ _eglLog(_EGL_WARNING, "failed to get info for radeon");
+ *chip_id = -1;
+ }
+ }
+
+ drmFreeVersion(version);
+
+ return (*chip_id >= 0);
+}
+
#else
static boolean
@@ -157,13 +221,21 @@ drm_fd_get_screen_name(int fd)
static struct pipe_screen *
create_drm_screen(const char *name, int fd)
{
+ struct pipe_screen *screen;
+
if (!name) {
name = drm_fd_get_screen_name(fd);
if (!name)
return NULL;
}
- return egl_pipe_create_drm_screen(name, fd);
+ screen = egl_pipe_create_drm_screen(name, fd);
+ if (screen)
+ _eglLog(_EGL_INFO, "created a pipe screen for %s", name);
+ else
+ _eglLog(_EGL_WARNING, "failed to create a pipe screen for %s", name);
+
+ return screen;
}
static struct pipe_screen *
diff --git a/src/gallium/targets/egl-static/egl_pipe.c b/src/gallium/targets/egl-static/egl_pipe.c
index 658c532b404..f2b50bd0eab 100644
--- a/src/gallium/targets/egl-static/egl_pipe.c
+++ b/src/gallium/targets/egl-static/egl_pipe.c
@@ -42,7 +42,6 @@
#include "radeon/drm/radeon_drm_public.h"
#include "r300/r300_public.h"
/* for r600 */
-#include "r600/drm/r600_drm_public.h"
#include "r600/r600_public.h"
/* for vmwgfx */
#include "svga/drm/svga_drm_public.h"
@@ -141,10 +140,10 @@ static struct pipe_screen *
pipe_r600_create_screen(int fd)
{
#if _EGL_PIPE_R600
- struct radeon *rw;
+ struct radeon_winsys *rw;
struct pipe_screen *screen;
- rw = r600_drm_winsys_create(fd);
+ rw = radeon_drm_winsys_create(fd);
if (!rw)
return NULL;
diff --git a/src/gallium/targets/gbm/Makefile b/src/gallium/targets/gbm/Makefile
index 53104253d4f..033a1acaaf9 100644
--- a/src/gallium/targets/gbm/Makefile
+++ b/src/gallium/targets/gbm/Makefile
@@ -15,7 +15,7 @@ GBM_INCLUDES = \
-I$(TOP)/src/gallium/auxiliary \
-I$(TOP)/src/gallium/include \
-GBM_LIBS = $(LIBUDEV_LIBS) $(LIBDRM_LIB) \
+GBM_LIBS = $(LIBUDEV_LIBS) $(LIBDRM_LIB) -lm \
$(TOP)/src/gallium/state_trackers/gbm/libgbm.a \
$(TOP)/src/gallium/drivers/identity/libidentity.a \
$(TOP)/src/gallium/drivers/galahad/libgalahad.a \
@@ -79,26 +79,30 @@ nouveau_SYS = -ldrm_nouveau
r300_LIBS = \
$(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
-r300_SYS = -ldrm_radeon
# r600 pipe driver
r600_LIBS = \
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/r600/libr600.a
-r600_SYS = -ldrm_radeon
# 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 += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
pipe_SYS += $(LLVM_LIBS)
pipe_LDFLAGS += $(LLVM_LDFLAGS)
endif
+ifneq ($(findstring llvmpipe,$(GALLIUM_DRIVERS_DIRS)),)
+pipe_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
+endif
+
# determine the targets/sources
pipe_TARGETS =
pipe_SOURCES =
@@ -119,9 +123,11 @@ pipe_SOURCES += pipe_nouveau.c
endif
ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
+ifneq ($(findstring r300,$(GALLIUM_DRIVERS_DIRS)),)
pipe_TARGETS += $(PIPE_PREFIX)r300.so
pipe_SOURCES += pipe_r300.c
endif
+endif
ifneq ($(findstring r600/drm,$(GALLIUM_WINSYS_DIRS)),)
pipe_TARGETS += $(PIPE_PREFIX)r600.so
@@ -148,7 +154,7 @@ $(GBM_EXTRA_TARGETS): $(TOP)/$(LIB_DIR)/gbm/%: %
@$(INSTALL) -d $(dir $@)
$(INSTALL) $< $(dir $@)
-$(pipe_TARGETS): $(PIPE_PREFIX)%.so: pipe_%.o
+$(pipe_TARGETS): $(PIPE_PREFIX)%.so: pipe_%.o $(pipe_LIBS) $($*_LIBS)
$(MKLIB) -o $@ -noprefix -linker '$(CC)' \
-ldflags '-L$(TOP)/$(LIB_DIR) $(pipe_LDFLAGS) $(LDFLAGS)' \
$(MKLIB_OPTIONS) $< \
diff --git a/src/gallium/targets/gbm/pipe_r600.c b/src/gallium/targets/gbm/pipe_r600.c
index 486a6592585..9f61a51404a 100644
--- a/src/gallium/targets/gbm/pipe_r600.c
+++ b/src/gallium/targets/gbm/pipe_r600.c
@@ -1,16 +1,15 @@
-
#include "state_tracker/drm_driver.h"
#include "target-helpers/inline_debug_helper.h"
-#include "r600/drm/r600_drm_public.h"
+#include "radeon/drm/radeon_drm_public.h"
#include "r600/r600_public.h"
static struct pipe_screen *
create_screen(int fd)
{
- struct radeon *rw;
+ struct radeon_winsys *rw;
struct pipe_screen *screen;
- rw = r600_drm_winsys_create(fd);
+ rw = radeon_drm_winsys_create(fd);
if (!rw)
return NULL;
diff --git a/src/gallium/targets/va-r600/Makefile b/src/gallium/targets/va-r600/Makefile
index 28797ad528d..d09a3aa8ad2 100644
--- a/src/gallium/targets/va-r600/Makefile
+++ b/src/gallium/targets/va-r600/Makefile
@@ -10,6 +10,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/r600/libr600.a \
$(TOP)/src/gallium/winsys/g3dvl/dri/libvldri.a \
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/auxiliary/libgallium.a
diff --git a/src/gallium/targets/va-r600/target.c b/src/gallium/targets/va-r600/target.c
index 8753e2bab17..1b8b6816ec1 100644
--- a/src/gallium/targets/va-r600/target.c
+++ b/src/gallium/targets/va-r600/target.c
@@ -1,14 +1,14 @@
#include "state_tracker/drm_driver.h"
#include "target-helpers/inline_debug_helper.h"
-#include "r600/drm/r600_drm_public.h"
+#include "radeon/drm/radeon_drm_public.h"
#include "r600/r600_public.h"
static struct pipe_screen *create_screen(int fd)
{
- struct radeon *radeon;
+ struct radeon_winsys *radeon;
struct pipe_screen *screen;
- radeon = r600_drm_winsys_create(fd);
+ radeon = radeon_drm_winsys_create(fd);
if (!radeon)
return NULL;
diff --git a/src/gallium/targets/vdpau-r600/Makefile b/src/gallium/targets/vdpau-r600/Makefile
index 0fd817b8e82..c2d95af295a 100644
--- a/src/gallium/targets/vdpau-r600/Makefile
+++ b/src/gallium/targets/vdpau-r600/Makefile
@@ -7,6 +7,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/r600/libr600.a \
$(TOP)/src/gallium/winsys/g3dvl/dri/libvldri.a \
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/auxiliary/libgallium.a
diff --git a/src/gallium/targets/vdpau-r600/target.c b/src/gallium/targets/vdpau-r600/target.c
index 8753e2bab17..1b8b6816ec1 100644
--- a/src/gallium/targets/vdpau-r600/target.c
+++ b/src/gallium/targets/vdpau-r600/target.c
@@ -1,14 +1,14 @@
#include "state_tracker/drm_driver.h"
#include "target-helpers/inline_debug_helper.h"
-#include "r600/drm/r600_drm_public.h"
+#include "radeon/drm/radeon_drm_public.h"
#include "r600/r600_public.h"
static struct pipe_screen *create_screen(int fd)
{
- struct radeon *radeon;
+ struct radeon_winsys *radeon;
struct pipe_screen *screen;
- radeon = r600_drm_winsys_create(fd);
+ radeon = radeon_drm_winsys_create(fd);
if (!radeon)
return NULL;
diff --git a/src/gallium/targets/xorg-r600/Makefile b/src/gallium/targets/xorg-r600/Makefile
new file mode 100644
index 00000000000..4577ba605a5
--- /dev/null
+++ b/src/gallium/targets/xorg-r600/Makefile
@@ -0,0 +1,25 @@
+TOP = ../../../..
+include $(TOP)/configs/current
+
+LIBNAME = r600g_drv.so
+
+C_SOURCES = \
+ target.c \
+ xorg.c
+
+DRIVER_DEFINES = \
+ -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD
+
+DRIVER_PIPES = \
+ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
+ $(TOP)/src/gallium/drivers/r600/libr600.a \
+ $(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
+ $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
+ $(TOP)/src/gallium/drivers/rbug/librbug.a
+
+DRIVER_LINKS = \
+ $(shell pkg-config --libs libdrm)
+
+include ../Makefile.xorg
diff --git a/src/gallium/targets/xorg-r600/target.c b/src/gallium/targets/xorg-r600/target.c
new file mode 100644
index 00000000000..60424359a7b
--- /dev/null
+++ b/src/gallium/targets/xorg-r600/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 "r600/r600_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 = r600_screen_create(sws);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen)
diff --git a/src/gallium/targets/xorg-r600/xorg.c b/src/gallium/targets/xorg-r600/xorg.c
new file mode 100644
index 00000000000..120cf6da6fd
--- /dev/null
+++ b/src/gallium/targets/xorg-r600/xorg.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Author: Alan Hourihane <[email protected]>
+ * Author: Jakob Bornecrantz <[email protected]>
+ * Author: Corbin Simpson <[email protected]>
+ *
+ */
+
+#include "../../state_trackers/xorg/xorg_winsys.h"
+
+static void r600_xorg_identify(int flags);
+static Bool r600_xorg_pci_probe(DriverPtr driver,
+ int entity_num,
+ struct pci_device *device,
+ intptr_t match_data);
+
+static const struct pci_id_match r600_xorg_device_match[] = {
+ {0x1002, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0},
+ {0, 0, 0},
+};
+
+static SymTabRec r600_xorg_chipsets[] = {
+ {PCI_MATCH_ANY, "AMD R6xx Graphics Chipset"},
+ {-1, NULL}
+};
+
+static PciChipsets r600_xorg_pci_devices[] = {
+ {PCI_MATCH_ANY, PCI_MATCH_ANY, NULL},
+ {-1, -1, NULL}
+};
+
+static XF86ModuleVersionInfo r600_xorg_version = {
+ "r600g",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 0, 1, 0, /* major, minor, patch */
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_VIDEODRV,
+ {0, 0, 0, 0}
+};
+
+/*
+ * Xorg driver exported structures
+ */
+
+_X_EXPORT DriverRec r600_driver = {
+ 1,
+ "r600g",
+ r600_xorg_identify,
+ NULL,
+ xorg_tracker_available_options,
+ NULL,
+ 0,
+ NULL,
+ r600_xorg_device_match,
+ r600_xorg_pci_probe
+};
+
+static MODULESETUPPROTO(r600_xorg_setup);
+
+_X_EXPORT XF86ModuleData r600gModuleData = {
+ &r600_xorg_version,
+ r600_xorg_setup,
+ NULL
+};
+
+/*
+ * Xorg driver functions
+ */
+
+static pointer
+r600_xorg_setup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = 0;
+
+ /* This module should be loaded only once, but check to be sure.
+ */
+ if (!setupDone) {
+ setupDone = 1;
+ xf86AddDriver(&r600_driver, module, HaveDriverFuncs);
+
+ /*
+ * The return value must be non-NULL on success even though there
+ * is no TearDownProc.
+ */
+ return (pointer) 1;
+ } else {
+ if (errmaj)
+ *errmaj = LDR_ONCEONLY;
+ return NULL;
+ }
+}
+
+static void
+r600_xorg_identify(int flags)
+{
+ xf86PrintChipsets("r600", "Driver for R6xx Gallium with KMS",
+ r600_xorg_chipsets);
+}
+
+static Bool
+r600_xorg_pci_probe(DriverPtr driver,
+ int entity_num, struct pci_device *device, intptr_t match_data)
+{
+ ScrnInfoPtr scrn = NULL;
+ EntityInfoPtr entity;
+
+ scrn = xf86ConfigPciEntity(scrn, 0, entity_num, r600_xorg_pci_devices,
+ NULL, NULL, NULL, NULL, NULL);
+ if (scrn != NULL) {
+ scrn->driverVersion = 1;
+ scrn->driverName = "r600";
+ scrn->name = "R600G";
+ scrn->Probe = NULL;
+
+ entity = xf86GetEntityInfo(entity_num);
+
+ /* Use all the functions from the xorg tracker */
+ xorg_tracker_set_functions(scrn);
+ }
+ return scrn != NULL;
+}
diff --git a/src/gallium/targets/xvmc-r600/Makefile b/src/gallium/targets/xvmc-r600/Makefile
index 0bb72f1eff9..a10a42d18ed 100644
--- a/src/gallium/targets/xvmc-r600/Makefile
+++ b/src/gallium/targets/xvmc-r600/Makefile
@@ -7,6 +7,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/r600/libr600.a \
$(TOP)/src/gallium/winsys/g3dvl/dri/libvldri.a \
$(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
+ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/auxiliary/libgallium.a
diff --git a/src/gallium/targets/xvmc-r600/target.c b/src/gallium/targets/xvmc-r600/target.c
index 8753e2bab17..1b8b6816ec1 100644
--- a/src/gallium/targets/xvmc-r600/target.c
+++ b/src/gallium/targets/xvmc-r600/target.c
@@ -1,14 +1,14 @@
#include "state_tracker/drm_driver.h"
#include "target-helpers/inline_debug_helper.h"
-#include "r600/drm/r600_drm_public.h"
+#include "radeon/drm/radeon_drm_public.h"
#include "r600/r600_public.h"
static struct pipe_screen *create_screen(int fd)
{
- struct radeon *radeon;
+ struct radeon_winsys *radeon;
struct pipe_screen *screen;
- radeon = r600_drm_winsys_create(fd);
+ radeon = radeon_drm_winsys_create(fd);
if (!radeon)
return NULL;