Hi,
the patch below should not affect the intel(4) X.Org driver
functionality. It's sole purpose is to make it compatible with the
future upgrade to the X.Org 1.19 xserver.
But since I don't have much hardware still using the intel driver (we
switched to modesettings(4) for many devices), I'd like to have this
tested against the current X server as much as possible.
To test it, you need to check out the /usr/xenocara source tree and
then:
cd /usr/xenocara/driver/xf86-video-intel
patch -p0 -E < /this/patch
doas make -f Makefile.bsd-wrapper obj
doas make -f Makefile.bsd-wrapper build
Then restart the X server.
Comments, oks are welcome too.
Thanks in advance.
Index: src/compat-api.h
===
RCS file: /cvs/OpenBSD/xenocara/driver/xf86-video-intel/src/compat-api.h,v
retrieving revision 1.6
diff -u -p -u -r1.6 compat-api.h
--- src/compat-api.h16 May 2016 09:54:33 - 1.6
+++ src/compat-api.h11 Nov 2017 17:39:18 -
@@ -30,6 +30,7 @@
#include
#include
+#include
#include
#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
@@ -227,4 +232,14 @@ static inline void FreePixmap(PixmapPtr
#if HAS_DIRTYTRACKING_ROTATION
#define PixmapSyncDirtyHelper(d, dd) PixmapSyncDirtyHelper(d)
+#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
Index: src/sna/sna.h
===
RCS file: /cvs/OpenBSD/xenocara/driver/xf86-video-intel/src/sna/sna.h,v
retrieving revision 1.3
diff -u -p -u -r1.3 sna.h
--- src/sna/sna.h 12 Apr 2015 19:42:06 - 1.3
+++ src/sna/sna.h 11 Nov 2017 17:39:18 -
@@ -367,8 +367,10 @@ struct sna {
EntityInfoPtr pEnt;
const struct intel_device_info *info;
+#if !HAVE_NOTIFY_FD
ScreenBlockHandlerProcPtr BlockHandler;
ScreenWakeupHandlerProcPtr WakeupHandler;
+#endif
CloseScreenProcPtr CloseScreen;
PicturePtr clear;
@@ -995,8 +997,7 @@ static inline uint32_t pixmap_size(Pixma
bool sna_accel_init(ScreenPtr sreen, struct sna *sna);
void sna_accel_create(struct sna *sna);
-void sna_accel_block_handler(struct sna *sna, struct timeval **tv);
-void sna_accel_wakeup_handler(struct sna *sna);
+void sna_accel_block(struct sna *sna, struct timeval **tv);
void sna_accel_watch_flush(struct sna *sna, int enable);
void sna_accel_flush(struct sna *sna);
void sna_accel_enter(struct sna *sna);
Index: src/sna/sna_accel.c
===
RCS file: /cvs/OpenBSD/xenocara/driver/xf86-video-intel/src/sna/sna_accel.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 sna_accel.c
--- src/sna/sna_accel.c 3 Dec 2015 22:36:46 - 1.7
+++ src/sna/sna_accel.c 11 Nov 2017 17:39:18 -
@@ -112,6 +112,11 @@
#define MAKE_COW_OWNER(ptr) ((void*)((uintptr_t)(ptr) | 1))
#define COW(ptr) (void *)((uintptr_t)(ptr) & ~1)
+#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)
{
@@ -17676,6 +17681,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;
@@ -17687,7 +17699,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;
@@ -17862,12 +17874,12 @@ 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);
}
-void sna_accel_block_handler(struct sna *sna, struct timeval **tv)
+void sna_accel_block(struct sna *sna, struct timeval **tv)
{
sigtrap_assert_inactive();
@@ -17942,22 +17954,6 @@ set_tv:
kgem_submit(&sna->kgem);
sna->kgem.wedged = !sna->kgem.wedged;
}
-}
-
-void sna_accel_wakeup_handler(struct sna *sna)
-{
- DBG(("%s: nbatch=%d, nee