From bc442919abfb61606517399b70e428282932e050 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Fri, 13 Jan 2017 03:36:22 +0000 Subject: [PATCH] alarm/xf86-video-armsoc-odroid to 240.78c3cda-1 --- ...k-WakeupHandler-signature-for-ABI-23.patch | 33 ++++++ .../0001-compat-for-newer-xorg.patch | 40 ------- .../0002-Use-NotifyFd-for-drm-fd.patch | 101 ++++++++++++++++++ alarm/xf86-video-armsoc-odroid/PKGBUILD | 24 +++-- 4 files changed, 147 insertions(+), 51 deletions(-) create mode 100644 alarm/xf86-video-armsoc-odroid/0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch delete mode 100644 alarm/xf86-video-armsoc-odroid/0001-compat-for-newer-xorg.patch create mode 100644 alarm/xf86-video-armsoc-odroid/0002-Use-NotifyFd-for-drm-fd.patch diff --git a/alarm/xf86-video-armsoc-odroid/0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch b/alarm/xf86-video-armsoc-odroid/0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch new file mode 100644 index 000000000..9f77d42ca --- /dev/null +++ b/alarm/xf86-video-armsoc-odroid/0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch @@ -0,0 +1,33 @@ +From 4e6cfc02a458f873015b7f73e93a39d3ae2ef366 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 19 Jul 2016 10:21:03 -0400 +Subject: [PATCH 1/2] Adapt Block/WakeupHandler signature for ABI 23 + +Signed-off-by: Adam Jackson +--- + src/compat-api.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/compat-api.h b/src/compat-api.h +index fefbc59..78d3c91 100644 +--- a/src/compat-api.h ++++ b/src/compat-api.h +@@ -77,9 +77,15 @@ + + #define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv + ++#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) ++#define BLOCKHANDLER_ARGS_DECL \ ++ ScreenPtr arg, pointer pTimeout ++#define BLOCKHANDLER_ARGS arg, pTimeout ++#else + #define BLOCKHANDLER_ARGS_DECL \ + ScreenPtr arg, pointer pTimeout, pointer pReadmask + #define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask ++#endif + + #define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen + #define CLOSE_SCREEN_ARGS pScreen +-- +2.11.0 + diff --git a/alarm/xf86-video-armsoc-odroid/0001-compat-for-newer-xorg.patch b/alarm/xf86-video-armsoc-odroid/0001-compat-for-newer-xorg.patch deleted file mode 100644 index f284bb077..000000000 --- a/alarm/xf86-video-armsoc-odroid/0001-compat-for-newer-xorg.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b8d09aae2902c60e89f48a1f45e822b64c9242a8 Mon Sep 17 00:00:00 2001 -From: Kevin Mihelich -Date: Sun, 15 Feb 2015 11:16:26 -0700 -Subject: [PATCH] compat for newer xorg - ---- - src/armsoc_dumb.c | 1 + - src/drmmode_display.c | 4 ++++ - 2 files changed, 5 insertions(+) - -diff --git a/src/armsoc_dumb.c b/src/armsoc_dumb.c -index 8f29b7a..879d77c 100644 ---- a/src/armsoc_dumb.c -+++ b/src/armsoc_dumb.c -@@ -27,6 +27,7 @@ - #include - #include - -+#include - #include - #include - #include -diff --git a/src/drmmode_display.c b/src/drmmode_display.c -index 85ce56f..1b47632 100644 ---- a/src/drmmode_display.c -+++ b/src/drmmode_display.c -@@ -32,6 +32,10 @@ - #include "config.h" - #endif - -+#include -+#include -+#include -+ - #include "xf86DDC.h" - #include "xf86RandR12.h" - --- -2.5.2 - diff --git a/alarm/xf86-video-armsoc-odroid/0002-Use-NotifyFd-for-drm-fd.patch b/alarm/xf86-video-armsoc-odroid/0002-Use-NotifyFd-for-drm-fd.patch new file mode 100644 index 000000000..6b09bfd97 --- /dev/null +++ b/alarm/xf86-video-armsoc-odroid/0002-Use-NotifyFd-for-drm-fd.patch @@ -0,0 +1,101 @@ +From e63caa8a48715adfac9242ec4c42d36d18e4fdf2 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Tue, 19 Jul 2016 08:51:12 -0700 +Subject: [PATCH 2/2] Use NotifyFd for drm fd + +NotifyFd is available after API 22, and must be used after API 23. + +Signed-off-by: Keith Packard +--- + src/compat-api.h | 5 +++++ + src/drmmode_display.c | 24 ++++++++++++++++++++++++ + 2 files changed, 29 insertions(+) + +diff --git a/src/compat-api.h b/src/compat-api.h +index 78d3c91..54f9f64 100644 +--- a/src/compat-api.h ++++ b/src/compat-api.h +@@ -77,7 +77,12 @@ + + #define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv + ++#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(22,0) ++#define HAVE_NOTIFY_FD 1 ++#endif ++ + #if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) ++#define RELOAD_CURSORS_DEPRECATED 1 + #define BLOCKHANDLER_ARGS_DECL \ + ScreenPtr arg, pointer pTimeout + #define BLOCKHANDLER_ARGS arg, pTimeout +diff --git a/src/drmmode_display.c b/src/drmmode_display.c +index 1b47632..b64bf71 100644 +--- a/src/drmmode_display.c ++++ b/src/drmmode_display.c +@@ -376,9 +376,11 @@ done_setting: + drmmode_output_dpms(output, DPMSModeOn); + } + ++#if !RELOAD_CURSORS_DEPRECATED + /* if hw cursor is initialized, reload it */ + if (drmmode->cursor) + xf86_reload_cursors(pScrn->pScreen); ++#endif + + cleanup: + if (newcrtc) +@@ -1846,6 +1848,13 @@ drmmode_uevent_fini(ScrnInfoPtr pScrn) + TRACE_EXIT(); + } + ++#if HAVE_NOTIFY_FD ++static void ++drmmode_notify_fd(int fd, int notify, void *data) ++{ ++ drmHandleEvent(fd, &event_context); ++} ++#else + static void + drmmode_wakeup_handler(pointer data, int err, pointer p) + { +@@ -1861,6 +1870,7 @@ drmmode_wakeup_handler(pointer data, int err, pointer p) + if (FD_ISSET(drmmode->fd, read_mask)) + drmHandleEvent(drmmode->fd, &event_context); + } ++#endif + + void + drmmode_wait_for_event(ScrnInfoPtr pScrn) +@@ -1876,15 +1886,29 @@ drmmode_screen_init(ScrnInfoPtr pScrn) + + drmmode_uevent_init(pScrn); + ++#if HAVE_NOTIFY_FD ++ SetNotifyFd(drmmode->fd, drmmode_notify_fd, X_NOTIFY_READ, NULL); ++#else + AddGeneralSocket(drmmode->fd); + + /* Register a wakeup handler to get informed on DRM events */ + RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, + drmmode_wakeup_handler, pScrn); ++#endif + } + + void + drmmode_screen_fini(ScrnInfoPtr pScrn) + { ++ struct drmmode_rec *drmmode = drmmode_from_scrn(pScrn); ++ ++#if HAVE_NOTIFY_FD ++ RemoveNotifyFd(drmmode->fd); ++#else ++ RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, ++ drmmode_wakeup_handler, pScrn); ++ RemoveGeneralSocket(drmmode->fd); ++#endif ++ + drmmode_uevent_fini(pScrn); + } +-- +2.11.0 + diff --git a/alarm/xf86-video-armsoc-odroid/PKGBUILD b/alarm/xf86-video-armsoc-odroid/PKGBUILD index 5604edabf..007255959 100644 --- a/alarm/xf86-video-armsoc-odroid/PKGBUILD +++ b/alarm/xf86-video-armsoc-odroid/PKGBUILD @@ -4,29 +4,31 @@ buildarch=4 pkgname=xf86-video-armsoc-odroid -_commit=3bdf799bbb0d087cc1a206dd913ed1d10dec86a9 -pkgver=237.3bdf799 -pkgrel=4 +pkgver=240.78c3cda +pkgrel=1 +pkgdesc='X.org graphics driver for ARM graphics - Exynos ODROID' arch=('armv7h') url="https://github.com/mdrjr/xf86-video-armsoc/tree/r4p0" license=('GPL2') -makedepends=('git' 'pkgconfig' 'xorg-server-devel' 'resourceproto' 'scrnsaverproto') -options=('!libtool') -conflicts=(xf86-video-armsoc) +makedepends=('git' 'xorg-server-devel' 'X-ABI-VIDEODRV_VERSION=23') +conflicts=('xf86-video-armsoc' 'xorg-server<1.19' 'X-ABI-VIDEODRV_VERSION<23' 'X-ABI-VIDEODRV_VERSION>=24') provides=(xf86-video-armsoc) -source=("$pkgname::git+https://github.com/mdrjr/xf86-video-armsoc.git#commit=${_commit}" - '0001-compat-for-newer-xorg.patch') +source=("$pkgname::git+https://github.com/mdrjr/xf86-video-armsoc.git#branch=r4p0" + '0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch' + '0002-Use-NotifyFd-for-drm-fd.patch') md5sums=('SKIP' - 'dd9885df7c3a5ec817a859c863860bc0') + '9d06b5add32485a340c771bb87f3c81c' + '742f19941f6ef38a344c26c5785b8b79') pkgver() { cd $pkgname - echo $(git rev-list --count makepkg).$(git rev-parse --short makepkg) + echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) } prepare() { cd $pkgname - git apply ../0001-compat-for-newer-xorg.patch + git apply ../0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch + git apply ../0002-Use-NotifyFd-for-drm-fd.patch } build() {