pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

xf86-video-intel-devel-dfbsd: Import xf86-video-intel git snapshots as wip/xf86-video-intel-devel-dfbsd



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Mon Mar 6 21:11:53 2017 -0800
Changeset:	1b78d4131f1e4ea9a70ec8142be6f6dacc8efe33

Added Files:
	xf86-video-intel-devel-dfbsd/DESCR
	xf86-video-intel-devel-dfbsd/Makefile
	xf86-video-intel-devel-dfbsd/PLIST
	xf86-video-intel-devel-dfbsd/TODO
	xf86-video-intel-devel-dfbsd/distinfo
	xf86-video-intel-devel-dfbsd/patches/patch-src_intel__device.c
	xf86-video-intel-devel-dfbsd/patches/patch-src_intel__list.h
	xf86-video-intel-devel-dfbsd/patches/patch-src_sna_kgem.c
	xf86-video-intel-devel-dfbsd/patches/patch-src_sna_sna__threads.c

Log Message:
xf86-video-intel-devel-dfbsd: Import xf86-video-intel git snapshots as wip/xf86-video-intel-devel-dfbsd

Features:
* xf86-video-intel git snapshots using commit ids to generate
  .tar.xz file similar to what FreeBSD ports now does.
  Fixed snapshots used to debug showstopping FreeBSD and DragonFly
  bugs so that glxgears now functions properly.

* Merged patches from FreeBSD ports and DragonFly dports.
  Can properly load i915kms module on FreeBSD.

* Developed further patches for DragonFly for kgem.c so that
  field in 2nd version of mmap struct is always initialized.

* Added option for FreeBSD to prefer uxa over sna.

* Added --enable-debug option.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1b78d4131f1e4ea9a70ec8142be6f6dacc8efe33

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 xf86-video-intel-devel-dfbsd/DESCR                 |  1 +
 xf86-video-intel-devel-dfbsd/Makefile              | 88 ++++++++++++++++++++++
 xf86-video-intel-devel-dfbsd/PLIST                 |  3 +
 xf86-video-intel-devel-dfbsd/TODO                  |  4 +
 xf86-video-intel-devel-dfbsd/distinfo              | 10 +++
 .../patches/patch-src_intel__device.c              | 45 +++++++++++
 .../patches/patch-src_intel__list.h                | 67 ++++++++++++++++
 .../patches/patch-src_sna_kgem.c                   | 83 ++++++++++++++++++++
 .../patches/patch-src_sna_sna__threads.c           | 16 ++++
 9 files changed, 317 insertions(+)

