alarm/xf86-video-armsoc-rockchip: fixes

This commit is contained in:
Kevin Mihelich 2017-01-13 03:19:27 +00:00
parent de17c83209
commit aa11aa77f0
3 changed files with 160 additions and 4 deletions

View file

@ -0,0 +1,33 @@
From a0840cc2f621e04af5751224e64b89ea0d39bf00 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
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 <ajax@redhat.com>
---
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

View file

@ -0,0 +1,113 @@
From d724dc5671b4b47f4913105ffa158318b7731440 Mon Sep 17 00:00:00 2001
From: Keith Packard <keithp@keithp.com>
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 <keithp@keithp.com>
---
src/compat-api.h | 5 +++++
src/drmmode_display.c | 29 ++++++++++++++++++++++++++++-
2 files changed, 33 insertions(+), 1 deletion(-)
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 8e45b5f..70fbc7c 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -410,9 +410,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)
@@ -1889,6 +1891,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)
{
@@ -1902,7 +1911,9 @@ drmmode_wakeup_handler(pointer data, int err, pointer p)
if (FD_ISSET(fd, read_mask))
drmHandleEvent(fd, &event_context);
}
+#endif
+#ifndef HAVE_NOTIFY_FD
void drmmode_init_wakeup_handler(struct ARMSOCRec *pARMSOC)
{
AddGeneralSocket(pARMSOC->drmFD);
@@ -1916,6 +1927,7 @@ void drmmode_fini_wakeup_handler(struct ARMSOCRec *pARMSOC)
drmmode_wakeup_handler, pARMSOC);
RemoveGeneralSocket(pARMSOC->drmFD);
}
+#endif
void
drmmode_wait_for_event(ScrnInfoPtr pScrn)
@@ -1927,15 +1939,30 @@ drmmode_wait_for_event(ScrnInfoPtr pScrn)
void
drmmode_screen_init(ScrnInfoPtr pScrn)
{
+#if HAVE_NOTIFY_FD
+ struct drmmode_rec *drmmode = drmmode_from_scrn(pScrn);
+#else
struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn);
+#endif
+
drmmode_uevent_init(pScrn);
+
+#if HAVE_NOTIFY_FD
+ SetNotifyFd(drmmode->fd, drmmode_notify_fd, X_NOTIFY_READ, NULL);
+#else
drmmode_init_wakeup_handler(pARMSOC);
+#endif
}
void
drmmode_screen_fini(ScrnInfoPtr pScrn)
{
+#if HAVE_NOTIFY_FD
+ struct drmmode_rec *drmmode = drmmode_from_scrn(pScrn);
+ RemoveNotifyFd(drmmode->fd);
+#else
struct ARMSOCRec *pARMSOC = ARMSOCPTR(pScrn);
- drmmode_uevent_fini(pScrn);
drmmode_fini_wakeup_handler(pARMSOC);
+#endif
+ drmmode_uevent_fini(pScrn);
}
--
2.11.0

View file

@ -3,25 +3,35 @@
buildarch=4
pkgname=xf86-video-armsoc-rockchip
_commit=67d4cffe67737458716116498a67546291def000
pkgver=261.67d4cff
pkgrel=3
pkgdesc='X.org graphics driver for ARM graphics - Rockchip'
arch=('armv7h')
url="https://github.com/mmind/xf86-video-armsoc"
license=('GPL2')
makedepends=('git' 'pkgconfig' 'xorg-server-devel' 'resourceproto' 'scrnsaverproto')
makedepends=('git' 'xorg-server-devel' 'X-ABI-VIDEODRV_VERSION=23')
conflicts=('xorg-server<1.19' 'X-ABI-VIDEODRV_VERSION<23' 'X-ABI-VIDEODRV_VERSION>=24')
options=('!libtool')
conflicts=(xf86-video-armsoc)
provides=(xf86-video-armsoc)
source=("$pkgname::git+https://github.com/mmind/xf86-video-armsoc.git#commit=${_commit}"
source=("$pkgname::git+https://github.com/mmind/xf86-video-armsoc.git#branch=devel/rockchip"
'0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch'
'0002-Use-NotifyFd-for-drm-fd.patch'
'20-armsoc.conf')
md5sums=('SKIP'
'c9ec23461d651841b128b68f07e25c7f'
'e7a0f28ac376f0c97a05b1bb758d36e4'
'ca34299695813b200f0d6054c45d1f94')
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-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch
git apply ../0002-Use-NotifyFd-for-drm-fd.patch
}
build() {