diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2018-02-18 17:16:39 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2018-02-18 17:16:39 +0000 |
commit | 59f36f1072242e554a7d6d64138db12b321a86bf (patch) | |
tree | 2a157e8f9e17d04bc4e0efde0ca7e9db5346cc37 /xserver/hw/xfree86 | |
parent | 1d0ff518f50b7e33f90ad75637db6090055f2d96 (diff) |
Update to xserver 1.19.6. bug fix release
Diffstat (limited to 'xserver/hw/xfree86')
-rw-r--r-- | xserver/hw/xfree86/drivers/modesetting/drmmode_display.c | 40 | ||||
-rw-r--r-- | xserver/hw/xfree86/modes/xf86EdidModes.c | 4 | ||||
-rw-r--r-- | xserver/hw/xfree86/ramdac/xf86HWCurs.c | 9 |
3 files changed, 24 insertions, 29 deletions
diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c index 21703d2c7..41dddaa1a 100644 --- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -60,34 +60,22 @@ static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int static Bool drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name) { - int i = 0; - char s1[20]; - - do { - switch(*s) { - case ',': - s1[i] = '\0'; - i = 0; - if (strcmp(s1, output_name) == 0) - return TRUE; - break; - case ' ': - case '\t': - case '\n': - case '\r': - break; - default: - s1[i] = *s; - i++; - break; - } - } while(*s++); + char **token = xstrtokenize(s, ", \t\n\r"); + Bool ret = FALSE; - s1[i] = '\0'; - if (strcmp(s1, output_name) == 0) - return TRUE; + if (!token) + return FALSE; - return FALSE; + for (int i = 0; token[i]; i++) { + if (strcmp(token[i], output_name) == 0) + ret = TRUE; + + free(token[i]); + } + + free(token); + + return ret; } int diff --git a/xserver/hw/xfree86/modes/xf86EdidModes.c b/xserver/hw/xfree86/modes/xf86EdidModes.c index f0e1e974b..f903496f5 100644 --- a/xserver/hw/xfree86/modes/xf86EdidModes.c +++ b/xserver/hw/xfree86/modes/xf86EdidModes.c @@ -976,8 +976,8 @@ handle_cea_svd(struct cea_video_block *video, void *data) int vid; vid = video->video_code & 0x7f; - if (vid < CEA_VIDEO_MODES_NUM) { - Mode = xf86DuplicateMode(CEAVideoModes + vid); + if (vid >= 1 && vid <= CEA_VIDEO_MODES_NUM) { + Mode = xf86DuplicateMode(CEAVideoModes + (vid - 1)); *Modes = xf86ModesAdd(*Modes, Mode); } } diff --git a/xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xserver/hw/xfree86/ramdac/xf86HWCurs.c index 7043a9c72..4e2e587fd 100644 --- a/xserver/hw/xfree86/ramdac/xf86HWCurs.c +++ b/xserver/hw/xfree86/ramdac/xf86HWCurs.c @@ -180,9 +180,16 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); - xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; + + xf86CursorInfoPtr infoPtr; unsigned char *bits; + if (!ScreenPriv) { /* NULL if Option "SWCursor" */ + return (pCurs == NullCursor); + } + + infoPtr = ScreenPriv->CursorInfoPtr; + if (pCurs == NullCursor) { (*infoPtr->HideCursor) (infoPtr->pScrn); return TRUE; |