summaryrefslogtreecommitdiff
path: root/src/VBox/Additions/x11/vboxvideo
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Additions/x11/vboxvideo
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Additions/x11/vboxvideo')
-rw-r--r--src/VBox/Additions/x11/vboxvideo/Makefile.kmk211
-rw-r--r--src/VBox/Additions/x11/vboxvideo/edid.c2
-rw-r--r--src/VBox/Additions/x11/vboxvideo/pointer.c2
-rw-r--r--src/VBox/Additions/x11/vboxvideo/setmode.c11
-rw-r--r--src/VBox/Additions/x11/vboxvideo/undefined65
-rw-r--r--src/VBox/Additions/x11/vboxvideo/undefined_extra19
-rw-r--r--src/VBox/Additions/x11/vboxvideo/vboxutils.c11
-rw-r--r--src/VBox/Additions/x11/vboxvideo/vboxvideo.c34
-rw-r--r--src/VBox/Additions/x11/vboxvideo/vboxvideo.h18
-rw-r--r--src/VBox/Additions/x11/vboxvideo/vboxvideo_dri.c21
-rw-r--r--src/VBox/Additions/x11/vboxvideo/vboxvideo_dri2.c62
-rw-r--r--src/VBox/Additions/x11/vboxvideo/vbva.c2
12 files changed, 261 insertions, 197 deletions
diff --git a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
index 59d9c923..67c53486 100644
--- a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
+++ b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
@@ -4,7 +4,7 @@
#
#
-# Copyright (C) 2006-2012 Oracle Corporation
+# Copyright (C) 2006-2013 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
@@ -32,8 +32,13 @@ ifeq ($(KBUILD_TARGET),solaris) # don't use .solaris or anything here.
endif
vboxvideo_13_DEFS := $(vboxvideo_70_DEFS) VBOXVIDEO_13
vboxvideo_15_DEFS := \
- $(vboxvideo_13_DEFS) VBOX_DRI NO_ANSIC PCIACCESS XSERVER_LIBPCIACCESS
+ $(vboxvideo_13_DEFS) NO_ANSIC PCIACCESS XSERVER_LIBPCIACCESS
+if1of ($(KBUILD_TARGET), linux solaris)
+ vboxvideo_15_DEFS += \
+ VBOX_DRI
+endif
vboxvideo_xorg_INCS = \
+ $(VBOX_PATH_X11_ROOT)/dri2proto-2.8 \
$(VBOX_PATH_X11_ROOT)/fontsproto-2.1.0 \
$(VBOX_PATH_X11_ROOT)/glproto-1.4.10 \
$(VBOX_PATH_X11_ROOT)/MesaLib-8.0.4-GL \
@@ -56,6 +61,7 @@ if1of ($(KBUILD_TARGET), linux)
SYSMODS += vboxvideo_drv
endif # target linux
vboxvideo_drv_TEMPLATE = VBOXGUESTR3XF86MOD
+vboxvideo_drv_CFLAGS += -Wno-shadow # Avoid MBs of warnings in X11 and OpenGL headers (solaris mostly).
vboxvideo_drv_DEFS.linux = linux
vboxvideo_drv_DEFS.x86 = __i386__
# This one has to be defined when building server code on systems where
@@ -130,13 +136,9 @@ vboxvideo_drv_SOURCES = \
#
DLLS += vboxvideo_drv_70
vboxvideo_drv_70_TEMPLATE = VBOXGUESTR3XORGMOD
-if1of ($(KBUILD_TARGET), linux)
- vboxvideo_drv_70_CFLAGS += \
- -Wno-conversion -Wno-unused-parameter $(VBOX_GCC_Wno-variadic-macros) # template?
-endif
vboxvideo_drv_70_DEFS = $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=700000000
ifeq ($(KBUILD_TARGET),solaris) # don't use .solaris or anything here.
- vboxvideo_drv_70_CFLAGS += -D_XPG6 # Until we have moved the C++ bits into a library
+ vboxvideo_drv_70_CFLAGS += -D_XPG6 -Wno-shadow # Use XPG6 until we have moved the C++ bits into a library.
endif
vboxvideo_drv_70_INCS = \
$(VBOX_PATH_X11_XORG_7_0) \
@@ -197,7 +199,8 @@ vboxvideo_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD
vboxvideo_drv_15_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100503000
if1of ($(KBUILD_TARGET), linux solaris)
- vboxvideo_drv_15_DEFS += VBOX_DRI
+ vboxvideo_drv_15_DEFS += \
+ VBOX_DRI_OLD
endif
vboxvideo_drv_15_INCS = \
$(vboxvideo_xorg_INCS) \
@@ -206,7 +209,7 @@ vboxvideo_drv_15_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
vboxvideo_drv_15_SOURCES = $(vboxvideo_drv_13_SOURCES)
if1of ($(KBUILD_TARGET), linux solaris)
vboxvideo_drv_15_SOURCES += \
- vboxvideo_dri.c
+ vboxvideo_dri.c
endif
@@ -217,6 +220,10 @@ DLLS += vboxvideo_drv_16
vboxvideo_drv_16_TEMPLATE = VBOXGUESTR3XORGMOD
vboxvideo_drv_16_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
vboxvideo_drv_16_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100600000
+if1of ($(KBUILD_TARGET), linux solaris)
+ vboxvideo_drv_16_DEFS += \
+ VBOX_DRI_OLD
+endif
vboxvideo_drv_16_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0 \
@@ -235,7 +242,11 @@ vboxvideo_drv_17_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.7.7
vboxvideo_drv_17_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
-vboxvideo_drv_17_SOURCES := $(vboxvideo_drv_15_SOURCES)
+vboxvideo_drv_17_SOURCES := $(vboxvideo_drv_13_SOURCES)
+if1of ($(KBUILD_TARGET), linux solaris)
+ vboxvideo_drv_17_SOURCES += \
+ vboxvideo_dri2.c
+endif
#
@@ -249,7 +260,7 @@ vboxvideo_drv_18_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.8.0
vboxvideo_drv_18_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
-vboxvideo_drv_18_SOURCES := $(vboxvideo_drv_15_SOURCES)
+vboxvideo_drv_18_SOURCES := $(vboxvideo_drv_17_SOURCES)
#
@@ -263,7 +274,7 @@ vboxvideo_drv_19_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.9.0
vboxvideo_drv_19_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
-vboxvideo_drv_19_SOURCES := $(vboxvideo_drv_15_SOURCES)
+vboxvideo_drv_19_SOURCES := $(vboxvideo_drv_17_SOURCES)
#
@@ -277,7 +288,7 @@ vboxvideo_drv_110_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.10.0
vboxvideo_drv_110_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
-vboxvideo_drv_110_SOURCES := $(vboxvideo_drv_15_SOURCES)
+vboxvideo_drv_110_SOURCES := $(vboxvideo_drv_17_SOURCES)
#
@@ -291,7 +302,7 @@ vboxvideo_drv_111_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.11.0
vboxvideo_drv_111_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
-vboxvideo_drv_111_SOURCES := $(vboxvideo_drv_15_SOURCES)
+vboxvideo_drv_111_SOURCES := $(vboxvideo_drv_17_SOURCES)
#
@@ -305,7 +316,7 @@ vboxvideo_drv_112_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.12.0
vboxvideo_drv_112_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
-vboxvideo_drv_112_SOURCES := $(vboxvideo_drv_15_SOURCES)
+vboxvideo_drv_112_SOURCES := $(vboxvideo_drv_17_SOURCES)
#
@@ -319,7 +330,35 @@ vboxvideo_drv_113_INCS = \
$(vboxvideo_xorg_INCS) \
$(VBOX_PATH_X11_ROOT)/xorg-server-1.13.0
vboxvideo_drv_113_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
-vboxvideo_drv_113_SOURCES := $(vboxvideo_drv_15_SOURCES)
+vboxvideo_drv_113_SOURCES := $(vboxvideo_drv_17_SOURCES)
+
+
+#
+# vboxvideo_drv_114
+#
+DLLS += vboxvideo_drv_114
+vboxvideo_drv_114_TEMPLATE = VBOXGUESTR3XORGMOD
+vboxvideo_drv_114_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
+vboxvideo_drv_114_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101400000
+vboxvideo_drv_114_INCS = \
+ $(vboxvideo_xorg_INCS) \
+ $(VBOX_PATH_X11_ROOT)/xorg-server-1.14.0
+vboxvideo_drv_114_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
+vboxvideo_drv_114_SOURCES := $(vboxvideo_drv_17_SOURCES)
+
+
+#
+# vboxvideo_drv_115
+#
+DLLS += vboxvideo_drv_115
+vboxvideo_drv_115_TEMPLATE = VBOXGUESTR3XORGMOD
+vboxvideo_drv_115_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
+vboxvideo_drv_115_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101500000
+vboxvideo_drv_115_INCS = \
+ $(vboxvideo_xorg_INCS) \
+ $(VBOX_PATH_X11_ROOT)/xorg-server-1.15.0
+vboxvideo_drv_115_INCS += $(PATH_ROOT)/src/VBox/Runtime/include
+vboxvideo_drv_115_SOURCES := $(vboxvideo_drv_17_SOURCES)
ifdef VBOX_USE_SYSTEM_XORG_HEADERS
@@ -328,21 +367,22 @@ ifdef VBOX_USE_SYSTEM_XORG_HEADERS
SYSMODS := $(filter-out vboxvideo_drv%,$(SYSMODS))
vboxvideo_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD
vboxvideo_drv_system_CFLAGS := \
- $(vboxvideo_drv_70_CFLAGS) -include xorg-server.h
+ $(vboxvideo_drv_70_CFLAGS) -include xorg-server.h
vboxvideo_drv_system_DEFS := $(vboxvideo_15_DEFS)
vboxvideo_drv_system_INCS += \
- $(PATH_ROOT)/src/VBox/Runtime/include \
- /usr/include/x11 \
- /usr/include/X11/dri \
- /usr/include/libdrm \
- /usr/include/xorg \
- /usr/include/pixman-1
- vboxvideo_drv_system_SOURCES := $(vboxvideo_drv_15_SOURCES)
+ $(PATH_ROOT)/src/VBox/Runtime/include \
+ /usr/include/x11 \
+ /usr/include/X11/dri \
+ /usr/include/libdrm \
+ /usr/include/xorg \
+ /usr/include/pixman-1
+ vboxvideo_drv_system_SOURCES := $(vboxvideo_drv_17_SOURCES)
endif
# Check the undefined symbols in the X.Org modules against lists of allowed
# symbols. Not very elegant, but it will catch problems early.
+
ifdef VBOX_WITH_TESTCASES
# ifndef VBOX_ONLY_ADDITIONS
ifndef VBOX_USE_SYSTEM_XORG_HEADERS
@@ -356,118 +396,29 @@ ifdef VBOX_WITH_TESTCASES
OTHERS += $(vboxvideo_drv_0_OUTDIR)/tstvboxvideo68.run
$$(vboxvideo_drv_0_OUTDIR)/tstvboxvideo68.run: $$(vboxvideo_drv_1_STAGE_TARGET)
$(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined --static
+ $(QUIET)$(ASH) $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
+ $(vboxvideo_drv_1_STAGE_TARGET) --static $(VBOXVIDEO_SRC_PATH)/undefined
$(QUIET)$(APPEND) -t "$@" "done"
endif
- TESTING += $(vboxvideo_drv_70_0_OUTDIR)/tstvboxvideo70.run
- OTHERS += $(vboxvideo_drv_70_0_OUTDIR)/tstvboxvideo70.run
-$$(vboxvideo_drv_70_0_OUTDIR)/tstvboxvideo70.run: $$(vboxvideo_drv_70_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_70_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_71_0_OUTDIR)/tstvboxvideo71.run
- OTHERS += $(vboxvideo_drv_71_0_OUTDIR)/tstvboxvideo71.run
-$$(vboxvideo_drv_71_0_OUTDIR)/tstvboxvideo71.run: $$(vboxvideo_drv_71_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_71_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_13_0_OUTDIR)/tstvboxvideo13.run
- OTHERS += $(vboxvideo_drv_13_0_OUTDIR)/tstvboxvideo13.run
-$$(vboxvideo_drv_13_0_OUTDIR)/tstvboxvideo13.run: $$(vboxvideo_drv_13_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_13_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_14_0_OUTDIR)/tstvboxvideo14.run
- OTHERS += $(vboxvideo_drv_14_0_OUTDIR)/tstvboxvideo14.run
-$$(vboxvideo_drv_14_0_OUTDIR)/tstvboxvideo14.run: $$(vboxvideo_drv_14_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_14_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_15_0_OUTDIR)/tstvboxvideo15.run
- OTHERS += $(vboxvideo_drv_15_0_OUTDIR)/tstvboxvideo15.run
-$$(vboxvideo_drv_15_0_OUTDIR)/tstvboxvideo15.run: $$(vboxvideo_drv_15_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_15_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_16_0_OUTDIR)/tstvboxvideo16.run
- OTHERS += $(vboxvideo_drv_16_0_OUTDIR)/tstvboxvideo16.run
-$$(vboxvideo_drv_16_0_OUTDIR)/tstvboxvideo16.run: $$(vboxvideo_drv_16_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_16_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_17_0_OUTDIR)/tstvboxvideo17.run
- OTHERS += $(vboxvideo_drv_17_0_OUTDIR)/tstvboxvideo17.run
-$$(vboxvideo_drv_17_0_OUTDIR)/tstvboxvideo17.run: $$(vboxvideo_drv_17_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_17_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_18_0_OUTDIR)/tstvboxvideo18.run
- OTHERS += $(vboxvideo_drv_18_0_OUTDIR)/tstvboxvideo18.run
-$$(vboxvideo_drv_18_0_OUTDIR)/tstvboxvideo18.run: $$(vboxvideo_drv_18_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_18_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_19_0_OUTDIR)/tstvboxvideo19.run
- OTHERS += $(vboxvideo_drv_19_0_OUTDIR)/tstvboxvideo19.run
-$$(vboxvideo_drv_19_0_OUTDIR)/tstvboxvideo19.run: $$(vboxvideo_drv_19_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_19_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_110_0_OUTDIR)/tstvboxvideo110.run
- OTHERS += $(vboxvideo_drv_110_0_OUTDIR)/tstvboxvideo110.run
-$$(vboxvideo_drv_110_0_OUTDIR)/tstvboxvideo110.run: $$(vboxvideo_drv_110_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_110_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_111_0_OUTDIR)/tstvboxvideo111.run
- OTHERS += $(vboxvideo_drv_111_0_OUTDIR)/tstvboxvideo111.run
-$$(vboxvideo_drv_111_0_OUTDIR)/tstvboxvideo111.run: $$(vboxvideo_drv_111_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_111_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_112_0_OUTDIR)/tstvboxvideo112.run
- OTHERS += $(vboxvideo_drv_112_0_OUTDIR)/tstvboxvideo112.run
-$$(vboxvideo_drv_112_0_OUTDIR)/tstvboxvideo112.run: $$(vboxvideo_drv_112_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_112_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
-
- TESTING += $(vboxvideo_drv_113_0_OUTDIR)/tstvboxvideo113.run
- OTHERS += $(vboxvideo_drv_113_0_OUTDIR)/tstvboxvideo113.run
-$$(vboxvideo_drv_113_0_OUTDIR)/tstvboxvideo113.run: $$(vboxvideo_drv_113_1_STAGE_TARGET)
- $(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
- $(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
- $(vboxvideo_drv_113_1_STAGE_TARGET) $(VBOXVIDEO_SRC_PATH)/undefined
- $(QUIET)$(APPEND) -t "$@" "done"
+##
+# Using the extra expansion to replace $(ver) before eval, thus everything
+# else needs escaped dollars.
+ define def_vboxvideo_test
+ TESTING += $$(vboxvideo_drv$(ver)_0_OUTDIR)/tstvboxvideo$(ver).run
+ OTHERS += $$(vboxvideo_drv$(ver)_0_OUTDIR)/tstvboxvideo$(ver).run
+ $$$$(vboxvideo_drv$(ver)_0_OUTDIR)/tstvboxvideo$(ver).run: $$$$(vboxvideo_drv$(ver)_1_STAGE_TARGET)
+ $$(QUIET)$$(call MSG_L1,Checking for unresolved symbols in $$<)
+ $$(QUIET)$$(ASH) $$(PATH_ROOT)/src/bldprogs/checkUndefined.sh $$(KBUILD_HOST) \
+ $$(vboxvideo_drv$(ver)_1_STAGE_TARGET) $$(VBOXVIDEO_SRC_PATH)/undefined $$(VBOXVIDEO_SRC_PATH)/undefined_extra
+ $$(QUIET)$$(APPEND) -t "$$@" "done"
+ endef
+
+ $(foreach ver, _70 _71 _13 _14 _15 _16 _17 _18 _19 _110 _111 _112 _113 _114 _115, $(eval $(def_vboxvideo_test)))
endif # ! VBOX_ONLY_SDK
endif # eq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
- endif # eq ($(KBUILD_TARGET),linux)
+ endif # 1of ($(KBUILD_TARGET),linux solaris)
endif # ! VBOX_USE_SYSTEM_XORG_HEADERS
# endif # ! VBOX_ONLY_ADDITIONS
endif # VBOX_WITH_TESTCASES
diff --git a/src/VBox/Additions/x11/vboxvideo/edid.c b/src/VBox/Additions/x11/vboxvideo/edid.c
index 2628a324..fd7aff4f 100644
--- a/src/VBox/Additions/x11/vboxvideo/edid.c
+++ b/src/VBox/Additions/x11/vboxvideo/edid.c
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Additions/x11/vboxvideo/pointer.c b/src/VBox/Additions/x11/vboxvideo/pointer.c
index 8ddada54..45fcecaf 100644
--- a/src/VBox/Additions/x11/vboxvideo/pointer.c
+++ b/src/VBox/Additions/x11/vboxvideo/pointer.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Additions/x11/vboxvideo/setmode.c b/src/VBox/Additions/x11/vboxvideo/setmode.c
index 72f1c041..7e082f86 100644
--- a/src/VBox/Additions/x11/vboxvideo/setmode.c
+++ b/src/VBox/Additions/x11/vboxvideo/setmode.c
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -143,9 +143,12 @@ Bool VBOXAdjustScreenPixmap(ScrnInfoPtr pScrn, int width, int height)
PixmapPtr pPixmap = pScreen->GetScreenPixmap(pScreen);
VBOXPtr pVBox = VBOXGetRec(pScrn);
uint64_t cbLine = vboxLineLength(pScrn, width);
+ int displayWidth = vboxDisplayPitch(pScrn, cbLine);
TRACE_LOG("width=%d, height=%d\n", width, height);
- if (width == pScrn->virtualX && height == pScrn->virtualY)
+ if ( width == pScrn->virtualX
+ && height == pScrn->virtualY
+ && displayWidth == pScrn->displayWidth)
return TRUE;
if (!pPixmap) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -165,9 +168,9 @@ Bool VBOXAdjustScreenPixmap(ScrnInfoPtr pScrn, int width, int height)
vboxClearVRAM(pScrn, width, height);
pScrn->virtualX = width;
pScrn->virtualY = height;
- pScrn->displayWidth = vboxDisplayPitch(pScrn, cbLine);
+ pScrn->displayWidth = displayWidth;
pVBox->cbLine = cbLine;
-#ifdef VBOX_DRI
+#ifdef VBOX_DRI_OLD
if (pVBox->useDRI)
VBOXDRIUpdateStride(pScrn, pVBox);
#endif
diff --git a/src/VBox/Additions/x11/vboxvideo/undefined b/src/VBox/Additions/x11/vboxvideo/undefined
index 8895a12c..d2ef2bdc 100644
--- a/src/VBox/Additions/x11/vboxvideo/undefined
+++ b/src/VBox/Additions/x11/vboxvideo/undefined
@@ -1,3 +1,5 @@
+DRI2CloseScreen
+DRI2ScreenInit
DRICloseScreen
DRICreateInfoRec
DRICreatePCIBusID
@@ -15,41 +17,28 @@ MakeAtom
PixmapWidthPaddingInfo
RRChangeOutputProperty
ShadowFBInit2
+VErrorF
XNFcalloc
XNFstrdup
Xalloc
-_ITM_registerTMCloneTable
-_ITM_deregisterTMCloneTable
-_Jv_RegisterClasses
-___errno
-__cxa_finalize
-__deregister_frame_info_bases
-__divdi3
-__errno_location
-__fxstat64
-__gmon_start__
-__iob
-__isoc99_sscanf
-__moddi3
-__register_frame_info_bases
-__stack_chk_fail
-__udivdi3
-__umoddi3
-__xstat64
+Xfree
calloc
chdir
chmod
chown
close
+drmClose
drmFreeVersion
drmGetVersion
fbPictureInit
fbScreenInit
fchmod
+fchown
fcntl
fflush
flock
fprintf
+__fprintf_chk
fputs
free
fstat
@@ -57,6 +46,7 @@ fsync
ftruncate
ftruncate64
futimes
+fwrite
getcwd
getenv
geteuid
@@ -68,12 +58,13 @@ ioctl
lchown
lseek
lseek64
+lstat
malloc
-nanosleep
memalign
memchr
memcmp
memcpy
+__memcpy_chk
memmove
memset
miClearVisualTypes
@@ -85,6 +76,7 @@ miSetVisualTypes
mmap64
mprotect
munmap
+nanosleep
nl_langinfo
open
open64
@@ -92,11 +84,14 @@ pciTag
pci_device_map_range
pci_device_unmap_range
posix_memalign
+pthread_self
pthread_sigmask
+pthread_yield
putenv
read
realloc
realpath
+__realpath_chk
rename
resVgaShared
screenInfo
@@ -104,18 +99,20 @@ serverGeneration
setenv
sigdelset
sigfillset
-sprintf
snprintf
-sscanf
+__snprintf_chk
+sprintf
+__sprintf_chk
sscanf
stat
stderr
strchr
strcmp
strcpy
-strncpy
strlen
strncmp
+strncpy
+__strncpy_chk
strpbrk
strstr
symlink
@@ -123,19 +120,21 @@ tolower
unlink
unsetenv
utimes
+vfprintf
+__vfprintf_chk
vgaHWFreeHWRec
vgaHWGetHWRec
-vgaHWGetIndex
vgaHWGetIOBase
+vgaHWGetIndex
vgaHWRestore
vgaHWSave
vgaHWSetStdFuncs
write
xf86AddDriver
xf86ConfigPciEntity
-xf86CrtcConfigPrivateIndex
xf86CreateCursorInfoRec
xf86CrtcConfigInit
+xf86CrtcConfigPrivateIndex
xf86CrtcCreate
xf86CrtcScreenInit
xf86CrtcSetSizeRange
@@ -160,13 +159,14 @@ xf86MatchPciInstances
xf86ModesAdd
xf86Msg
xf86OutputCreate
+xf86OutputSetEDID
xf86OutputUseScreenMonitor
xf86PrintChipsets
xf86PrintDepthBpp
xf86PrintModes
xf86SaveScreen
-xf86Screens
xf86ScreenToScrn
+xf86Screens
xf86ScrnToScreen
xf86SetBackingStore
xf86SetBlackWhitePixels
@@ -174,13 +174,26 @@ xf86SetDefaultVisual
xf86SetDepthBpp
xf86SetDesiredModes
xf86SetDpi
-xf86OutputSetEDID
xf86SetGamma
xf86SetModeDefaultName
xf86SetSingleMode
xf86SetWeight
xf86ShowUnusedOptions
xf86UnMapVidMem
+xf86calloc
+xf86close
xf86errno
+xf86free
+xf86ioctl
xf86isspace
+xf86memchr
+xf86memcpy
+xf86memset
+xf86open
+xf86sprintf
+xf86sscanf
+xf86strcmp
+xf86strcpy
+xf86strlen
xf86strtoul
+xf86vsnprintf
diff --git a/src/VBox/Additions/x11/vboxvideo/undefined_extra b/src/VBox/Additions/x11/vboxvideo/undefined_extra
new file mode 100644
index 00000000..7c54a2c1
--- /dev/null
+++ b/src/VBox/Additions/x11/vboxvideo/undefined_extra
@@ -0,0 +1,19 @@
+_ITM_deregisterTMCloneTable
+_ITM_registerTMCloneTable
+_Jv_RegisterClasses
+___errno
+__cxa_finalize
+__deregister_frame_info_bases
+__divdi3
+__errno_location
+__fxstat64
+__gmon_start__
+__iob
+__isoc99_sscanf
+__lxstat64
+__moddi3
+__register_frame_info_bases
+__stack_chk_fail
+__udivdi3
+__umoddi3
+__xstat64
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxutils.c b/src/VBox/Additions/x11/vboxvideo/vboxutils.c
index 75a0ccb3..59aea825 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxutils.c
+++ b/src/VBox/Additions/x11/vboxvideo/vboxutils.c
@@ -1,9 +1,10 @@
+/* $Id: vboxutils.c $ */
/** @file
* VirtualBox X11 Additions graphics driver utility functions
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -253,10 +254,12 @@ unsigned vboxNextStandardMode(ScrnInfoPtr pScrn, unsigned cIndex,
uint32_t *pcx, uint32_t *pcy,
uint32_t *pcBits)
{
+ unsigned i;
+
XF86ASSERT(cIndex < vboxNumStdModes,
("cIndex = %d, vboxNumStdModes = %d\n", cIndex,
vboxNumStdModes));
- for (unsigned i = cIndex; i < vboxNumStdModes - 1; ++i)
+ for (i = cIndex; i < vboxNumStdModes - 1; ++i)
{
uint32_t cBits = pScrn->bitsPerPixel;
uint32_t cx = vboxStandardModes[i].cx;
@@ -461,6 +464,7 @@ static DisplayModePtr vboxAddEmptyScreenMode(ScrnInfoPtr pScrn)
void vboxAddModes(ScrnInfoPtr pScrn, uint32_t cxInit, uint32_t cyInit)
{
unsigned cx = 0, cy = 0, cIndex = 0;
+ unsigned i;
/* For reasons related to the way RandR 1.1 is implemented, we need to
* make sure that the initial mode (more precisely, a mode equal to the
* initial virtual resolution) is always present in the mode list. RandR
@@ -489,8 +493,7 @@ void vboxAddModes(ScrnInfoPtr pScrn, uint32_t cxInit, uint32_t cyInit)
}
/* And finally any modes specified by the user. We assume here that
* the mode names reflect the mode sizes. */
- for (unsigned i = 0; pScrn->display->modes != NULL
- && pScrn->display->modes[i] != NULL; i++)
+ for (i = 0; pScrn->display->modes && pScrn->display->modes[i]; i++)
{
if (sscanf(pScrn->display->modes[i], "%ux%u", &cx, &cy) == 2)
{
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
index 60806426..d3affd99 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -75,7 +75,6 @@
#include "fb.h"
#include "vboxvideo.h"
-#include <iprt/asm-math.h>
#include "version-generated.h"
#include "product-generated.h"
#include <xf86.h>
@@ -157,12 +156,12 @@ static const struct pci_id_match vbox_device_match[] = {
static SymTabRec VBOXChipsets[] =
{
{VBOX_DEVICEID, "vbox"},
- {-1, NULL}
+ {-1, NULL}
};
static PciChipsets VBOXPCIchipsets[] = {
{ VBOX_DEVICEID, VBOX_DEVICEID, RES_SHARED_VGA },
- { -1, -1, RES_UNDEFINED },
+ { -1, -1, RES_UNDEFINED },
};
/*
@@ -199,7 +198,7 @@ DriverRec VBOXVIDEO = {
/* No options for now */
static const OptionInfoRec VBOXOptions[] = {
- { -1, NULL, OPTV_NONE, {0}, FALSE }
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
};
#ifndef XORG_7X
@@ -391,7 +390,7 @@ vbox_output_mode_valid (xf86OutputPtr output, DisplayModePtr mode)
TRACE_LOG("HDisplay=%d, VDisplay=%d\n", mode->HDisplay, mode->VDisplay);
/* We always like modes specified by the user in the configuration
* file and modes requested by the host, as doing otherwise is likely to
- * annoy people. */
+ * annoy people. */
if ( !(mode->type & M_T_USERDEF)
&& !(mode->type & M_T_PREFERRED)
&& vbox_device_available(VBOXGetRec(pScrn))
@@ -576,7 +575,7 @@ static XF86ModuleVersionInfo vboxVersionRec =
1, /* Module major version. Xorg-specific */
0, /* Module minor version. Xorg-specific */
1, /* Module patchlevel. Xorg-specific */
- ABI_CLASS_VIDEODRV, /* This is a video driver */
+ ABI_CLASS_VIDEODRV, /* This is a video driver */
ABI_VIDEODRV_VERSION,
MOD_CLASS_VIDEODRV,
{0, 0, 0, 0}
@@ -828,10 +827,16 @@ VBOXPreInit(ScrnInfoPtr pScrn, int flags)
if (!xf86LoadSubModule(pScrn, "vgahw"))
return FALSE;
-#ifdef VBOX_DRI
+#ifdef VBOX_DRI_OLD
/* Load the dri module. */
if (!xf86LoadSubModule(pScrn, "dri"))
return FALSE;
+#else
+# ifdef VBOX_DRI
+ /* Load the dri module. */
+ if (!xf86LoadSubModule(pScrn, "dri2"))
+ return FALSE;
+# endif
#endif
#ifndef PCIACCESS
@@ -1073,8 +1078,9 @@ static Bool VBOXScreenInit(ScreenPtr pScreen, int argc, char **argv)
}
}
- /* Set a sane minimum and maximum mode size */
- xf86CrtcSetSizeRange(pScrn, 64, 64, 32000, 32000);
+ /* Set a sane minimum and maximum mode size to match what the hardware
+ * supports. */
+ xf86CrtcSetSizeRange(pScrn, 64, 64, 16384, 16384);
/* Now create our initial CRTC/output configuration. */
if (!xf86InitialConfiguration(pScrn, TRUE)) {
@@ -1130,7 +1136,7 @@ static Bool VBOXScreenInit(ScreenPtr pScreen, int argc, char **argv)
/* colourmap code */
if (!miCreateDefColormap(pScreen))
- return (FALSE);
+ return (FALSE);
if(!xf86HandleColormaps(pScreen, 256, 8, vboxLoadPalette, NULL, 0))
return (FALSE);
@@ -1159,7 +1165,7 @@ static Bool VBOXScreenInit(ScreenPtr pScreen, int argc, char **argv)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Unable to start the VirtualBox mouse pointer integration with the host system.\n");
-#ifdef VBOX_DRI
+#ifdef VBOX_DRI_OLD
if (pVBox->useDRI)
pVBox->useDRI = VBOXDRIFinishScreenInit(pScreen);
#endif
@@ -1174,7 +1180,7 @@ static Bool VBOXEnterVT(ScrnInfoPtr pScrn)
vboxClearVRAM(pScrn, 0, 0);
if (pVBox->fHaveHGSMI)
vboxEnableVbva(pScrn);
-#ifdef VBOX_DRI
+#ifdef VBOX_DRI_OLD
if (pVBox->useDRI)
DRIUnlock(xf86ScrnToScreen(pScrn));
#endif
@@ -1203,7 +1209,7 @@ static void VBOXLeaveVT(ScrnInfoPtr pScrn)
vboxClearVRAM(pScrn, 0, 0);
VBOXRestoreMode(pScrn);
vboxDisableGraphicsCap(pVBox);
-#ifdef VBOX_DRI
+#ifdef VBOX_DRI_OLD
if (pVBox->useDRI)
DRILock(xf86ScrnToScreen(pScrn), 0);
#endif
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo.h b/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
index 64a91f3e..6564e6fc 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -97,16 +97,15 @@ if (!(expr)) \
#define BOOL_STR(a) ((a) ? "TRUE" : "FALSE")
#include <VBox/Hardware/VBoxVideoVBE.h>
-#include <VBox/VMMDev.h>
#include "xf86str.h"
#include "xf86Cursor.h"
-#define VBOX_VERSION 4000 /* Why? */
-#define VBOX_NAME "VBoxVideo"
-#define VBOX_DRIVER_NAME "vboxvideo"
+#define VBOX_VERSION 4000 /* Why? */
+#define VBOX_NAME "VBoxVideo"
+#define VBOX_DRIVER_NAME "vboxvideo"
-#ifdef VBOX_DRI
+#ifdef VBOX_DRI_OLD
/* DRI support */
#define _XF86DRI_SERVER_
/* Hack to work around a libdrm header which is broken on Solaris */
@@ -138,7 +137,6 @@ typedef struct VBOXRec
EntityInfoPtr pEnt;
#ifdef PCIACCESS
struct pci_device *pciInfo;
- struct pci_device *vmmDevInfo;
#else
pciVideoPtr pciInfo;
PCITAG pciTag;
@@ -193,10 +191,12 @@ typedef struct VBOXRec
Bool fAnyX;
#ifdef VBOX_DRI
Bool useDRI;
+#ifdef VBOX_DRI_OLD
int cVisualConfigs;
__GLXvisualConfig *pVisualConfigs;
DRIInfoRec *pDRIInfo;
int drmFD;
+# endif
#endif
} VBOXRec, *VBOXPtr;
@@ -257,14 +257,14 @@ static inline uint16_t vboxBPP(ScrnInfoPtr pScrn)
/** Calculate the scan line length for a display width */
static inline int32_t vboxLineLength(ScrnInfoPtr pScrn, int32_t cDisplayWidth)
{
- uint64_t cbLine = ((uint64_t)cDisplayWidth * vboxBPP(pScrn) / 8 + 3) & ~3;
+ uint32_t cbLine = (cDisplayWidth * vboxBPP(pScrn) / 8 + 3) & ~3;
return cbLine < INT32_MAX ? cbLine : INT32_MAX;
}
/** Calculate the display pitch from the scan line length */
static inline int32_t vboxDisplayPitch(ScrnInfoPtr pScrn, int32_t cbLine)
{
- return (int32_t)((uint64_t)cbLine * 8 / vboxBPP(pScrn));
+ return cbLine * 8 / vboxBPP(pScrn);
}
extern void vboxClearVRAM(ScrnInfoPtr pScrn, int32_t cNewX, int32_t cNewY);
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri.c b/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri.c
index 46ded352..1471a1bd 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri.c
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri.c
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -250,7 +250,7 @@ Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox)
pDRIInfo->busIdString = alloc(64);
sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d",
((pciConfigPtr)pVBox->pciInfo->thisCard)->busnum,
- ((pciConfigPtr)pVBox->pciInfo->thisCard)->devnum,
+ ((pciConfigPtr)pVBox->pciInfo->thisCard)->devnum,
((pciConfigPtr)pVBox->pciInfo->thisCard)->funcnum);
#endif
pDRIInfo->ddxDriverMajorVersion = VBOX_VIDEO_MAJOR;
@@ -270,10 +270,16 @@ Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox)
pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
TRACE_LOG("Calling DRIScreenInit\n");
if (!DRIScreenInit(pScreen, pDRIInfo, &pVBox->drmFD))
+ {
rc = FALSE;
- if (!rc)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"DRIScreenInit failed, disabling DRI.\n");
+ if (pVBox->drmFD)
+ {
+ drmClose(pVBox->drmFD);
+ pVBox->drmFD = -1;
+ }
+ }
}
if (rc && !VBOXInitVisualConfigs(pScrn, pVBox))
{
@@ -281,7 +287,8 @@ Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox)
"VBOXInitVisualConfigs failed, disabling DRI.\n");
rc = FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configurations initialized\n");
+ else
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configurations initialized\n");
/* Check the DRM version */
if (rc)
@@ -304,12 +311,12 @@ Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox)
/* Clean up on failure. */
if (!rc)
{
- if (pVBox->pDRIInfo)
- DRIDestroyInfoRec(pVBox->pDRIInfo);
- pVBox->pDRIInfo = NULL;
if (pVBox->drmFD >= 0)
VBOXDRICloseScreen(pScreen, pVBox);
pVBox->drmFD = -1;
+ if (pVBox->pDRIInfo)
+ DRIDestroyInfoRec(pVBox->pDRIInfo);
+ pVBox->pDRIInfo = NULL;
}
TRACE_LOG("returning %s\n", BOOL_STR(rc));
return rc;
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri2.c b/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri2.c
new file mode 100644
index 00000000..493f205f
--- /dev/null
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri2.c
@@ -0,0 +1,62 @@
+/** @file $Id: vboxvideo_dri2.c $
+ *
+ * VirtualBox X11 Additions graphics driver, DRI2 support
+ */
+
+/*
+ * Copyright (C) 2006-2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "vboxvideo.h"
+#include <drm.h>
+#include <dri2.h>
+
+static void VBOXDRICopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
+ DRI2BufferPtr pDest, DRI2BufferPtr pSrc)
+{
+}
+
+static DRI2Buffer2Ptr VBOXDRICreateBuffer(DrawablePtr pDraw,
+ unsigned int cAttachment,
+ unsigned int cFormat)
+{
+ return calloc(1, sizeof(DRI2Buffer2Rec));
+}
+
+static void VBOXDRIDestroyBuffer(DrawablePtr pDraw, DRI2Buffer2Ptr pBuffer)
+{
+ free(pBuffer);
+}
+
+/** As long as we are using our fake DRI driver inside of Mesa, we only want
+ * to implement the minimum here to make Mesa load it. Notably we just set
+ * "DRI2Info.fd" to -1 as we do not need authentication to work. */
+Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox)
+{
+ DRI2InfoRec DRI2Info;
+
+ memset(&DRI2Info, 0, sizeof(DRI2Info));
+ DRI2Info.version = 3;
+ DRI2Info.fd = -1;
+ DRI2Info.driverName = VBOX_DRI_DRIVER_NAME;
+ DRI2Info.deviceName = "/dev/dri/card0"; /** @todo: do this right. */
+ DRI2Info.CopyRegion = VBOXDRICopyRegion;
+ DRI2Info.Wait = NULL;
+ DRI2Info.CreateBuffer = VBOXDRICreateBuffer;
+ DRI2Info.DestroyBuffer = VBOXDRIDestroyBuffer;
+ return DRI2ScreenInit(pScreen, &DRI2Info);
+}
+
+void
+VBOXDRICloseScreen(ScreenPtr pScreen, VBOXPtr pVBox)
+{
+ DRI2CloseScreen(pScreen);
+}
diff --git a/src/VBox/Additions/x11/vboxvideo/vbva.c b/src/VBox/Additions/x11/vboxvideo/vbva.c
index 9f5bac94..67b0adc9 100644
--- a/src/VBox/Additions/x11/vboxvideo/vbva.c
+++ b/src/VBox/Additions/x11/vboxvideo/vbva.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;