svn commit: r504426 - in head: graphics graphics/libxatracker x11-drivers/xf86-video-vmware x11-drivers/xf86-video-vmware/files
Johannes Lundberg
johalun at FreeBSD.org
Mon Jun 17 15:09:47 UTC 2019
Author: johalun (src committer)
Date: Mon Jun 17 15:09:45 2019
New Revision: 504426
URL: https://svnweb.freebsd.org/changeset/ports/504426
Log:
New port: graphics/libxatracker
XA Tracker is built from Mesa sources and is required by xf86-video-vmware
in order to take advantage of accelerated graphics using the vmwgfx kernel
DRM driver.
This commit also adds libdrm as a runtime requirement for xf86-video-vmware
and patches the DRI device loading routine to work outside of Linux. If no
DRI device exists (vmwgfx kernel driver is not loaded), xf86-video-vmware
will fallback to software rendering.
The vmwgfx kernel driver is available in the drm-kmod port.
Reviewed by: zeising
Approved by: imp (mentor), zeising
Differential Revision: D20153
Added:
head/graphics/libxatracker/
head/graphics/libxatracker/Makefile (contents, props changed)
head/graphics/libxatracker/pkg-descr (contents, props changed)
head/graphics/libxatracker/pkg-plist (contents, props changed)
head/x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c (contents, props changed)
Modified:
head/graphics/Makefile
head/x11-drivers/xf86-video-vmware/Makefile
Modified: head/graphics/Makefile
==============================================================================
--- head/graphics/Makefile Mon Jun 17 14:06:25 2019 (r504425)
+++ head/graphics/Makefile Mon Jun 17 15:09:45 2019 (r504426)
@@ -499,6 +499,7 @@
SUBDIR += libwmf
SUBDIR += libwmf-nox11
SUBDIR += libwpg03
+ SUBDIR += libxatracker
SUBDIR += libyuv
SUBDIR += libzmf
SUBDIR += lightzone
Added: head/graphics/libxatracker/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/graphics/libxatracker/Makefile Mon Jun 17 15:09:45 2019 (r504426)
@@ -0,0 +1,36 @@
+# Created by: johalun
+# $FreeBSD$
+
+PORTNAME= libxatracker
+PORTVERSION= ${MESAVERSION}
+CATEGORIES= graphics
+
+COMMENT= Mesa XA state tracker
+
+USE_XORG= xorgproto
+
+.include <bsd.port.options.mk>
+.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
+
+ONLY_FOR_ARCHS= i386 amd64
+ONLY_FOR_ARCHS_REASON= Used only by VMWare supported architectures
+
+CONFIGURE_ARGS+= --disable-dri \
+ --disable-egl \
+ --disable-gbm \
+ --disable-gles2 \
+ --disable-glx \
+ --disable-opengl \
+ --disable-shared-glapi \
+ --with-gallium-drivers= \
+ --with-platforms=
+
+MESA_BUILD_WRKSRC= src/util src/compiler
+LDFLAGS_i386= -Wl,-znotext
+
+CONFIGURE_ARGS+= --enable-xa
+MESA_BUILD_WRKSRC+= src/gallium
+MESA_INSTALL_WRKSRC= src/gallium/state_trackers/xa src/gallium/targets/xa
+
+.include "${MASTERDIR}/Makefile.targets"
+.include <bsd.port.post.mk>
Added: head/graphics/libxatracker/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/graphics/libxatracker/pkg-descr Mon Jun 17 15:09:45 2019 (r504426)
@@ -0,0 +1,9 @@
+Mesa is a 3-D graphics library with an API which is very similar to that
+of OpenGL*. To the extent that Mesa utilizes the OpenGL command syntax or
+state machine, it is being used with authorization from Silicon Graphics,
+Inc. However, the author makes no claim that Mesa is in any way a
+compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
+
+XA is a new state tracker designed by VMWare for their virtual GPU driver "vmwgfx".
+
+WWW: http://www.mesa3d.org/
Added: head/graphics/libxatracker/pkg-plist
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/graphics/libxatracker/pkg-plist Mon Jun 17 15:09:45 2019 (r504426)
@@ -0,0 +1,7 @@
+include/xa_composite.h
+include/xa_context.h
+include/xa_tracker.h
+lib/libxatracker.so
+lib/libxatracker.so.2
+lib/libxatracker.so.2.4.0
+libdata/pkgconfig/xatracker.pc
Modified: head/x11-drivers/xf86-video-vmware/Makefile
==============================================================================
--- head/x11-drivers/xf86-video-vmware/Makefile Mon Jun 17 14:06:25 2019 (r504425)
+++ head/x11-drivers/xf86-video-vmware/Makefile Mon Jun 17 15:09:45 2019 (r504426)
@@ -16,6 +16,11 @@ ONLY_FOR_ARCHS_REASON= The vmware gfx protocol is only
XORG_CAT= driver
+LIB_DEPENDS+= libdrm.so:graphics/libdrm \
+ libxatracker.so:graphics/libxatracker
+
+CONFIGURE_ARGS= --without-libudev
+
.include <bsd.port.options.mk>
.if ${ARCH} == i386
Added: head/x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c Mon Jun 17 15:09:45 2019 (r504426)
@@ -0,0 +1,44 @@
+--- vmwgfx/vmwgfx_dri2.c.orig 2018-05-17 07:42:24 UTC
++++ vmwgfx/vmwgfx_dri2.c
+@@ -413,8 +413,7 @@ xorg_dri2_init(ScreenPtr pScreen)
+ modesettingPtr ms = modesettingPTR(pScrn);
+ DRI2InfoRec dri2info;
+ int major, minor;
+- char fdPath[VMWGFX_FD_PATH_LEN];
+- ssize_t numChar;
++ const char *dev_name;
+
+ memset(&dri2info, 0, sizeof(dri2info));
+
+@@ -430,20 +429,13 @@ xorg_dri2_init(ScreenPtr pScreen)
+ dri2info.fd = ms->fd;
+ dri2info.driverName = "vmwgfx";
+
+- /*
+- * This way of obtaining the DRM device name is a bit
+- * os-specific. It would be better to obtain it from
+- * drmOpen. Currently this works only for Linux.
+- */
+- memset(fdPath, 0, VMWGFX_FD_PATH_LEN);
+- snprintf(fdPath, VMWGFX_FD_PATH_LEN - 1, "/proc/self/fd/%d", ms->fd);
+- numChar = readlink(fdPath, ms->dri2_device_name, VMWGFX_DRI_DEVICE_LEN);
+- if (numChar <= 0 || numChar >= VMWGFX_DRI_DEVICE_LEN) {
++ dev_name = drmGetDeviceNameFromFd2(ms->fd);
++ if (!dev_name) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Could not find the drm device name. Disabling dri2.\n");
+ return FALSE;
+ }
+- ms->dri2_device_name[numChar] = 0;
++ strncpy(ms->dri2_device_name, dev_name, VMWGFX_DRI_DEVICE_LEN);
+ dri2info.deviceName = ms->dri2_device_name;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Path of drm device is \"%s\".\n", ms->dri2_device_name);
+@@ -466,6 +458,7 @@ xorg_dri2_init(ScreenPtr pScreen)
+ dri2info.AuthMagic3 = vmw_dri_auth_magic3;
+ }
+ #endif
++ free(dev_name);
+
+ return DRI2ScreenInit(pScreen, &dri2info);
+ }
More information about the svn-ports-all
mailing list