forked from pfsense/FreeBSD-ports
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
johalun
authored and
johalun
committed
Jun 17, 2019
1 parent
40ce40a
commit 434b197
Showing
6 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
x11-drivers/xf86-video-vmware/files/patch-vmwgfx_vmwgfx__dri2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |