Module Name: xsrc Committed By: mrg Date: Thu Jan 3 10:27:30 UTC 2019
Modified Files: xsrc/external/mit/xf86-video-intel/dist/src/sna: sna.h sna_accel.c sna_driver.c xsrc/external/mit/xorg-server/dist/Xext: xf86bigfont.c Log Message: make the intel driver work again with xorg-server 1.20: - BlockHandler() timeout value changed from struct timeval ** to int ** that has a millisecond value. - avoid a NULL ptr deref in ProcXF86BigfontQueryFont() and make some code actually able to be run. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ xsrc/external/mit/xf86-video-intel/dist/src/sna/sna.h \ xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c cvs rdiff -u -r1.3 -r1.4 \ xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c cvs rdiff -u -r1.1.1.6 -r1.2 \ xsrc/external/mit/xorg-server/dist/Xext/xf86bigfont.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: xsrc/external/mit/xf86-video-intel/dist/src/sna/sna.h diff -u xsrc/external/mit/xf86-video-intel/dist/src/sna/sna.h:1.2 xsrc/external/mit/xf86-video-intel/dist/src/sna/sna.h:1.3 --- xsrc/external/mit/xf86-video-intel/dist/src/sna/sna.h:1.2 Mon Dec 31 22:17:20 2018 +++ xsrc/external/mit/xf86-video-intel/dist/src/sna/sna.h Thu Jan 3 10:27:30 2019 @@ -998,7 +998,11 @@ static inline uint32_t pixmap_size(Pixma bool sna_accel_init(ScreenPtr sreen, struct sna *sna); void sna_accel_create(struct sna *sna); +#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(23, 0) void sna_accel_block_handler(struct sna *sna, struct timeval **tv); +#else +void sna_accel_block_handler(struct sna *sna, int *tv_msec); +#endif void sna_accel_wakeup_handler(struct sna *sna); void sna_accel_watch_flush(struct sna *sna, int enable); void sna_accel_flush(struct sna *sna); Index: xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c diff -u xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c:1.2 xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c:1.3 --- xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c:1.2 Mon Dec 31 22:17:20 2018 +++ xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c Thu Jan 3 10:27:30 2019 @@ -740,14 +740,23 @@ sna_block_handler(BLOCKHANDLER_ARGS_DECL #else struct sna *sna = to_sna_from_screen(arg); #endif +#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(23, 0) struct timeval **tv = timeout; DBG(("%s (tv=%ld.%06ld)\n", __FUNCTION__, *tv ? (*tv)->tv_sec : -1, *tv ? (*tv)->tv_usec : 0)); +#else + int *tv = timeout; + + DBG(("%s (tv=%ld.%06ld)\n", __FUNCTION__, + *tv / 1000, *tv % (1000 * 1000))); +#endif sna->BlockHandler(BLOCKHANDLER_ARGS); +#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(23, 0) if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec) || has_shadow(sna)) +#endif sna_accel_block_handler(sna, tv); } Index: xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c diff -u xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c:1.3 xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c:1.4 --- xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c:1.3 Mon Dec 31 22:17:20 2018 +++ xsrc/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c Thu Jan 3 10:27:30 2019 @@ -18010,7 +18010,12 @@ void sna_accel_close(struct sna *sna) kgem_cleanup_cache(&sna->kgem); } +/* tv changed from timeval to milliseconds in ABI 23 */ +#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(23, 0) void sna_accel_block_handler(struct sna *sna, struct timeval **tv) +#else +void sna_accel_block_handler(struct sna *sna, int *tv_msec) +#endif { sigtrap_assert_inactive(); @@ -18069,6 +18074,7 @@ restart: if (timeout < 3) goto restart; +#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(23, 0) if (*tv == NULL) { *tv = &sna->timer_tv; goto set_tv; @@ -18078,6 +18084,10 @@ set_tv: (*tv)->tv_sec = timeout / 1000; (*tv)->tv_usec = timeout % 1000 * 1000; } +#else + if (*tv_msec > timeout) + *tv_msec = timeout; +#endif } sna->kgem.scanout_busy = false; Index: xsrc/external/mit/xorg-server/dist/Xext/xf86bigfont.c diff -u xsrc/external/mit/xorg-server/dist/Xext/xf86bigfont.c:1.1.1.6 xsrc/external/mit/xorg-server/dist/Xext/xf86bigfont.c:1.2 --- xsrc/external/mit/xorg-server/dist/Xext/xf86bigfont.c:1.1.1.6 Mon Dec 31 09:36:08 2018 +++ xsrc/external/mit/xorg-server/dist/Xext/xf86bigfont.c Thu Jan 3 10:27:30 2019 @@ -377,7 +377,7 @@ ProcXF86BigfontQueryFont(ClientPtr clien #ifdef HAS_SHM if (!badSysCall) pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); - if (pDesc) { + if (pDesc && pDesc->attach_addr) { pCI = (xCharInfo *) pDesc->attach_addr; if (stuff_flags & XF86Bigfont_FLAGS_Shm) shmid = pDesc->shmid;