aboutsummaryrefslogtreecommitdiff
path: root/x11-drivers
diff options
context:
space:
mode:
authorJohannes Lundberg <johalun@FreeBSD.org>2019-06-17 15:09:45 +0000
committerJohannes Lundberg <johalun@FreeBSD.org>2019-06-17 15:09:45 +0000
commit91f6994f6ff2589c2b18371c7959336498e14086 (patch)
tree3bdc7ef0b1212944b8e3dcad8e8240a5fe567476 /x11-drivers
parentf3b97d07e99f903b0d6684c647e53e61ea4017e1 (diff)
downloadports-91f6994f6ff2589c2b18371c7959336498e14086.tar.gz
ports-91f6994f6ff2589c2b18371c7959336498e14086.zip
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
Notes
Notes: svn path=/head/; revision=504426
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/xf86-video-vmware/Makefile5
-rw-r--r--x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c44
2 files changed, 49 insertions, 0 deletions
diff --git a/x11-drivers/xf86-video-vmware/Makefile b/x11-drivers/xf86-video-vmware/Makefile
index 7401252333f6..270ecc34c69a 100644
--- a/x11-drivers/xf86-video-vmware/Makefile
+++ b/x11-drivers/xf86-video-vmware/Makefile
@@ -16,6 +16,11 @@ ONLY_FOR_ARCHS_REASON= The vmware gfx protocol is only supported on x86-compatib
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
diff --git a/x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c b/x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c
new file mode 100644
index 000000000000..1c3b51ba3d23
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c
@@ -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);
+ }