Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit make the intel driver work again with xorg-se...



details:   https://anonhg.NetBSD.org/xsrc/rev/7e018829dfe2
branches:  trunk
changeset: 10073:7e018829dfe2
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jan 03 10:27:30 2019 +0000

description:
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.

diffstat:

 external/mit/xf86-video-intel/dist/src/sna/sna.h        |   4 ++++
 external/mit/xf86-video-intel/dist/src/sna/sna_accel.c  |  10 ++++++++++
 external/mit/xf86-video-intel/dist/src/sna/sna_driver.c |   9 +++++++++
 external/mit/xorg-server/dist/Xext/xf86bigfont.c        |   2 +-
 4 files changed, 24 insertions(+), 1 deletions(-)

diffs (89 lines):

diff -r c80d6d5d567e -r 7e018829dfe2 external/mit/xf86-video-intel/dist/src/sna/sna.h
--- a/external/mit/xf86-video-intel/dist/src/sna/sna.h  Thu Jan 03 09:00:22 2019 +0000
+++ b/external/mit/xf86-video-intel/dist/src/sna/sna.h  Thu Jan 03 10:27:30 2019 +0000
@@ -998,7 +998,11 @@
 
 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);
diff -r c80d6d5d567e -r 7e018829dfe2 external/mit/xf86-video-intel/dist/src/sna/sna_accel.c
--- a/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c    Thu Jan 03 09:00:22 2019 +0000
+++ b/external/mit/xf86-video-intel/dist/src/sna/sna_accel.c    Thu Jan 03 10:27:30 2019 +0000
@@ -18010,7 +18010,12 @@
        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 @@
                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 @@
                        (*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;
diff -r c80d6d5d567e -r 7e018829dfe2 external/mit/xf86-video-intel/dist/src/sna/sna_driver.c
--- a/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c   Thu Jan 03 09:00:22 2019 +0000
+++ b/external/mit/xf86-video-intel/dist/src/sna/sna_driver.c   Thu Jan 03 10:27:30 2019 +0000
@@ -740,14 +740,23 @@
 #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);
 }
 
diff -r c80d6d5d567e -r 7e018829dfe2 external/mit/xorg-server/dist/Xext/xf86bigfont.c
--- a/external/mit/xorg-server/dist/Xext/xf86bigfont.c  Thu Jan 03 09:00:22 2019 +0000
+++ b/external/mit/xorg-server/dist/Xext/xf86bigfont.c  Thu Jan 03 10:27:30 2019 +0000
@@ -377,7 +377,7 @@
 #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;



Home | Main Index | Thread Index | Old Index