summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/gallium/targets
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2013-09-05 14:07:04 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2013-09-05 14:07:04 +0000
commit821893da535a9c114e427454fe97ee8db13dafbd (patch)
tree5fac22b58520a25347ff8fada5894ca5c8a9b10c /dist/Mesa/src/gallium/targets
parentd0da870fb1db8146fc38e88a1f9b10c37890c46c (diff)
Merge Mesa 9.2.0
Diffstat (limited to 'dist/Mesa/src/gallium/targets')
-rw-r--r--dist/Mesa/src/gallium/targets/Makefile12
-rw-r--r--dist/Mesa/src/gallium/targets/Makefile.dri116
-rw-r--r--dist/Mesa/src/gallium/targets/Makefile.xorg82
-rw-r--r--dist/Mesa/src/gallium/targets/dri-i915/Makefile32
-rw-r--r--dist/Mesa/src/gallium/targets/dri-i965/Makefile32
-rw-r--r--dist/Mesa/src/gallium/targets/dri-i965/SConscript32
-rw-r--r--dist/Mesa/src/gallium/targets/dri-i965/target.c29
-rw-r--r--dist/Mesa/src/gallium/targets/dri-nouveau/Makefile28
-rw-r--r--dist/Mesa/src/gallium/targets/dri-r300/Makefile24
-rw-r--r--dist/Mesa/src/gallium/targets/dri-r300/SConscript26
-rw-r--r--dist/Mesa/src/gallium/targets/dri-r300/target.c3
-rw-r--r--dist/Mesa/src/gallium/targets/dri-r600/Makefile26
-rw-r--r--dist/Mesa/src/gallium/targets/dri-r600/SConscript25
-rw-r--r--dist/Mesa/src/gallium/targets/dri-swrast/Makefile34
-rw-r--r--dist/Mesa/src/gallium/targets/dri-vmwgfx/Makefile24
-rw-r--r--dist/Mesa/src/gallium/targets/dri-vmwgfx/SConscript10
-rw-r--r--dist/Mesa/src/gallium/targets/dri-vmwgfx/target.c18
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/Makefile207
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/SConscript28
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/egl.c169
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/egl_pipe.c77
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/egl_pipe.h1
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/egl_st.c4
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/egl_st.h1
-rw-r--r--dist/Mesa/src/gallium/targets/egl-static/st_GL.c1
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/Makefile169
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/gbm.c46
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_i915.c27
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_i965.c30
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_loader.c192
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_loader.h48
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_nouveau.c21
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_r300.c27
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_r600.c27
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_swrast.c22
-rw-r--r--dist/Mesa/src/gallium/targets/gbm/pipe_vmwgfx.c27
-rw-r--r--dist/Mesa/src/gallium/targets/graw-null/graw_util.c3
-rw-r--r--dist/Mesa/src/gallium/targets/graw-xlib/graw_xlib.c12
-rw-r--r--dist/Mesa/src/gallium/targets/libgl-gdi/SConscript4
-rw-r--r--dist/Mesa/src/gallium/targets/libgl-xlib/Makefile119
-rw-r--r--dist/Mesa/src/gallium/targets/libgl-xlib/SConscript22
-rw-r--r--dist/Mesa/src/gallium/targets/libgl-xlib/xlib.c4
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-i915/Makefile24
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-i965/Makefile26
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-i965/intel_target.c29
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-i965/intel_xorg.c147
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-nouveau/Makefile29
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-nouveau/nouveau_xorg.c8
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-r300/Makefile24
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-r300/target.c26
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-r300/xorg.c148
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/Makefile33
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/SConscript63
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c524
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.h48
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_driver.h120
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_hook.h39
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c260
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_screen.c267
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_target.c26
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_video.c1089
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_xorg.c191
-rw-r--r--dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmwarectrlproto.h122
63 files changed, 297 insertions, 4787 deletions
diff --git a/dist/Mesa/src/gallium/targets/Makefile b/dist/Mesa/src/gallium/targets/Makefile
deleted file mode 100644
index a0bc5eb14..000000000
--- a/dist/Mesa/src/gallium/targets/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# src/gallium/winsys/Makefile
-TOP = ../../..
-include $(TOP)/configs/current
-
-SUBDIRS = $(GALLIUM_TARGET_DIRS)
-
-default install clean:
- @for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir && $(MAKE) $@) || exit 1; \
- fi \
- done
diff --git a/dist/Mesa/src/gallium/targets/Makefile.dri b/dist/Mesa/src/gallium/targets/Makefile.dri
deleted file mode 100644
index 6c6ad184f..000000000
--- a/dist/Mesa/src/gallium/targets/Makefile.dri
+++ /dev/null
@@ -1,116 +0,0 @@
-# -*-makefile-*-
-
-
-ifeq ($(MESA_LLVM),1)
-PIPE_DRIVERS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
-LDFLAGS += $(LLVM_LDFLAGS)
-DRIVER_EXTRAS = $(LLVM_LIBS)
-else
-LDFLAGS += -lstdc++
-endif
-
-MESA_MODULES = \
- $(TOP)/src/mesa/libmesagallium.a \
- $(GALLIUM_AUXILIARIES)
-
-COMMON_GALLIUM_SOURCES = \
- $(TOP)/src/mesa/drivers/dri/common/utils.c \
- $(TOP)/src/mesa/drivers/dri/common/vblank.c \
- $(TOP)/src/mesa/drivers/dri/common/dri_util.c \
- $(TOP)/src/mesa/drivers/dri/common/xmlconfig.c
-
-COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
- $(TOP)/src/mesa/drivers/common/driverfuncs.c \
- $(TOP)/src/mesa/drivers/dri/common/texmem.c \
- $(TOP)/src/mesa/drivers/dri/common/drirenderbuffer.c
-
-COMMON_BM_SOURCES = \
- $(TOP)/src/mesa/drivers/dri/common/dri_bufmgr.c \
- $(TOP)/src/mesa/drivers/dri/common/dri_drmpool.c
-
-INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
-
-OBJECTS = \
- $(C_SOURCES:.c=.o) \
- $(ASM_SOURCES:.S=.o)
-
-
-### Include directories
-SHARED_INCLUDES = \
- -I. \
- -I$(TOP)/src/mesa/drivers/dri/common \
- -Iserver \
- -I$(TOP)/include \
- -I$(TOP)/include/GL/internal \
- -I$(TOP)/src/mapi \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/drivers \
- -I$(TOP)/src/gallium/winsys \
- -I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/mesa/math \
- -I$(TOP)/src/mesa/transform \
- -I$(TOP)/src/mesa/shader \
- -I$(TOP)/src/mesa/swrast \
- -I$(TOP)/src/mesa/swrast_setup \
- -I$(TOP)/src/egl/main \
- -I$(TOP)/src/egl/drivers/dri \
- $(LIBDRM_CFLAGS)
-
-LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME)
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend symlinks $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
-
-$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \
- $(TOP)/src/mesa/drivers/dri/Makefile.targets $(TOP)/src/mesa/drivers/dri/common/dri_test.o
- $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
- $(OBJECTS) $(PIPE_DRIVERS) \
- -Wl,--start-group $(MESA_MODULES) -Wl,--end-group \
- $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
- $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS) $(LDFLAGS);
- @rm -f $@.test
- mv -f $@.tmp $@
-
-$(TOP)/$(LIB_DIR)/gallium:
- mkdir -p $@
-
-$(LIBNAME_STAGING): $(LIBNAME)
- $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium
-
-depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
- rm -f depend
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
- $(ASM_SOURCES) 2> /dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-# Remove .o and backup files
-clean:
- -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
- -rm -f depend depend.bak
-
-
-install: $(LIBNAME)
- $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
- $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
-
-
-include depend
diff --git a/dist/Mesa/src/gallium/targets/Makefile.xorg b/dist/Mesa/src/gallium/targets/Makefile.xorg
deleted file mode 100644
index 6fad7109f..000000000
--- a/dist/Mesa/src/gallium/targets/Makefile.xorg
+++ /dev/null
@@ -1,82 +0,0 @@
-# src/gallium/targets/Makefile.xorg
-
-# Template makefile for gallium xorg drivers.
-#
-# Usage:
-# The minimum that the including makefile needs to define
-# is TOP, LIBNAME and one of of the *_SOURCES.
-#
-# Optional defines:
-# DRIVER_INCLUDES are appended to the list of includes directories.
-# DRIVER_DEFINES is not used for makedepend, but for compilation.
-# DRIVER_PIPES are pipe drivers and modules that the driver depends on.
-# DRIVER_LINKS are flags given to the linker.
-
-### Basic defines ###
-
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(CPP_SOURCES:.cpp=.o) \
- $(ASM_SOURCES:.S=.o)
-
-INCLUDES = \
- $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/drivers \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/winsys \
- $(DRIVER_INCLUDES)
-
-LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET)
-
-ifeq ($(MESA_LLVM),1)
-LD = $(CXX)
-LDFLAGS += $(LLVM_LDFLAGS)
-USE_CXX=1
-DRIVER_PIPES += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
-DRIVER_LINKS += $(LLVM_LIBS) -lm -ldl
-endif
-
-
-##### TARGETS #####
-
-default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
-
-$(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES)
- $(MKLIB) -linker '$(CC)' -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
-
-depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
- rm -f depend
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
-
-$(LIBNAME_STAGING): $(LIBNAME)
- $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium
-
-$(TOP)/$(LIB_DIR)/gallium:
- mkdir -p $@
-
-clean:
- rm -f $(OBJECTS) $(GENERATED_SOURCES) $(LIBNAME).a depend depend.bak
-
-install:
- $(INSTALL) -d $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR)
- $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR)
-
-
-##### RULES #####
-
-%.s: %.c
- $(CC) -S $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-%.o: %.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-%.o: %.cpp
- $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-%.o: %.S
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-sinclude depend
-
-.PHONY: default clean install
diff --git a/dist/Mesa/src/gallium/targets/dri-i915/Makefile b/dist/Mesa/src/gallium/targets/dri-i915/Makefile
deleted file mode 100644
index 9c10d71a4..000000000
--- a/dist/Mesa/src/gallium/targets/dri-i915/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = i915_dri.so
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \
- $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
- $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(TOP)/src/gallium/drivers/i915/libi915.a
-
-C_SOURCES = \
- target.c \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-DRIVER_DEFINES = \
- -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD -DGALLIUM_SOFTPIPE
-
-ifeq ($(MESA_LLVM),1)
-DRIVER_DEFINES += -DGALLIUM_LLVMPIPE
-endif
-
-include ../Makefile.dri
-
-DRI_LIB_DEPS += -ldrm_intel
-
-symlinks:
diff --git a/dist/Mesa/src/gallium/targets/dri-i965/Makefile b/dist/Mesa/src/gallium/targets/dri-i965/Makefile
deleted file mode 100644
index 4b50d0425..000000000
--- a/dist/Mesa/src/gallium/targets/dri-i965/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = i965_dri.so
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \
- $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
- $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(TOP)/src/gallium/drivers/i965/libi965.a
-
-C_SOURCES = \
- target.c \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-DRIVER_DEFINES = \
- -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD -DGALLIUM_SOFTPIPE
-
-ifeq ($(MESA_LLVM),1)
-DRIVER_DEFINES += -DGALLIUM_LLVMPIPE
-endif
-
-include ../Makefile.dri
-
-DRI_LIB_DEPS += -ldrm_intel
-
-symlinks:
diff --git a/dist/Mesa/src/gallium/targets/dri-i965/SConscript b/dist/Mesa/src/gallium/targets/dri-i965/SConscript
deleted file mode 100644
index 669f70d6b..000000000
--- a/dist/Mesa/src/gallium/targets/dri-i965/SConscript
+++ /dev/null
@@ -1,32 +0,0 @@
-Import('*')
-
-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,
- ws_wrapper,
- i965,
- trace,
- rbug,
- mesa,
- glsl,
- gallium,
- COMMON_DRI_DRM_OBJECTS
-])
-
-module = env.LoadableModule(
- target = 'i965_dri.so',
- source = 'target.c',
- SHLIBPREFIX = '',
-)
-
-env.Alias('dri-i965', module) \ No newline at end of file
diff --git a/dist/Mesa/src/gallium/targets/dri-i965/target.c b/dist/Mesa/src/gallium/targets/dri-i965/target.c
deleted file mode 100644
index 0632b97be..000000000
--- a/dist/Mesa/src/gallium/targets/dri-i965/target.c
+++ /dev/null
@@ -1,29 +0,0 @@
-
-#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;
-
- screen = sw_screen_wrap(screen);
-
- screen = debug_screen_wrap(screen);
-
- return screen;
-}
-
-DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen)
diff --git a/dist/Mesa/src/gallium/targets/dri-nouveau/Makefile b/dist/Mesa/src/gallium/targets/dri-nouveau/Makefile
deleted file mode 100644
index eb1ee859a..000000000
--- a/dist/Mesa/src/gallium/targets/dri-nouveau/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-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/nvc0/libnvc0.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)
-
-symlinks:
diff --git a/dist/Mesa/src/gallium/targets/dri-r300/Makefile b/dist/Mesa/src/gallium/targets/dri-r300/Makefile
deleted file mode 100644
index a1bb753f8..000000000
--- a/dist/Mesa/src/gallium/targets/dri-r300/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = r300_dri.so
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.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 \
- $(TOP)/src/gallium/drivers/r300/libr300.a
-
-C_SOURCES = \
- target.c \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-DRIVER_DEFINES = \
- -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD
-
-include ../Makefile.dri
-
-symlinks:
diff --git a/dist/Mesa/src/gallium/targets/dri-r300/SConscript b/dist/Mesa/src/gallium/targets/dri-r300/SConscript
deleted file mode 100644
index 683b6c697..000000000
--- a/dist/Mesa/src/gallium/targets/dri-r300/SConscript
+++ /dev/null
@@ -1,26 +0,0 @@
-Import('*')
-
-env = drienv.Clone()
-
-env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE', 'GALLIUM_GALAHAD'])
-
-env.Prepend(LIBS = [
- st_dri,
- radeonwinsys,
- r300,
- galahad,
- trace,
- rbug,
- mesa,
- glsl,
- gallium,
- COMMON_DRI_DRM_OBJECTS
-])
-
-module = env.SharedLibrary(
- target ='r300_dri.so',
- source = 'target.c',
- SHLIBPREFIX = '',
-)
-
-env.Alias('dri-r300', module) \ No newline at end of file
diff --git a/dist/Mesa/src/gallium/targets/dri-r300/target.c b/dist/Mesa/src/gallium/targets/dri-r300/target.c
index b48bcad37..07b07051c 100644
--- a/dist/Mesa/src/gallium/targets/dri-r300/target.c
+++ b/dist/Mesa/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"
@@ -23,4 +22,4 @@ create_screen(int fd)
return screen;
}
-DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen)
+DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen, NULL)
diff --git a/dist/Mesa/src/gallium/targets/dri-r600/Makefile b/dist/Mesa/src/gallium/targets/dri-r600/Makefile
deleted file mode 100644
index 0c4de203d..000000000
--- a/dist/Mesa/src/gallium/targets/dri-r600/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = r600_dri.so
-
-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/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(TOP)/src/gallium/drivers/noop/libnoop.a
-
-C_SOURCES = \
- target.c \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-DRIVER_DEFINES = \
- -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_NOOP
-
-include ../Makefile.dri
-
-DRI_LIB_DEPS +=
-
-symlinks:
diff --git a/dist/Mesa/src/gallium/targets/dri-r600/SConscript b/dist/Mesa/src/gallium/targets/dri-r600/SConscript
deleted file mode 100644
index 1df11a874..000000000
--- a/dist/Mesa/src/gallium/targets/dri-r600/SConscript
+++ /dev/null
@@ -1,25 +0,0 @@
-Import('*')
-
-env = drienv.Clone()
-
-env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE'])
-
-env.Prepend(LIBS = [
- st_dri,
- r600winsys,
- r600,
- trace,
- rbug,
- mesa,
- glsl,
- gallium,
- COMMON_DRI_DRM_OBJECTS
-])
-
-module = env.SharedLibrary(
- target ='r600_dri.so',
- source = 'target.c',
- SHLIBPREFIX = '',
-)
-
-env.Alias('dri-r600', module)
diff --git a/dist/Mesa/src/gallium/targets/dri-swrast/Makefile b/dist/Mesa/src/gallium/targets/dri-swrast/Makefile
deleted file mode 100644
index 948c45abe..000000000
--- a/dist/Mesa/src/gallium/targets/dri-swrast/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = swrastg_dri.so
-
-DRIVER_DEFINES = \
- -D__NOT_HAVE_DRM_H -DGALLIUM_SOFTPIPE \
- -DGALLIUM_RBUG -DGALLIUM_TRACE
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/state_trackers/dri/sw/libdrisw.a \
- $(TOP)/src/gallium/winsys/sw/dri/libswdri.a \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a
-
-SWRAST_COMMON_GALLIUM_SOURCES = \
- $(TOP)/src/mesa/drivers/dri/common/utils.c \
- $(TOP)/src/mesa/drivers/dri/common/drisw_util.c \
- $(TOP)/src/mesa/drivers/dri/common/xmlconfig.c
-
-C_SOURCES = \
- swrast_drm_api.c \
- $(SWRAST_COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-include ../Makefile.dri
-
-INCLUDES += \
- -I$(TOP)/src/gallium/winsys/sw/dri
-
-symlinks:
diff --git a/dist/Mesa/src/gallium/targets/dri-vmwgfx/Makefile b/dist/Mesa/src/gallium/targets/dri-vmwgfx/Makefile
deleted file mode 100644
index 8c716f42f..000000000
--- a/dist/Mesa/src/gallium/targets/dri-vmwgfx/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = vmwgfx_dri.so
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \
- $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
- $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(TOP)/src/gallium/drivers/svga/libsvga.a
-
-C_SOURCES = \
- target.c \
- vmw_powf.c \
- $(COMMON_GALLIUM_SOURCES)
-
-DRIVER_DEFINES = \
- -DGALLIUM_RBUG -DGALLIUM_TRACE
-
-include ../Makefile.dri
-
-symlinks:
diff --git a/dist/Mesa/src/gallium/targets/dri-vmwgfx/SConscript b/dist/Mesa/src/gallium/targets/dri-vmwgfx/SConscript
index 17dd02105..0d19944f5 100644
--- a/dist/Mesa/src/gallium/targets/dri-vmwgfx/SConscript
+++ b/dist/Mesa/src/gallium/targets/dri-vmwgfx/SConscript
@@ -2,10 +2,18 @@ Import('*')
env = drienv.Clone()
-if True:
+if env['suncc']:
+ print 'warning: not building dri-vmwgfx'
+ Return()
+
+if env['build'] == 'release':
+ env.Append(CPPDEFINES = ['GALLIUM_RBUG'])
+ env.Prepend(LIBS = [rbug])
+else:
env.Append(CPPDEFINES = ['GALLIUM_TRACE', 'GALLIUM_RBUG', 'GALLIUM_GALAHAD', 'GALLIUM_SOFTPIPE'])
env.Prepend(LIBS = [trace, rbug, galahad, softpipe, ws_wrapper])
+
env.Prepend(LIBS = [
st_dri,
svgadrm,
diff --git a/dist/Mesa/src/gallium/targets/dri-vmwgfx/target.c b/dist/Mesa/src/gallium/targets/dri-vmwgfx/target.c
index 1362851d6..e01e4652a 100644
--- a/dist/Mesa/src/gallium/targets/dri-vmwgfx/target.c
+++ b/dist/Mesa/src/gallium/targets/dri-vmwgfx/target.c
@@ -26,4 +26,20 @@ create_screen(int fd)
return screen;
}
-DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen)
+static const struct drm_conf_ret throttle_ret = {
+ .type = DRM_CONF_INT,
+ .val.val_int = 2,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+ switch (conf) {
+ case DRM_CONF_THROTTLE:
+ return &throttle_ret;
+ default:
+ break;
+ }
+ return NULL;
+}
+
+DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen, drm_configuration)
diff --git a/dist/Mesa/src/gallium/targets/egl-static/Makefile b/dist/Mesa/src/gallium/targets/egl-static/Makefile
deleted file mode 100644
index 5b7b330a1..000000000
--- a/dist/Mesa/src/gallium/targets/egl-static/Makefile
+++ /dev/null
@@ -1,207 +0,0 @@
-# src/gallium/targets/egl-static/Makefile
-#
-# This is Makefile for egl_gallium.so. It is static in that all state trackers
-# and pipe drivers are linked statically when possible.
-#
-# The following variables are examined
-#
-# EGL_PLATFORMS - platforms to support
-# EGL_CLIENT_APIS - state trackers to support
-# GALLIUM_WINSYS_DIRS - pipe drivers to support
-# SHARED_GLAPI - st/mesa can be statically linked or not
-#
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-OUTPUTS := egl_gallium
-
-egl_CPPFLAGS := \
- -I$(TOP)/include \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/drivers \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/winsys
-egl_LIBS := \
- $(TOP)/src/gallium/drivers/identity/libidentity.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(GALLIUM_AUXILIARIES)
-egl_SYS :=
-
-egl_SOURCES := \
- egl.c \
- egl_pipe.c \
- egl_st.c
-
-egl_OBJECTS := $(egl_SOURCES:%.c=%.o)
-
-# st/egl
-egl_CPPFLAGS += \
- -I$(TOP)/src/gallium/state_trackers/egl \
- -I$(TOP)/src/egl/main \
- -D_EGL_MAIN=_eglMain
-egl_LIBS += $(TOP)/src/gallium/state_trackers/egl/libegl.a
-egl_SYS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) -lEGL -lm -lpthread
-
-# EGL platforms
-ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
-egl_CPPFLAGS += $(LIBDRM_CFLAGS)
-egl_LIBS += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a
-egl_SYS += -lX11 -lXext -lXfixes $(LIBDRM_LIB)
-endif
-ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
-egl_CPPFLAGS += $(LIBDRM_CFLAGS)
-egl_LIBS += $(TOP)/src/gallium/winsys/sw/wayland/libws_wayland.a
-egl_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
-egl_SYS += $(LIBDRM_LIB) $(WAYLAND_LIBS)
-endif
-ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
-egl_CPPFLAGS += $(LIBDRM_CFLAGS)
-egl_SYS += $(LIBDRM_LIB) -lgbm
-endif
-ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
-egl_LIBS += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a
-endif
-
-# st/mesa
-ifneq ($(filter $(GL_LIB), $(EGL_CLIENT_APIS)),)
-egl_CPPFLAGS += -I$(TOP)/src/mesa $(API_DEFINES)
-# make st/mesa built-in when there is a single glapi provider
-ifeq ($(SHARED_GLAPI),1)
-egl_LIBS += $(TOP)/src/mesa/libmesagallium.a
-egl_SYS += -lm -lpthread $(DLOPEN_LIBS) -l$(GLAPI_LIB)
-else
-egl_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
-OUTPUTS += st_GL
-endif # SHARED_GLAPI
-endif
-
-# st/vega
-ifneq ($(filter $(VG_LIB), $(EGL_CLIENT_APIS)),)
-egl_CPPFLAGS += -I$(TOP)/src/gallium/state_trackers/vega -DFEATURE_VG=1
-egl_LIBS += $(TOP)/src/gallium/state_trackers/vega/libvega.a
-egl_SYS += -lm -l$(VG_LIB)
-endif
-
-# i915
-ifneq ($(findstring i915/drm,$(GALLIUM_WINSYS_DIRS)),)
-egl_CPPFLAGS += -D_EGL_PIPE_I915=1
-egl_LIBS += \
- $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
- $(TOP)/src/gallium/drivers/i915/libi915.a
-egl_SYS += -ldrm_intel
-endif
-
-# i965
-ifneq ($(findstring i965/drm,$(GALLIUM_WINSYS_DIRS)),)
-egl_CPPFLAGS += -D_EGL_PIPE_I995=1
-egl_LIBS += \
- $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
- $(TOP)/src/gallium/drivers/i965/libi965.a \
- $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a
-egl_SYS += -ldrm_intel
-endif
-
-# nouveau
-ifneq ($(findstring nouveau/drm,$(GALLIUM_WINSYS_DIRS)),)
-egl_CPPFLAGS += -D_EGL_PIPE_NOUVEAU=1
-egl_LIBS += \
- $(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
-egl_SYS += -ldrm_nouveau
-endif
-
-# r300
-ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_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
-
-# r600
-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/drivers/r600/libr600.a
-egl_SYS += -ldrm_radeon
-endif
-
-# vmwgfx
-ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),)
-egl_CPPFLAGS += -D_EGL_PIPE_VMWGFX=1
-egl_LIBS += \
- $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
- $(TOP)/src/gallium/drivers/svga/libsvga.a
-endif
-
-# 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))
-egl_LIBS := $(sort $(egl_LIBS))
-egl_SYS := $(sort $(egl_SYS))
-
-# st_GL, built only when shared glapi is not enabled
-st_GL_CPPFLAGS := -I $(TOP)/src/mesa -I$(TOP)/src/gallium/include
-st_GL_LIBS := $(TOP)/src/mesa/libmesagallium.a $(GALLIUM_AUXILIARIES)
-st_GL_SYS := -lm -lpthread $(DLOPEN_LIBS)
-
-# LLVM
-ifeq ($(MESA_LLVM),1)
-egl_SYS += $(LLVM_LIBS)
-LDFLAGS += $(LLVM_LDFLAGS)
-
-st_GL_SYS += $(LLVM_LIBS)
-endif
-
-OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl
-OUTPUTS := $(addprefix $(OUTPUT_PATH)/, $(addsuffix .so, $(OUTPUTS)))
-
-default: $(OUTPUTS)
-
-$(OUTPUT_PATH)/egl_gallium.so: $(egl_OBJECTS) $(egl_LIBS)
- $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
- -ldflags '-L$(TOP)/$(LIB_DIR) -Wl,--no-undefined $(LDFLAGS)' \
- -cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
- $(egl_OBJECTS) -Wl,--start-group $(egl_LIBS) -Wl,--end-group \
- $(egl_SYS)
-
-$(OUTPUT_PATH)/st_GL.so: st_GL.o $(st_GL_LIBS)
- $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
- -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
- -cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
- $< -Wl,--start-group $(st_GL_LIBS) -Wl,--end-group \
- $(st_GL_SYS)
-
-$(egl_OBJECTS): %.o: %.c
- $(CC) -c -o $@ $< $(egl_CPPFLAGS) $(DEFINES) $(CFLAGS)
-
-st_GL.o: st_GL.c
- $(CC) -c -o $@ $< $(st_GL_CPPFLAGS) $(DEFINES) $(CFLAGS)
-
-install: $(OUTPUTS)
- $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
- for out in $(OUTPUTS); do \
- $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
- done
-
-clean:
- rm -f *.o
diff --git a/dist/Mesa/src/gallium/targets/egl-static/SConscript b/dist/Mesa/src/gallium/targets/egl-static/SConscript
index cbd98cc41..b4ccc5b80 100644
--- a/dist/Mesa/src/gallium/targets/egl-static/SConscript
+++ b/dist/Mesa/src/gallium/targets/egl-static/SConscript
@@ -79,39 +79,25 @@ if True:
openvg_name = 'OpenVG' if env['platform'] != 'windows' else 'libOpenVG'
env.Prepend(LIBS = [openvg_name, st_vega])
-if env['x11']:
+if env['HAVE_X11']:
env.Prepend(LIBS = [
ws_xlib,
- env['X11_LIBS'],
])
-
-if env['dri']:
- env.ParseConfig('pkg-config --cflags --libs xfixes')
+ env.PkgUseModules('X11')
# pipe drivers
-if env['drm']:
- env.ParseConfig('pkg-config --cflags --libs libdrm')
+if env['HAVE_DRM']:
+ env.PkgUseModules('DRM')
- if env['drm_intel']:
- env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
- env.Append(CPPDEFINES = ['_EGL_PIPE_I915', '_EGL_PIPE_I965'])
+ if env['HAVE_DRM_INTEL']:
+ env.PkgUseModules('DRM_INTEL')
+ env.Append(CPPDEFINES = ['_EGL_PIPE_I915'])
env.Prepend(LIBS = [
i915drm,
i915,
- i965drm,
- i965,
ws_wrapper,
])
- if env['drm_radeon']:
- env.Append(CPPDEFINES = ['_EGL_PIPE_R300', '_EGL_PIPE_R600'])
- env.Prepend(LIBS = [
- radeonwinsys,
- r300,
- r600winsys,
- r600,
- ])
-
env.Append(CPPDEFINES = ['_EGL_PIPE_VMWGFX'])
env.Prepend(LIBS = [
svgadrm,
diff --git a/dist/Mesa/src/gallium/targets/egl-static/egl.c b/dist/Mesa/src/gallium/targets/egl-static/egl.c
index 2caad0e1e..0b59bdb52 100644
--- a/dist/Mesa/src/gallium/targets/egl-static/egl.c
+++ b/dist/Mesa/src/gallium/targets/egl-static/egl.c
@@ -1,6 +1,5 @@
/*
* Mesa 3-D graphics library
- * Version: 7.10
*
* Copyright (C) 2010-2011 LunarG Inc.
*
@@ -31,11 +30,12 @@
#include "egllog.h"
#ifdef HAVE_LIBUDEV
-#include <stdio.h>
+#include <stdio.h> /* for sscanf */
#include <libudev.h>
+#endif
+
#define DRIVER_MAP_GALLIUM_ONLY
#include "pci_ids/pci_id_driver_map.h"
-#endif
#include "egl_pipe.h"
#include "egl_st.h"
@@ -60,27 +60,29 @@ get_st_api(enum st_api_type api)
return stmod->stapi;
}
-static const char *
-drm_fd_get_screen_name(int fd)
-{
#ifdef HAVE_LIBUDEV
- struct udev *udev;
- struct udev_device *device, *parent;
+
+static boolean
+drm_fd_get_pci_id(int fd, int *vendor_id, int *chip_id)
+{
+ struct udev *udev = NULL;
+ struct udev_device *device = NULL, *parent;
struct stat buf;
const char *pci_id;
- int vendor_id, chip_id, idx = -1, i;
+
+ *chip_id = -1;
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "failed to stat fd %d", fd);
- return NULL;
+ goto out;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"could not create udev device for fd %d", fd);
- return NULL;
+ goto out;
}
parent = udev_device_get_parent(device);
@@ -91,53 +93,158 @@ drm_fd_get_screen_name(int fd)
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL ||
- sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
+ sscanf(pci_id, "%x:%x", vendor_id, chip_id) != 2) {
_eglLog(_EGL_WARNING, "malformed or no PCI ID");
+ *chip_id = -1;
goto out;
}
- /* find the driver index */
+out:
+ if (device)
+ udev_device_unref(device);
+ if (udev)
+ udev_unref(udev);
+
+ return (*chip_id >= 0);
+}
+
+#elif defined(PIPE_OS_ANDROID) && !defined(_EGL_NO_DRM)
+
+#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;
+ }
+ }
+ else if (util_strcmp(version->name, "nouveau") == 0) {
+ *vendor_id = 0x10de;
+ /* not used */
+ *chip_id = 0;
+ }
+ else if (util_strcmp(version->name, "vmwgfx") == 0) {
+ *vendor_id = 0x15ad;
+ /* assume SVGA II */
+ *chip_id = 0x0405;
+ }
+
+ drmFreeVersion(version);
+
+ return (*chip_id >= 0);
+}
+
+#else
+
+static boolean
+drm_fd_get_pci_id(int fd, int *vendor_id, int *chip_id)
+{
+ return FALSE;
+}
+
+#endif /* HAVE_LIBUDEV */
+
+static const char *
+drm_fd_get_screen_name(int fd)
+{
+ int vendor_id, chip_id;
+ int idx, i;
+
+ if (!drm_fd_get_pci_id(fd, &vendor_id, &chip_id)) {
+ _eglLog(_EGL_WARNING, "failed to get driver name for fd %d", fd);
+ return NULL;
+ }
+
for (idx = 0; driver_map[idx].driver; idx++) {
if (vendor_id != driver_map[idx].vendor_id)
continue;
+ /* done if no chip id */
if (driver_map[idx].num_chips_ids == -1)
- goto out;
+ break;
for (i = 0; i < driver_map[idx].num_chips_ids; i++) {
if (driver_map[idx].chip_ids[i] == chip_id)
- goto out;
+ break;
}
+ /* matched! */
+ if (i < driver_map[idx].num_chips_ids)
+ break;
}
-out:
- udev_device_unref(device);
- udev_unref(udev);
-
- if (idx >= 0) {
- _eglLog((driver_map[idx].driver) ? _EGL_INFO : _EGL_WARNING,
- "pci id for fd %d: %04x:%04x, driver %s",
- fd, vendor_id, chip_id, driver_map[idx].driver);
-
- return driver_map[idx].driver;
- }
-#endif
-
- _eglLog(_EGL_WARNING, "failed to get driver name for fd %d", fd);
+ _eglLog((driver_map[idx].driver) ? _EGL_INFO : _EGL_WARNING,
+ "pci id for fd %d: %04x:%04x, driver %s",
+ fd, vendor_id, chip_id, driver_map[idx].driver);
- return NULL;
+ return driver_map[idx].driver;
}
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/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.c b/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.c
index 658c532b4..57a323353 100644
--- a/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.c
+++ b/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.c
@@ -1,6 +1,5 @@
/*
* Mesa 3-D graphics library
- * Version: 7.10
*
* Copyright (C) 2011 LunarG Inc.
*
@@ -32,21 +31,24 @@
/* for i915 */
#include "i915/drm/i915_drm_public.h"
#include "i915/i915_public.h"
-/* for i965 */
#include "target-helpers/inline_wrapper_sw_helper.h"
-#include "i965/drm/i965_drm_public.h"
-#include "i965/brw_public.h"
+/* for ilo */
+#include "intel/intel_winsys.h"
+#include "ilo/ilo_public.h"
/* for nouveau */
#include "nouveau/drm/nouveau_drm_public.h"
/* for r300 */
#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 radeonsi */
+#include "radeonsi/radeonsi_public.h"
/* for vmwgfx */
#include "svga/drm/svga_drm_public.h"
#include "svga/svga_public.h"
+/* for freedreno */
+#include "freedreno/drm/freedreno_drm_public.h"
static struct pipe_screen *
pipe_i915_create_screen(int fd)
@@ -72,22 +74,20 @@ pipe_i915_create_screen(int fd)
}
static struct pipe_screen *
-pipe_i965_create_screen(int fd)
+pipe_ilo_create_screen(int fd)
{
-#if _EGL_PIPE_I965
- struct brw_winsys_screen *bws;
+#if _EGL_PIPE_ILO
+ struct intel_winsys *iws;
struct pipe_screen *screen;
- bws = i965_drm_winsys_screen_create(fd);
- if (!bws)
+ iws = intel_winsys_create_for_fd(fd);
+ if (!iws)
return NULL;
- screen = brw_screen_create(bws);
+ screen = ilo_screen_create(iws);
if (!screen)
return NULL;
- screen = sw_screen_wrap(screen);
-
screen = debug_screen_wrap(screen);
return screen;
@@ -141,10 +141,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;
@@ -161,6 +161,29 @@ pipe_r600_create_screen(int fd)
}
static struct pipe_screen *
+pipe_radeonsi_create_screen(int fd)
+{
+#if _EGL_PIPE_RADEONSI
+ struct radeon_winsys *rw;
+ struct pipe_screen *screen;
+
+ rw = radeon_drm_winsys_create(fd);
+ if (!rw)
+ return NULL;
+
+ screen = radeonsi_screen_create(rw);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+#else
+ return NULL;
+#endif
+}
+
+static struct pipe_screen *
pipe_vmwgfx_create_screen(int fd)
{
#if _EGL_PIPE_VMWGFX
@@ -183,21 +206,43 @@ pipe_vmwgfx_create_screen(int fd)
#endif
}
+static struct pipe_screen *
+pipe_freedreno_create_screen(int fd)
+{
+#if _EGL_PIPE_FREEDRENO
+ struct pipe_screen *screen;
+
+ screen = fd_drm_screen_create(fd);
+ if (!screen)
+ return NULL;
+
+ screen = debug_screen_wrap(screen);
+
+ return screen;
+#else
+ return NULL;
+#endif
+}
+
struct pipe_screen *
egl_pipe_create_drm_screen(const char *name, int fd)
{
if (strcmp(name, "i915") == 0)
return pipe_i915_create_screen(fd);
else if (strcmp(name, "i965") == 0)
- return pipe_i965_create_screen(fd);
+ return pipe_ilo_create_screen(fd);
else if (strcmp(name, "nouveau") == 0)
return pipe_nouveau_create_screen(fd);
else if (strcmp(name, "r300") == 0)
return pipe_r300_create_screen(fd);
else if (strcmp(name, "r600") == 0)
return pipe_r600_create_screen(fd);
+ else if (strcmp(name, "radeonsi") == 0)
+ return pipe_radeonsi_create_screen(fd);
else if (strcmp(name, "vmwgfx") == 0)
return pipe_vmwgfx_create_screen(fd);
+ else if (strcmp(name, "kgsl") == 0)
+ return pipe_freedreno_create_screen(fd);
else
return NULL;
}
diff --git a/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.h b/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.h
index 569b2d067..65d25ba54 100644
--- a/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.h
+++ b/dist/Mesa/src/gallium/targets/egl-static/egl_pipe.h
@@ -1,6 +1,5 @@
/*
* Mesa 3-D graphics library
- * Version: 7.10
*
* Copyright (C) 2011 LunarG Inc.
*
diff --git a/dist/Mesa/src/gallium/targets/egl-static/egl_st.c b/dist/Mesa/src/gallium/targets/egl-static/egl_st.c
index 81d7bb475..da0cd5b8b 100644
--- a/dist/Mesa/src/gallium/targets/egl-static/egl_st.c
+++ b/dist/Mesa/src/gallium/targets/egl-static/egl_st.c
@@ -1,6 +1,5 @@
/*
* Mesa 3-D graphics library
- * Version: 7.10
*
* Copyright (C) 2011 LunarG Inc.
*
@@ -54,8 +53,9 @@ dlopen_gl_lib_cb(const char *dir, size_t len, void *callback_data)
int ret;
if (len) {
+ assert(len <= INT_MAX && "path is insanely long!");
ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT,
- len, dir, name);
+ (int)len, dir, name);
}
else {
ret = util_snprintf(path, sizeof(path), "%s" UTIL_DL_EXT, name);
diff --git a/dist/Mesa/src/gallium/targets/egl-static/egl_st.h b/dist/Mesa/src/gallium/targets/egl-static/egl_st.h
index 7a3773c6b..f17e85b19 100644
--- a/dist/Mesa/src/gallium/targets/egl-static/egl_st.h
+++ b/dist/Mesa/src/gallium/targets/egl-static/egl_st.h
@@ -1,6 +1,5 @@
/*
* Mesa 3-D graphics library
- * Version: 7.10
*
* Copyright (C) 2011 LunarG Inc.
*
diff --git a/dist/Mesa/src/gallium/targets/egl-static/st_GL.c b/dist/Mesa/src/gallium/targets/egl-static/st_GL.c
index 3f4b7a09f..86fc98e8a 100644
--- a/dist/Mesa/src/gallium/targets/egl-static/st_GL.c
+++ b/dist/Mesa/src/gallium/targets/egl-static/st_GL.c
@@ -1,6 +1,5 @@
/*
* Mesa 3-D graphics library
- * Version: 7.10
*
* Copyright (C) 2011 LunarG Inc.
*
diff --git a/dist/Mesa/src/gallium/targets/gbm/Makefile b/dist/Mesa/src/gallium/targets/gbm/Makefile
deleted file mode 100644
index 53104253d..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/Makefile
+++ /dev/null
@@ -1,169 +0,0 @@
-# src/gallium/targets/gbm/Makefile
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-PIPE_PREFIX := pipe_
-
-GBM_BACKEND = gbm_gallium_drm
-GBM_SOURCES = gbm.c pipe_loader.c
-
-GBM_INCLUDES = \
- -I$(TOP)/include \
- -I$(TOP)/src/gallium/state_trackers/gbm \
- -I$(TOP)/src/gbm/main \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/include \
-
-GBM_LIBS = $(LIBUDEV_LIBS) $(LIBDRM_LIB) \
- $(TOP)/src/gallium/state_trackers/gbm/libgbm.a \
- $(TOP)/src/gallium/drivers/identity/libidentity.a \
- $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(GALLIUM_AUXILIARIES)
-
-
-GBM_CFLAGS = \
- -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 = \
- $(TOP)/src/gallium/drivers/identity/libidentity.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(GALLIUM_AUXILIARIES)
-
-# as if we are DRI modules
-pipe_SYS = $(DRI_LIB_DEPS)
-
-pipe_CLFLAGS = \
- -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD \
- $(LIBDRM_CFLAGS)
-
-pipe_LDFLAGS = -Wl,--no-undefined
-
-# i915 pipe driver
-i915_LIBS = \
- $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
- $(TOP)/src/gallium/drivers/i915/libi915.a
-i915_SYS = -ldrm_intel
-
-# i965 pipe driver
-i965_LIBS = \
- $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
- $(TOP)/src/gallium/drivers/i965/libi965.a \
- $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a
-i965_SYS = -ldrm_intel
-
-# nouveau pipe driver
-nouveau_LIBS = \
- $(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
-nouveau_SYS = -ldrm_nouveau
-
-# r300 pipe driver
-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/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
-
-# 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 $(pipe_LIBS) $($*_LIBS) -Wl,--end-group \
- $(pipe_SYS) $($*_SYS)
-
-$(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/dist/Mesa/src/gallium/targets/gbm/gbm.c b/dist/Mesa/src/gallium/targets/gbm/gbm.c
index e840fc5fa..8f460573b 100644
--- a/dist/Mesa/src/gallium/targets/gbm/gbm.c
+++ b/dist/Mesa/src/gallium/targets/gbm/gbm.c
@@ -25,36 +25,58 @@
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
-#include "util/u_inlines.h"
-
#include "gbm_gallium_drmint.h"
-#include "pipe_loader.h"
-static struct pipe_screen *
-create_drm_screen(const char *name, int fd)
+#include "util/u_memory.h"
+#include "util/u_inlines.h"
+#include "pipe-loader/pipe_loader.h"
+
+static const char *
+get_library_search_path(void)
{
- struct pipe_module *pmod = get_pipe_module(name);
-
- return (pmod && pmod->drmdd && pmod->drmdd->create_screen) ?
- pmod->drmdd->create_screen(fd) : NULL;
+ const char *search_path = NULL;
+
+ /* don't allow setuid apps to use GBM_BACKENDS_PATH */
+ if (geteuid() == getuid())
+ search_path = getenv("GBM_BACKENDS_PATH");
+ if (search_path == NULL)
+ search_path = PIPE_SEARCH_DIR;
+
+ return search_path;
}
int
gallium_screen_create(struct gbm_gallium_drm_device *gdrm)
{
- gdrm->base.driver_name = drm_fd_get_screen_name(gdrm->base.base.fd);
- if (gdrm->base.driver_name == NULL)
+ struct pipe_loader_device *dev;
+#ifdef HAVE_PIPE_LOADER_DRM
+ int ret;
+
+ ret = pipe_loader_drm_probe_fd(&dev, gdrm->base.base.fd);
+ if (!ret)
return -1;
+#endif /* HAVE_PIPE_LOADER_DRM */
- gdrm->screen = create_drm_screen(gdrm->base.driver_name, gdrm->base.base.fd);
+ gdrm->screen = pipe_loader_create_screen(dev, get_library_search_path());
if (gdrm->screen == NULL) {
debug_printf("failed to load driver: %s\n", gdrm->base.driver_name);
+ pipe_loader_release(&dev, 1);
return -1;
};
+ gdrm->driver = dev;
+ gdrm->base.driver_name = strdup(dev->driver_name);
return 0;
}
+void
+gallium_screen_destroy(struct gbm_gallium_drm_device *gdrm)
+{
+ FREE(gdrm->base.driver_name);
+ gdrm->screen->destroy(gdrm->screen);
+ pipe_loader_release((struct pipe_loader_device **)&gdrm->driver, 1);
+}
+
GBM_EXPORT struct gbm_backend gbm_backend = {
.backend_name = "gallium_drm",
.create_device = gbm_gallium_drm_device_create,
diff --git a/dist/Mesa/src/gallium/targets/gbm/pipe_i915.c b/dist/Mesa/src/gallium/targets/gbm/pipe_i915.c
deleted file mode 100644
index cd74044d8..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_i915.c
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/gbm/pipe_i965.c b/dist/Mesa/src/gallium/targets/gbm/pipe_i965.c
deleted file mode 100644
index f810ecffb..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_i965.c
+++ /dev/null
@@ -1,30 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/gbm/pipe_loader.c b/dist/Mesa/src/gallium/targets/gbm/pipe_loader.c
deleted file mode 100644
index 6200541db..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_loader.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright © 2011 Intel Corporation
- *
- * 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 (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
- * 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.
- *
- * Authors:
- * Kristian Høgsberg <krh@bitplanet.net>
- * Benjamin Franzke <benjaminfranzke@googlemail.com>
- */
-
-#include <stdio.h>
-#include "util/u_string.h"
-#include "util/u_memory.h"
-
-#include <libudev.h>
-
-#include "gbm_gallium_drmint.h"
-#include "pipe_loader.h"
-#define DRIVER_MAP_GALLIUM_ONLY
-#include "pci_ids/pci_id_driver_map.h"
-
-static struct pipe_module pipe_modules[16];
-
-static INLINE char *
-loader_strdup(const char *str)
-{
- return mem_dup(str, strlen(str) + 1);
-}
-
-char *
-drm_fd_get_screen_name(int fd)
-{
- struct udev *udev;
- struct udev_device *device, *parent;
- const char *pci_id;
- char *driver = NULL;
- int vendor_id, chip_id, i, j;
-
- udev = udev_new();
- device = _gbm_udev_device_new_from_fd(udev, fd);
- if (device == NULL)
- return NULL;
-
- parent = udev_device_get_parent(device);
- if (parent == NULL) {
- fprintf(stderr, "gbm: could not get parent device");
- goto out;
- }
-
- pci_id = udev_device_get_property_value(parent, "PCI_ID");
- if (pci_id == NULL ||
- sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
- fprintf(stderr, "gbm: malformed or no PCI ID");
- goto out;
- }
-
- for (i = 0; driver_map[i].driver; i++) {
- if (vendor_id != driver_map[i].vendor_id)
- continue;
- if (driver_map[i].num_chips_ids == -1) {
- driver = loader_strdup(driver_map[i].driver);
- _gbm_log("pci id for %d: %04x:%04x, driver %s",
- fd, vendor_id, chip_id, driver);
- goto out;
- }
-
- for (j = 0; j < driver_map[i].num_chips_ids; j++)
- if (driver_map[i].chip_ids[j] == chip_id) {
- driver = loader_strdup(driver_map[i].driver);
- _gbm_log("pci id for %d: %04x:%04x, driver %s",
- fd, vendor_id, chip_id, driver);
- goto out;
- }
- }
-
-out:
- udev_device_unref(device);
- udev_unref(udev);
-
- return driver;
-}
-
-static void
-find_pipe_module(struct pipe_module *pmod, const char *name)
-{
- char *search_paths, *end, *next, *p;
- char path[PATH_MAX];
- int ret;
-
- search_paths = NULL;
- if (geteuid() == getuid()) {
- /* don't allow setuid apps to use GBM_BACKENDS_PATH */
- search_paths = getenv("GBM_BACKENDS_PATH");
- }
- if (search_paths == NULL)
- search_paths = GBM_BACKEND_SEARCH_DIR;
-
- end = search_paths + strlen(search_paths);
- for (p = search_paths; p < end && pmod->lib == NULL; p = next + 1) {
- int len;
- next = strchr(p, ':');
- if (next == NULL)
- next = end;
-
- len = next - p;
-
- if (len) {
- ret = util_snprintf(path, sizeof(path),
- "%.*s/" PIPE_PREFIX "%s" UTIL_DL_EXT, len, p, pmod->name);
- }
- else {
- ret = util_snprintf(path, sizeof(path),
- PIPE_PREFIX "%s" UTIL_DL_EXT, pmod->name);
- }
- if (ret > 0 && ret < sizeof(path)) {
- pmod->lib = util_dl_open(path);
- debug_printf("loaded %s\n", path);
- }
-
- }
-}
-
-static boolean
-load_pipe_module(struct pipe_module *pmod, const char *name)
-{
- pmod->name = loader_strdup(name);
- if (!pmod->name)
- return FALSE;
-
- find_pipe_module(pmod, name);
-
- if (pmod->lib) {
- pmod->drmdd = (const struct drm_driver_descriptor *)
- util_dl_get_proc_address(pmod->lib, "driver_descriptor");
-
- /* sanity check on the name */
- if (pmod->drmdd && strcmp(pmod->drmdd->name, pmod->name) != 0)
- pmod->drmdd = NULL;
-
- if (!pmod->drmdd) {
- util_dl_close(pmod->lib);
- pmod->lib = NULL;
- }
- }
-
- return (pmod->drmdd != NULL);
-}
-
-struct pipe_module *
-get_pipe_module(const char *name)
-{
- struct pipe_module *pmod = NULL;
- int i;
-
- if (!name)
- return NULL;
-
- for (i = 0; i < Elements(pipe_modules); i++) {
- if (!pipe_modules[i].initialized ||
- strcmp(pipe_modules[i].name, name) == 0) {
- pmod = &pipe_modules[i];
- break;
- }
- }
- if (!pmod)
- return NULL;
-
- if (!pmod->initialized) {
- load_pipe_module(pmod, name);
- pmod->initialized = TRUE;
- }
-
- return pmod;
-}
diff --git a/dist/Mesa/src/gallium/targets/gbm/pipe_loader.h b/dist/Mesa/src/gallium/targets/gbm/pipe_loader.h
deleted file mode 100644
index 2e4cd9906..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_loader.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright © 2011 Intel Corporation
- *
- * 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 (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
- * 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.
- *
- * Authors:
- * Benjamin Franzke <benjaminfranzke@googlemail.com>
- */
-
-#ifndef _PIPE_LOADER_H_
-#define _PIPE_LOADER_H_
-
-#include "pipe/p_compiler.h"
-#include "util/u_dl.h"
-#include "state_tracker/drm_driver.h"
-
-struct pipe_module {
- boolean initialized;
- char *name;
- struct util_dl_library *lib;
- const struct drm_driver_descriptor *drmdd;
-};
-
-struct pipe_module *
-get_pipe_module(const char *name);
-
-char *
-drm_fd_get_screen_name(int fd);
-
-#endif
diff --git a/dist/Mesa/src/gallium/targets/gbm/pipe_nouveau.c b/dist/Mesa/src/gallium/targets/gbm/pipe_nouveau.c
deleted file mode 100644
index 0c9081bc7..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_nouveau.c
+++ /dev/null
@@ -1,21 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/gbm/pipe_r300.c b/dist/Mesa/src/gallium/targets/gbm/pipe_r300.c
deleted file mode 100644
index 09940f0a1..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_r300.c
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/gbm/pipe_r600.c b/dist/Mesa/src/gallium/targets/gbm/pipe_r600.c
deleted file mode 100644
index 486a65925..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_r600.c
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/gbm/pipe_swrast.c b/dist/Mesa/src/gallium/targets/gbm/pipe_swrast.c
deleted file mode 100644
index b2e3289c5..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_swrast.c
+++ /dev/null
@@ -1,22 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/gbm/pipe_vmwgfx.c b/dist/Mesa/src/gallium/targets/gbm/pipe_vmwgfx.c
deleted file mode 100644
index 22a28fa85..000000000
--- a/dist/Mesa/src/gallium/targets/gbm/pipe_vmwgfx.c
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/graw-null/graw_util.c b/dist/Mesa/src/gallium/targets/graw-null/graw_util.c
index 09cba895d..07693e85f 100644
--- a/dist/Mesa/src/gallium/targets/graw-null/graw_util.c
+++ b/dist/Mesa/src/gallium/targets/graw-null/graw_util.c
@@ -21,6 +21,7 @@ graw_parse_geometry_shader(struct pipe_context *pipe,
if (!tgsi_text_translate(text, tokens, Elements(tokens)))
return NULL;
+ memset(&state, 0, sizeof state);
state.tokens = tokens;
return pipe->create_gs_state(pipe, &state);
}
@@ -35,6 +36,7 @@ graw_parse_vertex_shader(struct pipe_context *pipe,
if (!tgsi_text_translate(text, tokens, Elements(tokens)))
return NULL;
+ memset(&state, 0, sizeof state);
state.tokens = tokens;
return pipe->create_vs_state(pipe, &state);
}
@@ -49,6 +51,7 @@ graw_parse_fragment_shader(struct pipe_context *pipe,
if (!tgsi_text_translate(text, tokens, Elements(tokens)))
return NULL;
+ memset(&state, 0, sizeof state);
state.tokens = tokens;
return pipe->create_fs_state(pipe, &state);
}
diff --git a/dist/Mesa/src/gallium/targets/graw-xlib/graw_xlib.c b/dist/Mesa/src/gallium/targets/graw-xlib/graw_xlib.c
index b6d798e57..148837c5e 100644
--- a/dist/Mesa/src/gallium/targets/graw-xlib/graw_xlib.c
+++ b/dist/Mesa/src/gallium/targets/graw-xlib/graw_xlib.c
@@ -89,13 +89,13 @@ graw_create_window_and_screen( int x,
if (visinfo->red_mask == 0xff0000 &&
visinfo->green_mask == 0xff00 &&
visinfo->blue_mask == 0xff) {
- if (format != PIPE_FORMAT_B8G8R8A8_UNORM)
+ if (format != PIPE_FORMAT_BGRA8888_UNORM)
goto fail;
}
else if (visinfo->red_mask == 0xff &&
visinfo->green_mask == 0xff00 &&
visinfo->blue_mask == 0xff0000) {
- if (format != PIPE_FORMAT_R8G8B8A8_UNORM)
+ if (format != PIPE_FORMAT_RGBA8888_UNORM)
goto fail;
}
else {
@@ -147,18 +147,16 @@ graw_create_window_and_screen( int x,
if (screen == NULL)
goto fail;
- XFree(visinfo);
+ free(visinfo);
return screen;
fail:
if (screen)
screen->destroy(screen);
- if (xlib_handle)
- FREE(xlib_handle);
+ FREE(xlib_handle);
- if (visinfo)
- XFree(visinfo);
+ free(visinfo);
if (win)
XDestroyWindow(graw.display, win);
diff --git a/dist/Mesa/src/gallium/targets/libgl-gdi/SConscript b/dist/Mesa/src/gallium/targets/libgl-gdi/SConscript
index 49462a8e3..f8393dac2 100644
--- a/dist/Mesa/src/gallium/targets/libgl-gdi/SConscript
+++ b/dist/Mesa/src/gallium/targets/libgl-gdi/SConscript
@@ -27,7 +27,9 @@ if env['llvm']:
env.Append(CPPDEFINES = 'HAVE_LLVMPIPE')
drivers += [llvmpipe]
-if env['gcc']:
+if env['gcc'] and env['machine'] != 'x86_64':
+ # DEF parser in certain versions of MinGW is busted, as does not behave as
+ # MSVC. mingw-w64 works fine.
sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def']
else:
sources += ['#src/gallium/state_trackers/wgl/opengl32.def']
diff --git a/dist/Mesa/src/gallium/targets/libgl-xlib/Makefile b/dist/Mesa/src/gallium/targets/libgl-xlib/Makefile
deleted file mode 100644
index 53a6c33ed..000000000
--- a/dist/Mesa/src/gallium/targets/libgl-xlib/Makefile
+++ /dev/null
@@ -1,119 +0,0 @@
-# src/gallium/targets/libgl-xlib/Makefile
-
-# This makefile produces a "stand-alone" libGL.so which is based on
-# Xlib (no DRI HW acceleration)
-
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-
-GL_MAJOR = 1
-GL_MINOR = 5
-GL_TINY = 0$(MESA_MAJOR)$(MESA_MINOR)0$(MESA_TINY)
-
-
-INCLUDE_DIRS = \
- -I$(TOP)/include \
- -I$(TOP)/src/mapi \
- -I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/drivers \
- -I$(TOP)/src/gallium/state_trackers/glx/xlib \
- -I$(TOP)/src/gallium/auxiliary \
- $(X11_CFLAGS)
-
-DEFINES += \
- -DGALLIUM_SOFTPIPE \
- -DGALLIUM_RBUG \
- -DGALLIUM_TRACE \
- -DGALLIUM_GALAHAD
-#-DGALLIUM_CELL will be defined by the config */
-
-XLIB_TARGET_SOURCES = \
- xlib.c
-
-
-XLIB_TARGET_OBJECTS = $(XLIB_TARGET_SOURCES:.c=.o)
-
-
-# Note: CELL_SPU_LIB is only defined for cell configs
-
-LIBS = \
- $(GALLIUM_DRIVERS) \
- $(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \
- $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a \
- $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
- $(TOP)/src/mapi/glapi/libglapi.a \
- $(TOP)/src/mesa/libmesagallium.a \
- $(GALLIUM_AUXILIARIES) \
- $(CELL_SPU_LIB) \
-
-
-# LLVM
-ifeq ($(MESA_LLVM),1)
-DEFINES += -DGALLIUM_LLVMPIPE
-GL_LIB_DEPS += $(LLVM_LIBS)
-LDFLAGS += $(LLVM_LDFLAGS)
-endif
-
-ifeq ($(SHARED_GLAPI),1)
-GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS)
-endif
-
-
-.SUFFIXES : .cpp
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-.cpp.o:
- $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
-
-
-
-default: $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME)
-
-$(TOP)/$(LIB_DIR)/gallium:
- @ mkdir -p $(TOP)/$(LIB_DIR)/gallium
-
-# Make the libGL.so library
-$(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_TARGET_OBJECTS) $(LIBS) Makefile
- $(TOP)/bin/mklib -o $(GL_LIB) \
- -linker "$(CXX)" -ldflags '$(LDFLAGS)' \
- -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
- -cplusplus \
- -install $(TOP)/$(LIB_DIR)/gallium \
- $(MKLIB_OPTIONS) $(XLIB_TARGET_OBJECTS) \
- -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS)
-
-
-depend: $(XLIB_TARGET_SOURCES)
- @ echo "running $(MKDEP)"
- @ rm -f depend # workaround oops on gutsy?!?
- @ touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(XLIB_TARGET_SOURCES) \
- > /dev/null 2>/dev/null
-
-
-install: default
- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
- $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL
- @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
- $(MINSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
- fi
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
-
-clean:
- -rm -f *.o depend
-
-
-include depend
diff --git a/dist/Mesa/src/gallium/targets/libgl-xlib/SConscript b/dist/Mesa/src/gallium/targets/libgl-xlib/SConscript
index ca15372f1..58ed6d4a3 100644
--- a/dist/Mesa/src/gallium/targets/libgl-xlib/SConscript
+++ b/dist/Mesa/src/gallium/targets/libgl-xlib/SConscript
@@ -10,11 +10,13 @@ env.Append(CPPPATH = [
'#/src/mesa',
'#/src/mesa/main',
'#src/gallium/state_trackers/glx/xlib',
+ Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers
])
env.Append(CPPDEFINES = ['USE_XSHM'])
env.Prepend(LIBS = env['X11_LIBS'])
+env.Prepend(LIBPATH = env['X11_LIBPATH'])
# when GLES is enabled, gl* and _glapi_* belong to bridge_glapi and
# shared_glapi respectively
@@ -42,20 +44,18 @@ if True:
if env['llvm']:
env.Append(CPPDEFINES = ['GALLIUM_LLVMPIPE'])
env.Prepend(LIBS = [llvmpipe])
-
-if False:
- # TODO: Detect Cell SDK
- env.Append(CPPDEFINES = 'GALLIUM_CELL')
- env.Prepend(LIBS = [cell])
-
-# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
-libgl = env.SharedLibrary(
+
+# libGL.so.1.5
+libgl_1_5 = env.SharedLibrary(
target ='GL',
source = sources,
+ SHLIBSUFFIX = env['SHLIBSUFFIX'] + '.1.5',
)
-if True:
- # XXX: Only install this libGL.so if DRI not enabled
- libgl = env.InstallSharedLibrary(libgl, version=(1, 5))
+# libGL.so.1
+libgl = env.subst('${SHLIBPREFIX}GL${SHLIBSUFFIX}')
+libgl_1 = libgl + '.1'
+env.Command(libgl_1, libgl_1_5, "ln -sf ${SOURCE.file} ${TARGET}")
+env.Command(libgl, libgl_1, "ln -sf ${SOURCE.file} ${TARGET}")
env.Alias('libgl-xlib', libgl)
diff --git a/dist/Mesa/src/gallium/targets/libgl-xlib/xlib.c b/dist/Mesa/src/gallium/targets/libgl-xlib/xlib.c
index 1a5892b94..f974b6189 100644
--- a/dist/Mesa/src/gallium/targets/libgl-xlib/xlib.c
+++ b/dist/Mesa/src/gallium/targets/libgl-xlib/xlib.c
@@ -42,7 +42,7 @@
/* Helper function to build a subset of a driver stack consisting of
- * one of the software rasterizers (cell, llvmpipe, softpipe) and the
+ * one of the software rasterizers (llvmpipe, softpipe) and the
* xlib winsys.
*/
static struct pipe_screen *
@@ -114,7 +114,7 @@ extern void (*linker_foo(const unsigned char *procName))()
#ifdef GLX_INDIRECT_RENDERING
#define GL_GLEXT_PROTOTYPES
-#include "GL/gl.h"
+#include "main/glheader.h"
#include "glapi/glapi.h"
#include "glapi/glapitable.h"
diff --git a/dist/Mesa/src/gallium/targets/xorg-i915/Makefile b/dist/Mesa/src/gallium/targets/xorg-i915/Makefile
deleted file mode 100644
index 865240404..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-i915/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = modesetting_drv.so
-
-C_SOURCES = \
- intel_target.c \
- intel_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/winsys/i915/drm/libi915drm.a \
- $(TOP)/src/gallium/drivers/i915/libi915.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 libdrm_intel)
-
-include ../Makefile.xorg
diff --git a/dist/Mesa/src/gallium/targets/xorg-i965/Makefile b/dist/Mesa/src/gallium/targets/xorg-i965/Makefile
deleted file mode 100644
index 494dce41c..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-i965/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = i965g_drv.so
-
-C_SOURCES = \
- intel_target.c \
- intel_xorg.c
-
-DRIVER_DEFINES = \
- -DHAVE_CONFIG_H -DGALLIUM_SOFTPIPE \
- -DGALLIUM_RBUG -DGALLIUM_TRACE
-
-DRIVER_PIPES = \
- $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
- $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
- $(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
-
-DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm libdrm_intel)
-
-include ../Makefile.xorg
diff --git a/dist/Mesa/src/gallium/targets/xorg-i965/intel_target.c b/dist/Mesa/src/gallium/targets/xorg-i965/intel_target.c
deleted file mode 100644
index 0632b97be..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-i965/intel_target.c
+++ /dev/null
@@ -1,29 +0,0 @@
-
-#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;
-
- screen = sw_screen_wrap(screen);
-
- screen = debug_screen_wrap(screen);
-
- return screen;
-}
-
-DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen)
diff --git a/dist/Mesa/src/gallium/targets/xorg-i965/intel_xorg.c b/dist/Mesa/src/gallium/targets/xorg-i965/intel_xorg.c
deleted file mode 100644
index f4608f0eb..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-i965/intel_xorg.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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 <alanh@tungstengraphics.com>
- * Author: Jakob Bornecrantz <wallbraker@gmail.com>
- *
- */
-
-#include "../../state_trackers/xorg/xorg_winsys.h"
-
-static void intel_xorg_identify(int flags);
-static Bool intel_xorg_pci_probe(DriverPtr driver,
- int entity_num,
- struct pci_device *device,
- intptr_t match_data);
-
-static const struct pci_id_match intel_xorg_device_match[] = {
- {0x8086, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0},
- {0, 0, 0},
-};
-
-static SymTabRec intel_xorg_chipsets[] = {
- {PCI_MATCH_ANY, "Intel Graphics Device"},
- {-1, NULL}
-};
-
-static PciChipsets intel_xorg_pci_devices[] = {
- {PCI_MATCH_ANY, PCI_MATCH_ANY, NULL},
- {-1, -1, NULL}
-};
-
-static XF86ModuleVersionInfo intel_xorg_version = {
- "modesetting",
- 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 modesetting = {
- 1,
- "modesetting",
- intel_xorg_identify,
- NULL,
- xorg_tracker_available_options,
- NULL,
- 0,
- NULL,
- intel_xorg_device_match,
- intel_xorg_pci_probe
-};
-
-static MODULESETUPPROTO(intel_xorg_setup);
-
-_X_EXPORT XF86ModuleData modesettingModuleData = {
- &intel_xorg_version,
- intel_xorg_setup,
- NULL
-};
-
-/*
- * Xorg driver functions
- */
-
-static pointer
-intel_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(&modesetting, 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
-intel_xorg_identify(int flags)
-{
- xf86PrintChipsets("modesetting", "Driver for Modesetting Kernel Drivers",
- intel_xorg_chipsets);
-}
-
-static Bool
-intel_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, intel_xorg_pci_devices,
- NULL, NULL, NULL, NULL, NULL);
- if (scrn != NULL) {
- scrn->driverVersion = 1;
- scrn->driverName = "i965";
- scrn->name = "modesetting";
- 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/dist/Mesa/src/gallium/targets/xorg-nouveau/Makefile b/dist/Mesa/src/gallium/targets/xorg-nouveau/Makefile
deleted file mode 100644
index 755969cae..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-nouveau/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = nouveau2_drv.so
-
-C_SOURCES = \
- nouveau_target.c \
- nouveau_xorg.c
-
-DRIVER_DEFINES = \
- -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE
-
-DRIVER_PIPES = \
- $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
- $(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 \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a
-
-DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm libdrm_nouveau)
-
-DRIVER_INCLUDES = \
- $(shell pkg-config --cflags-only-I libdrm libdrm_nouveau xf86driproto)
-
-include ../Makefile.xorg
diff --git a/dist/Mesa/src/gallium/targets/xorg-nouveau/nouveau_xorg.c b/dist/Mesa/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
index 43470a165..2324d2444 100644
--- a/dist/Mesa/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
+++ b/dist/Mesa/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
@@ -29,8 +29,8 @@
*/
#include "../../state_trackers/xorg/xorg_winsys.h"
-#include <nouveau_drmif.h>
-#include <xorg/dri.h>
+#include <nouveau.h>
+#include <dri.h>
#include <xf86drmMode.h>
static void nouveau_xorg_identify(int flags);
@@ -139,7 +139,7 @@ nouveau_xorg_pci_probe(DriverPtr driver,
}
busid = DRICreatePCIBusID(device);
- ret = nouveau_device_open(&dev, busid);
+ ret = nouveau_device_open(busid, &dev);
if (ret) {
xf86DrvMsg(-1, X_ERROR, "[drm] failed to open device\n");
free(busid);
@@ -147,7 +147,7 @@ nouveau_xorg_pci_probe(DriverPtr driver,
}
chipset = dev->chipset;
- nouveau_device_close(&dev);
+ nouveau_device_del(&dev);
ret = drmCheckModesettingSupported(busid);
free(busid);
diff --git a/dist/Mesa/src/gallium/targets/xorg-r300/Makefile b/dist/Mesa/src/gallium/targets/xorg-r300/Makefile
deleted file mode 100644
index 195ab817a..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-r300/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = r300_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/winsys/radeon/drm/libradeonwinsys.a \
- $(TOP)/src/gallium/drivers/r300/libr300.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/dist/Mesa/src/gallium/targets/xorg-r300/target.c b/dist/Mesa/src/gallium/targets/xorg-r300/target.c
deleted file mode 100644
index b48bcad37..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-r300/target.c
+++ /dev/null
@@ -1,26 +0,0 @@
-
-#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;
-}
-
-DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen)
diff --git a/dist/Mesa/src/gallium/targets/xorg-r300/xorg.c b/dist/Mesa/src/gallium/targets/xorg-r300/xorg.c
deleted file mode 100644
index 933bfb8a0..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-r300/xorg.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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 <alanh@tungstengraphics.com>
- * Author: Jakob Bornecrantz <wallbraker@gmail.com>
- * Author: Corbin Simpson <MostAwesomedude@gmail.com>
- *
- */
-
-#include "../../state_trackers/xorg/xorg_winsys.h"
-
-static void r300_xorg_identify(int flags);
-static Bool r300_xorg_pci_probe(DriverPtr driver,
- int entity_num,
- struct pci_device *device,
- intptr_t match_data);
-
-static const struct pci_id_match r300_xorg_device_match[] = {
- {0x1002, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0},
- {0, 0, 0},
-};
-
-static SymTabRec r300_xorg_chipsets[] = {
- {PCI_MATCH_ANY, "ATI R300 Graphics Chipset"},
- {-1, NULL}
-};
-
-static PciChipsets r300_xorg_pci_devices[] = {
- {PCI_MATCH_ANY, PCI_MATCH_ANY, NULL},
- {-1, -1, NULL}
-};
-
-static XF86ModuleVersionInfo r300_xorg_version = {
- "r300",
- 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 r300_driver = {
- 1,
- "r300",
- r300_xorg_identify,
- NULL,
- xorg_tracker_available_options,
- NULL,
- 0,
- NULL,
- r300_xorg_device_match,
- r300_xorg_pci_probe
-};
-
-static MODULESETUPPROTO(r300_xorg_setup);
-
-_X_EXPORT XF86ModuleData r300ModuleData = {
- &r300_xorg_version,
- r300_xorg_setup,
- NULL
-};
-
-/*
- * Xorg driver functions
- */
-
-static pointer
-r300_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(&r300_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
-r300_xorg_identify(int flags)
-{
- xf86PrintChipsets("r300", "Driver for Radeon Gallium with KMS",
- r300_xorg_chipsets);
-}
-
-static Bool
-r300_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, r300_xorg_pci_devices,
- NULL, NULL, NULL, NULL, NULL);
- if (scrn != NULL) {
- scrn->driverVersion = 1;
- scrn->driverName = "r300";
- scrn->name = "r300";
- 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/dist/Mesa/src/gallium/targets/xorg-vmwgfx/Makefile b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/Makefile
deleted file mode 100644
index 04a444f5e..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = vmwgfx_drv.so
-
-C_SOURCES = \
- vmw_xorg.c \
- vmw_video.c \
- vmw_ioctl.c \
- vmw_ctrl.c \
- vmw_target.c \
- vmw_screen.c
-
-DRIVER_INCLUDES = \
- -I$(TOP)/src/gallium
-
-DRIVER_DEFINES = \
- -std=gnu99 \
- -DGALLIUM_RBUG \
- -DGALLIUM_TRACE \
- -DHAVE_CONFIG_H
-
-DRIVER_PIPES = \
- $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
- $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
- $(TOP)/src/gallium/drivers/svga/libsvga.a \
- $(TOP)/src/gallium/drivers/trace/libtrace.a \
- $(TOP)/src/gallium/drivers/rbug/librbug.a
-
-DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm libkms)
-
-include ../Makefile.xorg
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/SConscript b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/SConscript
deleted file mode 100644
index 099d49cf1..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/SConscript
+++ /dev/null
@@ -1,63 +0,0 @@
-import os.path
-
-Import('*')
-
-env = env.Clone()
-
-env.ParseConfig('pkg-config --cflags --libs libdrm xorg-server')
-
-if env['kms']:
- env.ParseConfig('pkg-config --cflags --libs libkms')
-
-env.Prepend(CPPPATH = [
- '#/include',
- '#/src/gallium',
- '#/src/mesa',
- '#/src/gallium/drivers/svga',
- '#/src/gallium/drivers/svga/include',
-])
-
-env.Append(CPPDEFINES = [
-])
-
-if env['gcc']:
- env.Append(CPPDEFINES = [
- 'HAVE_STDINT_H',
- 'HAVE_SYS_TYPES_H',
- ])
-
-env.Append(CFLAGS = [
- '-std=gnu99',
- '-D_FILE_OFFSET_BITS=64',
-])
-
-env.Prepend(LIBPATH = [
-])
-
-env.Prepend(LIBS = [
- trace,
- rbug,
- st_xorg,
- svgadrm,
- svga,
- gallium,
-])
-
-sources = [
- 'vmw_ioctl.c',
- 'vmw_ctrl.c',
- 'vmw_screen.c',
- 'vmw_target.c',
- 'vmw_video.c',
- 'vmw_xorg.c',
-]
-
-# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
-module = env.LoadableModule(
- target ='vmwgfx_drv.so',
- source = sources,
- LIBS = env['LIBS'],
- SHLIBPREFIX = '',
-)
-
-env.Alias('xorg-vmwgfx', module)
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c
deleted file mode 100644
index 9b422e661..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Copyright 2006 by VMware, 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * vmwarectrl.c --
- *
- * The implementation of the VMWARE_CTRL protocol extension that
- * allows X clients to communicate with the driver.
- */
-
-#include <xorg-server.h>
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include <X11/X.h>
-#include <X11/extensions/panoramiXproto.h>
-
-#include "vmw_driver.h"
-#include "vmwarectrlproto.h"
-
-#include "xf86drm.h"
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrlQueryVersion --
- *
- * Implementation of QueryVersion command handler. Initialises and
- * sends a reply.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Writes reply to client
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-VMwareCtrlQueryVersion(ClientPtr client)
-{
- xVMwareCtrlQueryVersionReply rep = { 0, };
- register int n;
-
- REQUEST_SIZE_MATCH(xVMwareCtrlQueryVersionReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = VMWARE_CTRL_MAJOR_VERSION;
- rep.minorVersion = VMWARE_CTRL_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xVMwareCtrlQueryVersionReply), (char *)&rep);
-
- return client->noClientException;
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrlDoSetRes --
- *
- * Set the custom resolution into the mode list.
- *
- * This is done by alternately updating one of two dynamic modes. It is
- * done this way because the server gets upset if you try to switch
- * to a new resolution that has the same index as the current one.
- *
- * Results:
- * TRUE on success, FALSE otherwise.
- *
- * Side effects:
- * One dynamic mode will be updated if successful.
- *
- *----------------------------------------------------------------------------
- */
-
-static Bool
-VMwareCtrlDoSetRes(ScrnInfoPtr pScrn,
- CARD32 x,
- CARD32 y)
-{
- struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
- struct vmw_rect rect;
- rect.x = 0;
- rect.y = 0;
- rect.w = x;
- rect.h = y;
-
- vmw_ioctl_update_layout(vmw, 1, &rect);
-
- return TRUE;
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrlSetRes --
- *
- * Implementation of SetRes command handler. Initialises and sends a
- * reply.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Writes reply to client
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-VMwareCtrlSetRes(ClientPtr client)
-{
- REQUEST(xVMwareCtrlSetResReq);
- xVMwareCtrlSetResReply rep = { 0, };
- ScrnInfoPtr pScrn;
- ExtensionEntry *ext;
- register int n;
-
- REQUEST_SIZE_MATCH(xVMwareCtrlSetResReq);
-
- if (!(ext = CheckExtension(VMWARE_CTRL_PROTOCOL_NAME))) {
- return BadMatch;
- }
-
- pScrn = ext->extPrivate;
- if (pScrn->scrnIndex != stuff->screen) {
- return BadMatch;
- }
-
- if (!VMwareCtrlDoSetRes(pScrn, stuff->x, stuff->y)) {
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = (sizeof(xVMwareCtrlSetResReply) - sizeof(xGenericReply)) >> 2;
- rep.sequenceNumber = client->sequence;
- rep.screen = stuff->screen;
- rep.x = stuff->x;
- rep.y = stuff->y;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.screen, n);
- swapl(&rep.x, n);
- swapl(&rep.y, n);
- }
- WriteToClient(client, sizeof(xVMwareCtrlSetResReply), (char *)&rep);
-
- return client->noClientException;
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrlDoSetTopology --
- *
- * Set the custom topology and set a dynamic mode to the bounding box
- * of the passed topology. If a topology is already pending, then do
- * nothing but do not return failure.
- *
- * Results:
- * TRUE on success, FALSE otherwise.
- *
- * Side effects:
- * One dynamic mode and the pending xinerama state will be updated if
- * successful.
- *
- *----------------------------------------------------------------------------
- */
-
-static Bool
-VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn,
- xXineramaScreenInfo *extents,
- unsigned long number)
-{
- struct vmw_rect *rects;
- struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
- int i;
-
- rects = calloc(number, sizeof(*rects));
- if (!rects)
- return FALSE;
-
- for (i = 0; i < number; i++) {
- rects[i].x = extents[i].x_org;
- rects[i].y = extents[i].y_org;
- rects[i].w = extents[i].width;
- rects[i].h = extents[i].height;
- }
-
- vmw_ioctl_update_layout(vmw, number, rects);
-
- free(rects);
- return TRUE;
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrlSetTopology --
- *
- * Implementation of SetTopology command handler. Initialises and sends a
- * reply.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Writes reply to client
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-VMwareCtrlSetTopology(ClientPtr client)
-{
- REQUEST(xVMwareCtrlSetTopologyReq);
- xVMwareCtrlSetTopologyReply rep = { 0, };
- ScrnInfoPtr pScrn;
- ExtensionEntry *ext;
- register int n;
- xXineramaScreenInfo *extents;
-
- REQUEST_AT_LEAST_SIZE(xVMwareCtrlSetTopologyReq);
-
- if (!(ext = CheckExtension(VMWARE_CTRL_PROTOCOL_NAME))) {
- return BadMatch;
- }
-
- pScrn = ext->extPrivate;
- if (pScrn->scrnIndex != stuff->screen) {
- return BadMatch;
- }
-
- extents = (xXineramaScreenInfo *)(stuff + 1);
- if (!VMwareCtrlDoSetTopology(pScrn, extents, stuff->number)) {
- return BadValue;
- }
-
- rep.type = X_Reply;
- rep.length = (sizeof(xVMwareCtrlSetTopologyReply) - sizeof(xGenericReply)) >> 2;
- rep.sequenceNumber = client->sequence;
- rep.screen = stuff->screen;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.screen, n);
- }
- WriteToClient(client, sizeof(xVMwareCtrlSetTopologyReply), (char *)&rep);
-
- return client->noClientException;
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrlDispatch --
- *
- * Dispatcher for VMWARE_CTRL commands. Calls the correct handler for
- * each command type.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Side effects of individual command handlers.
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-VMwareCtrlDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- switch(stuff->data) {
- case X_VMwareCtrlQueryVersion:
- return VMwareCtrlQueryVersion(client);
- case X_VMwareCtrlSetRes:
- return VMwareCtrlSetRes(client);
- case X_VMwareCtrlSetTopology:
- return VMwareCtrlSetTopology(client);
- }
- return BadRequest;
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * SVMwareCtrlQueryVersion --
- *
- * Wrapper for QueryVersion handler that handles input from other-endian
- * clients.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Side effects of unswapped implementation.
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-SVMwareCtrlQueryVersion(ClientPtr client)
-{
- register int n;
-
- REQUEST(xVMwareCtrlQueryVersionReq);
- REQUEST_SIZE_MATCH(xVMwareCtrlQueryVersionReq);
-
- swaps(&stuff->length, n);
-
- return VMwareCtrlQueryVersion(client);
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * SVMwareCtrlSetRes --
- *
- * Wrapper for SetRes handler that handles input from other-endian
- * clients.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Side effects of unswapped implementation.
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-SVMwareCtrlSetRes(ClientPtr client)
-{
- register int n;
-
- REQUEST(xVMwareCtrlSetResReq);
- REQUEST_SIZE_MATCH(xVMwareCtrlSetResReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->screen, n);
- swapl(&stuff->x, n);
- swapl(&stuff->y, n);
-
- return VMwareCtrlSetRes(client);
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * SVMwareCtrlSetTopology --
- *
- * Wrapper for SetTopology handler that handles input from other-endian
- * clients.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Side effects of unswapped implementation.
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-SVMwareCtrlSetTopology(ClientPtr client)
-{
- register int n;
-
- REQUEST(xVMwareCtrlSetTopologyReq);
- REQUEST_SIZE_MATCH(xVMwareCtrlSetTopologyReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->screen, n);
- swapl(&stuff->number, n);
- /* Each extent is a struct of shorts. */
- SwapRestS(stuff);
-
- return VMwareCtrlSetTopology(client);
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * SVMwareCtrlDispatch --
- *
- * Wrapper for dispatcher that handles input from other-endian clients.
- *
- * Results:
- * Standard response codes.
- *
- * Side effects:
- * Side effects of individual command handlers.
- *
- *----------------------------------------------------------------------------
- */
-
-static int
-SVMwareCtrlDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- switch(stuff->data) {
- case X_VMwareCtrlQueryVersion:
- return SVMwareCtrlQueryVersion(client);
- case X_VMwareCtrlSetRes:
- return SVMwareCtrlSetRes(client);
- case X_VMwareCtrlSetTopology:
- return SVMwareCtrlSetTopology(client);
- }
- return BadRequest;
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrlResetProc --
- *
- * Cleanup handler called when the extension is removed.
- *
- * Results:
- * None
- *
- * Side effects:
- * None
- *
- *----------------------------------------------------------------------------
- */
-
-static void
-VMwareCtrlResetProc(ExtensionEntry* extEntry)
-{
- /* Currently, no cleanup is necessary. */
-}
-
-
-/*
- *----------------------------------------------------------------------------
- *
- * VMwareCtrl_ExitInit --
- *
- * Initialiser for the VMWARE_CTRL protocol extension.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Protocol extension will be registered if successful.
- *
- *----------------------------------------------------------------------------
- */
-
-void
-vmw_ctrl_ext_init(struct vmw_customizer *vmw)
-{
- ExtensionEntry *myext;
- ScrnInfoPtr pScrn = vmw->pScrn;
-
- if (!(myext = CheckExtension(VMWARE_CTRL_PROTOCOL_NAME))) {
- if (!(myext = AddExtension(VMWARE_CTRL_PROTOCOL_NAME, 0, 0,
- VMwareCtrlDispatch,
- SVMwareCtrlDispatch,
- VMwareCtrlResetProc,
- StandardMinorOpcode))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to add VMWARE_CTRL extension\n");
- return;
- }
-
- /*
- * For now, only support one screen as that's all the virtual
- * hardware supports.
- */
- myext->extPrivate = pScrn;
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Initialized VMWARE_CTRL extension version %d.%d\n",
- VMWARE_CTRL_MAJOR_VERSION, VMWARE_CTRL_MINOR_VERSION);
- }
-}
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.h b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.h
deleted file mode 100644
index 65e1cf541..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ctrl.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2006 by VMware, 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * vmw_ctrl.h --
- *
- * The definitions used by the VMWARE_CTRL protocol extension that
- * allows X clients to communicate with the driver.
- */
-
-
-#ifndef _VMW_CTRL_H_
-#define _VMW_CTRL_H_
-
-#define VMWARE_CTRL_PROTOCOL_NAME "VMWARE_CTRL"
-
-#define VMWARE_CTRL_MAJOR_VERSION 0
-#define VMWARE_CTRL_MINOR_VERSION 2
-
-#define X_VMwareCtrlQueryVersion 0
-#define X_VMwareCtrlSetRes 1
-#define X_VMwareCtrlSetTopology 2
-
-#endif /* _VMW_CTRL_H_ */
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_driver.h b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_driver.h
deleted file mode 100644
index 8dfc9d2ef..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_driver.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/**********************************************************
- * Copyright 2009 VMware, Inc. 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, 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.
- *
- **********************************************************/
-
-/**
- * @file
- * Contains the shared resources for VMware Xorg driver
- * that sits ontop of the Xorg State Traker.
- *
- * It is initialized in vmw_screen.c.
- *
- * @author Jakob Bornecrantz <jakob@vmware.com>
- */
-
-#ifndef VMW_DRIVER_H_
-#define VMW_DRIVER_H_
-
-#include "state_trackers/xorg/xorg_tracker.h"
-
-struct vmw_dma_buffer;
-
-struct vmw_rect
-{
- int32_t x;
- int32_t y;
- uint32_t w;
- uint32_t h;
-};
-
-struct vmw_customizer
-{
- CustomizerRec base;
- ScrnInfoPtr pScrn;
-
- int fd;
-
- void *cursor_priv;
-
- /* vmw_video.c */
- void *video_priv;
- uint64_t max_fb_size;
-};
-
-static INLINE struct vmw_customizer *
-vmw_customizer(CustomizerPtr cust)
-{
- return cust ? (struct vmw_customizer *) cust : NULL;
-}
-
-/***********************************************************************
- * vmw_ctrl.c
- */
-
-void vmw_ctrl_ext_init(struct vmw_customizer *vmw);
-
-
-/***********************************************************************
- * vmw_video.c
- */
-
-Bool vmw_video_init(struct vmw_customizer *vmw);
-
-Bool vmw_video_close(struct vmw_customizer *vmw);
-
-void vmw_video_stop_all(struct vmw_customizer *vmw);
-
-
-/***********************************************************************
- * vmw_ioctl.c
- */
-
-int vmw_ioctl_cursor_bypass(struct vmw_customizer *vmw, int xhot, int yhot);
-
-struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_customizer *vmw,
- uint32_t size,
- unsigned *handle);
-
-void * vmw_ioctl_buffer_map(struct vmw_customizer *vmw,
- struct vmw_dma_buffer *buf);
-
-void vmw_ioctl_buffer_unmap(struct vmw_customizer *vmw,
- struct vmw_dma_buffer *buf);
-
-void vmw_ioctl_buffer_destroy(struct vmw_customizer *vmw,
- struct vmw_dma_buffer *buf);
-
-int vmw_ioctl_supports_streams(struct vmw_customizer *vmw);
-
-int vmw_ioctl_num_streams(struct vmw_customizer *vmw,
- uint32_t *ntot, uint32_t *nfree);
-
-int vmw_ioctl_unref_stream(struct vmw_customizer *vmw, uint32_t stream_id);
-
-int vmw_ioctl_claim_stream(struct vmw_customizer *vmw, uint32_t *out);
-
-int vmw_ioctl_update_layout(struct vmw_customizer *vmw, uint32_t num, struct vmw_rect *rects);
-
-
-#endif
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_hook.h b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_hook.h
deleted file mode 100644
index 224a2d929..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_hook.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**********************************************************
- * Copyright 2009 VMware, Inc. 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, 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.
- *
- **********************************************************/
-
-#ifndef VMW_HOOK_H_
-#define VMW_HOOK_H_
-
-#include "state_trackers/xorg/xorg_winsys.h"
-
-
-/***********************************************************************
- * vmw_screen.c
- */
-
-void vmw_screen_set_functions(ScrnInfoPtr pScrn);
-
-
-#endif
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c
deleted file mode 100644
index 7625d2fb8..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/**********************************************************
- * Copyright 2009 VMware, Inc. 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, 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.
- *
- **********************************************************/
-
-/**
- * @file
- * Contains the functions for creating dma buffers by calling
- * the kernel via driver specific ioctls.
- *
- * @author Jakob Bornecrantz <jakob@vmware.com>
- */
-
-#ifndef HAVE_STDINT_H
-#define HAVE_STDINT_H 1
-#endif
-#define _FILE_OFFSET_BITS 64
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <sys/mman.h>
-#include "xf86drm.h"
-#include "../../winsys/svga/drm/vmwgfx_drm.h"
-
-#include "vmw_driver.h"
-#include "util/u_debug.h"
-
-struct vmw_dma_buffer
-{
- void *data;
- unsigned handle;
- uint64_t map_handle;
- unsigned map_count;
- uint32_t size;
-};
-
-static int
-vmw_ioctl_get_param(struct vmw_customizer *vmw, uint32_t param, uint64_t *out)
-{
- struct drm_vmw_getparam_arg gp_arg;
- int ret;
-
- memset(&gp_arg, 0, sizeof(gp_arg));
- gp_arg.param = param;
- ret = drmCommandWriteRead(vmw->fd, DRM_VMW_GET_PARAM,
- &gp_arg, sizeof(gp_arg));
-
- if (ret == 0) {
- *out = gp_arg.value;
- }
-
- return ret;
-}
-
-int
-vmw_ioctl_supports_streams(struct vmw_customizer *vmw)
-{
- uint64_t value;
- int ret;
-
- ret = vmw_ioctl_get_param(vmw, DRM_VMW_PARAM_NUM_STREAMS, &value);
- if (ret)
- return ret;
-
- return value ? 0 : -ENOSYS;
-}
-
-int
-vmw_ioctl_num_streams(struct vmw_customizer *vmw,
- uint32_t *ntot, uint32_t *nfree)
-{
- uint64_t v1, v2;
- int ret;
-
- ret = vmw_ioctl_get_param(vmw, DRM_VMW_PARAM_NUM_STREAMS, &v1);
- if (ret)
- return ret;
-
- ret = vmw_ioctl_get_param(vmw, DRM_VMW_PARAM_NUM_FREE_STREAMS, &v2);
- if (ret)
- return ret;
-
- *ntot = (uint32_t)v1;
- *nfree = (uint32_t)v2;
-
- return 0;
-}
-
-int
-vmw_ioctl_claim_stream(struct vmw_customizer *vmw, uint32_t *out)
-{
- struct drm_vmw_stream_arg s_arg;
- int ret;
-
- ret = drmCommandRead(vmw->fd, DRM_VMW_CLAIM_STREAM,
- &s_arg, sizeof(s_arg));
-
- if (ret)
- return -1;
-
- *out = s_arg.stream_id;
- return 0;
-}
-
-int
-vmw_ioctl_unref_stream(struct vmw_customizer *vmw, uint32_t stream_id)
-{
- struct drm_vmw_stream_arg s_arg;
- int ret;
-
- memset(&s_arg, 0, sizeof(s_arg));
- s_arg.stream_id = stream_id;
-
- ret = drmCommandRead(vmw->fd, DRM_VMW_CLAIM_STREAM,
- &s_arg, sizeof(s_arg));
-
- return 0;
-}
-
-int
-vmw_ioctl_cursor_bypass(struct vmw_customizer *vmw, int xhot, int yhot)
-{
- struct drm_vmw_cursor_bypass_arg arg;
- int ret;
-
- memset(&arg, 0, sizeof(arg));
- arg.flags = DRM_VMW_CURSOR_BYPASS_ALL;
- arg.xhot = xhot;
- arg.yhot = yhot;
-
- ret = drmCommandWrite(vmw->fd, DRM_VMW_CURSOR_BYPASS,
- &arg, sizeof(arg));
-
- return ret;
-}
-
-struct vmw_dma_buffer *
-vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *handle)
-{
- struct vmw_dma_buffer *buf;
- union drm_vmw_alloc_dmabuf_arg arg;
- struct drm_vmw_alloc_dmabuf_req *req = &arg.req;
- struct drm_vmw_dmabuf_rep *rep = &arg.rep;
- int ret;
-
- buf = calloc(1, sizeof(*buf));
- if (!buf)
- goto err;
-
- memset(&arg, 0, sizeof(arg));
- req->size = size;
- do {
- ret = drmCommandWriteRead(vmw->fd, DRM_VMW_ALLOC_DMABUF, &arg, sizeof(arg));
- } while (ret == -ERESTART);
-
- if (ret) {
- debug_printf("IOCTL failed %d: %s\n", ret, strerror(-ret));
- goto err_free;
- }
-
-
- buf->data = NULL;
- buf->handle = rep->handle;
- buf->map_handle = rep->map_handle;
- buf->map_count = 0;
- buf->size = size;
-
- *handle = rep->handle;
-
- return buf;
-
-err_free:
- free(buf);
-err:
- return NULL;
-}
-
-void
-vmw_ioctl_buffer_destroy(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf)
-{
- struct drm_vmw_unref_dmabuf_arg arg;
-
- if (buf->data) {
- munmap(buf->data, buf->size);
- buf->data = NULL;
- }
-
- memset(&arg, 0, sizeof(arg));
- arg.handle = buf->handle;
- drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg));
-
- free(buf);
-}
-
-void *
-vmw_ioctl_buffer_map(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf)
-{
- void *map;
-
- if (buf->data == NULL) {
- map = mmap(NULL, buf->size, PROT_READ | PROT_WRITE, MAP_SHARED,
- vmw->fd, buf->map_handle);
- if (map == MAP_FAILED) {
- debug_printf("%s: Map failed.\n", __FUNCTION__);
- return NULL;
- }
-
- buf->data = map;
- }
-
- ++buf->map_count;
-
- return buf->data;
-}
-
-void
-vmw_ioctl_buffer_unmap(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf)
-{
- --buf->map_count;
-}
-
-int
-vmw_ioctl_update_layout(struct vmw_customizer *vmw, uint32_t num, struct vmw_rect *rects)
-{
- struct drm_vmw_update_layout_arg ul_arg;
- int ret;
-
- assert(sizeof(struct vmw_rect) == sizeof(struct drm_vmw_rect));
-
- memset(&ul_arg, 0, sizeof(ul_arg));
- ul_arg.num_outputs = num;
- ul_arg.rects = (uint64_t)(uintptr_t)rects;
-
- ret = drmCommandWriteRead(vmw->fd, DRM_VMW_UPDATE_LAYOUT,
- &ul_arg, sizeof(ul_arg));
-
- return ret;
-}
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_screen.c b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_screen.c
deleted file mode 100644
index 766220316..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_screen.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/**********************************************************
- * Copyright 2009 VMware, Inc. 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, 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.
- *
- **********************************************************/
-
-/**
- * @file
- * Contains the init code for the VMware Xorg driver.
- *
- * @author Jakob Bornecrantz <jakob@vmware.com>
- */
-
-#include "vmw_hook.h"
-#include "vmw_driver.h"
-#include <pipe/p_context.h>
-
-#include "cursorstr.h"
-#include "../../winsys/svga/drm/vmwgfx_drm.h"
-
-void vmw_winsys_screen_set_throttling(struct pipe_screen *screen,
- uint32_t throttle_us);
-
-
-/* modified version of crtc functions */
-xf86CrtcFuncsRec vmw_screen_crtc_funcs;
-
-static void
-vmw_screen_cursor_load_argb(xf86CrtcPtr crtc, CARD32 *image)
-{
- struct vmw_customizer *vmw =
- vmw_customizer(xorg_customizer(crtc->scrn));
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
- xf86CrtcFuncsPtr funcs = vmw->cursor_priv;
- CursorPtr c = config->cursor;
-
- /* Run the ioctl before uploading the image */
- vmw_ioctl_cursor_bypass(vmw, c->bits->xhot, c->bits->yhot);
-
- funcs->load_cursor_argb(crtc, image);
-}
-
-static void
-vmw_screen_cursor_init(struct vmw_customizer *vmw)
-{
- ScrnInfoPtr pScrn = vmw->pScrn;
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
- int i;
-
- /* XXX assume that all crtc's have the same function struct */
-
- /* Save old struct need to call the old functions as well */
- vmw->cursor_priv = (void*)(config->crtc[0]->funcs);
- memcpy(&vmw_screen_crtc_funcs, vmw->cursor_priv, sizeof(xf86CrtcFuncsRec));
- vmw_screen_crtc_funcs.load_cursor_argb = vmw_screen_cursor_load_argb;
-
- for (i = 0; i < config->num_crtc; i++)
- config->crtc[i]->funcs = &vmw_screen_crtc_funcs;
-}
-
-static void
-vmw_screen_cursor_close(struct vmw_customizer *vmw)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(vmw->pScrn);
- int i;
-
- vmw_ioctl_cursor_bypass(vmw, 0, 0);
-
- for (i = 0; i < config->num_crtc; i++)
- config->crtc[i]->funcs = vmw->cursor_priv;
-}
-
-static void
-vmw_context_throttle(CustomizerPtr cust,
- struct pipe_context *pipe,
- enum xorg_throttling_reason reason)
-{
- switch (reason) {
- case THROTTLE_RENDER:
- vmw_winsys_screen_set_throttling(pipe->screen, 20000);
- break;
- default:
- vmw_winsys_screen_set_throttling(pipe->screen, 0);
- }
-}
-
-static void
-vmw_context_no_throttle(CustomizerPtr cust,
- struct pipe_context *pipe,
- enum xorg_throttling_reason reason)
-{
- vmw_winsys_screen_set_throttling(pipe->screen, 0);
-}
-
-static Bool
-vmw_check_fb_size(CustomizerPtr cust,
- unsigned long pitch,
- unsigned long height)
-{
- struct vmw_customizer *vmw = vmw_customizer(cust);
-
- /**
- * 1) Is there a pitch alignment?
- * 2) The 1024 byte pad is an arbitrary value to be on
- */
-
- return ((uint64_t) pitch * height + 1024ULL < vmw->max_fb_size);
-}
-
-static Bool
-vmw_pre_init(CustomizerPtr cust, int fd)
-{
- struct vmw_customizer *vmw = vmw_customizer(cust);
- drmVersionPtr ver;
-
- vmw->fd = fd;
-
- ver = drmGetVersion(vmw->fd);
- if (ver == NULL ||
- (ver->version_major == 1 && ver->version_minor < 1)) {
- cust->swap_throttling = TRUE;
- cust->dirty_throttling = TRUE;
- cust->winsys_context_throttle = vmw_context_no_throttle;
- } else {
- cust->swap_throttling = TRUE;
- cust->dirty_throttling = FALSE;
- cust->winsys_context_throttle = vmw_context_throttle;
- debug_printf("%s: Enabling kernel throttling.\n", __func__);
-
- if (ver->version_major > 1 ||
- (ver->version_major == 1 && ver->version_minor >= 3)) {
- struct drm_vmw_getparam_arg arg;
- int ret;
-
- arg.param = DRM_VMW_PARAM_MAX_FB_SIZE;
- ret = drmCommandWriteRead(fd, DRM_VMW_GET_PARAM, &arg,
- sizeof(arg));
- if (!ret) {
- vmw->max_fb_size = arg.value;
- cust->winsys_check_fb_size = vmw_check_fb_size;
- debug_printf("%s: Enabling fb size check.\n", __func__);
- }
- }
- }
-
- if (ver)
- drmFreeVersion(ver);
-
- return TRUE;
-}
-
-static Bool
-vmw_screen_init(CustomizerPtr cust)
-{
- struct vmw_customizer *vmw = vmw_customizer(cust);
-
- vmw_screen_cursor_init(vmw);
-
- vmw_ctrl_ext_init(vmw);
-
- /* if gallium is used then we don't need to do anything more. */
- if (xorg_has_gallium(vmw->pScrn))
- return TRUE;
-
- vmw_video_init(vmw);
-
- return TRUE;
-}
-
-static Bool
-vmw_screen_close(CustomizerPtr cust)
-{
- struct vmw_customizer *vmw = vmw_customizer(cust);
-
- if (!vmw)
- return TRUE;
-
- vmw_screen_cursor_close(vmw);
-
- vmw_video_close(vmw);
-
- return TRUE;
-}
-
-static Bool
-vmw_screen_enter_vt(CustomizerPtr cust)
-{
- debug_printf("%s: enter\n", __func__);
-
- return TRUE;
-}
-
-static Bool
-vmw_screen_leave_vt(CustomizerPtr cust)
-{
- struct vmw_customizer *vmw = vmw_customizer(cust);
-
- debug_printf("%s: enter\n", __func__);
-
- vmw_video_stop_all(vmw);
-
- return TRUE;
-}
-
-/*
- * Functions for setting up hooks into the xorg state tracker
- */
-
-static Bool (*vmw_screen_pre_init_saved)(ScrnInfoPtr pScrn, int flags) = NULL;
-
-static Bool
-vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags)
-{
- struct vmw_customizer *vmw;
- CustomizerPtr cust;
-
- vmw = xnfcalloc(1, sizeof(*vmw));
- if (!vmw)
- return FALSE;
-
- cust = &vmw->base;
-
- cust->winsys_pre_init = vmw_pre_init;
- cust->winsys_screen_init = vmw_screen_init;
- cust->winsys_screen_close = vmw_screen_close;
- cust->winsys_enter_vt = vmw_screen_enter_vt;
- cust->winsys_leave_vt = vmw_screen_leave_vt;
- cust->no_3d = TRUE;
- cust->unhidden_hw_cursor_update = TRUE;
- vmw->pScrn = pScrn;
-
- pScrn->driverPrivate = cust;
-
- pScrn->PreInit = vmw_screen_pre_init_saved;
- if (!pScrn->PreInit(pScrn, flags))
- return FALSE;
-
- return TRUE;
-}
-
-void
-vmw_screen_set_functions(ScrnInfoPtr pScrn)
-{
- assert(!vmw_screen_pre_init_saved);
-
- vmw_screen_pre_init_saved = pScrn->PreInit;
- pScrn->PreInit = vmw_screen_pre_init;
-}
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_target.c b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_target.c
deleted file mode 100644
index 15089d6db..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_target.c
+++ /dev/null
@@ -1,26 +0,0 @@
-
-#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/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_video.c b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_video.c
deleted file mode 100644
index 797920999..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_video.c
+++ /dev/null
@@ -1,1089 +0,0 @@
-/*
- * Copyright 2007 by VMware, 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * vmwarevideo.c --
- *
- * Xv extension support.
- * See http://www.xfree86.org/current/DESIGN16.html
- *
- */
-
-
-#include "xf86xv.h"
-#include "fourcc.h"
-
-#include "pipe/p_compiler.h"
-/*
- * We can't incude svga_types.h due to conflicting types for Bool.
- */
-typedef int64_t int64;
-typedef uint64_t uint64;
-
-typedef int32_t int32;
-typedef uint32_t uint32;
-
-typedef int16_t int16;
-typedef uint16_t uint16;
-
-typedef int8_t int8;
-typedef uint8_t uint8;
-
-#include "svga/include/svga_reg.h"
-#include "svga/include/svga_escape.h"
-#include "svga/include/svga_overlay.h"
-
-#include "vmw_driver.h"
-
-#include <X11/extensions/Xv.h>
-
-#include "xf86drm.h"
-#include "../../winsys/svga/drm/vmwgfx_drm.h"
-
-#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
-
-/*
- * Number of videos that can be played simultaneously
- */
-#define VMWARE_VID_NUM_PORTS 1
-
-/*
- * Using a dark shade as the default colorKey
- */
-#define VMWARE_VIDEO_COLORKEY 0x100701
-
-/*
- * Maximum dimensions
- */
-#define VMWARE_VID_MAX_WIDTH 2048
-#define VMWARE_VID_MAX_HEIGHT 2048
-
-#define VMWARE_VID_NUM_ENCODINGS 1
-static XF86VideoEncodingRec vmwareVideoEncodings[] =
-{
- {
- 0,
- "XV_IMAGE",
- VMWARE_VID_MAX_WIDTH, VMWARE_VID_MAX_HEIGHT,
- {1, 1}
- }
-};
-
-#define VMWARE_VID_NUM_FORMATS 2
-static XF86VideoFormatRec vmwareVideoFormats[] =
-{
- { 16, TrueColor},
- { 24, TrueColor}
-};
-
-#define VMWARE_VID_NUM_IMAGES 3
-static XF86ImageRec vmwareVideoImages[] =
-{
- XVIMAGE_YV12,
- XVIMAGE_YUY2,
- XVIMAGE_UYVY
-};
-
-#define VMWARE_VID_NUM_ATTRIBUTES 2
-static XF86AttributeRec vmwareVideoAttributes[] =
-{
- {
- XvGettable | XvSettable,
- 0x000000,
- 0xffffff,
- "XV_COLORKEY"
- },
- {
- XvGettable | XvSettable,
- 0,
- 1,
- "XV_AUTOPAINT_COLORKEY"
- }
-};
-
-/*
- * Video frames are stored in a circular list of buffers.
- * Must be power or two, See vmw_video_port_play.
- */
-#define VMWARE_VID_NUM_BUFFERS 1
-
-/*
- * Defines the structure used to hold and pass video data to the host
- */
-struct vmw_video_buffer
-{
- unsigned handle;
- int size;
- void *data;
- void *extra_data;
- struct vmw_dma_buffer *buf;
-};
-
-
-/**
- * Structure representing a single video stream, aka port.
- *
- * Ports maps one to one to a SVGA stream. Port is just
- * what Xv calls a SVGA stream.
- */
-struct vmw_video_port
-{
- /*
- * Function prototype same as XvPutImage.
- *
- * This is either set to vmw_video_port_init or vmw_video_port_play.
- * At init this function is set to port_init. In port_init we set it
- * to port_play and call it, after initializing the struct.
- */
- int (*play)(ScrnInfoPtr, struct vmw_video_port *,
- short, short, short, short, short,
- short, short, short, int, unsigned char*,
- short, short, RegionPtr);
-
- /* values to go into the SVGAOverlayUnit */
- uint32 streamId;
- uint32 colorKey;
- uint32 flags;
-
- /* round robin of buffers */
- unsigned currBuf;
- struct vmw_video_buffer bufs[VMWARE_VID_NUM_BUFFERS];
-
- /* properties that applies to all buffers */
- int size;
- int pitches[3];
- int offsets[3];
-
- /* things for X */
- RegionRec clipBoxes;
- Bool isAutoPaintColorkey;
-};
-
-
-/**
- * Structure holding all the infromation for video.
- */
-struct vmw_video_private
-{
- int fd;
-
- /** ports */
- struct vmw_video_port port[VMWARE_VID_NUM_PORTS];
-
- /** Used to store port pointers pointers */
- DevUnion port_ptr[VMWARE_VID_NUM_PORTS];
-};
-
-
-/*
- * Callback functions exported to Xv, prefixed with vmw_xv_*.
- */
-static int vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y,
- short drw_x, short drw_y, short src_w, short src_h,
- short drw_w, short drw_h, int image,
- unsigned char *buf, short width, short height,
- Bool sync, RegionPtr clipBoxes, pointer data,
- DrawablePtr dst);
-static void vmw_xv_stop_video(ScrnInfoPtr pScrn, pointer data, Bool Cleanup);
-static int vmw_xv_query_image_attributes(ScrnInfoPtr pScrn, int format,
- unsigned short *width,
- unsigned short *height, int *pitches,
- int *offsets);
-static int vmw_xv_set_port_attribute(ScrnInfoPtr pScrn, Atom attribute,
- INT32 value, pointer data);
-static int vmw_xv_get_port_attribute(ScrnInfoPtr pScrn, Atom attribute,
- INT32 *value, pointer data);
-static void vmw_xv_query_best_size(ScrnInfoPtr pScrn, Bool motion,
- short vid_w, short vid_h, short drw_w,
- short drw_h, unsigned int *p_w,
- unsigned int *p_h, pointer data);
-
-
-/*
- * Local functions.
- */
-static XF86VideoAdaptorPtr vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw);
-
-static int vmw_video_port_init(ScrnInfoPtr pScrn,
- struct vmw_video_port *port,
- short src_x, short src_y, short drw_x,
- short drw_y, short src_w, short src_h,
- short drw_w, short drw_h, int format,
- unsigned char *buf, short width,
- short height, RegionPtr clipBoxes);
-static int vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port,
- short src_x, short src_y, short drw_x,
- short drw_y, short src_w, short src_h,
- short drw_w, short drw_h, int format,
- unsigned char *buf, short width,
- short height, RegionPtr clipBoxes);
-static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmw_video_port *port);
-
-static int vmw_video_buffer_alloc(struct vmw_customizer *vmw, int size,
- struct vmw_video_buffer *out);
-static int vmw_video_buffer_free(struct vmw_customizer *vmw,
- struct vmw_video_buffer *out);
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_init --
- *
- * Initializes Xv support.
- *
- * Results:
- * TRUE on success, FALSE on error.
- *
- * Side effects:
- * Xv support is initialized. Memory is allocated for all supported
- * video streams.
- *
- *-----------------------------------------------------------------------------
- */
-
-Bool
-vmw_video_init(struct vmw_customizer *vmw)
-{
- ScrnInfoPtr pScrn = vmw->pScrn;
- ScreenPtr pScreen = pScrn->pScreen;
- XF86VideoAdaptorPtr *overlayAdaptors, *newAdaptors = NULL;
- XF86VideoAdaptorPtr newAdaptor = NULL;
- int numAdaptors;
- unsigned int ntot, nfree;
-
- debug_printf("%s: enter\n", __func__);
-
- if (vmw_ioctl_num_streams(vmw, &ntot, &nfree) != 0) {
- debug_printf("No stream ioctl support\n");
- return FALSE;
- }
-
- if (nfree == 0) {
- debug_printf("No free streams\n");
- return FALSE;
- }
-
- numAdaptors = xf86XVListGenericAdaptors(pScrn, &overlayAdaptors);
-
- newAdaptor = vmw_video_init_adaptor(pScrn, vmw);
- if (!newAdaptor) {
- debug_printf("Failed to initialize Xv extension\n");
- return FALSE;
- }
-
- if (!numAdaptors) {
- numAdaptors = 1;
- overlayAdaptors = &newAdaptor;
- } else {
- newAdaptors = malloc((numAdaptors + 1) *
- sizeof(XF86VideoAdaptorPtr*));
- if (!newAdaptors) {
- xf86XVFreeVideoAdaptorRec(newAdaptor);
- return FALSE;
- }
-
- memcpy(newAdaptors, overlayAdaptors,
- numAdaptors * sizeof(XF86VideoAdaptorPtr));
- newAdaptors[numAdaptors++] = newAdaptor;
- overlayAdaptors = newAdaptors;
- }
-
- if (!xf86XVScreenInit(pScreen, overlayAdaptors, numAdaptors)) {
- debug_printf("Failed to initialize Xv extension\n");
- xf86XVFreeVideoAdaptorRec(newAdaptor);
- return FALSE;
- }
-
- if (newAdaptors) {
- free(newAdaptors);
- }
-
- debug_printf("Initialized VMware Xv extension successfully\n");
-
- return TRUE;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_close --
- *
- * Unitializes video.
- *
- * Results:
- * TRUE.
- *
- * Side effects:
- * vmw->video_priv = NULL
- *
- *-----------------------------------------------------------------------------
- */
-
-Bool
-vmw_video_close(struct vmw_customizer *vmw)
-{
- ScrnInfoPtr pScrn = vmw->pScrn;
- struct vmw_video_private *video;
- int i;
-
- debug_printf("%s: enter\n", __func__);
-
- video = vmw->video_priv;
- if (!video)
- return TRUE;
-
- for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) {
- /* make sure the port is stoped as well */
- vmw_xv_stop_video(pScrn, &video->port[i], TRUE);
- vmw_ioctl_unref_stream(vmw, video->port[i].streamId);
- REGION_UNINIT(pScreen, &video->port[i].clipBoxes);
- }
-
-
- /* XXX: I'm sure this function is missing code for turning off Xv */
-
- free(vmw->video_priv);
- vmw->video_priv = NULL;
-
- return TRUE;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_stop_all --
- *
- * Stop all video streams from playing.
- *
- * Results:
- * None.
- *
- * Side effects:
- * All buffers are freed.
- *
- *-----------------------------------------------------------------------------
- */
-
-void vmw_video_stop_all(struct vmw_customizer *vmw)
-{
- ScrnInfoPtr pScrn = vmw->pScrn;
- struct vmw_video_private *video = vmw->video_priv;
- int i;
-
- debug_printf("%s: enter\n", __func__);
-
- if (!video)
- return;
-
- for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) {
- vmw_xv_stop_video(pScrn, &video->port[i], TRUE);
- }
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_init_adaptor --
- *
- * Initializes a XF86VideoAdaptor structure with the capabilities and
- * functions supported by this video driver.
- *
- * Results:
- * On success initialized XF86VideoAdaptor struct or NULL on error
- *
- * Side effects:
- * None.
- *
- *-----------------------------------------------------------------------------
- */
-
-static XF86VideoAdaptorPtr
-vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw)
-{
- XF86VideoAdaptorPtr adaptor;
- struct vmw_video_private *video;
- int i;
-
- debug_printf("%s: enter \n", __func__);
-
- adaptor = xf86XVAllocateVideoAdaptorRec(pScrn);
- if (!adaptor) {
- debug_printf("Not enough memory\n");
- return NULL;
- }
-
- video = calloc(1, sizeof(*video));
- if (!video) {
- debug_printf("Not enough memory.\n");
- xf86XVFreeVideoAdaptorRec(adaptor);
- return NULL;
- }
-
- vmw->video_priv = video;
-
- adaptor->type = XvInputMask | XvImageMask | XvWindowMask;
-
- /**
- * Note: CLIP_TO_VIEWPORT was removed from the flags, since with the
- * crtc/output based modesetting, the viewport is not updated on
- * RandR modeswitches. Hence the video may incorrectly be clipped away.
- * The correct approach, (if needed) would be to clip against the
- * scanout area union of all active crtcs. Revisit if needed.
- */
-
- adaptor->flags = VIDEO_OVERLAID_IMAGES;
- adaptor->name = "VMware Video Engine";
- adaptor->nEncodings = VMWARE_VID_NUM_ENCODINGS;
- adaptor->pEncodings = vmwareVideoEncodings;
- adaptor->nFormats = VMWARE_VID_NUM_FORMATS;
- adaptor->pFormats = vmwareVideoFormats;
- adaptor->nPorts = VMWARE_VID_NUM_PORTS;
- adaptor->pPortPrivates = video->port_ptr;
-
- for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) {
- vmw_ioctl_claim_stream(vmw, &video->port[i].streamId);
- video->port[i].play = vmw_video_port_init;
- video->port[i].flags = SVGA_VIDEO_FLAG_COLORKEY;
- video->port[i].colorKey = VMWARE_VIDEO_COLORKEY;
- video->port[i].isAutoPaintColorkey = TRUE;
- REGION_NULL(pScrn->pScreen, &video->port[i].clipBoxes);
- adaptor->pPortPrivates[i].ptr = &video->port[i];
- }
-
- adaptor->nAttributes = VMWARE_VID_NUM_ATTRIBUTES;
- adaptor->pAttributes = vmwareVideoAttributes;
-
- adaptor->nImages = VMWARE_VID_NUM_IMAGES;
- adaptor->pImages = vmwareVideoImages;
-
- adaptor->PutVideo = NULL;
- adaptor->PutStill = NULL;
- adaptor->GetVideo = NULL;
- adaptor->GetStill = NULL;
- adaptor->StopVideo = vmw_xv_stop_video;
- adaptor->SetPortAttribute = vmw_xv_set_port_attribute;
- adaptor->GetPortAttribute = vmw_xv_get_port_attribute;
- adaptor->QueryBestSize = vmw_xv_query_best_size;
- adaptor->PutImage = vmw_xv_put_image;
- adaptor->QueryImageAttributes = vmw_xv_query_image_attributes;
-
- debug_printf("%s: done %p\n", __func__, adaptor);
-
- return adaptor;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_port_init --
- *
- * Initializes a video stream in response to the first PutImage() on a
- * video stream. The process goes as follows:
- * - Figure out characteristics according to format
- * - Allocate offscreen memory
- * - Pass on video to Play() functions
- *
- * Results:
- * Success or XvBadAlloc on failure.
- *
- * Side effects:
- * Video stream is initialized and its first frame sent to the host
- * (done by VideoPlay() function called at the end)
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_video_port_init(ScrnInfoPtr pScrn, struct vmw_video_port *port,
- short src_x, short src_y, short drw_x,
- short drw_y, short src_w, short src_h,
- short drw_w, short drw_h, int format,
- unsigned char *buf, short width,
- short height, RegionPtr clipBoxes)
-{
- struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
- unsigned short w, h;
- int i, ret;
-
- debug_printf("\t%s: id %d, format %d\n", __func__, port->streamId, format);
-
- w = width;
- h = height;
- /* init all the format attributes, used for buffers */
- port->size = vmw_xv_query_image_attributes(pScrn, format, &w, &h,
- port->pitches, port->offsets);
-
- if (port->size == -1)
- return XvBadAlloc;
-
- port->play = vmw_video_port_play;
-
- for (i = 0; i < VMWARE_VID_NUM_BUFFERS; ++i) {
- ret = vmw_video_buffer_alloc(vmw, port->size, &port->bufs[i]);
- if (ret != Success)
- break;
- }
-
- /* Free all allocated buffers on failure */
- if (ret != Success) {
- for (--i; i >= 0; --i) {
- vmw_video_buffer_free(vmw, &port->bufs[i]);
- }
- return ret;
- }
-
- port->currBuf = 0;
-
- REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
-
- if (port->isAutoPaintColorkey)
- xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
-
- xorg_flush(pScrn->pScreen);
-
- return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h,
- drw_w, drw_h, format, buf, width, height, clipBoxes);
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_port_play --
- *
- * Sends all the attributes associated with the video frame using the
- * FIFO ESCAPE mechanism to the host.
- *
- * Results:
- * Always returns Success.
- *
- * Side effects:
- * None.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port,
- short src_x, short src_y, short drw_x,
- short drw_y, short src_w, short src_h,
- short drw_w, short drw_h, int format,
- unsigned char *buf, short width,
- short height, RegionPtr clipBoxes)
-{
- struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
- struct drm_vmw_control_stream_arg arg;
- unsigned short w, h;
- int size;
- int ret;
-
- debug_printf("\t%s: enter\n", __func__);
-
- w = width;
- h = height;
-
- /* we don't update the ports size */
- size = vmw_xv_query_image_attributes(pScrn, format, &w, &h,
- port->pitches, port->offsets);
-
- if (size > port->size) {
- debug_printf("\t%s: Increase in size of Xv video frame streamId:%d.\n",
- __func__, port->streamId);
- vmw_xv_stop_video(pScrn, port, TRUE);
- return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w,
- src_h, drw_w, drw_h, format, buf, width, height,
- clipBoxes);
- }
-
- memcpy(port->bufs[port->currBuf].data, buf, port->size);
-
- memset(&arg, 0, sizeof(arg));
-
- arg.stream_id = port->streamId;
- arg.enabled = TRUE;
- arg.flags = port->flags;
- arg.color_key = port->colorKey;
- arg.handle = port->bufs[port->currBuf].handle;
- arg.format = format;
- arg.size = port->size;
- arg.width = w;
- arg.height = h;
- arg.src.x = src_x;
- arg.src.y = src_y;
- arg.src.w = src_w;
- arg.src.h = src_h;
- arg.dst.x = drw_x;
- arg.dst.y = drw_y;
- arg.dst.w = drw_w;
- arg.dst.h = drw_h;
- arg.pitch[0] = port->pitches[0];
- arg.pitch[1] = port->pitches[1];
- arg.pitch[2] = port->pitches[2];
- arg.offset = 0;
-
- /*
- * Update the clipList and paint the colorkey, if required.
- */
- if (!REGION_EQUAL(pScrn->pScreen, &port->clipBoxes, clipBoxes)) {
- REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
- if (port->isAutoPaintColorkey)
- xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
- }
-
- xorg_flush(pScrn->pScreen);
-
- ret = drmCommandWrite(vmw->fd, DRM_VMW_CONTROL_STREAM, &arg, sizeof(arg));
- if (ret) {
- vmw_video_port_cleanup(pScrn, port);
- return XvBadAlloc;
- }
-
- if (++(port->currBuf) >= VMWARE_VID_NUM_BUFFERS)
- port->currBuf = 0;
-
- return Success;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_port_cleanup --
- *
- * Frees up all resources (if any) taken by a video stream.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Same as above.
- *
- *-----------------------------------------------------------------------------
- */
-
-static void
-vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmw_video_port *port)
-{
- struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
- uint32 id, colorKey, flags;
- Bool isAutoPaintColorkey;
- int i;
-
- debug_printf("\t%s: enter\n", __func__);
-
- for (i = 0; i < VMWARE_VID_NUM_BUFFERS; i++) {
- vmw_video_buffer_free(vmw, &port->bufs[i]);
- }
-
- /*
- * reset stream for next video
- */
- id = port->streamId;
- colorKey = port->colorKey;
- flags = port->flags;
- isAutoPaintColorkey = port->isAutoPaintColorkey;
-
- memset(port, 0, sizeof(*port));
-
- port->streamId = id;
- port->play = vmw_video_port_init;
- port->colorKey = colorKey;
- port->flags = flags;
- port->isAutoPaintColorkey = isAutoPaintColorkey;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_buffer_alloc --
- *
- * Allocates and map a kernel buffer to be used as data storage.
- *
- * Results:
- * XvBadAlloc on failure, otherwise Success.
- *
- * Side effects:
- * Calls into the kernel, sets members of out.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_video_buffer_alloc(struct vmw_customizer *vmw, int size,
- struct vmw_video_buffer *out)
-{
- out->buf = vmw_ioctl_buffer_create(vmw, size, &out->handle);
- if (!out->buf)
- return XvBadAlloc;
-
- out->data = vmw_ioctl_buffer_map(vmw, out->buf);
- if (!out->data) {
- vmw_ioctl_buffer_destroy(vmw, out->buf);
-
- out->handle = 0;
- out->buf = NULL;
-
- return XvBadAlloc;
- }
-
- out->size = size;
- out->extra_data = calloc(1, size);
-
- debug_printf("\t\t%s: allocated buffer %p of size %i\n", __func__, out, size);
-
- return Success;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_video_buffer_free --
- *
- * Frees and unmaps an allocated kernel buffer.
- *
- * Results:
- * Success.
- *
- * Side effects:
- * Calls into the kernel, sets members of out to 0.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_video_buffer_free(struct vmw_customizer *vmw,
- struct vmw_video_buffer *out)
-{
- if (out->size == 0)
- return Success;
-
- free(out->extra_data);
- vmw_ioctl_buffer_unmap(vmw, out->buf);
- vmw_ioctl_buffer_destroy(vmw, out->buf);
-
- out->buf = NULL;
- out->data = NULL;
- out->handle = 0;
- out->size = 0;
-
- debug_printf("\t\t%s: freed buffer %p\n", __func__, out);
-
- return Success;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_xv_put_image --
- *
- * Main video playback function. It copies the passed data which is in
- * the specified format (e.g. FOURCC_YV12) into the overlay.
- *
- * If sync is TRUE the driver should not return from this
- * function until it is through reading the data from buf.
- *
- * Results:
- * Success or XvBadAlloc on failure
- *
- * Side effects:
- * Video port will be played(initialized if 1st frame) on success
- * or will fail on error.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y,
- short drw_x, short drw_y, short src_w, short src_h,
- short drw_w, short drw_h, int format,
- unsigned char *buf, short width, short height,
- Bool sync, RegionPtr clipBoxes, pointer data,
- DrawablePtr dst)
-{
- struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
- struct vmw_video_port *port = data;
-
- debug_printf("%s: enter (%u, %u) (%ux%u) (%u, %u) (%ux%u) (%ux%u)\n", __func__,
- src_x, src_y, src_w, src_h,
- drw_x, drw_y, drw_w, drw_h,
- width, height);
-
- if (!vmw->video_priv)
- return XvBadAlloc;
-
- return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h,
- drw_w, drw_h, format, buf, width, height, clipBoxes);
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_xv_stop_video --
- *
- * Called when we should stop playing video for a particular stream. If
- * Cleanup is FALSE, the "stop" operation is only temporary, and thus we
- * don't do anything. If Cleanup is TRUE we kill the video port by
- * sending a message to the host and freeing up the stream.
- *
- * Results:
- * None.
- *
- * Side effects:
- * See above.
- *
- *-----------------------------------------------------------------------------
- */
-
-static void
-vmw_xv_stop_video(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
-{
- struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn));
- struct vmw_video_port *port = data;
- struct drm_vmw_control_stream_arg arg;
- int ret;
-
- debug_printf("%s: cleanup is %s\n", __func__, cleanup ? "TRUE" : "FALSE");
-
- if (!vmw->video_priv)
- return;
-
- REGION_EMPTY(pScrn->pScreen, &port->clipBoxes);
-
- if (!cleanup)
- return;
-
-
- memset(&arg, 0, sizeof(arg));
- arg.stream_id = port->streamId;
- arg.enabled = FALSE;
-
- ret = drmCommandWrite(vmw->fd, DRM_VMW_CONTROL_STREAM, &arg, sizeof(arg));
- assert(ret == 0);
-
- vmw_video_port_cleanup(pScrn, port);
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_xv_query_image_attributes --
- *
- * From the spec: This function is called to let the driver specify how data
- * for a particular image of size width by height should be stored.
- * Sometimes only the size and corrected width and height are needed. In
- * that case pitches and offsets are NULL.
- *
- * Results:
- * The size of the memory required for the image, or -1 on error.
- *
- * Side effects:
- * None.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_xv_query_image_attributes(ScrnInfoPtr pScrn, int format,
- unsigned short *width, unsigned short *height,
- int *pitches, int *offsets)
-{
- INT32 size, tmp;
-
- if (*width > VMWARE_VID_MAX_WIDTH) {
- *width = VMWARE_VID_MAX_WIDTH;
- }
- if (*height > VMWARE_VID_MAX_HEIGHT) {
- *height = VMWARE_VID_MAX_HEIGHT;
- }
-
- *width = (*width + 1) & ~1;
- if (offsets != NULL) {
- offsets[0] = 0;
- }
-
- switch (format) {
- case FOURCC_YV12:
- *height = (*height + 1) & ~1;
- size = (*width + 3) & ~3;
- if (pitches) {
- pitches[0] = size;
- }
- size *= *height;
- if (offsets) {
- offsets[1] = size;
- }
- tmp = ((*width >> 1) + 3) & ~3;
- if (pitches) {
- pitches[1] = pitches[2] = tmp;
- }
- tmp *= (*height >> 1);
- size += tmp;
- if (offsets) {
- offsets[2] = size;
- }
- size += tmp;
- break;
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- size = *width * 2;
- if (pitches) {
- pitches[0] = size;
- }
- size *= *height;
- break;
- default:
- debug_printf("Query for invalid video format %d\n", format);
- return -1;
- }
- return size;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_xv_set_port_attribute --
- *
- * From the spec: A port may have particular attributes such as colorKey, hue,
- * saturation, brightness or contrast. Xv clients set these
- * attribute values by sending attribute strings (Atoms) to the server.
- *
- * Results:
- * Success if the attribute exists and XvBadAlloc otherwise.
- *
- * Side effects:
- * The respective attribute gets the new value.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_xv_set_port_attribute(ScrnInfoPtr pScrn, Atom attribute,
- INT32 value, pointer data)
-{
- struct vmw_video_port *port = data;
- Atom xvColorKey = MAKE_ATOM("XV_COLORKEY");
- Atom xvAutoPaint = MAKE_ATOM("XV_AUTOPAINT_COLORKEY");
-
- if (attribute == xvColorKey) {
- debug_printf("%s: Set colorkey:0x%x\n", __func__, (unsigned)value);
- port->colorKey = value;
- } else if (attribute == xvAutoPaint) {
- debug_printf("%s: Set autoPaint: %s\n", __func__, value? "TRUE": "FALSE");
- port->isAutoPaintColorkey = value;
- } else {
- return XvBadAlloc;
- }
-
- return Success;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_xv_get_port_attribute --
- *
- * From the spec: A port may have particular attributes such as hue,
- * saturation, brightness or contrast. Xv clients get these
- * attribute values by sending attribute strings (Atoms) to the server
- *
- * Results:
- * Success if the attribute exists and XvBadAlloc otherwise.
- *
- * Side effects:
- * "value" contains the requested attribute on success.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-vmw_xv_get_port_attribute(ScrnInfoPtr pScrn, Atom attribute,
- INT32 *value, pointer data)
-{
- struct vmw_video_port *port = data;
- Atom xvColorKey = MAKE_ATOM("XV_COLORKEY");
- Atom xvAutoPaint = MAKE_ATOM("XV_AUTOPAINT_COLORKEY");
-
- if (attribute == xvColorKey) {
- *value = port->colorKey;
- } else if (attribute == xvAutoPaint) {
- *value = port->isAutoPaintColorkey;
- } else {
- return XvBadAlloc;
- }
-
- return Success;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * vmw_xv_query_best_size --
- *
- * From the spec: QueryBestSize provides the client with a way to query what
- * the destination dimensions would end up being if they were to request
- * that an area vid_w by vid_h from the video stream be scaled to rectangle
- * of drw_w by drw_h on the screen. Since it is not expected that all
- * hardware will be able to get the target dimensions exactly, it is
- * important that the driver provide this function.
- *
- * This function seems to never be called, but to be on the safe side
- * we apply the same logic that QueryImageAttributes has for width
- * and height.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *-----------------------------------------------------------------------------
- */
-
-static void
-vmw_xv_query_best_size(ScrnInfoPtr pScrn, Bool motion,
- short vid_w, short vid_h, short drw_w,
- short drw_h, unsigned int *p_w,
- unsigned int *p_h, pointer data)
-{
- *p_w = (drw_w + 1) & ~1;
- *p_h = drw_h;
-
- return;
-}
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_xorg.c b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_xorg.c
deleted file mode 100644
index 87aad25b2..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmw_xorg.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/**********************************************************
- * Copyright 2008-2009 VMware, Inc. 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, 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.
- *
- **********************************************************/
-
-/**
- * @file
- * Glue file for Xorg State Tracker.
- *
- * @author Alan Hourihane <alanh@tungstengraphics.com>
- * @author Jakob Bornecrantz <wallbraker@gmail.com>
- */
-
-#include "vmw_hook.h"
-
-
-/*
- * Defines and modinfo
- */
-
-#define VMWGFX_DRIVER_NAME "vmwgfx"
-
-#define VMW_STRING_INNER(s) #s
-#define VMW_STRING(str) VMW_STRING_INNER(str)
-
-#define VMWGFX_VERSION_MAJOR 11
-#define VMWGFX_VERSION_MINOR 0
-#define VMWGFX_VERSION_PATCH 0
-#define VMWGFX_VERSION_STRING_MAJOR VMW_STRING(VMWGFX_VERSION_MAJOR)
-#define VMWGFX_VERSION_STRING_MINOR VMW_STRING(VMWGFX_VERSION_MINOR)
-#define VMWGFX_VERSION_STRING_PATCH VMW_STRING(VMWGFX_VERSION_PATCH)
-
-#define VMWGFX_DRIVER_VERSION \
- (VMWGFX_VERSION_MAJOR * 65536 + VMWGFX_VERSION_MINOR * 256 + VMWGFX_VERSION_PATCH)
-#define VMWGFX_DRIVER_VERSION_STRING \
- VMWGFX_VERSION_STRING_MAJOR "." VMWGFX_VERSION_STRING_MINOR \
- "." VMWGFX_VERSION_STRING_PATCH
-
-/*
- * Standard four digit version string expected by VMware Tools installer.
- * As the driver's version is only {major, minor, patchlevel}, simply append an
- * extra zero for the fourth digit.
- */
-#ifdef __GNUC__
-_X_EXPORT const char vmwgfx_drv_modinfo[] __attribute__((section(".modinfo"),unused)) =
- "version=" VMWGFX_DRIVER_VERSION_STRING ".0";
-#endif
-
-static void vmw_xorg_identify(int flags);
-_X_EXPORT Bool vmw_xorg_pci_probe(DriverPtr driver,
- int entity_num,
- struct pci_device *device,
- intptr_t match_data);
-
-
-/*
- * Tables
- */
-
-static const struct pci_id_match vmw_xorg_device_match[] = {
- {0x15ad, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0},
-};
-
-static SymTabRec vmw_xorg_chipsets[] = {
- {PCI_MATCH_ANY, "VMware SVGA Device"},
- {-1, NULL}
-};
-
-static PciChipsets vmw_xorg_pci_devices[] = {
- {PCI_MATCH_ANY, PCI_MATCH_ANY, NULL},
- {-1, -1, NULL}
-};
-
-static XF86ModuleVersionInfo vmw_xorg_version = {
- VMWGFX_DRIVER_NAME,
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- VMWGFX_VERSION_MAJOR, VMWGFX_VERSION_MINOR, VMWGFX_VERSION_PATCH,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_VIDEODRV,
- {0, 0, 0, 0}
-};
-
-/*
- * Xorg driver exported structures
- */
-
-_X_EXPORT DriverRec vmwgfx = {
- 1,
- VMWGFX_DRIVER_NAME,
- vmw_xorg_identify,
- NULL,
- xorg_tracker_available_options,
- NULL,
- 0,
- NULL,
- vmw_xorg_device_match,
- vmw_xorg_pci_probe
-};
-
-static MODULESETUPPROTO(vmw_xorg_setup);
-
-_X_EXPORT XF86ModuleData vmwgfxModuleData = {
- &vmw_xorg_version,
- vmw_xorg_setup,
- NULL
-};
-
-
-/*
- * Xorg driver functions
- */
-
-static pointer
-vmw_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(&vmwgfx, 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
-vmw_xorg_identify(int flags)
-{
- xf86PrintChipsets("vmwgfx", "Driver for VMware SVGA device",
- vmw_xorg_chipsets);
-}
-
-_X_EXPORT Bool
-vmw_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, vmw_xorg_pci_devices,
- NULL, NULL, NULL, NULL, NULL);
- if (scrn != NULL) {
- scrn->driverVersion = 1;
- scrn->driverName = "vmwgfx";
- scrn->name = "vmwgfx";
- scrn->Probe = NULL;
-
- entity = xf86GetEntityInfo(entity_num);
-
- /* Use all the functions from the xorg tracker */
- xorg_tracker_set_functions(scrn);
-
- vmw_screen_set_functions(scrn);
- }
- return scrn != NULL;
-}
diff --git a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmwarectrlproto.h b/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmwarectrlproto.h
deleted file mode 100644
index 269e10b64..000000000
--- a/dist/Mesa/src/gallium/targets/xorg-vmwgfx/vmwarectrlproto.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2006 by VMware, 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * vmwarectrlproto.h --
- *
- * The description of the VMWARE_CTRL protocol extension that
- * allows X clients to communicate with the driver.
- */
-
-#ifndef _VMWARE_CTRL_PROTO_H_
-#define _VMWARE_CTRL_PROTO_H_
-
-
-#include <X11/X.h>
-#include "vmw_ctrl.h"
-
-
-/*
- * Requests and Replies
- */
-
-/* Version 0.1 definitions. */
-
-typedef struct {
- CARD8 reqType; /* always X_VMwareCtrlReqCode */
- CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlQueryVersion */
- CARD16 length B16;
- CARD32 majorVersion B32;
- CARD32 minorVersion B32;
-} xVMwareCtrlQueryVersionReq;
-#define sz_xVMwareCtrlQueryVersionReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 majorVersion B32;
- CARD32 minorVersion B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-} xVMwareCtrlQueryVersionReply;
-#define sz_xVMwareCtrlQueryVersionReply 32
-
-typedef struct {
- CARD8 reqType; /* always X_VMwareCtrlReqCode */
- CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlSetRes */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 x B32;
- CARD32 y B32;
-} xVMwareCtrlSetResReq;
-#define sz_xVMwareCtrlSetResReq 16
-
-typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 screen B32;
- CARD32 x B32;
- CARD32 y B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
-} xVMwareCtrlSetResReply;
-#define sz_xVMwareCtrlSetResReply 32
-
-/* Version 0.2 definitions. */
-
-typedef struct {
- CARD8 reqType; /* always X_VMwareCtrlReqCode */
- CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlSetTopology */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 number B32;
- CARD32 pad1 B32;
-} xVMwareCtrlSetTopologyReq;
-#define sz_xVMwareCtrlSetTopologyReq 16
-
-typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 screen B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xVMwareCtrlSetTopologyReply;
-#define sz_xVMwareCtrlSetTopologyReply 32
-
-#endif /* _VMWARE_CTRL_PROTO_H_ */