From owner-svn-ports-all@freebsd.org Mon Jun 17 15:09:47 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F1EC15BC5E4; Mon, 17 Jun 2019 15:09:47 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4CBC6D5C8; Mon, 17 Jun 2019 15:09:46 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EB9627445; Mon, 17 Jun 2019 15:09:46 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HF9ksV045821; Mon, 17 Jun 2019 15:09:46 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HF9jZw045815; Mon, 17 Jun 2019 15:09:45 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201906171509.x5HF9jZw045815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Mon, 17 Jun 2019 15:09:45 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r504426 - in head: graphics graphics/libxatracker x11-drivers/xf86-video-vmware x11-drivers/xf86-video-vmware/files X-SVN-Group: ports-head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head: graphics graphics/libxatracker x11-drivers/xf86-video-vmware x11-drivers/xf86-video-vmware/files X-SVN-Commit-Revision: 504426 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4CBC6D5C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 15:09:47 -0000 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 +.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 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 .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); + }