xserver: Branch 'master' - 3 commits

Peter Hutterer whot at kemper.freedesktop.org
Mon May 29 03:58:04 UTC 2017


 fb/fbpict.h                              |    5 -----
 hw/xfree86/common/xf86pciBus.c           |    2 +-
 hw/xfree86/os-support/shared/posix_tty.c |    3 +++
 3 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 2fbf62b2fb3dcb29551251d09aa695715bb754f4
Author: Jason Gerecke <killertofu at gmail.com>
Date:   Fri May 26 14:27:19 2017 -0700

    xfree86: Fix interpretation of xf86WaitForInput timeout
    
    Commit aa6717ce2 switched xf86WaitForInput from using select(2) to using
    poll(2). Before this change, the timeout was interpreted as being in
    microseconds; afterwards it is fed directly to xorg_poll which interprets
    it as being in milliseconds. This results in the function potentially
    blocking 1000x longer than intended. This commit scales down the timeout
    argument before passing it to xorg_poll, being careful to ensure the result
    is not rounded down due to integer division.
    
    Signed-off-by: Jason Gerecke <jason.gerecke at wacom.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
index 6249a625c..a795ae19d 100644
--- a/hw/xfree86/os-support/shared/posix_tty.c
+++ b/hw/xfree86/os-support/shared/posix_tty.c
@@ -394,6 +394,9 @@ xf86WaitForInput(int fd, int timeout)
     poll_fd.fd = fd;
     poll_fd.events = POLLIN;
 
+    /* convert microseconds to milliseconds */
+    timeout = (timeout + 999) / 1000;
+
     if (fd >= 0) {
         SYSCALL(r = xserver_poll(&poll_fd, 1, timeout));
     }
commit 96af794dc648eadcd596893412d7530e92cb5421
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri May 5 09:04:35 2017 +1000

    xfree86: up the path name size to 512 in xf86MatchDriverFromFiles
    
    ./hw/xfree86/common/xf86pciBus.c: In function ‘xf86MatchDriverFromFiles’:
    ../hw/xfree86/common/xf86pciBus.c:1330:52: warning: ‘snprintf’ output may be
    truncated before the last format character [-Wformat-truncation=]
                 snprintf(path_name, sizeof(path_name), "%s/%s", ^~~~~~~
    ../hw/xfree86/common/xf86pciBus.c:1330:13: note: ‘snprintf’ output between 2
    
    dirent->d_name is 256, so sprintf("%s/%s") into a 256 buffer gives us:
    
    and 257 bytes into a destination of size 256
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 0d0a76bc8..012ca08d2 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1303,7 +1303,7 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
     char *line = NULL, *tmpMatch;
     size_t len;
     ssize_t read;
-    char path_name[256], vendor_str[5], chip_str[5];
+    char path_name[512], vendor_str[5], chip_str[5];
     uint16_t vendor, chip;
     int j;
 
commit bf3a591fdc5c98f7cab232bf5ec39902947ae2e5
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon May 8 10:07:51 2017 +1000

    fb: remove some superfluous empty lines
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/fb/fbpict.h b/fb/fbpict.h
index 5cb866368..201ea092e 100644
--- a/fb/fbpict.h
+++ b/fb/fbpict.h
@@ -30,7 +30,6 @@
 
 /* fbpict.c */
 extern _X_EXPORT void
-
 fbComposite(CARD8 op,
             PicturePtr pSrc,
             PicturePtr pMask,
@@ -43,21 +42,17 @@ fbComposite(CARD8 op,
 /* fbtrap.c */
 
 extern _X_EXPORT void
-
 fbAddTraps(PicturePtr pPicture,
            INT16 xOff, INT16 yOff, int ntrap, xTrap * traps);
 
 extern _X_EXPORT void
-
 fbRasterizeTrapezoid(PicturePtr alpha, xTrapezoid * trap, int x_off, int y_off);
 
 extern _X_EXPORT void
-
 fbAddTriangles(PicturePtr pPicture,
                INT16 xOff, INT16 yOff, int ntri, xTriangle * tris);
 
 extern _X_EXPORT void
-
 fbTrapezoids(CARD8 op,
              PicturePtr pSrc,
              PicturePtr pDst,


More information about the xorg-commit mailing list