pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
xf86-video-intel-dfbsd: Update wip/xf86-video-intel-dfbsd through git 2019-01-21
Module Name: pkgsrc-wip
Committed By: David Shao <davshao%gmail.com@localhost>
Pushed By: dshao
Date: Sat Feb 23 20:30:07 2019 -0800
Changeset: d1bbedcb96d41cbf0af5ec9f7322be5fd2e2c1ac
Modified Files:
xf86-video-intel-dfbsd/DESCR
xf86-video-intel-dfbsd/Makefile
xf86-video-intel-dfbsd/PLIST
xf86-video-intel-dfbsd/TODO
xf86-video-intel-dfbsd/distinfo
xf86-video-intel-dfbsd/patches/patch-src_intel__device.c
xf86-video-intel-dfbsd/patches/patch-src_sna_kgem.c
Added Files:
xf86-video-intel-dfbsd/patches/patch-src_intel__list.h
xf86-video-intel-dfbsd/patches/patch-src_sna_sna__threads.c
xf86-video-intel-dfbsd/patches/patch-src_sna_sna__video.c
Removed Files:
xf86-video-intel-dfbsd/PLIST.Linux
xf86-video-intel-dfbsd/patches/patch-src_backlight.c
xf86-video-intel-dfbsd/patches/patch-src_compat-api.h
xf86-video-intel-dfbsd/patches/patch-src_legacy_i810_i810__dri.c
xf86-video-intel-dfbsd/patches/patch-src_legacy_i810_i810__video.c
xf86-video-intel-dfbsd/patches/patch-src_sna_sna.h
xf86-video-intel-dfbsd/patches/patch-src_sna_sna__accel.c
xf86-video-intel-dfbsd/patches/patch-src_sna_sna__acpi.c
xf86-video-intel-dfbsd/patches/patch-src_sna_sna__display.c
xf86-video-intel-dfbsd/patches/patch-src_sna_sna__dri2.c
xf86-video-intel-dfbsd/patches/patch-src_sna_sna__driver.c
xf86-video-intel-dfbsd/patches/patch-src_uxa_intel.h
xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__display.c
xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__driver.c
Log Message:
xf86-video-intel-dfbsd: Update wip/xf86-video-intel-dfbsd through git 2019-01-21
Changes:
Switch to only using the git version
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d1bbedcb96d41cbf0af5ec9f7322be5fd2e2c1ac
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
xf86-video-intel-dfbsd/DESCR | 12 ---
xf86-video-intel-dfbsd/Makefile | 94 +++++++++++++++------
xf86-video-intel-dfbsd/PLIST | 4 +-
xf86-video-intel-dfbsd/PLIST.Linux | 3 -
xf86-video-intel-dfbsd/TODO | 14 +---
xf86-video-intel-dfbsd/distinfo | 30 +++----
.../patches/patch-src_backlight.c | 25 ------
.../patches/patch-src_compat-api.h | 40 ---------
.../patches/patch-src_intel__device.c | 61 ++++++++++----
.../patches/patch-src_intel__list.h | 67 +++++++++++++++
.../patches/patch-src_legacy_i810_i810__dri.c | 33 --------
.../patches/patch-src_legacy_i810_i810__video.c | 88 --------------------
.../patches/patch-src_sna_kgem.c | 53 ++++++++++--
xf86-video-intel-dfbsd/patches/patch-src_sna_sna.h | 17 ----
.../patches/patch-src_sna_sna__accel.c | 50 ------------
.../patches/patch-src_sna_sna__acpi.c | 38 ---------
.../patches/patch-src_sna_sna__display.c | 30 -------
.../patches/patch-src_sna_sna__dri2.c | 12 ---
.../patches/patch-src_sna_sna__driver.c | 95 ----------------------
.../patches/patch-src_sna_sna__threads.c | 18 ++++
.../patches/patch-src_sna_sna__video.c | 20 +++++
.../patches/patch-src_uxa_intel.h | 17 ----
.../patches/patch-src_uxa_intel__display.c | 55 -------------
.../patches/patch-src_uxa_intel__driver.c | 79 ------------------
24 files changed, 287 insertions(+), 668 deletions(-)
diffs:
diff --git a/xf86-video-intel-dfbsd/DESCR b/xf86-video-intel-dfbsd/DESCR
index bb729eafa1..08dab8f7da 100644
--- a/xf86-video-intel-dfbsd/DESCR
+++ b/xf86-video-intel-dfbsd/DESCR
@@ -1,13 +1 @@
This is the video driver for Intel cards for the modular Xorg server.
-Support hardware includes the following chipsets:
- - i810, i810-dc100, i810e
- - i815
- - i830
- - i845
- - i852
- - i855
- - i915
- - i945
- - i965
-
-An older version of the Intel driver is available in x11/xf86-video-i810.
diff --git a/xf86-video-intel-dfbsd/Makefile b/xf86-video-intel-dfbsd/Makefile
index 7111005767..9ad3e6c8fb 100644
--- a/xf86-video-intel-dfbsd/Makefile
+++ b/xf86-video-intel-dfbsd/Makefile
@@ -1,10 +1,31 @@
-# $NetBSD: Makefile,v 1.39 2016/12/07 21:59:54 wiz Exp $
+# $NetBSD: Makefile,v 1.40 2018/03/07 11:57:43 wiz Exp $
-DISTNAME= xf86-video-intel-2.99.917
-PKGREVISION= 6
+# 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
+
+# 2019-01-21 sna/uxa: Fix colormap handling at screen depth 30. (v2)
+COMMIT_ID= 33ee0c3b21ea279e08d0863fcb2e874f0974b00e
+
+# 2019-01-10 sna: Switch off old outputs on topology changes
+# COMMIT_ID= c37c7ee0748ba828ec5d2c7304cd2a17af2c8109
+
+# 2018-05-12 configure: Set DRI1 to autodiscover
+# COMMIT_ID= 359477215092ac1b602ad1e2f17a28963d9224c2
+
+# sna: Use the first active crtc as the primary output fallback
+# COMMIT_ID= cb6ba2da056f3298a765b4da5cd626343c00a533
+
+# 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
+PKGREVISION= 7
CATEGORIES= x11
-MASTER_SITES= ${MASTER_SITE_XORG:=driver/}
-EXTRACT_SUFX= .tar.bz2
+MASTER_SITES= http://cgit.freedesktop.org/xorg/driver/${PORTNAME}/snapshot/
+EXTRACT_SUFX= .tar.xz
MAINTAINER= joerg%NetBSD.org@localhost
HOMEPAGE= http://xorg.freedesktop.org/
@@ -12,52 +33,79 @@ COMMENT= Modular Xorg Intel video driver
CONFLICTS+= xf86-video-i810-[0-9]*
-CONFIGURE_ARGS+= --enable-dri
-
-.include "../../mk/bsd.prefs.mk"
+# Enabled by default
+# CONFIGURE_ARGS+= --enable-dri
+# CONFIGURE_ARGS+= --enable-dri2
GNU_CONFIGURE= YES
USE_LIBTOOL= YES
-USE_TOOLS+= pkg-config
+USE_TOOLS+= pkg-config automake autoconf autoreconf
CONFIGURE_ENV.SunOS+= DRIVER_MAN_SUFFIX=4
-# From FreeBSD ports / DragonFly dports
+# From DragonFly dports x11-drivers/xf86-video-intel29 2.99.2017.01.06
+CONFIGURE_ENV.DragonFly+= xorg_cv_cc_flag__Wno_maybe_uninitialized=no
+
# 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
-CFLAGS.FreeBSD+= -D_WITH_GETLINE=1
-CONFIGURE_ENV.FreeBSD+= xorg_cv_cc_flag__Wno_maybe_uninitialized=no
+# FreeBSD ports now patches files individually.
+# CFLAGS.FreeBSD+= -D_WITH_GETLINE=1
CFLAGS.DragonFly+= -D_WITH_GETLINE=1
-CONFIGURE_ENV.DragonFly+= xorg_cv_cc_flag__Wno_maybe_uninitialized=no
-BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.7
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "DragonFly"
+SUBST_CLASSES+= jmp_buf
+SUBST_STAGE.jmp_buf= post-patch
+SUBST_MESSAGE.jmp_buf= Prefer to use dfly specific sigjmp_buf for less errors
+SUBST_FILES.jmp_buf= src/sna/sna.h
+SUBST_FILES.jmp_buf+= src/sna/sna_accel.c
+SUBST_SED.jmp_buf= -e 's@[[:<:]]jmp_buf[[:>:]]@sigjmp_buf@g'
+.endif
PKG_OPTIONS_VAR= PKG_OPTIONS.xf86-video-intel
-PKG_SUPPORTED_OPTIONS= debug xvmc
+PKG_SUPPORTED_OPTIONS= uxa dri3 debug
+PKG_SUGGESTED_OPTIONS=
+
+CONFIGURE_ARGS.FreeBSD+= --disable-udev
+
+.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
+# .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
-PLIST_VARS+= xvmc
+pre-configure:
+ cd ${WRKSRC} && autoreconf -vif
-.if !empty(PKG_OPTIONS:Mxvmc)
-.include "../../x11/xcb-util/buildlink3.mk"
-PLIST.xvmc= yes
-.endif
-
-.include "../../devel/xorg-util-macros/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.7
.include "../../x11/modular-xorg-server/buildlink3.mk"
.include "../../x11/libXvMC/buildlink3.mk"
.include "../../x11/libdrm/buildlink3.mk"
.include "../../x11/xorgproto/buildlink3.mk"
-.include "../../x11/libXrender/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
+
+# Seems required for actual xvmc support
+.include "../../x11/xcb-util/buildlink3.mk"
+
.include "../../mk/bsd.pkg.mk"
diff --git a/xf86-video-intel-dfbsd/PLIST b/xf86-video-intel-dfbsd/PLIST
index 3433a3c808..867a2ac72c 100644
--- a/xf86-video-intel-dfbsd/PLIST
+++ b/xf86-video-intel-dfbsd/PLIST
@@ -1,3 +1,5 @@
-@comment $NetBSD: PLIST,v 1.4 2013/05/16 06:16:50 richard Exp $
+@comment $NetBSD: PLIST,v 1.1 2015/04/01 13:11:38 tnn2 Exp $
+lib/libI810XvMC.la
+lib/libIntelXvMC.la
lib/xorg/modules/drivers/intel_drv.la
man/man4/intel.4
diff --git a/xf86-video-intel-dfbsd/PLIST.Linux b/xf86-video-intel-dfbsd/PLIST.Linux
deleted file mode 100644
index 9553627d1c..0000000000
--- a/xf86-video-intel-dfbsd/PLIST.Linux
+++ /dev/null
@@ -1,3 +0,0 @@
-@comment $NetBSD: PLIST.Linux,v 1.1 2016/03/09 07:31:56 tnn Exp $
-libexec/xf86-video-intel-backlight-helper
-share/polkit-1/actions/org.x.xf86-video-intel.backlight-helper.policy
diff --git a/xf86-video-intel-dfbsd/TODO b/xf86-video-intel-dfbsd/TODO
index 91a0990efa..2f394e5177 100644
--- a/xf86-video-intel-dfbsd/TODO
+++ b/xf86-video-intel-dfbsd/TODO
@@ -1,12 +1,4 @@
-Copy this port to replace x11/xf86-video-intel,
-do not install from wip.
+Copy port to x11/xf86-video-intel, do not install from wip.
-Implemented changes discussed in pkg/50090
-(x11/xf86-video-intel fix build and enable functionality
- on newer DragonFly and FreeBSD)
-
-Also includes fixes not quite added discussed in pkg/51687
-(x11/xf86-video-intel fix build post xserver 1.19)
-
-Needs to switch to latest git snapshot from freedesktop.org
-since no release since 2014.
+FreeBSD 11-release G45 Intel integrated graphics machine reboots
+when startx of xfce4.
diff --git a/xf86-video-intel-dfbsd/distinfo b/xf86-video-intel-dfbsd/distinfo
index 9161fb7f9d..f059fc6d55 100644
--- a/xf86-video-intel-dfbsd/distinfo
+++ b/xf86-video-intel-dfbsd/distinfo
@@ -1,21 +1,11 @@
-$NetBSD: distinfo,v 1.28 2016/12/07 21:59:54 wiz Exp $
+$NetBSD: distinfo,v 1.1 2015/04/01 13:11:38 tnn2 Exp $
-SHA1 (xf86-video-intel-2.99.917.tar.bz2) = 9af9ded7a29026c211e5eb50a547e3e33976301d
-RMD160 (xf86-video-intel-2.99.917.tar.bz2) = dd443e9e87286bbc454f4231a7a5d7c9bb2488a1
-SHA512 (xf86-video-intel-2.99.917.tar.bz2) = cbf4d46ad1ad5e5587c0f1f620ff534ef0645270517b60056b9f03e83d8216e2f456de46352a06c37c0c46963cc4ed20b71b815b20ec1bf680ff046e535f580f
-Size (xf86-video-intel-2.99.917.tar.bz2) = 2259040 bytes
-SHA1 (patch-src_backlight.c) = 39537a3233613c777f0475343f0be615bff3c3ca
-SHA1 (patch-src_compat-api.h) = 303cc02ad41aa8024631577b9ea0bb26cd5f23f4
-SHA1 (patch-src_intel__device.c) = 37771d560aac9a51c3bfa72d7905c0030f8deb5d
-SHA1 (patch-src_legacy_i810_i810__dri.c) = fb963b994d51c9db48457106048226214a2d986c
-SHA1 (patch-src_legacy_i810_i810__video.c) = 8788a9bf4e1efdb5292771c125af9a24c09d62da
-SHA1 (patch-src_sna_kgem.c) = b109f5c42f455d2ac5d9b2ca4a57821c4cfbab40
-SHA1 (patch-src_sna_sna.h) = 13f0f7c9f8235f6100da90203a9ca4aa09fad977
-SHA1 (patch-src_sna_sna__accel.c) = 0510f3409b5a1e6c0b381147af33e2ac1d4ff590
-SHA1 (patch-src_sna_sna__acpi.c) = 7105609e38876fe8bb931d6980c023cabdf41736
-SHA1 (patch-src_sna_sna__display.c) = beec5ca100c768547ceeb6ba8f3344aba802cd2d
-SHA1 (patch-src_sna_sna__dri2.c) = 4bcc7e5c502a340954073386dad88fd6cebcc7b1
-SHA1 (patch-src_sna_sna__driver.c) = 394f0553e64cbcfa5b175cba9d7b87c86f025415
-SHA1 (patch-src_uxa_intel.h) = 201a28ce259c474ea9f83700ec04c105388ad8ed
-SHA1 (patch-src_uxa_intel__display.c) = b8936ecbad39f5a507ae32b4c46d5069f53ca727
-SHA1 (patch-src_uxa_intel__driver.c) = de06325884207d93fd3ebff62e330dede4cd3faf
+SHA1 (xf86-video-intel-33ee0c3b21ea279e08d0863fcb2e874f0974b00e.tar.xz) = c6890dd1d7e1bdd787ae0d473cb855929168684d
+RMD160 (xf86-video-intel-33ee0c3b21ea279e08d0863fcb2e874f0974b00e.tar.xz) = 09c2927b027c8d639fc8d9a97cce1f77d5e349a1
+SHA512 (xf86-video-intel-33ee0c3b21ea279e08d0863fcb2e874f0974b00e.tar.xz) = b63ce62b1406e9e576aab7db4174b0b40c6074590d32166d98eac7b5019671f47c5ab6199e887b442a9db7daaf2e7df908ec8c4d4016e8c89fc28d750c169622
+Size (xf86-video-intel-33ee0c3b21ea279e08d0863fcb2e874f0974b00e.tar.xz) = 955256 bytes
+SHA1 (patch-src_intel__device.c) = b0a1f775d3e66605e9a1d94745bc4f7a1fba179e
+SHA1 (patch-src_intel__list.h) = 98ba59c22bc7109f95666291ca1aac19189999aa
+SHA1 (patch-src_sna_kgem.c) = bcc7bf2fded99b5f5b6920f610c30b0bbc72668d
+SHA1 (patch-src_sna_sna__threads.c) = 54a3bd0de878009335f08b3f41812540a72f5d4d
+SHA1 (patch-src_sna_sna__video.c) = ee732a2c73997cfdf5c5b936fac065a0224687af
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_backlight.c b/xf86-video-intel-dfbsd/patches/patch-src_backlight.c
deleted file mode 100644
index 947b352a22..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_backlight.c
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_backlight.c,v 1.2 2015/05/22 05:40:36 richard Exp $
-
-SunOS needs <sys/mkdev.h> for major()
-
---- src/backlight.c.orig 2014-11-18 21:50:39.000000000 +0000
-+++ src/backlight.c
-@@ -49,6 +49,9 @@
-
- #include "backlight.h"
- #include "fd.h"
-+#ifdef __sun
-+#include <sys/mkdev.h>
-+#endif
-
- #define BACKLIGHT_CLASS "/sys/class/backlight"
-
-@@ -84,7 +87,7 @@ void backlight_init(struct backlight *b)
- b->has_power = 0;
- }
-
--#ifdef __OpenBSD__
-+#if defined(__OpenBSD__) || defined(__NetBSD__)
-
- #include <dev/wscons/wsconsio.h>
- #include <xf86Priv.h>
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_compat-api.h b/xf86-video-intel-dfbsd/patches/patch-src_compat-api.h
deleted file mode 100644
index 0ef711e4d3..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_compat-api.h
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-src_compat-api.h,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
---- src/compat-api.h.orig 2014-11-18 21:50:39.000000000 +0000
-+++ src/compat-api.h
-@@ -30,6 +30,7 @@
-
- #include <xorg-server.h>
- #include <xorgVersion.h>
-+#include <xf86Module.h>
-
- #include <picturestr.h>
- #ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
-@@ -42,6 +43,10 @@
- #define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
- #endif
-
-+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 22
-+#define HAVE_NOTIFY_FD 1
-+#endif
-+
- #ifndef XF86_SCRN_INTERFACE
-
- #define SCRN_ARG_TYPE int
-@@ -223,4 +228,14 @@ static inline void FreePixmap(PixmapPtr
- dstx, dsty)
- #endif
-
-+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(22, 0)
-+#define OsBlockSIGIO()
-+#define OsReleaseSIGIO()
-+#endif
-+
-+#if !HAVE_NOTIFY_FD
-+#define SetNotifyFd(fd, cb, mode, data) AddGeneralSocket(fd);
-+#define RemoveNotifyFd(fd) RemoveGeneralSocket(fd)
-+#endif
-+
- #endif
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_intel__device.c b/xf86-video-intel-dfbsd/patches/patch-src_intel__device.c
index 9c66ec45cc..84c542b281 100644
--- a/xf86-video-intel-dfbsd/patches/patch-src_intel__device.c
+++ b/xf86-video-intel-dfbsd/patches/patch-src_intel__device.c
@@ -1,23 +1,56 @@
$NetBSD$
-From past DragonFly dports x11-drivers/xf86-video-intel29 and FreeBSD ports
+Patches from FreeBSD ports x11-drivers/xf86-video-intel
---- src/intel_device.c.orig 2014-11-18 21:50:39.000000000 +0000
+* WITH_GETLINE patch.
+
+* Patch to use "i915kms" as module name from FreeBSD ports
+x11-drivers/xf86-video-intel.
+
+Patch from DragonFly dports x11-drivers/xf86-video-intel29
+
+* i915 does not use hw.dri.0.busid so simplify to basics.
+
+--- src/intel_device.c.orig 2018-05-12 09:01:10.000000000 +0000
+++ src/intel_device.c
-@@ -398,8 +398,16 @@ static int __intel_open_device__legacy(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__)
++ "i915kms",
++#endif
+ "i915",
+ NULL,
+ };
+@@ -424,6 +432,10 @@ static int __intel_open_device__legacy(c
+ "pci:%04x:%02x:%02x.%d",
pci->domain, pci->bus, pci->dev, pci->func);
- ret = drmCheckModesettingSupported(id);
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+ if (ret || 1) {
-+ if (xf86LoadKernelModule("i915kms"))
-+#elif defined(__DragonFly__)
-+ if (ret || 1) {
-+ if (xf86LoadKernelModule("i915"))
++#if defined(__DragonFly__)
++ /* assume modesetting for i915, allow multiple loads and no fbcon */
++ load_i915_kernel_module();
+#else
+ ret = drmCheckModesettingSupported(id);
if (ret) {
- if (xf86LoadKernelModule("i915"))
+ if (load_i915_kernel_module() == 0)
+@@ -433,6 +445,7 @@ static int __intel_open_device__legacy(c
+ /* Be nice to the user and load fbcon too */
+ (void)xf86LoadKernelModule("fbcon");
+ }
+#endif
- ret = drmCheckModesettingSupported(id);
- if (ret)
- return -1;
+
+ return fd_set_nonblock(drmOpen(NULL, id));
+ }
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_intel__list.h b/xf86-video-intel-dfbsd/patches/patch-src_intel__list.h
new file mode 100644
index 0000000000..1906481054
--- /dev/null
+++ b/xf86-video-intel-dfbsd/patches/patch-src_intel__list.h
@@ -0,0 +1,67 @@
+$NetBSD$
+
+Patch from FreeBSD ports x11-drivers/xf86-video-intel.
+
+--- 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-dfbsd/patches/patch-src_legacy_i810_i810__dri.c b/xf86-video-intel-dfbsd/patches/patch-src_legacy_i810_i810__dri.c
deleted file mode 100644
index 6c8e6e0554..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_legacy_i810_i810__dri.c
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-src_legacy_i810_i810__dri.c,v 1.1 2015/04/20 13:39:00 khorben Exp $
-
-CID 1107540: Make the code safe avoiding random stack access. In
-the first loop where there is a singleton point to pptSrc, only
-access that singleton, no matter what.
-
-November 2013 patch from NetBSD xsrc:
-http://mail-index.netbsd.org/source-changes/2013/11/14/msg049188.html
-
---- src/legacy/i810/i810_dri.c.orig 2014-08-29 09:33:11.000000000 +0000
-+++ src/legacy/i810/i810_dri.c
-@@ -1104,10 +1104,17 @@ I810DRIMoveBuffers(WindowPtr pParent, DD
- while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext + 1;
-- pptTmp = pptSrc + (pboxTmp - pbox);
-- while (pboxTmp <= pboxBase) {
-- *pboxNew1++ = *pboxTmp++;
-- *pptNew1++ = *pptTmp++;
-+ if (pptSrc == &ptOldOrg) {
-+ if (pboxTmp <= pboxBase) {
-+ *pboxNew1++ = *pboxTmp;
-+ *pptNew1++ = *pptSrc;
-+ }
-+ } else {
-+ pptTmp = pptSrc + (pboxTmp - pbox);
-+ while (pboxTmp <= pboxBase) {
-+ *pboxNew1++ = *pboxTmp++;
-+ *pptNew1++ = *pptTmp++;
-+ }
- }
- pboxBase = pboxNext;
- }
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_legacy_i810_i810__video.c b/xf86-video-intel-dfbsd/patches/patch-src_legacy_i810_i810__video.c
deleted file mode 100644
index 1aeb09058f..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_legacy_i810_i810__video.c
+++ /dev/null
@@ -1,88 +0,0 @@
-$NetBSD: patch-src_legacy_i810_i810__video.c,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
---- src/legacy/i810/i810_video.c.orig 2014-08-29 09:33:11.000000000 +0000
-+++ src/legacy/i810/i810_video.c
-@@ -77,7 +77,11 @@ static int I810PutImage( ScrnInfoPtr,
- static int I810QueryImageAttributes(ScrnInfoPtr,
- int, unsigned short *, unsigned short *, int *, int *);
-
-+#if !HAVE_NOTIFY_FD
- static void I810BlockHandler(BLOCKHANDLER_ARGS_DECL);
-+#else
-+static void I810BlockHandler(void *data, void *_timeout);
-+#endif
-
- #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
-
-@@ -418,8 +422,14 @@ I810SetupImageVideo(ScreenPtr screen)
-
- pI810->adaptor = adapt;
-
-+#if !HAVE_NOTIFY_FD
- pI810->BlockHandler = screen->BlockHandler;
- screen->BlockHandler = I810BlockHandler;
-+#else
-+ RegisterBlockAndWakeupHandlers(I810BlockHandler,
-+ (ServerWakeupHandlerProcPtr)NoopDDA,
-+ pScrn);
-+#endif
-
- xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
- xvContrast = MAKE_ATOM("XV_CONTRAST");
-@@ -1135,6 +1145,7 @@ I810QueryImageAttributes(
- return size;
- }
-
-+#if !HAVE_NOTIFY_FD
- static void
- I810BlockHandler (BLOCKHANDLER_ARGS_DECL)
- {
-@@ -1172,7 +1183,38 @@ I810BlockHandler (BLOCKHANDLER_ARGS_DECL
- }
- }
- }
-+#else
-+static void
-+I810BlockHandler(void *data, void *_timeout)
-+{
-+ ScrnInfoPtr pScrn = data;
-+ I810Ptr pI810 = I810PTR(pScrn);
-+ I810PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);
-+ I810OverlayRegPtr overlay = (I810OverlayRegPtr) (pI810->FbBase + pI810->OverlayStart);
-
-+ if(pPriv->videoStatus & TIMER_MASK) {
-+ UpdateCurrentTime();
-+ if(pPriv->videoStatus & OFF_TIMER) {
-+ if(pPriv->offTime < currentTime.milliseconds) {
-+ /* Turn off the overlay */
-+ overlay->OV0CMD &= 0xFFFFFFFE;
-+ OVERLAY_UPDATE(pI810->OverlayPhysical);
-+
-+ pPriv->videoStatus = FREE_TIMER;
-+ pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
-+ }
-+ } else { /* FREE_TIMER */
-+ if(pPriv->freeTime < currentTime.milliseconds) {
-+ if(pPriv->linear) {
-+ xf86FreeOffscreenLinear(pPriv->linear);
-+ pPriv->linear = NULL;
-+ }
-+ pPriv->videoStatus = 0;
-+ }
-+ }
-+ }
-+}
-+#endif
-
- /***************************************************************************
- * Offscreen Images
-@@ -1373,7 +1415,6 @@ I810DisplaySurface(
- UpdateCurrentTime();
- pI810Priv->videoStatus = FREE_TIMER;
- pI810Priv->freeTime = currentTime.milliseconds + FREE_DELAY;
-- pScrn->pScreen->BlockHandler = I810BlockHandler;
- }
-
- return Success;
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_kgem.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_kgem.c
index 86d9ee0a20..dac2bbac68 100644
--- a/xf86-video-intel-dfbsd/patches/patch-src_sna_kgem.c
+++ b/xf86-video-intel-dfbsd/patches/patch-src_sna_kgem.c
@@ -1,13 +1,31 @@
$NetBSD$
-From DragonFly dports x11-drivers/xf86-video-intel29
+WITH_GETLINE patch from FreeBSD ports x11-drivers/xf86-video-intel
---- src/sna/kgem.c.orig 2014-12-09 16:08:21.000000000 +0000
+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 2019-01-10 10:01:58.000000000 +0000
+++ src/sna/kgem.c
-@@ -70,7 +70,11 @@ search_snoop_cache(struct kgem *kgem, un
- #define DBG_NO_CREATE2 0
+@@ -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"
+
+@@ -71,7 +76,11 @@ search_snoop_cache(struct kgem *kgem, un
#define DBG_NO_USERPTR 0
#define DBG_NO_UNSYNCHRONIZED_USERPTR 0
+ #define DBG_NO_COHERENT_MMAP_GTT 0
+#if defined(__DragonFly__)
+#define DBG_NO_LLC 1
+#else
@@ -16,7 +34,32 @@ From DragonFly dports x11-drivers/xf86-video-intel29
#define DBG_NO_SEMAPHORES 0
#define DBG_NO_MADV 0
#define DBG_NO_UPLOAD_CACHE 0
-@@ -2802,11 +2806,21 @@ bool __kgem_ring_is_idle(struct kgem *kg
+@@ -682,7 +691,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);
+@@ -691,7 +704,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);
+@@ -3313,11 +3331,21 @@ bool __kgem_ring_is_idle(struct kgem *kg
if (rq) {
struct kgem_request *tmp;
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna.h b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna.h
deleted file mode 100644
index cc92d91f2c..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna.h
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-src_sna_sna.h,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
---- src/sna/sna.h.orig 2014-12-20 13:29:05.000000000 +0000
-+++ src/sna/sna.h
-@@ -364,8 +364,10 @@ struct sna {
- EntityInfoPtr pEnt;
- const struct intel_device_info *info;
-
-+#if !HAVE_NOTIFY_FD
- ScreenBlockHandlerProcPtr BlockHandler;
- ScreenWakeupHandlerProcPtr WakeupHandler;
-+#endif
- CloseScreenProcPtr CloseScreen;
-
- PicturePtr clear;
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__accel.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__accel.c
deleted file mode 100644
index 9cc3ba3aff..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__accel.c
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD: patch-src_sna_sna__accel.c,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
---- src/sna/sna_accel.c.orig 2014-12-20 13:29:27.000000000 +0000
-+++ src/sna/sna_accel.c
-@@ -115,6 +115,11 @@
- #define RECTILINEAR 0x4
- #define OVERWRITES 0x8
-
-+#if XFONT2_CLIENT_FUNCS_VERSION >= 1
-+#define AllocateFontPrivateIndex() xfont2_allocate_font_private_index()
-+#define FontSetPrivate(font, idx, data) xfont2_font_set_private(font, idx, data)
-+#endif
-+
- #if 0
- static void __sna_fallback_flush(DrawablePtr d)
- {
-@@ -17811,6 +17816,13 @@ static bool sna_option_accel_blt(struct
- return strcasecmp(s, "blt") == 0;
- }
-
-+#if HAVE_NOTIFY_FD
-+static void sna_accel_notify(int fd, int ready, void *data)
-+{
-+ sna_mode_wakeup(data);
-+}
-+#endif
-+
- bool sna_accel_init(ScreenPtr screen, struct sna *sna)
- {
- const char *backend;
-@@ -17822,7 +17834,7 @@ bool sna_accel_init(ScreenPtr screen, st
- list_init(&sna->flush_pixmaps);
- list_init(&sna->active_pixmaps);
-
-- AddGeneralSocket(sna->kgem.fd);
-+ SetNotifyFd(sna->kgem.fd, sna_accel_notify, X_NOTIFY_READ, sna);
-
- #ifdef DEBUG_MEMORY
- sna->timer_expire[DEBUG_MEMORY_TIMER] = GetTimeInMillis()+ 10 * 1000;
-@@ -17998,7 +18010,7 @@ void sna_accel_close(struct sna *sna)
- sna_pixmap_expire(sna);
-
- DeleteCallback(&FlushCallback, sna_accel_flush_callback, sna);
-- RemoveGeneralSocket(sna->kgem.fd);
-+ RemoveNotifyFd(sna->kgem.fd);
-
- kgem_cleanup_cache(&sna->kgem);
- }
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__acpi.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__acpi.c
deleted file mode 100644
index 7b9cb083f1..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__acpi.c
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD: patch-src_sna_sna__acpi.c,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
---- src/sna/sna_acpi.c.orig 2014-08-29 09:33:11.000000000 +0000
-+++ src/sna/sna_acpi.c
-@@ -92,7 +92,7 @@ void _sna_acpi_wakeup(struct sna *sna)
- DBG(("%s: error [%d], detaching from acpid\n", __FUNCTION__, n));
-
- /* XXX reattach later? */
-- RemoveGeneralSocket(sna->acpi.fd);
-+ RemoveNotifyFd(sna->acpi.fd);
- sna_acpi_fini(sna);
- return;
- }
-@@ -136,6 +136,13 @@ void _sna_acpi_wakeup(struct sna *sna)
- } while (n);
- }
-
-+#if HAVE_NOTIFY_FD
-+static void sna_acpi_notify(int fd, int read, void *data)
-+{
-+ _sna_acpi_wakeup(data);
-+}
-+#endif
-+
- static int read_power_state(const char *path)
- {
- DIR *dir;
-@@ -200,7 +207,7 @@ void sna_acpi_init(struct sna *sna)
-
- DBG(("%s: attaching to acpid\n", __FUNCTION__));
-
-- AddGeneralSocket(sna->acpi.fd);
-+ SetNotifyFd(sna->acpi.fd, sna_acpi_notify, X_NOTIFY_READ, sna);
- sna->acpi.remain = sizeof(sna->acpi.event) - 1;
- sna->acpi.offset = 0;
-
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__display.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__display.c
deleted file mode 100644
index baafbc534e..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__display.c
+++ /dev/null
@@ -1,30 +0,0 @@
-$NetBSD: patch-src_sna_sna__display.c,v 1.1 2015/05/22 05:40:36 richard Exp $
-
-SunOS needs <alloca.h> for alloca()
-
-DragonFly dports some version ignored xf86ReturnOptValBool()
-
---- src/sna/sna_display.c.orig 2014-12-20 13:45:31.000000000 +0000
-+++ src/sna/sna_display.c
-@@ -72,6 +72,9 @@
- #include <memcheck.h>
- #endif
-
-+#ifdef __sun
-+#include <alloca.h>
-+#endif
- /* Minor discrepancy between 32-bit/64-bit ABI in old kernels */
- union compat_mode_get_connector{
- struct drm_mode_get_connector conn;
-@@ -5543,7 +5546,11 @@ static bool sna_probe_initial_configurat
- OPTION_ROTATE,
- OPTION_PANNING,
- };
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+ if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE) || 1) {
-+#else
- if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
-+#endif
- DBG(("%s: user requests reprobing\n", __FUNCTION__));
- return false;
- }
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__dri2.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__dri2.c
deleted file mode 100644
index e7ec9398e6..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__dri2.c
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-src_sna_sna__dri2.c,v 1.1 2015/03/03 01:02:05 khorben Exp $
-
---- src/sna/sna_dri2.c.orig 2014-12-20 12:46:23.000000000 +0000
-+++ src/sna/sna_dri2.c
-@@ -247,6 +247,7 @@ inline static void *dri2_window_get_fron
-
- #define xorg_can_triple_buffer() 0
- #define swap_limit(d, l) false
-+#define mark_stale(b)
-
- #else
-
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__driver.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__driver.c
deleted file mode 100644
index f9a009e71e..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__driver.c
+++ /dev/null
@@ -1,95 +0,0 @@
-$NetBSD: patch-src_sna_sna__driver.c,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
-Wrong place for #if !HAVE_NOTIFY_FD condition.
-
-"sna: Update sanity check for next stage of Xorg ABI" 2016-09-19
-https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=b45dbdbd446108745b39b305303b457f5e876989
-
-"sna: Wrap direct access to ScrnInfoPtr->pScreen" 2015-01-13
-https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=b7feeca0730bf55c23e5bc5af4cae9b8a73bba0e
-
---- src/sna/sna_driver.c.orig 2014-12-11 13:52:11.000000000 +0000
-+++ src/sna/sna_driver.c
-@@ -721,6 +721,7 @@ cleanup:
- return FALSE;
- }
-
-+#if !HAVE_NOTIFY_FD
- static bool has_shadow(struct sna *sna)
- {
- if (!sna->mode.shadow_damage)
-@@ -778,6 +779,31 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DE
- FD_CLR(sna->kgem.fd, (fd_set*)read_mask);
- }
- }
-+#else
-+static void
-+sna_block_handler(void *data, void *_timeout)
-+{
-+ struct sna *sna = data;
-+ int *timeout = _timeout;
-+ struct timeval tv, *tvp;
-+
-+ DBG(("%s (timeout=%d)\n", __FUNCTION__, *timeout));
-+ if (*timeout == 0)
-+ return;
-+
-+ if (*timeout < 0) {
-+ tvp = NULL;
-+ } else {
-+ tv.tv_sec = *timeout / 1000;
-+ tv.tv_usec = (*timeout % 1000) * 1000;
-+ tvp = &tv;
-+ }
-+
-+ sna_accel_block_handler(sna, &tvp);
-+ if (tvp)
-+ *timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000;
-+}
-+#endif
-
- #if HAVE_UDEV
- static void
-@@ -948,6 +974,12 @@ static Bool sna_early_close_screen(CLOSE
-
- /* XXX Note that we will leak kernel resources if !vtSema */
-
-+#if HAVE_NOTIFY_FD
-+ RemoveBlockAndWakeupHandlers(sna_block_handler,
-+ (ServerWakeupHandlerProcPtr)NoopDDA,
-+ sna);
-+#endif
-+
- sna_uevent_fini(sna);
- sna_mode_close(sna);
-
-@@ -1098,7 +1130,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
- DBG(("%s\n", __FUNCTION__));
-
- assert(sna->scrn == scrn);
-- assert(scrn->pScreen == NULL); /* set afterwards */
-+ assert(scrn->pScreen == NULL || /* set afterwards */
-+ scrn->pScreen == screen);
-
- assert(sna->freed_pixmap == NULL);
-
-@@ -1166,11 +1199,17 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
- * later memory should be bound when allocating, e.g rotate_mem */
- scrn->vtSema = TRUE;
-
-+#if !HAVE_NOTIFY_FD
- sna->BlockHandler = screen->BlockHandler;
- screen->BlockHandler = sna_block_handler;
-
- sna->WakeupHandler = screen->WakeupHandler;
- screen->WakeupHandler = sna_wakeup_handler;
-+#else
-+ RegisterBlockAndWakeupHandlers(sna_block_handler,
-+ (ServerWakeupHandlerProcPtr)NoopDDA,
-+ sna);
-+#endif
-
- screen->SaveScreen = sna_save_screen;
- screen->CreateScreenResources = sna_create_screen_resources;
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__threads.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__threads.c
new file mode 100644
index 0000000000..501c5d0973
--- /dev/null
+++ b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__threads.c
@@ -0,0 +1,18 @@
+$NetBSD$
+
+WITH_GETLINE patch from FreeBSD ports x11-drivers/xf86-video-intel
+
+--- 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>
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__video.c b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__video.c
new file mode 100644
index 0000000000..0802b94399
--- /dev/null
+++ b/xf86-video-intel-dfbsd/patches/patch-src_sna_sna__video.c
@@ -0,0 +1,20 @@
+$NetBSD$
+
+Extend to DragonFly
+
+2019-01-10
+sna: fix of byteswap.h absence on bsd
+
+https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=985553dff9d9de255edb6acb0ae85117ceb3e76c
+
+--- src/sna/sna_video.c.orig 2019-01-10 10:01:58.000000000 +0000
++++ src/sna/sna_video.c
+@@ -59,7 +59,7 @@
+ #include "intel_options.h"
+
+ #include <xf86xv.h>
+-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+ #include <sys/types.h>
+ #include <sys/endian.h>
+ #ifdef __OpenBSD__
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel.h b/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel.h
deleted file mode 100644
index ebaaf4b0e7..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel.h
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-src_uxa_intel.h,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
---- src/uxa/intel.h.orig 2014-12-09 20:41:25.000000000 +0000
-+++ src/uxa/intel.h
-@@ -196,7 +196,10 @@ typedef struct intel_screen_private {
-
- int colorKey;
- XF86VideoAdaptorPtr adaptor;
-+
-+#if !HAVE_NOTIFY_FD
- ScreenBlockHandlerProcPtr BlockHandler;
-+#endif
- Bool overlayOn;
-
- struct {
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__display.c b/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__display.c
deleted file mode 100644
index 111eafa090..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__display.c
+++ /dev/null
@@ -1,55 +0,0 @@
-$NetBSD: patch-src_uxa_intel__display.c,v 1.1 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
---- src/uxa/intel_display.c.orig 2014-12-09 20:43:16.000000000 +0000
-+++ src/uxa/intel_display.c
-@@ -2072,6 +2072,7 @@ intel_pageflip_abort(ScrnInfoPtr scrn, x
- /*
- * Check for pending DRM events and process them.
- */
-+#if !HAVE_NOTIFY_FD
- static void
- drm_wakeup_handler(pointer data, int err, pointer p)
- {
-@@ -2086,6 +2087,14 @@ drm_wakeup_handler(pointer data, int err
- if (FD_ISSET(mode->fd, read_mask))
- drmHandleEvent(mode->fd, &mode->event_context);
- }
-+#else
-+static void
-+drm_notify_fd(int fd, int ready, void *data)
-+{
-+ struct intel_mode *mode = data;
-+ drmHandleEvent(mode->fd, &mode->event_context);
-+}
-+#endif
-
- /*
- * If there are any available, read drm_events
-@@ -2250,9 +2259,11 @@ intel_mode_init(struct intel_screen_priv
- * registration within ScreenInit and not PreInit.
- */
- mode->flip_count = 0;
-- AddGeneralSocket(mode->fd);
-+ SetNotifyFd(mode->fd, drm_notify_fd, X_NOTIFY_READ, mode);
-+#if !HAVE_NOTIFY_FD
- RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
- drm_wakeup_handler, mode);
-+#endif
- }
-
- void
-@@ -2276,9 +2287,11 @@ intel_mode_close(intel_screen_private *i
-
- intel_drm_abort_scrn(intel->scrn);
-
-+#if !HAVE_NOTIFY_FD
- RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
- drm_wakeup_handler, mode);
-- RemoveGeneralSocket(mode->fd);
-+#endif
-+ RemoveNotifyFd(mode->fd);
- }
-
- void
diff --git a/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__driver.c b/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__driver.c
deleted file mode 100644
index df531819d1..0000000000
--- a/xf86-video-intel-dfbsd/patches/patch-src_uxa_intel__driver.c
+++ /dev/null
@@ -1,79 +0,0 @@
-$NetBSD: patch-src_uxa_intel__driver.c,v 1.2 2016/12/07 21:59:54 wiz Exp $
-
-Upstream patches for xorg-server-1.19.
-
-Translated back using 2015-01-13 "sna: Wrap direct access to ScrnInfoPtr->pScreen"
-https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=b7feeca0730bf55c23e5bc5af4cae9b8a73bba0e
-
---- src/uxa/intel_driver.c.orig 2014-12-09 20:43:22.000000000 +0000
-+++ src/uxa/intel_driver.c
-@@ -642,7 +642,11 @@ redisplay_dirty(ScreenPtr screen, Pixmap
- return;
-
- PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
-+#ifdef HAS_DIRTYTRACKING_ROTATION
-+ PixmapSyncDirtyHelper(dirty);
-+#else
- PixmapSyncDirtyHelper(dirty, &pixregion);
-+#endif
- RegionUninit(&pixregion);
-
- intel_flush(intel);
-@@ -659,8 +663,9 @@ redisplay_dirty(ScreenPtr screen, Pixmap
- }
-
- static void
--intel_dirty_update(ScreenPtr screen)
-+intel_dirty_update(intel_screen_private *intel)
- {
-+ ScreenPtr screen = (intel->scrn)->pScreen;
- RegionPtr region;
- PixmapDirtyUpdatePtr ent;
-
-@@ -677,6 +682,7 @@ intel_dirty_update(ScreenPtr screen)
- }
- #endif
-
-+#if !HAVE_NOTIFY_FD
- static void
- I830BlockHandler(BLOCKHANDLER_ARGS_DECL)
- {
-@@ -694,9 +700,22 @@ I830BlockHandler(BLOCKHANDLER_ARGS_DECL)
- intel_uxa_block_handler(intel);
- intel_video_block_handler(intel);
- #ifdef INTEL_PIXMAP_SHARING
-- intel_dirty_update(screen);
-+ intel_dirty_update(intel);
- #endif
- }
-+#else
-+static void
-+I830BlockHandler(void *data, void *timeout)
-+{
-+ intel_screen_private *intel = data;
-+
-+ intel_uxa_block_handler(intel);
-+ intel_video_block_handler(intel);
-+#ifdef INTEL_PIXMAP_SHARING
-+ intel_dirty_update(intel);
-+#endif
-+}
-+#endif
-
- static Bool
- intel_init_initial_framebuffer(ScrnInfoPtr scrn)
-@@ -939,8 +958,14 @@ I830ScreenInit(SCREEN_INIT_ARGS_DECL)
- "Hardware cursor initialization failed\n");
- }
-
-+#if !HAVE_NOTIFY_FD
- intel->BlockHandler = screen->BlockHandler;
- screen->BlockHandler = I830BlockHandler;
-+#else
-+ RegisterBlockAndWakeupHandlers(I830BlockHandler,
-+ (ServerWakeupHandlerProcPtr)NoopDDA,
-+ intel);
-+#endif
-
- #ifdef INTEL_PIXMAP_SHARING
- screen->StartPixmapTracking = PixmapStartDirtyTracking;
Home |
Main Index |
Thread Index |
Old Index