diffs:
diff --git a/xf86-video-intel-devel-dfbsd/DESCR b/xf86-video-intel-devel-dfbsd/DESCR
new file mode 100644
index 0000000000..08dab8f7da
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/DESCR
@@ -0,0 +1 @@
+This is the video driver for Intel cards for the modular Xorg server.
diff --git a/xf86-video-intel-devel-dfbsd/Makefile b/xf86-video-intel-devel-dfbsd/Makefile
new file mode 100644
index 0000000000..37317878da
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/Makefile
@@ -0,0 +1,88 @@
+# $NetBSD: Makefile,v 1.1 2015/04/01 13:11:38 tnn2 Exp $
+
+# Use the commit id to obtain a snapshot of the form: 
+# http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/xf86-video-intel-78d7a09b0343829c81257024b164b0b3764392ac.tar.xz
+
+# 2017-02-28 intel: Fix checking xf86LoadKernelModule for success
+COMMIT_ID=	78d7a09b0343829c81257024b164b0b3764392ac
+
+PORTNAME=	xf86-video-intel
+
+DISTNAME=	${PORTNAME}-${COMMIT_ID}
+PKGNAME=	${PORTNAME}-2.99.917
+CATEGORIES=	x11
+MASTER_SITES=	http://cgit.freedesktop.org/xorg/driver/${PORTNAME}/snapshot/
+EXTRACT_SUFX=	.tar.xz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://xorg.freedesktop.org/
+COMMENT=	Modular Xorg Intel video driver
+
+CONFLICTS+=	xf86-video-i810-[0-9]*
+
+# Enabled by default
+# CONFIGURE_ARGS+=	--enable-dri
+# CONFIGURE_ARGS+=	--enable-dri2
+
+GNU_CONFIGURE=	YES
+USE_LIBTOOL=	YES
+USE_TOOLS+=	pkg-config automake autoconf autoreconf
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+CONFIGURE_ENV+=	DRIVER_MAN_SUFFIX=4
+.endif
+
+# DragonFly version 4.6-RELEASE, maybe other versions prior to 4.7
+# need -D_WITH_GETLINE=1 according to: 
+# https://github.com/DragonFlyBSD/DPorts/issues/184
+# FreeBSD ports now patches files individually.
+# CFLAGS.FreeBSD+=		-D_WITH_GETLINE=1
+CFLAGS.DragonFly+=		-D_WITH_GETLINE=1
+
+# From DragonFly dports x11-drivers/xf86-video-intel29 2.99.2017.01.06
+CONFIGURE_ENV.DragonFly+=	xorg_cv_cc_flag__Wno_maybe_uninitialized=no
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.xf86-video-intel
+PKG_SUPPORTED_OPTIONS=	uxa dri3 debug
+PKG_SUGGESTED_OPTIONS+=	dri3
+
+# .if ${OPSYS} == "FreeBSD"
+# PKG_SUGGESTED_OPTIONS+=	uxa
+# .endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Muxa)
+CONFIGURE_ARGS+=	--with-default-accel=uxa
+.endif
+
+.if !empty(PKG_OPTIONS:Mdri3)
+CONFIGURE_ARGS+=	--enable-dri3
+.include "../../x11/dri3proto/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--disable-dri3
+.endif
+
+# Debug flags recommended for server and drivers by:
+# https://www.x.org/wiki/Development/Documentation/ServerDebugging/
+# enable-debug crashes xorg DragonFly in __kgem_bo_map__cpu
+.if !empty(PKG_OPTIONS:Mdebug)
+CFLAGS+=		-O0 -g3
+CONFIGURE_ARGS+=	--enable-debug
+.endif
+
+pre-configure:
+	cd ${WRKSRC} && autoreconf -vif
+
+BUILDLINK_API_DEPENDS.libdrm+=	libdrm>=2.4.7
+
+.include "../../x11/modular-xorg-server/buildlink3.mk"
+.include "../../x11/libdrm/buildlink3.mk"
+.include "../../x11/libXvMC/buildlink3.mk"
+.include "../../x11/xcb-util/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../devel/xorg-util-macros/buildlink3.mk"
+# .include "../../wip/mk/git-package.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/xf86-video-intel-devel-dfbsd/PLIST b/xf86-video-intel-devel-dfbsd/PLIST
new file mode 100644
index 0000000000..45c2434c1c
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2015/04/01 13:11:38 tnn2 Exp $
+lib/xorg/modules/drivers/intel_drv.la
+man/man4/intel.4
diff --git a/xf86-video-intel-devel-dfbsd/TODO b/xf86-video-intel-devel-dfbsd/TODO
new file mode 100644
index 0000000000..2f394e5177
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/TODO
@@ -0,0 +1,4 @@
+Copy port to x11/xf86-video-intel, do not install from wip.
+
+FreeBSD 11-release G45 Intel integrated graphics machine reboots
+when startx of xfce4.
diff --git a/xf86-video-intel-devel-dfbsd/distinfo b/xf86-video-intel-devel-dfbsd/distinfo
new file mode 100644
index 0000000000..ad1946b681
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2015/04/01 13:11:38 tnn2 Exp $
+
+SHA1 (xf86-video-intel-78d7a09b0343829c81257024b164b0b3764392ac.tar.xz) = 8959e39c07d4788735bd673e30c0e89786329467
+RMD160 (xf86-video-intel-78d7a09b0343829c81257024b164b0b3764392ac.tar.xz) = eead54d19cf4e04dd1c48ebc3059bd71f165f6e3
+SHA512 (xf86-video-intel-78d7a09b0343829c81257024b164b0b3764392ac.tar.xz) = b4fc602d5ad4c87d7899684644c8d4a5fb0ed7ce3816b914c2539747e8b02812099ad2ab6ce2f5fad6a12bc79cc38bf1100009ec3eab291c6b51dc4fa9c79968
+Size (xf86-video-intel-78d7a09b0343829c81257024b164b0b3764392ac.tar.xz) = 945608 bytes
+SHA1 (patch-src_intel__device.c) = d43e9b2207d9e521793f76e6c0da731a243cf309
+SHA1 (patch-src_intel__list.h) = e1c4e001c499208e8a9789ee3a2c45173d8214cc
+SHA1 (patch-src_sna_kgem.c) = 9094ed4ba1ab93a37f61f6718c759e073bd70493
+SHA1 (patch-src_sna_sna__threads.c) = dbbc53febbe254e1214473b42668f9ad90235d32
diff --git a/xf86-video-intel-devel-dfbsd/patches/patch-src_intel__device.c b/xf86-video-intel-devel-dfbsd/patches/patch-src_intel__device.c
new file mode 100644
index 0000000000..1a77bb84ad
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/patches/patch-src_intel__device.c
@@ -0,0 +1,45 @@
+$NetBSD$
+
+WITH_GETLINE patch from FreeBSD ports libdrm 2.4.75.
+
+Patch to use "i915kms" as module name from FreeBSD ports libdrm 2.4.75.
+
+From DragonFly dports x11-drivers/xf86-video-intel29 2.99.2017.01.06
+patch for drmCheckModesettingSupported() always returning 0.
+
+--- src/intel_device.c.orig	2017-02-28 20:52:19.000000000 +0000
++++ src/intel_device.c
+@@ -28,6 +28,11 @@
+ #include "config.h"
+ #endif
+ 
++#if defined(__FreeBSD__)
++#define _WITH_GETLINE	/* to expose getline() in stdio.h on FreeBSD */
++#include <stdio.h>	/* for getline() */
++#endif
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <assert.h>
+@@ -204,6 +209,9 @@ static inline struct intel_device *intel
+ }
+ 
+ static const char *kernel_module_names[] ={
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++	"i915kms",
++#endif
+ 	"i915",
+ 	NULL,
+ };
+@@ -425,7 +433,11 @@ static int __intel_open_device__legacy(c
+ 		 pci->domain, pci->bus, pci->dev, pci->func);
+ 
+ 	ret = drmCheckModesettingSupported(id);
++#if defined(__DragonFly__)
++	if (ret || 1) {
++#else
+ 	if (ret) {
++#endif
+ 		if (load_i915_kernel_module() == 0)
+ 			ret = drmCheckModesettingSupported(id);
+ 		if (ret)
diff --git a/xf86-video-intel-devel-dfbsd/patches/patch-src_intel__list.h b/xf86-video-intel-devel-dfbsd/patches/patch-src_intel__list.h
new file mode 100644
index 0000000000..87cad820d2
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/patches/patch-src_intel__list.h
@@ -0,0 +1,67 @@
+$NetBSD$
+
+Patch from FreeBSD ports libdrm 2.4.75.
+
+--- src/intel_list.h.orig	2017-02-10 21:52:47.000000000 +0000
++++ src/intel_list.h
+@@ -305,8 +305,10 @@ list_is_empty(const struct list *head)
+ #define list_last_entry(ptr, type, member) \
+     list_entry((ptr)->prev, type, member)
+ 
++#if !defined(__FreeBSD__)
+ #define __container_of(ptr, sample, member)				\
+     (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
++#endif
+ /**
+  * Loop through the list given by head and set pos to struct in the list.
+  *
+@@ -324,15 +326,29 @@ list_is_empty(const struct list *head)
+  * @param member Member name of the struct list in the list elements.
+  *
+  */
++#if defined(__FreeBSD__)
++ #define list_for_each_entry(pos, head, member)				\
++    for (pos = NULL, pos = __container_of((head)->next, pos, member);	\
++ 	 &pos->member != (head);					\
++ 	 pos = __container_of(pos->member.next, pos, member))
++#else
+ #define list_for_each_entry(pos, head, member)				\
+     for (pos = __container_of((head)->next, pos, member);		\
+ 	 &pos->member != (head);					\
+ 	 pos = __container_of(pos->member.next, pos, member))
++#endif
+ 
++#if defined(__FreeBSD__)
++#define list_for_each_entry_reverse(pos, head, member)			\
++    for (pos = NULL, pos = __container_of((head)->prev, pos, member);	\
++ 	 &pos->member != (head);					\
++ 	 pos = __container_of(pos->member.prev, pos, member))
++#else
+ #define list_for_each_entry_reverse(pos, head, member)				\
+     for (pos = __container_of((head)->prev, pos, member);		\
+ 	 &pos->member != (head);					\
+ 	 pos = __container_of(pos->member.prev, pos, member))
++#endif
+ 
+ /**
+  * Loop through the list, keeping a backup pointer to the element. This
+@@ -341,11 +357,19 @@ list_is_empty(const struct list *head)
+  *
+  * See list_for_each_entry for more details.
+  */
++#if defined(__FreeBSD__)
++#define list_for_each_entry_safe(pos, tmp, head, member)		\
++    for (pos = NULL, pos = __container_of((head)->next, pos, member),	\
++ 	 tmp = __container_of(pos->member.next, pos, member);		\
++ 	 &pos->member != (head);					\
++ 	 pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
++#else
+ #define list_for_each_entry_safe(pos, tmp, head, member)		\
+     for (pos = __container_of((head)->next, pos, member),		\
+ 	 tmp = __container_of(pos->member.next, pos, member);		\
+ 	 &pos->member != (head);					\
+ 	 pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
++#endif
+ 
+ #else
+ 
diff --git a/xf86-video-intel-devel-dfbsd/patches/patch-src_sna_kgem.c b/xf86-video-intel-devel-dfbsd/patches/patch-src_sna_kgem.c
new file mode 100644
index 0000000000..4f70c0c687
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/patches/patch-src_sna_kgem.c
@@ -0,0 +1,83 @@
+$NetBSD$
+
+WITH_GETLINE patch from FreeBSD ports libdrm 2.4.75.
+
+Patch for --enable-debug from DragonFly dports
+x11-drivers/xf86-video-intel29 
+
+Additional patch for DragonFly because struct drm_i915_gem_mmap
+has a field flags.
+
+--- src/sna/kgem.c.orig	2017-02-10 21:52:47.000000000 +0000
++++ src/sna/kgem.c
+@@ -29,6 +29,11 @@
+ #include "config.h"
+ #endif
+ 
++#if defined(__FreeBSD__)
++#define _WITH_GETLINE	/* to expose getline() in stdio.h on FreeBSD */
++#include <stdio.h>	/* for getline() */
++#endif
++
+ #include "sna.h"
+ #include "sna_reg.h"
+ 
+@@ -70,7 +75,11 @@ search_snoop_cache(struct kgem *kgem, un
+ #define DBG_NO_CREATE2 0
+ #define DBG_NO_USERPTR 0
+ #define DBG_NO_UNSYNCHRONIZED_USERPTR 0
++#if defined(__DragonFly__)
++#define DBG_NO_LLC 1
++#else
+ #define DBG_NO_LLC 0
++#endif
+ #define DBG_NO_SEMAPHORES 0
+ #define DBG_NO_MADV 0
+ #define DBG_NO_UPLOAD_CACHE 0
+@@ -680,7 +689,11 @@ retry_wc:
+ 
+ static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo)
+ {
++#if defined(__DragonFly__)
++	struct local_i915_gem_mmap2 arg;
++#else
+ 	struct local_i915_gem_mmap arg;
++#endif
+ 	int err;
+ 
+ 	VG_CLEAR(arg);
+@@ -689,7 +702,12 @@ static void *__kgem_bo_map__cpu(struct k
+ retry:
+ 	arg.handle = bo->handle;
+ 	arg.size = bytes(bo);
++#if defined(__DragonFly__)
++	arg.flags = 0;
++	if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP_v2, &arg))) {
++#else
+ 	if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) {
++#endif
+ 		DBG(("%s: failed %d, throttling/cleaning caches\n",
+ 		     __FUNCTION__, err));
+ 		assert(err != -EINVAL || bo->prime);
+@@ -3299,11 +3317,21 @@ bool __kgem_ring_is_idle(struct kgem *kg
+ 	if (rq) {
+ 		struct kgem_request *tmp;
+ 
++#if defined(__DragonFly__)
++		if (rq->bo == NULL)
++			fprintf(stderr, "__kgem_ring_is_idle: rq->bo == NULL\n");
++		if (rq->bo && __kgem_busy(kgem, rq->bo->handle)) {
++			DBG(("%s: last fence handle=%d still busy\n",
++			     __FUNCTION__, rq->bo->handle));
++			return false;
++		}
++#else
+ 		if (__kgem_busy(kgem, rq->bo->handle)) {
+ 			DBG(("%s: last fence handle=%d still busy\n",
+ 			     __FUNCTION__, rq->bo->handle));
+ 			return false;
+ 		}
++#endif
+ 
+ 		do {
+ 			tmp = list_first_entry(&kgem->requests[ring],
diff --git a/xf86-video-intel-devel-dfbsd/patches/patch-src_sna_sna__threads.c b/xf86-video-intel-devel-dfbsd/patches/patch-src_sna_sna__threads.c
new file mode 100644
index 0000000000..a0cc87f6ce
--- /dev/null
+++ b/xf86-video-intel-devel-dfbsd/patches/patch-src_sna_sna__threads.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- src/sna/sna_threads.c.orig	2017-02-10 21:52:47.000000000 +0000
++++ src/sna/sna_threads.c
+@@ -29,6 +29,11 @@
+ #include "config.h"
+ #endif
+ 
++#if defined(__FreeBSD__)
++#define _WITH_GETLINE	/* to expose getline() in stdio.h on FreeBSD */
++#include <stdio.h>	/* for getline() */
++#endif
++
+ #include "sna.h"
+ 
+ #include <unistd.h>


Home | Main Index | Thread Index | Old Index