From 838952c97e0ecb334fe4e84a17373fffde053ebe Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 9 Dec 2014 18:27:11 -0800 Subject: Get rid of const warnings in XSERVER_INPUT_EVENT dtrace probe calls Use typedefs to work around dtrace dropping const qualifiers from probe arguments when generating Xserver-dtrace.h. Add new probes.h header to avoid having to replicate these typedefs in every file with dtrace probes. Gets rid of these warnings from gcc 4.8: getevents.c:1096:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' discards 'const' qualifier from pointer target type [enabled by default] getevents.c:1096:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1651:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1651:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1791:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1791:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1921:9: warning: passing argument 6 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] getevents.c:1921:9: warning: passing argument 7 of '__dtrace_Xserver___input__event' disards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer (cherry picked from commit 9e002dfcd71439fd81563db1f70e8c1964d52fab) --- dix/Xserver.d | 5 ++++- dix/dispatch.c | 5 +---- dix/events.c | 8 +------- dix/getevents.c | 7 +------ dix/resource.c | 5 +---- include/Makefile.am | 1 + include/probes.h | 41 +++++++++++++++++++++++++++++++++++++++++ os/connection.c | 12 +++--------- 8 files changed, 53 insertions(+), 31 deletions(-) create mode 100644 include/probes.h diff --git a/dix/Xserver.d b/dix/Xserver.d index 248d48e24..f4f229d84 100644 --- a/dix/Xserver.d +++ b/dix/Xserver.d @@ -31,6 +31,9 @@ #include #endif +typedef const uint8_t *const_uint8_p; +typedef const double *const_double_p; + provider Xserver { /* reqType, data, length, client id, request buffer */ probe request__start(string, uint8_t, uint16_t, int, void *); @@ -49,7 +52,7 @@ provider Xserver { /* client id, event type, event* */ probe send__event(int, uint8_t, void *); /* deviceid, type, button/keycode/touchid, flags, nvalues, mask, values */ - probe input__event(int, int, uint32_t, uint32_t, int8_t, uint8_t*, double*); + probe input__event(int, int, uint32_t, uint32_t, int8_t, const_uint8_p, const_double_p); }; #pragma D attributes Unstable/Unstable/Common provider Xserver provider diff --git a/dix/dispatch.c b/dix/dispatch.c index 9044ac786..17fa75e19 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -131,10 +131,7 @@ int ProcInitialConnection(); #ifdef XSERVER_DTRACE #include "registry.h" -#include -typedef const char *string; - -#include "Xserver-dtrace.h" +#include "probes.h" #endif #define mskcnt ((MAXCLIENTS + 31) / 32) diff --git a/dix/events.c b/dix/events.c index 250061568..150620f59 100644 --- a/dix/events.c +++ b/dix/events.c @@ -125,13 +125,7 @@ Equipment Corporation. #include #include "xkbsrv.h" #include "xace.h" - -#ifdef XSERVER_DTRACE -#include -typedef const char *string; - -#include "Xserver-dtrace.h" -#endif +#include "probes.h" #include #include diff --git a/dix/getevents.c b/dix/getevents.c index 6fb12c5c1..bc7ffa63b 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -68,12 +68,7 @@ #include "exevents.h" #include "extnsionst.h" #include "listdev.h" /* for sizing up DeviceClassesChangedEvent */ - -#if XSERVER_DTRACE -#include -typedef const char *string; -#include -#endif +#include "probes.h" /* Number of motion history events to store. */ #define MOTION_HISTORY_SIZE 256 diff --git a/dix/resource.c b/dix/resource.c index 26debdb00..964f0b306 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -144,10 +144,7 @@ Equipment Corporation. #include "gcstruct.h" #ifdef XSERVER_DTRACE -#include -typedef const char *string; - -#include "Xserver-dtrace.h" +#include "probes.h" #define TypeNameString(t) LookupResourceName(t) #endif diff --git a/include/Makefile.am b/include/Makefile.am index 6578038a5..168b00f70 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -71,6 +71,7 @@ EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ + probes.h \ protocol-versions.h \ systemd-logind.h \ xsha1.h diff --git a/include/probes.h b/include/probes.h new file mode 100644 index 000000000..e9cdd3e8e --- /dev/null +++ b/include/probes.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef XORG_PROBES_H +#define XORG_PROBES_H + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +/* definitions needed to include Dtrace probes in a source file */ + +#if XSERVER_DTRACE +#include +typedef const char *string; +typedef const uint8_t *const_uint8_p; +typedef const double *const_double_p; +#include "../dix/Xserver-dtrace.h" +#endif + +#endif /* XORG_PROBES_H */ diff --git a/os/connection.c b/os/connection.c index 64c83fccb..7ff44e175 100644 --- a/os/connection.c +++ b/os/connection.c @@ -113,17 +113,11 @@ SOFTWARE. #ifdef HAVE_GETPEERUCRED #include #include -#endif - -#ifdef XSERVER_DTRACE -#include -typedef const char *string; - -#ifndef HAVE_GETPEERUCRED +#else #define zoneid_t int #endif -#include "../dix/Xserver-dtrace.h" -#endif + +#include "probes.h" static int lastfdesc; /* maximum file descriptor */ -- cgit v1.2.3 From 904105166450fbcc76cf18392beb4d6d3238bee0 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 18:52:05 -0800 Subject: dmx: Add _X_ATTRIBUTE_PRINTF to dmxConfigLog() & dmxConfigOutput() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of gcc 4.8 warnings: dmxparse.c: In function ‘dmxConfigLog’: dmxparse.c:61:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] vprintf(format, args); /* RATS: All calls to dmxConfigLog from ^ dmxprint.c: In function ‘dmxConfigOutput’: dmxprint.c:149:9: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] pos += vfprintf(str, format, args); /* assumes no newlines! */ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 5e01eac10e915568324aff81b51d3af558757042) --- hw/dmx/config/dmxparse.h | 3 ++- hw/dmx/config/dmxprint.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/dmx/config/dmxparse.h b/hw/dmx/config/dmxparse.h index 7d31b6309..cc2f0eb71 100644 --- a/hw/dmx/config/dmxparse.h +++ b/hw/dmx/config/dmxparse.h @@ -38,6 +38,7 @@ #define _DMXPARSE_H_ #include /* For FILE */ +#include /* For _X_ATTRIBUTE_PRINTF */ /** Stores tokens not stored in other structures (e.g., keywords and ;) */ typedef struct _DMXConfigToken { @@ -203,7 +204,7 @@ extern int yylex(void); extern int yydebug; extern void yyerror(const char *message); -extern void dmxConfigLog(const char *format, ...); +extern void dmxConfigLog(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,0); extern void *dmxConfigAlloc(unsigned long bytes); extern void *dmxConfigRealloc(void *orig, unsigned long orig_bytes, unsigned long bytes); diff --git a/hw/dmx/config/dmxprint.c b/hw/dmx/config/dmxprint.c index 9dec52b5c..536d92bfe 100644 --- a/hw/dmx/config/dmxprint.c +++ b/hw/dmx/config/dmxprint.c @@ -130,7 +130,7 @@ dmxConfigPopState(void) dmxConfigNewline(); } -static void +static void _X_ATTRIBUTE_PRINTF(4, 5) dmxConfigOutput(int addSpace, int doNewline, const char *comment, const char *format, ...) { -- cgit v1.2.3 From d4b0ab833253493f0ea98b6faca6c17ed55b1c22 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 18:58:01 -0800 Subject: dmx: move format strings inline so gcc can check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of gcc 4.8 warnings: dmxprint.c: In function ‘dmxConfigPrintPair’: dmxprint.c:284:25: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] p->ysign < 0 ? '-' : '+', p->y); ^ dmxprint.c:289:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y); ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 11af200b004b4810c9267e3e16449c3175c64d4a) --- hw/dmx/config/dmxprint.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/dmx/config/dmxprint.c b/hw/dmx/config/dmxprint.c index 536d92bfe..c80e830e4 100644 --- a/hw/dmx/config/dmxprint.c +++ b/hw/dmx/config/dmxprint.c @@ -261,32 +261,20 @@ dmxConfigPrintString(DMXConfigStringPtr p, int quote) static int dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace) { - const char *format = NULL; - if (!p) return 0; - switch (p->token) { - case T_ORIGIN: - format = "@%dx%d"; - break; - case T_DIMENSION: - format = "%dx%d"; - break; - case T_OFFSET: - format = "%c%d%c%d"; - break; - } if (p->token == T_OFFSET) { if (!p->comment && !p->x && !p->y && p->xsign >= 0 && p->ysign >= 0) return 0; - dmxConfigOutput(addSpace, 0, p->comment, format, + dmxConfigOutput(addSpace, 0, p->comment, "%c%d%c%d", p->xsign < 0 ? '-' : '+', p->x, p->ysign < 0 ? '-' : '+', p->y); } else { if (!p->comment && !p->x && !p->y) return 0; - dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y); + dmxConfigOutput(addSpace, 0, p->comment, "%s%dx%d", + (p->token == T_ORIGIN) ? "@" : "", p->x, p->y); } return 1; } -- cgit v1.2.3 From 43251c13d7cfaa5deb1146219e175b3fcd1cfffd Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 19:09:36 -0800 Subject: dmx: fix printf format argument warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of these gcc 4.8 warnings: dmxinit.c: In function ‘dmxErrorHandler’: dmxinit.c:167:16: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘XID64’ [-Wformat=] ev->resourceid); ^ dmxinit.c:171:16: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘XID64’ [-Wformat=] ev->resourceid); ^ dmxinit.c:175:16: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘XID64’ [-Wformat=] ev->resourceid); ^ dmxinit.c:181:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=] ev->serial); ^ dmxinit.c:183:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=] dpy->request); ^ dmxinit.c: In function ‘InitOutput’: dmxinit.c:637:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=] dmxLog(dmxInfo, "Generation: %d\n", dmxGeneration); ^ dmxprop.c: In function ‘dmxPropertyCheckOtherWindows’: dmxprop.c:223:24: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘Window’ [-Wformat=] dmxScreen->name, win, tp.value); ^ dmxprop.c: In function ‘dmxPropertyWindow’: dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘Window’ [-Wformat=] other->index, other->name, other->scrnWin); ^ dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘Window’ [-Wformat=] Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit f358f0d50cadaf10f7d97e21da00419a4a37c4e1) --- hw/dmx/dmxinit.c | 12 ++++++------ hw/dmx/dmxprop.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index fd2ade0ef..37961b812 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -164,23 +164,23 @@ dmxErrorHandler(Display * dpy, XErrorEvent * ev) switch (ev->error_code) { case BadValue: dmxLog(dmxWarning, " Value: 0x%x\n", - ev->resourceid); + (unsigned int) ev->resourceid); break; case BadAtom: dmxLog(dmxWarning, " AtomID: 0x%x\n", - ev->resourceid); + (unsigned int) ev->resourceid); break; default: dmxLog(dmxWarning, " ResourceID: 0x%x\n", - ev->resourceid); + (unsigned int) ev->resourceid); break; } /* Provide serial number information */ dmxLog(dmxWarning, " Failed serial number: %d\n", - ev->serial); + (unsigned int) ev->serial); dmxLog(dmxWarning, " Current serial number: %d\n", - dpy->request); + (unsigned int) dpy->request); return 0; } @@ -634,7 +634,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) if (major > 0 && minor > 0) year += 2000; - dmxLog(dmxInfo, "Generation: %d\n", dmxGeneration); + dmxLog(dmxInfo, "Generation: %lu\n", dmxGeneration); dmxLog(dmxInfo, "DMX version: %d.%d.%02d%02d%02d (%s)\n", major, minor, year, month, day, VENDOR_STRING); diff --git a/hw/dmx/dmxprop.c b/hw/dmx/dmxprop.c index 4be2dbd4c..5e306d286 100644 --- a/hw/dmx/dmxprop.c +++ b/hw/dmx/dmxprop.c @@ -220,7 +220,7 @@ dmxPropertyCheckOtherWindows(DMXScreenInfo * dmxScreen, Atom atom) if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) { dmxLog(dmxDebug, "On %s/%lu: %s\n", - dmxScreen->name, win, tp.value); + dmxScreen->name, (unsigned long) win, tp.value); if (!strncmp((char *) tp.value, (char *) id, strlen((char *) id))) { int idx; @@ -360,8 +360,8 @@ dmxPropertyWindow(DMXScreenInfo * dmxScreen) dmxScreen->next = (other->next ? other->next : other); other->next = (tmp ? tmp : dmxScreen); dmxLog(dmxDebug, "%d/%s/%lu and %d/%s/%lu are on the same backend\n", - dmxScreen->index, dmxScreen->name, dmxScreen->scrnWin, - other->index, other->name, other->scrnWin); + dmxScreen->index, dmxScreen->name, (unsigned long) dmxScreen->scrnWin, + other->index, other->name, (unsigned long) other->scrnWin); } snprintf(buf, sizeof(buf), ".%d,%lu", dmxScreen->index, -- cgit v1.2.3 From 25292a3bc1032aab8586d7311159e88acca7b689 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 20:53:33 -0800 Subject: dmx: remove unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of gcc 4.8 warnings: dmxscrinit.c: In function ‘dmxBEScreenInit’: dmxscrinit.c:83:15: warning: unused variable ‘gcvals’ [-Wunused-variable] XGCValues gcvals; ^ dmxwindow.c: In function ‘dmxResizeWindow’: dmxwindow.c:860:19: warning: variable ‘pSibPriv’ set but not used [-Wunused-but-set-variable] dmxWinPrivPtr pSibPriv; ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 0fbebad72428abbc9fc3fa9f406f7a7e1b9d95b2) --- hw/dmx/dmxscrinit.c | 1 - hw/dmx/dmxwindow.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 963d3a9de..097418d05 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -80,7 +80,6 @@ dmxBEScreenInit(ScreenPtr pScreen) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; XSetWindowAttributes attribs; - XGCValues gcvals; unsigned long mask; int i, j; diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index c75373534..c157e1099 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -857,13 +857,9 @@ dmxResizeWindow(WindowPtr pWindow, int x, int y, ScreenPtr pScreen = pWindow->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow); - dmxWinPrivPtr pSibPriv; unsigned int m; XWindowChanges c; - if (pSib) - pSibPriv = DMX_GET_WINDOW_PRIV(pSib); - DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen); #if 1 if (pScreen->ResizeWindow) -- cgit v1.2.3 From 00a962261af856081a7505a95cd871f4af047071 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 21:07:12 -0800 Subject: dmx: attempt to untangle nested loops using same index variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This doesn't just make gcc sad, it makes my brain sad. Change from: for (i = 0; i < dmxNumScreens; i++) { int i; for (i = 0; i < nconfigs; i++) { for (j = 0; j < dmxScreen->beNumVisuals; j++) { to the easier to follow: for (i = 0; i < dmxNumScreens; i++) { for (j = 0; j < nconfigs; j++) { for (k = 0; k < dmxScreen->beNumVisuals; k++) { Gets rid of gcc 4.8 warning: dmxinit.c: In function ‘InitOutput’: dmxinit.c:765:17: warning: declaration of ‘i’ shadows a previous local [-Wshadow] int i; ^ dmxinit.c:608:9: warning: shadowed declaration is here [-Wshadow] int i; ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 57e08fae82f733304200a473f55b86e689404c13) --- hw/dmx/dmxinit.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index 37961b812..025dc8637 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -762,7 +762,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) dmxGlxVisualPrivate **configprivs = NULL; int nconfigs = 0; int (*oldErrorHandler) (Display *, XErrorEvent *); - int i; /* Catch errors if when using an older GLX w/o FBconfigs */ oldErrorHandler = XSetErrorHandler(dmxNOPErrorHandler); @@ -797,28 +796,29 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) configprivs = malloc(nconfigs * sizeof(dmxGlxVisualPrivate *)); if (configs != NULL && configprivs != NULL) { + int j; /* Initialize our private info for each visual * (currently only x_visual_depth and x_visual_class) */ - for (i = 0; i < nconfigs; i++) { + for (j = 0; j < nconfigs; j++) { - configprivs[i] = (dmxGlxVisualPrivate *) + configprivs[j] = (dmxGlxVisualPrivate *) malloc(sizeof(dmxGlxVisualPrivate)); - configprivs[i]->x_visual_depth = 0; - configprivs[i]->x_visual_class = 0; + configprivs[j]->x_visual_depth = 0; + configprivs[j]->x_visual_class = 0; /* Find the visual depth */ - if (configs[i].vid > 0) { - int j; - - for (j = 0; j < dmxScreen->beNumVisuals; j++) { - if (dmxScreen->beVisuals[j].visualid == - configs[i].vid) { - configprivs[i]->x_visual_depth = - dmxScreen->beVisuals[j].depth; - configprivs[i]->x_visual_class = - dmxScreen->beVisuals[j].class; + if (configs[j].vid > 0) { + int k; + + for (k = 0; k < dmxScreen->beNumVisuals; k++) { + if (dmxScreen->beVisuals[k].visualid == + configs[j].vid) { + configprivs[j]->x_visual_depth = + dmxScreen->beVisuals[k].depth; + configprivs[j]->x_visual_class = + dmxScreen->beVisuals[k].class; break; } } -- cgit v1.2.3 From 069180bd2a243a13328eeea61ec5f8df5622a5de Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 21:11:17 -0800 Subject: dmx: more unshadowing of variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of gcc 4.8 warnings: dmxinputinit.c: In function ‘dmxInputScanForExtensions’: dmxinputinit.c:877:14: warning: declaration of ‘display’ shadows a global declaration [-Wshadow] Display *display; ^ In file included from ../../../include/windowstr.h:60:0, from dmxinputinit.c:72: ../../../include/opaque.h:52:30: warning: shadowed declaration is here [-Wshadow] extern _X_EXPORT const char *display; ^ glxcmds.c: In function ‘__glXCreatePbuffer’: glxcmds.c:3397:21: warning: declaration of ‘pc’ shadows a parameter [-Wshadow] CARD32 *pc = (CARD32 *) (be_req + 1); ^ glxcmds.c:3314:52: warning: shadowed declaration is here [-Wshadow] __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc) ^ glxscreens.c: In function ‘CalcServerVersionAndExtensions’: glxscreens.c:139:35: warning: declaration of ‘req’ shadows a previous local [-Wshadow] xGLXQueryServerStringReq *req; ^ glxscreens.c:68:26: warning: shadowed declaration is here [-Wshadow] xGLXQueryVersionReq *req; ^ glxscreens.c:140:36: warning: declaration of ‘reply’ shadows a previous local [-Wshadow] xGLXQueryServerStringReply reply; ^ glxscreens.c:69:27: warning: shadowed declaration is here [-Wshadow] xGLXQueryVersionReply reply; ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit bd563fd48f909094d6660854e97811ad7e676ddf) --- hw/dmx/glxProxy/glxcmds.c | 6 +++--- hw/dmx/glxProxy/glxscreens.c | 4 ++-- hw/dmx/input/dmxinputinit.c | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index fb4d5acce..88c2eb15b 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -3394,11 +3394,11 @@ __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc) /* Send attributes */ if (attr != NULL) { - CARD32 *pc = (CARD32 *) (be_req + 1); + CARD32 *pca = (CARD32 *) (be_req + 1); while (numAttribs-- > 0) { - *pc++ = *attr++; /* token */ - *pc++ = *attr++; /* value */ + *pca++ = *attr++; /* token */ + *pca++ = *attr++; /* value */ } } diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c index 138afedf2..b62776c41 100644 --- a/hw/dmx/glxProxy/glxscreens.c +++ b/hw/dmx/glxProxy/glxscreens.c @@ -65,8 +65,6 @@ static void CalcServerVersionAndExtensions(void) { int s; - xGLXQueryVersionReq *req; - xGLXQueryVersionReply reply; char **be_extensions; char *ext; char *denied_extensions; @@ -80,6 +78,8 @@ CalcServerVersionAndExtensions(void) for (s = 0; s < __glXNumActiveScreens; s++) { DMXScreenInfo *dmxScreen = &dmxScreens[s]; Display *dpy = dmxScreen->beDisplay; + xGLXQueryVersionReq *req; + xGLXQueryVersionReply reply; /* Send the glXQueryVersion request */ LockDisplay(dpy); diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index abb6a8551..56a39df8c 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -874,17 +874,17 @@ dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI) { XExtensionVersion *ext; XDeviceInfo *devices; - Display *display; + Display *dsp; int num; int i, j; XextErrorHandler handler; - if (!(display = XOpenDisplay(dmxInput->name))) + if (!(dsp = XOpenDisplay(dmxInput->name))) return; /* Print out information about the XInput Extension. */ handler = XSetExtensionErrorHandler(dmxInputExtensionErrorHandler); - ext = XGetExtensionVersion(display, INAME); + ext = XGetExtensionVersion(dsp, INAME); XSetExtensionErrorHandler(handler); if (!ext || ext == (XExtensionVersion *) NoSuchExtension) { @@ -894,7 +894,7 @@ dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI) dmxLogInput(dmxInput, "Locating devices on %s (%s version %d.%d)\n", dmxInput->name, INAME, ext->major_version, ext->minor_version); - devices = XListInputDevices(display, &num); + devices = XListInputDevices(dsp, &num); XFree(ext); ext = NULL; @@ -956,7 +956,7 @@ dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI) } XFreeDeviceList(devices); } - XCloseDisplay(display); + XCloseDisplay(dsp); } /** Re-initialize all the devices described in \a dmxInput. Called from -- cgit v1.2.3 From 649f37fa01f7a2d471858609d47f297cdb8615d0 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 22:09:14 -0800 Subject: dmx: glxproxy prototype cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of 107 -Wmissing-prototypes & -Wredundant-decls warnings from gcc 4.8 Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit ac64a653fb4935a799baca7545ba6ca401e20fa1) --- hw/dmx/glxProxy/compsize.h | 7 +++++++ hw/dmx/glxProxy/g_disptab.h | 21 ++++++++++++++++++++- hw/dmx/glxProxy/glxcmds.c | 1 - hw/dmx/glxProxy/glxcmds.h | 6 ++++++ hw/dmx/glxProxy/glxcmdsswap.c | 2 -- hw/dmx/glxProxy/glxext.h | 1 + hw/dmx/glxProxy/glxscreens.h | 2 ++ hw/dmx/glxProxy/glxserver.h | 8 -------- hw/dmx/glxProxy/glxsingle.c | 6 ++---- hw/dmx/glxProxy/glxsingle.h | 4 ---- hw/dmx/glxProxy/glxswap.c | 4 +--- hw/dmx/glxProxy/glxvendor.c | 6 ++---- 12 files changed, 41 insertions(+), 27 deletions(-) diff --git a/hw/dmx/glxProxy/compsize.h b/hw/dmx/glxProxy/compsize.h index 360966233..5e759b0a0 100644 --- a/hw/dmx/glxProxy/compsize.h +++ b/hw/dmx/glxProxy/compsize.h @@ -48,4 +48,11 @@ extern GLint __glTexGeniv_size(GLenum e); extern GLint __glTexParameterfv_size(GLenum e); extern GLint __glTexParameteriv_size(GLenum e); +extern GLint __glCallLists_size(GLsizei n, GLenum type); +extern GLint __glDrawPixels_size(GLenum format, GLenum type, GLsizei w, GLsizei h); +extern GLint __glBitmap_size(GLsizei w, GLsizei h); +extern GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w); +extern GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h); +extern GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d); + #endif /* !__compsize_h__ */ diff --git a/hw/dmx/glxProxy/g_disptab.h b/hw/dmx/glxProxy/g_disptab.h index 530338798..783f87a54 100644 --- a/hw/dmx/glxProxy/g_disptab.h +++ b/hw/dmx/glxProxy/g_disptab.h @@ -655,7 +655,6 @@ extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte *); extern void __glXDispSwap_SeparableFilter2D(GLbyte *); extern void __glXDispSwap_TexImage3D(GLbyte *); extern void __glXDispSwap_TexSubImage3D(GLbyte *); -extern void __glXDispSwap_DrawArrays(GLbyte *); extern void __glXDispSwap_PrioritizeTextures(GLbyte *); extern void __glXDispSwap_CopyTexImage1D(GLbyte *); extern void __glXDispSwap_CopyTexImage2D(GLbyte *); @@ -663,6 +662,26 @@ extern void __glXDispSwap_CopyTexSubImage1D(GLbyte *); extern void __glXDispSwap_CopyTexSubImage2D(GLbyte *); extern void __glXDispSwap_CopyTexSubImage3D(GLbyte *); +extern void __glXDispSwap_BindTexture(GLbyte *); +extern void __glXDispSwap_BlendColor(GLbyte *); +extern void __glXDispSwap_BlendEquation(GLbyte *); +extern void __glXDispSwap_ColorTable(GLbyte *); +extern void __glXDispSwap_ColorTableParameterfv(GLbyte *); +extern void __glXDispSwap_ColorTableParameteriv(GLbyte *); +extern void __glXDispSwap_CopyColorTable(GLbyte *); +extern void __glXDispSwap_ConvolutionParameterf(GLbyte *); +extern void __glXDispSwap_ConvolutionParameteri(GLbyte *); +extern void __glXDispSwap_Histogram(GLbyte *); +extern void __glXDispSwap_Minmax(GLbyte *); +extern void __glXDispSwap_ResetHistogram(GLbyte *); +extern void __glXDispSwap_ResetMinmax(GLbyte *); + +extern int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapBindSwapBarrierSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapJoinSwapGroupSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapQueryMaxSwapBarriersSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapMakeCurrentReadSGI(__GLXclientState *, GLbyte *); + #define __GLX_MIN_GLXCMD_OPCODE 1 #define __GLX_MAX_GLXCMD_OPCODE 20 #define __GLX_MIN_RENDER_OPCODE 1 diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index 88c2eb15b..4c500c93d 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -61,7 +61,6 @@ extern __GLXFBConfig **__glXFBConfigs; extern int __glXNumFBConfigs; -extern int glxIsExtensionSupported(char *ext); extern int __glXGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc); #define BE_TO_CLIENT_ERROR(x) \ diff --git a/hw/dmx/glxProxy/glxcmds.h b/hw/dmx/glxProxy/glxcmds.h index b0745927e..689e33485 100644 --- a/hw/dmx/glxProxy/glxcmds.h +++ b/hw/dmx/glxProxy/glxcmds.h @@ -33,5 +33,11 @@ extern int __glXCreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc); extern int __glXJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc); extern int __glXMakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc); extern int __glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc); +extern int __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, + GLXContextTag tag); + +extern Display *GetBackEndDisplay(__GLXclientState * cl, int s); +extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, + int s); #endif /* !__GLX_cmds_h__ */ diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c index ab3e7edc1..600a6e1cb 100644 --- a/hw/dmx/glxProxy/glxcmdsswap.c +++ b/hw/dmx/glxProxy/glxcmdsswap.c @@ -39,8 +39,6 @@ #include "glxext.h" #include "glxvendor.h" -extern int glxIsExtensionSupported(char *ext); - int __glXSwapGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc); /************************************************************************/ diff --git a/hw/dmx/glxProxy/glxext.h b/hw/dmx/glxProxy/glxext.h index 47cec15cf..b96ebc1f4 100644 --- a/hw/dmx/glxProxy/glxext.h +++ b/hw/dmx/glxProxy/glxext.h @@ -53,6 +53,7 @@ extern void __glXFlushContextCache(void); extern void __glXFreeGLXWindow(__glXWindow * pGlxWindow); extern void __glXFreeGLXPixmap(__GLXpixmap * pGlxPixmap); +extern void __glXFreeGLXPbuffer(__glXPbuffer * pGlxPbuffer); extern void __glXNoSuchRenderOpcode(GLbyte *); extern int __glXNoSuchSingleOpcode(__GLXclientState *, GLbyte *); diff --git a/hw/dmx/glxProxy/glxscreens.h b/hw/dmx/glxProxy/glxscreens.h index a9fe2a9db..9a538d193 100644 --- a/hw/dmx/glxProxy/glxscreens.h +++ b/hw/dmx/glxProxy/glxscreens.h @@ -50,4 +50,6 @@ extern void __glXScreenReset(void); extern char *__glXGetServerString(unsigned int name); +extern int glxIsExtensionSupported(char *ext); + #endif /* !__GLX_screens_h__ */ diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h index 754ad30a0..7aa5ad2f2 100644 --- a/hw/dmx/glxProxy/glxserver.h +++ b/hw/dmx/glxProxy/glxserver.h @@ -149,9 +149,7 @@ extern __GLXclientState *__glXClients[]; typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *); typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *); typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *); -extern __GLXdispatchSingleProcPtr __glXSingleTable[]; extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[]; -extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[]; extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[]; extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[]; @@ -193,9 +191,6 @@ extern RESTYPE __glXPbufferRes; extern char *__glXcombine_strings(const char *, const char *); -extern void __glXDisp_DrawArrays(GLbyte *); -extern void __glXDispSwap_DrawArrays(GLbyte *); - /* ** Routines for sending swapped replies. */ @@ -287,9 +282,6 @@ extern int __glXConvolutionParameterfvSize(GLenum pname); extern int __glXColorTableParameterfvSize(GLenum pname); extern int __glXColorTableParameterivSize(GLenum pname); -extern void __glXFreeGLXWindow(__glXWindow * pGlxWindow); -extern void __glXFreeGLXPbuffer(__glXPbuffer * pGlxPbuffer); - extern int __glXVersionMajor; extern int __glXVersionMinor; diff --git a/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c index 034497315..79d426bbf 100644 --- a/hw/dmx/glxProxy/glxsingle.c +++ b/hw/dmx/glxProxy/glxsingle.c @@ -45,6 +45,8 @@ /* #include "g_disptab_EXT.h" */ #include "unpack.h" #include "glxutil.h" +#include "glxcmds.h" +#include "glxsingle.h" #include "GL/glxproto.h" @@ -81,10 +83,6 @@ #define X_GLXSingle 0 /* needed by GetReqExtra */ -extern Display *GetBackEndDisplay(__GLXclientState * cl, int s); -extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, - int s); - static int swap_vec_element_size = 0; static void diff --git a/hw/dmx/glxProxy/glxsingle.h b/hw/dmx/glxProxy/glxsingle.h index 32a9d4921..6126177fa 100644 --- a/hw/dmx/glxProxy/glxsingle.h +++ b/hw/dmx/glxProxy/glxsingle.h @@ -47,8 +47,4 @@ extern int __glXForwardAllWithReplySwapsv(__GLXclientState * cl, GLbyte * pc); extern int __glXForwardAllWithReplySwapiv(__GLXclientState * cl, GLbyte * pc); extern int __glXForwardAllWithReplySwapdv(__GLXclientState * cl, GLbyte * pc); -extern int __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc); -extern int __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc); -extern int __glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc); - #endif diff --git a/hw/dmx/glxProxy/glxswap.c b/hw/dmx/glxProxy/glxswap.c index 5f565010d..bc18e5518 100644 --- a/hw/dmx/glxProxy/glxswap.c +++ b/hw/dmx/glxProxy/glxswap.c @@ -39,9 +39,7 @@ #include "dmxwindow.h" #include "glxserver.h" #include "glxswap.h" - -extern int __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, - GLXContextTag tag); +#include "glxcmds.h" typedef struct _SwapGroup *SwapGroupPtr; diff --git a/hw/dmx/glxProxy/glxvendor.c b/hw/dmx/glxProxy/glxvendor.c index fc8aff0cc..52d70eb70 100644 --- a/hw/dmx/glxProxy/glxvendor.c +++ b/hw/dmx/glxProxy/glxvendor.c @@ -44,6 +44,8 @@ /* #include "g_disptab_EXT.h" */ #include "unpack.h" #include "glxutil.h" +#include "glxcmds.h" +#include "glxvendor.h" #include "GL/glxproto.h" @@ -78,10 +80,6 @@ dpy->request++ #endif -extern Display *GetBackEndDisplay(__GLXclientState * cl, int s); -extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, - int s); - static int swap_vec_element_size = 0; static void -- cgit v1.2.3 From 3af41608228a796ff51698b9a6b6e74aa7cd67ba Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 22:13:28 -0800 Subject: dmx: remove redundant declaration of dmxFontPrivateIndex from dmxfont.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of 8 instances of gcc 4.8 warning: In file included from glxcmds.c:38:0: ../../../hw/dmx/dmxfont.h:57:12: warning: redundant redeclaration of ‘dmxFontPrivateIndex’ [-Wredundant-decls] extern int dmxFontPrivateIndex; ^ In file included from glxcmds.c:35:0: ../../../hw/dmx/dmx.h:388:12: note: previous declaration of ‘dmxFontPrivateIndex’ was here extern int dmxFontPrivateIndex; /**< Private index for Fonts */ ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 1033b85196e0f25877b4b9081993aff16bf32138) --- hw/dmx/dmxfont.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/dmx/dmxfont.h b/hw/dmx/dmxfont.h index 8575ca953..66c663377 100644 --- a/hw/dmx/dmxfont.h +++ b/hw/dmx/dmxfont.h @@ -54,6 +54,4 @@ extern Bool dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont); extern Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont); extern Bool dmxBEFreeFont(ScreenPtr pScreen, FontPtr pFont); -extern int dmxFontPrivateIndex; - #endif /* DMXFONT_H */ -- cgit v1.2.3 From 78df8521cfd8a279da15c7d267de5c9fe1108d4a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 22:16:49 -0800 Subject: dmx: remove redundant redeclarations of variables from other headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of these gcc 4.8 warnings: dmxcb.c:50:12: warning: redundant redeclaration of ‘PanoramiXPixWidth’ [-Wredundant-decls] extern int PanoramiXPixWidth; ^ In file included from dmxcb.c:49:0: ../../Xext/panoramiXsrv.h:12:22: note: previous declaration of ‘PanoramiXPixWidth’ was here extern _X_EXPORT int PanoramiXPixWidth; ^ dmxcb.c:51:12: warning: redundant redeclaration of ‘PanoramiXPixHeight’ [-Wredundant-decls] extern int PanoramiXPixHeight; ^ In file included from dmxcb.c:49:0: ../../Xext/panoramiXsrv.h:13:22: note: previous declaration of ‘PanoramiXPixHeight’ was here extern _X_EXPORT int PanoramiXPixHeight; ^ dmxcb.c:52:12: warning: redundant redeclaration of ‘PanoramiXNumScreens’ [-Wredundant-decls] extern int PanoramiXNumScreens; ^ In file included from dmxcb.c:49:0: ../../Xext/panoramiXsrv.h:11:22: note: previous declaration of ‘PanoramiXNumScreens’ was here extern _X_EXPORT int PanoramiXNumScreens; ^ dmxpict.c:60:12: warning: redundant redeclaration of ‘RenderErrBase’ [-Wredundant-decls] extern int RenderErrBase; ^ In file included from ../../render/glyphstr.h:29:0, from ../../render/picturestr.h:28, from dmx.h:65, from dmxpict.c:42: ../../render/picture.h:176:22: note: previous declaration of ‘RenderErrBase’ was here extern _X_EXPORT int RenderErrBase; ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 45ec646d77086eeb5f94766b055a93b5c75bdef0) --- hw/dmx/dmxcb.c | 3 --- hw/dmx/dmxpict.c | 1 - 2 files changed, 4 deletions(-) diff --git a/hw/dmx/dmxcb.c b/hw/dmx/dmxcb.c index 86015f395..cca5702ee 100644 --- a/hw/dmx/dmxcb.c +++ b/hw/dmx/dmxcb.c @@ -47,9 +47,6 @@ extern int connBlockScreenStart; #ifdef PANORAMIX #include "panoramiXsrv.h" -extern int PanoramiXPixWidth; -extern int PanoramiXPixHeight; -extern int PanoramiXNumScreens; #endif int dmxGlobalWidth, dmxGlobalHeight; diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c index 64d0ae150..aaca178b9 100644 --- a/hw/dmx/dmxpict.c +++ b/hw/dmx/dmxpict.c @@ -57,7 +57,6 @@ #include "mipict.h" #include "fbpict.h" -extern int RenderErrBase; extern int (*ProcRenderVector[RenderNumberRequests]) (ClientPtr); static int (*dmxSaveRenderVector[RenderNumberRequests]) (ClientPtr); -- cgit v1.2.3 From 03dd982d2b28f5959d5dc31ec45bff3ee5a0c82c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 22:20:24 -0800 Subject: dmx: Mark glxIsExtensionSupported as a const char * MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of 9 instances of gcc 4.8 warning: glxcmds.c: In function ‘CreateContext’: glxcmds.c:378:13: warning: passing argument 1 of ‘glxIsExtensionSupported’ discards ‘const’ qualifier from pointer target type [enabled by default] else if (glxIsExtensionSupported("GLX_SGIX_fbconfig")) { ^ In file included from glxserver.h:49:0, from glxcmds.c:41: glxscreens.h:53:12: note: expected ‘char *’ but argument is of type ‘const char *’ extern int glxIsExtensionSupported(char *ext); Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 9682c47e228962e4008855c4da7467748742685e) --- hw/dmx/glxProxy/glxscreens.c | 2 +- hw/dmx/glxProxy/glxscreens.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c index b62776c41..15bb1e862 100644 --- a/hw/dmx/glxProxy/glxscreens.c +++ b/hw/dmx/glxProxy/glxscreens.c @@ -335,7 +335,7 @@ __glXGetServerString(unsigned int name) } int -glxIsExtensionSupported(char *ext) +glxIsExtensionSupported(const char *ext) { return (strstr(ExtensionsString, ext) != NULL); } diff --git a/hw/dmx/glxProxy/glxscreens.h b/hw/dmx/glxProxy/glxscreens.h index 9a538d193..bb7477bc7 100644 --- a/hw/dmx/glxProxy/glxscreens.h +++ b/hw/dmx/glxProxy/glxscreens.h @@ -50,6 +50,6 @@ extern void __glXScreenReset(void); extern char *__glXGetServerString(unsigned int name); -extern int glxIsExtensionSupported(char *ext); +extern int glxIsExtensionSupported(const char *ext); #endif /* !__GLX_screens_h__ */ -- cgit v1.2.3 From cb7ee9808a18057f534d6b8025b950f5f7275749 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 22:33:54 -0800 Subject: dmx: constify GCOps & GCFuncs pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of 16 instances of gcc 4.8 warnings: In file included from dmxgc.c:41:0: dmx.h:327:23: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] (_saved)->_entry = (_actual)->_entry; \ ^ dmxgc.h:80:5: note: in expansion of macro ‘DMX_WRAP’ DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC)); \ ^ dmxgc.c:192:5: note: in expansion of macro ‘DMX_GC_FUNC_EPILOGUE’ DMX_GC_FUNC_EPILOGUE(pGC); ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit a0e44ddfb0c641e7896a55abf26621ae3d17e337) --- hw/dmx/dmxgc.c | 4 ++-- hw/dmx/dmxgc.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index 234316797..ec15d27aa 100644 --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -49,7 +49,7 @@ #include "pixmapstr.h" #include "migc.h" -static GCFuncs dmxGCFuncs = { +static const GCFuncs dmxGCFuncs = { dmxValidateGC, dmxChangeGC, dmxCopyGC, @@ -59,7 +59,7 @@ static GCFuncs dmxGCFuncs = { dmxCopyClip, }; -static GCOps dmxGCOps = { +static const GCOps dmxGCOps = { dmxFillSpans, dmxSetSpans, dmxPutImage, diff --git a/hw/dmx/dmxgc.h b/hw/dmx/dmxgc.h index c8ecb53a0..c5c6b7732 100644 --- a/hw/dmx/dmxgc.h +++ b/hw/dmx/dmxgc.h @@ -41,8 +41,8 @@ /** GC private area. */ typedef struct _dmxGCPriv { - GCOps *ops; - GCFuncs *funcs; + const GCOps *ops; + const GCFuncs *funcs; XlibGC gc; Bool msc; } dmxGCPrivRec, *dmxGCPrivPtr; -- cgit v1.2.3 From 3f26c837262c4d15f18a6974ea15660f24ce94c1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 12 Dec 2014 22:38:26 -0800 Subject: dmx: include header for DMXExtensionInit() in dmx.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of gcc 4.8 warning: dmx.c:1193:1: warning: no previous prototype for ‘DMXExtensionInit’ [-Wmissing-prototypes] DMXExtensionInit(void) ^ Signed-off-by: Alan Coopersmith Reviewed-by: Rémi Cardona Reviewed-by: Keith Packard (cherry picked from commit 4a758f59a8a65c313244e06852745c8e180ff247) --- hw/dmx/dmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index 99e970cb9..2988df33a 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -55,6 +55,7 @@ #include "extinit.h" #include "opaque.h" +#include "dmx.h" #include "dmxextension.h" #include #include -- cgit v1.2.3 From 918032905433f64320dc4c222228c008bbd50cd2 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 4 Jun 2015 13:23:19 -0500 Subject: xace: Add XaceHookIsSet helper function Signed-off-by: Andrew Eikum Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer (cherry picked from commit 5dc2a9aae46352f1f35d3ba122da04727789a15d) --- Xext/xace.c | 15 +++++++++++++++ Xext/xace.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/Xext/xace.c b/Xext/xace.c index d77b3126a..b3c67f632 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -213,6 +213,21 @@ XaceHook(int hook, ...) return prv ? *prv : Success; } +/* XaceHookIsSet + * + * Utility function to determine whether there are any callbacks listening on a + * particular XACE hook. + * + * Returns non-zero if there is a callback, zero otherwise. + */ +int +XaceHookIsSet(int hook) +{ + if (hook < 0 || hook >= XACE_NUM_HOOKS) + return 0; + return XaceHooks[hook] != NULL; +} + /* XaceCensorImage * * Called after pScreen->GetImage to prevent pieces or trusted windows from diff --git a/Xext/xace.h b/Xext/xace.h index 5e6cb0437..3303f76bc 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -65,6 +65,9 @@ extern _X_EXPORT int XaceHook(int /*hook */ , ... /*appropriate args for hook */ ); +/* determine whether any callbacks are present for the XACE hook */ +extern _X_EXPORT int XaceHookIsSet(int hook); + /* Special-cased hook functions */ extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major); -- cgit v1.2.3 From d23171754a6c4f7361ac5aed64eaa29222b32df2 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 4 Jun 2015 13:24:53 -0500 Subject: dix: Send KeyPress and KeyRelease events to the XACE_KEY_AVAIL hook While it's documented in the XACE spec, the XACE_KEY_AVAIL hook is currently never actually invoked by the xserver. This hook was added in 13c6713c82 (25 Aug 2006), but as the keyboard processing was moved into XKB, the hook was forgotten and silently dropped. The code calling this hook was removed by 7af53799c (4 Jan 2009), but it was probably already unused before that. This patch re-adds support for this hook. The "count" hook parameter is unused. Signed-off-by: Andrew Eikum Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer (cherry picked from commit 990cf5b2828f73dc7a07f1e38f608af39acfd81d) --- Xi/exevents.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Xi/exevents.c b/Xi/exevents.c index 0857bcee6..21fb69696 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1730,6 +1730,18 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) break; } + /* send KeyPress and KeyRelease events to XACE plugins */ + if (XaceHookIsSet(XACE_KEY_AVAIL) && + (event->type == ET_KeyPress || event->type == ET_KeyRelease)) { + xEvent *core; + int count; + + if (EventToCore(ev, &core, &count) == Success && count > 0) { + XaceHook(XACE_KEY_AVAIL, core, device, 0); + free(core); + } + } + if (DeviceEventCallback && !syncEvents.playingEvents) { DeviceEventInfoRec eventinfo; SpritePtr pSprite = device->spriteInfo->sprite; -- cgit v1.2.3 From df4f69d4624b60c9a463712a81cce4e48175e4ae Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Tue, 12 May 2015 14:19:15 -0400 Subject: Fix border tile origin when background is ParentRelative According to http://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:CreateWindow "The border tile origin is always the same as the background tile origin." ChangeWindowAttributes goes to some effort to make sure it repaints the border tile whenever the background origin may have changed, but miPaintWindow was ignoring the background origin. Found by xts XChangeWindowAttributes-3 Signed-off-by: Peter Harris Reviewed-by: Keith Packard Signed-off-by: Keith Packard (cherry picked from commit b4061cf5f76241157b2dc81dec053012075311c0) --- mi/miexpose.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mi/miexpose.c b/mi/miexpose.c index fc4dbc071..3e49f15f4 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -478,14 +478,21 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) else { PixmapPtr pixmap; - tile_x_off = drawable->x; - tile_y_off = drawable->y; + fill = pWin->border; + solid = pWin->borderIsPixel; /* servers without pixmaps draw their own borders */ if (!pScreen->GetWindowPixmap) return; pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable); drawable = &pixmap->drawable; + + while (pWin->backgroundState == ParentRelative) + pWin = pWin->parent; + + tile_x_off = pWin->drawable.x; + tile_y_off = pWin->drawable.y; + #ifdef COMPOSITE draw_x_off = pixmap->screen_x; draw_y_off = pixmap->screen_y; @@ -495,8 +502,6 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) draw_x_off = 0; draw_y_off = 0; #endif - fill = pWin->border; - solid = pWin->borderIsPixel; } gcval[0].val = GXcopy; -- cgit v1.2.3 From b46ff18b247f75b33408fe34118b8a86a0f77e45 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 2 Jul 2015 20:16:21 +0200 Subject: mi: fix typo in warning about overflowing queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debian bug#726041 Reported-by: Vincent Hobeïka Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard (cherry picked from commit ac94cdb9df94dd26688de6d3d9143ac48f7b3c7b) --- mi/mieq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mi/mieq.c b/mi/mieq.c index 8907a6ea1..b7be193fe 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -599,7 +599,7 @@ mieqProcessInputEvents(void) ErrorF("[mi] EQ processing has resumed after %lu dropped events.\n", (unsigned long) miEventQueue.dropped); ErrorF - ("[mi] This may be caused my a misbehaving driver monopolizing the server's resources.\n"); + ("[mi] This may be caused by a misbehaving driver monopolizing the server's resources.\n"); miEventQueue.dropped = 0; } -- cgit v1.2.3 From 9e744ac376396ef032f44fba69f7e34d78f04abc Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 2 Jun 2015 13:58:30 -0400 Subject: fb: Make rootless-agnostic Reviewed-by: Jasper St. Pierre Signed-off-by: Adam Jackson (cherry picked from commit 315661a425018a546f7bcc18ad3e5f4578473ca6) --- fb/fb.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index ab110f327..c687aa7a0 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -472,13 +472,8 @@ typedef struct { #define fbGetWindowPixmap(pWin) ((PixmapPtr)\ dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey(pWin))) -#ifdef ROOTLESS #define __fbPixDrawableX(pPix) ((pPix)->drawable.x) #define __fbPixDrawableY(pPix) ((pPix)->drawable.y) -#else -#define __fbPixDrawableX(pPix) 0 -#define __fbPixDrawableY(pPix) 0 -#endif #ifdef COMPOSITE #define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix) - (pPix)->screen_x) -- cgit v1.2.3 From 061ff2621ccc8560d15fb804eff68a3e15c1b5d1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 15 May 2015 11:27:31 -0400 Subject: glx/swrast: Do more GLX extension setup This gets you nice things like core contexts when using Xvfb. Also, no, MESA_copy_sub_buffer is not enabled automatically. Reviewed-by: James Jones Reviewed-by: Jon Turney Signed-off-by: Adam Jackson (cherry picked from commit 2d7194334a9f84e417ec90e220b2fe476f704612) --- glx/glxdriswrast.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index 5d9aa0437..e25ca4768 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -71,6 +71,8 @@ struct __GLXDRIscreen { const __DRIcopySubBufferExtension *copySubBuffer; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; + + unsigned char glx_enable_bits[__GLX_EXT_BYTES]; }; struct __GLXDRIcontext { @@ -394,21 +396,34 @@ initializeExtensions(__GLXDRIscreen * screen) const __DRIextension **extensions; int i; + if (screen->swrast->base.version >= 3) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context_profile"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_EXT_create_context_es2_profile"); + } + + /* these are harmless to enable unconditionally */ + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_framebuffer_sRGB"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_make_current_read"); + extensions = screen->core->getExtensions(screen->driScreen); for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { screen->copySubBuffer = (const __DRIcopySubBufferExtension *) extensions[i]; - /* GLX_MESA_copy_sub_buffer is always enabled. */ + __glXEnableExtension(screen->glx_enable_bits, + "GLX_MESA_copy_sub_buffer"); } if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; /* GLX_EXT_texture_from_pixmap is always enabled. */ } - - /* Ignore unknown extensions */ } } @@ -420,6 +435,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName = "swrast"; __GLXDRIscreen *screen; + size_t buffer_size; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -431,6 +447,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.swapInterval = NULL; screen->base.pScreen = pScreen; + __glXInitExtensionEnableBits(screen->glx_enable_bits); + screen->driver = glxProbeDriver(driverName, (void **) &screen->core, __DRI_CORE, 1, @@ -459,6 +477,19 @@ __glXDRIscreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); + /* The first call simply determines the length of the extension string. + * This allows us to allocate some memory to hold the extension string, + * but it requires that we call __glXGetExtensionString a second time. + */ + buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); + if (buffer_size > 0) { + free(screen->base.GLXextensions); + + screen->base.GLXextensions = xnfalloc(buffer_size); + (void) __glXGetExtensionString(screen->glx_enable_bits, + screen->base.GLXextensions); + } + screen->base.GLXmajor = 1; screen->base.GLXminor = 4; -- cgit v1.2.3 From c15e48bb032514f1123f715719c25eaba7e043a7 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 1 Jun 2014 04:29:19 -0700 Subject: XQuartz: GLX: Use __glXEnableExtension to build extensions list Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 3790001ea29658872aebda00a03170e392b47878) --- hw/xquartz/GL/indirect.c | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 19b7d86e7..4e6ab3d13 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c @@ -52,6 +52,7 @@ #include "visualConfigs.h" #include "dri.h" +#include "extension_string.h" #include "darwin.h" #define GLAQUA_DEBUG_MSG(msg, args ...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", \ @@ -111,6 +112,10 @@ typedef struct __GLXAquaDrawable __GLXAquaDrawable; */ struct __GLXAquaScreen { __GLXscreen base; + + /* Supported GLX extensions */ + unsigned char glx_enable_bits[__GLX_EXT_BYTES]; + int index; int num_vis; }; @@ -541,13 +546,33 @@ __glXAquaScreenProbe(ScreenPtr pScreen) screen->base.GLXmajor = 1; screen->base.GLXminor = 4; - screen->base.GLXextensions = strdup("GLX_SGIX_fbconfig " - "GLX_SGIS_multisample " - "GLX_ARB_multisample " - "GLX_EXT_visual_info " - "GLX_EXT_import_context "); - /*We may be able to add more GLXextensions at a later time. */ + memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES); + + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_rating"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_import_context"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_OML_swap_method"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_fbconfig"); + + __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIS_multisample"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_multisample"); + + //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); + //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); + + // Generate the GLX extensions string (overrides that set by __glXScreenInit()) + { + unsigned int buffer_size = + __glXGetExtensionString(screen->glx_enable_bits, NULL); + if (buffer_size > 0) { + free(screen->base.GLXextensions); + + screen->base.GLXextensions = xnfalloc(buffer_size); + __glXGetExtensionString(screen->glx_enable_bits, + screen->base.GLXextensions); + } + } return &screen->base; } -- cgit v1.2.3 From 414fc605a930c5baa7e65cc303b05f3977b86baf Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Tue, 9 Jun 2015 23:29:40 -0700 Subject: XQuartz: Silence -Wpointer-bool-conversion X11Controller.m:417:17: error: address of function 'asl_log_descriptor' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion,Value Conversion Issue] if (asl_log_descriptor) { ~~ ^~~~~~~~~~~~~~~~~~ X11Controller.m:417:17: note: prefix with the address-of operator to silence this warning [Semantic Issue] if (asl_log_descriptor) { ^ & Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 0b9c32489131a5723bd78decf5d2557b94207cf4) --- hw/xquartz/X11Controller.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 022e83258..c3c697616 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -364,7 +364,7 @@ extern char *bundle_id_prefix; } #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 - if (asl_log_descriptor) { + if (&asl_log_descriptor) { char *asl_sender; aslmsg amsg = asl_new(ASL_TYPE_MSG); assert(amsg); @@ -414,7 +414,7 @@ extern char *bundle_id_prefix; case 0: /* child2 */ #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 - if (asl_log_descriptor) { + if (&asl_log_descriptor) { /* Replace our stdout/stderr */ dup2(stdout_pipe[1], STDOUT_FILENO); dup2(stderr_pipe[1], STDERR_FILENO); @@ -443,7 +443,7 @@ extern char *bundle_id_prefix; } #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 - if (asl_log_descriptor) { + if (&asl_log_descriptor) { /* Close the write ends of the pipe */ close(stdout_pipe[1]); close(stderr_pipe[1]); -- cgit v1.2.3 From 601e9b5f8c147ef4242b4bda76e9a16e3d635370 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Tue, 9 Jun 2015 23:30:50 -0700 Subject: XQuartz: Silence -Wunused-variable X11Controller.m:939:9: warning: unused variable 'remain' [-Wunused-variable,Unused Entity Issue] int remain; ^ Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 9fe7f5ccada37e2d2a2fa92064b92a0334a3fcdd) --- hw/xquartz/X11Controller.m | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index c3c697616..a5c513861 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -936,7 +936,6 @@ extern char *bundle_id_prefix; - (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN { - int remain; [X11App prefs_synchronize]; /* shutdown the X server, it will exit () for us. */ -- cgit v1.2.3 From 434890171d5ab4ec61a05596cb33e469a61a870c Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Tue, 9 Jun 2015 23:34:50 -0700 Subject: XQuartz: Silence -Wunused-function quartzKeyboard.c:741:1: warning: unused function 'macroman2ucs' [-Wunused-function,Unused Entity Issue] macroman2ucs(unsigned char c) ^ 1 warning generated. Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 3a6fa115759c787ec34483437021ad1e55c52423) --- hw/xquartz/quartzKeyboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index 84e34d916..2fed59306 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -737,6 +737,7 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) return 1; } +#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 static inline UniChar macroman2ucs(unsigned char c) { @@ -782,6 +783,7 @@ macroman2ucs(unsigned char c) if (c < 128) return c; else return table[c - 128]; } +#endif static KeySym make_dead_key(KeySym in) -- cgit v1.2.3 From ba00d8fe70cbb16e45e578437defaf3eed6d25f4 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Tue, 9 Jun 2015 23:41:12 -0700 Subject: XQuartz: Silence -Wformat-security for NSRunAlertPanel Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 9003a3e5c55903ce4e371b2d5cb5030b5f97ae0e) --- hw/xquartz/X11Application.m | 15 +++++++-------- hw/xquartz/X11Controller.m | 6 +++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 2efbd658b..8a928baac 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1069,12 +1069,12 @@ X11ApplicationCanEnterRandR(void) if (!XQuartzIsRootless) QuartzShowFullscreen(FALSE); - switch (NSRunAlertPanel(title, msg, + switch (NSRunAlertPanel(title, @"%@", NSLocalizedString(@"Allow", @""), NSLocalizedString(@"Cancel", @""), - NSLocalizedString(@"Always Allow", @""))) { + NSLocalizedString(@"Always Allow", @""), msg)) { case NSAlertOtherReturn: [X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES]; [X11App prefs_synchronize]; @@ -1122,10 +1122,10 @@ X11ApplicationFatalError(const char *f, va_list args) */ dispatch_sync(dispatch_get_main_queue(), ^{ if (NSAlertDefaultReturn == - NSRunAlertPanel (title, msg, + NSRunAlertPanel (title, @"%@", NSLocalizedString (@"Quit", @""), - NSLocalizedString ( - @"Report...", @""), nil)) { + NSLocalizedString (@"Report...", @""), + nil, msg)) { exit (EXIT_FAILURE); } }); @@ -1160,9 +1160,8 @@ check_xinitrc(void) @"Startup xinitrc dialog"); if (NSAlertDefaultReturn == - NSRunAlertPanel(nil, msg, NSLocalizedString(@"Yes", @""), - NSLocalizedString(@"No", - @""), nil)) { + NSRunAlertPanel(nil, @"%@", NSLocalizedString(@"Yes", @""), + NSLocalizedString(@"No", @""), nil, msg)) { char buf2[1024]; int i = -1; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index a5c513861..c75493c42 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -929,9 +929,9 @@ extern char *bundle_id_prefix; * and then run the alert on a timer? It seems to work here, so.. */ - return (NSRunAlertPanel(title, msg, NSLocalizedString(@"Quit", @""), - NSLocalizedString(@"Cancel", @""), nil) - == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel; + NSInteger result = NSRunAlertPanel(title, @"%@", NSLocalizedString(@"Quit", @""), + NSLocalizedString(@"Cancel", @""), nil, msg); + return (result == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel; } - (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN -- cgit v1.2.3 From d939043594fe75c49f356e717f94195050f6d08c Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Mon, 12 Oct 2015 02:04:11 -0700 Subject: XQuartz: Relax App Transport Security for communicating with the update server Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit df80e2649aa47957986554928e6bf41b86c15240) --- hw/xquartz/bundle/Info.plist.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp index a0d9050ac..06e33f871 100644 --- a/hw/xquartz/bundle/Info.plist.cpp +++ b/hw/xquartz/bundle/Info.plist.cpp @@ -35,6 +35,19 @@ sparkle.pem SUFeedURL http://xquartz.macosforge.org/downloads/sparkle/release.xml + NSAppTransportSecurity + + NSExceptionDomains + + macosforge.org + + NSIncludesSubdomains + + NSExceptionAllowsInsecureHTTPLoads + + + + #endif LSApplicationCategoryType public.app-category.utilities -- cgit v1.2.3 From 3a7ed42d33d264f7151fa2ed9bef7a55bde1c0e2 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Mon, 12 Oct 2015 02:06:10 -0700 Subject: XQuartz: Remove InfoPlist.strings Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 6e6827aac33eddeacfb37ef3d7b0397b1446bf66) --- hw/xquartz/bundle/Makefile.am | 30 --------------------- .../bundle/Resources/Dutch.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../Resources/English.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../Resources/French.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../Resources/German.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../Resources/Italian.lproj/InfoPlist.strings | Bin 278 -> 0 bytes .../Resources/Japanese.lproj/InfoPlist.strings | Bin 272 -> 0 bytes .../Resources/Spanish.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/Resources/ar.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/Resources/ca.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/Resources/cs.lproj/InfoPlist.strings | Bin 272 -> 0 bytes .../bundle/Resources/da.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/Resources/el.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../bundle/Resources/fi.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../bundle/Resources/he.lproj/InfoPlist.strings | Bin 298 -> 0 bytes .../bundle/Resources/hr.lproj/InfoPlist.strings | Bin 286 -> 0 bytes .../bundle/Resources/hu.lproj/InfoPlist.strings | Bin 278 -> 0 bytes .../bundle/Resources/ko.lproj/InfoPlist.strings | Bin 266 -> 0 bytes .../bundle/Resources/no.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/Resources/pl.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../bundle/Resources/pt.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../bundle/Resources/pt_PT.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../bundle/Resources/ro.lproj/InfoPlist.strings | Bin 280 -> 0 bytes .../bundle/Resources/ru.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../bundle/Resources/sk.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../bundle/Resources/sv.lproj/InfoPlist.strings | Bin 260 -> 0 bytes .../bundle/Resources/th.lproj/InfoPlist.strings | Bin 270 -> 0 bytes .../bundle/Resources/tr.lproj/InfoPlist.strings | Bin 272 -> 0 bytes .../bundle/Resources/uk.lproj/InfoPlist.strings | Bin 264 -> 0 bytes .../bundle/Resources/zh_CN.lproj/InfoPlist.strings | Bin 260 -> 0 bytes .../bundle/Resources/zh_TW.lproj/InfoPlist.strings | Bin 264 -> 0 bytes hw/xquartz/bundle/mk_bundke.sh | 2 +- 32 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/ar.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/ca.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/cs.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/hr.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/hu.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/ro.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/th.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/tr.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/uk.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings delete mode 100644 hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am index 87392b423..074075209 100644 --- a/hw/xquartz/bundle/Makefile.am +++ b/hw/xquartz/bundle/Makefile.am @@ -30,153 +30,123 @@ EXTRA_DIST = \ Info.plist.cpp \ PkgInfo \ $(resource_DATA) \ - Resources/ar.lproj/InfoPlist.strings \ Resources/ar.lproj/Localizable.strings \ Resources/ar.lproj/locversion.plist \ Resources/ar.lproj/main.nib/designable.nib \ Resources/ar.lproj/main.nib/keyedobjects.nib \ - Resources/ca.lproj/InfoPlist.strings \ Resources/ca.lproj/Localizable.strings \ Resources/ca.lproj/locversion.plist \ Resources/ca.lproj/main.nib/designable.nib \ Resources/ca.lproj/main.nib/keyedobjects.nib \ - Resources/cs.lproj/InfoPlist.strings \ Resources/cs.lproj/Localizable.strings \ Resources/cs.lproj/locversion.plist \ Resources/cs.lproj/main.nib/designable.nib \ Resources/cs.lproj/main.nib/keyedobjects.nib \ - Resources/da.lproj/InfoPlist.strings \ Resources/da.lproj/Localizable.strings \ Resources/da.lproj/locversion.plist \ Resources/da.lproj/main.nib/designable.nib \ Resources/da.lproj/main.nib/keyedobjects.nib \ - Resources/Dutch.lproj/InfoPlist.strings \ Resources/Dutch.lproj/Localizable.strings \ Resources/Dutch.lproj/locversion.plist \ Resources/Dutch.lproj/main.nib/designable.nib \ Resources/Dutch.lproj/main.nib/keyedobjects.nib \ - Resources/el.lproj/InfoPlist.strings \ Resources/el.lproj/Localizable.strings \ Resources/el.lproj/locversion.plist \ Resources/el.lproj/main.nib/designable.nib \ Resources/el.lproj/main.nib/keyedobjects.nib \ - Resources/English.lproj/InfoPlist.strings \ Resources/English.lproj/Localizable.strings \ Resources/English.lproj/locversion.plist \ Resources/English.lproj/main.nib/designable.nib \ Resources/English.lproj/main.nib/keyedobjects.nib \ - Resources/fi.lproj/InfoPlist.strings \ Resources/fi.lproj/Localizable.strings \ Resources/fi.lproj/locversion.plist \ Resources/fi.lproj/main.nib/designable.nib \ Resources/fi.lproj/main.nib/keyedobjects.nib \ - Resources/French.lproj/InfoPlist.strings \ Resources/French.lproj/Localizable.strings \ Resources/French.lproj/locversion.plist \ Resources/French.lproj/main.nib/designable.nib \ Resources/French.lproj/main.nib/keyedobjects.nib \ - Resources/German.lproj/InfoPlist.strings \ Resources/German.lproj/Localizable.strings \ Resources/German.lproj/locversion.plist \ Resources/German.lproj/main.nib/designable.nib \ Resources/German.lproj/main.nib/keyedobjects.nib \ - Resources/he.lproj/InfoPlist.strings \ Resources/he.lproj/Localizable.strings \ Resources/he.lproj/locversion.plist \ Resources/he.lproj/main.nib/designable.nib \ Resources/he.lproj/main.nib/keyedobjects.nib \ - Resources/hr.lproj/InfoPlist.strings \ Resources/hr.lproj/Localizable.strings \ Resources/hr.lproj/locversion.plist \ Resources/hr.lproj/main.nib/designable.nib \ Resources/hr.lproj/main.nib/keyedobjects.nib \ - Resources/hu.lproj/InfoPlist.strings \ Resources/hu.lproj/Localizable.strings \ Resources/hu.lproj/locversion.plist \ Resources/hu.lproj/main.nib/designable.nib \ Resources/hu.lproj/main.nib/keyedobjects.nib \ - Resources/Italian.lproj/InfoPlist.strings \ Resources/Italian.lproj/Localizable.strings \ Resources/Italian.lproj/locversion.plist \ Resources/Italian.lproj/main.nib/designable.nib \ Resources/Italian.lproj/main.nib/keyedobjects.nib \ - Resources/Japanese.lproj/InfoPlist.strings \ Resources/Japanese.lproj/Localizable.strings \ Resources/Japanese.lproj/locversion.plist \ Resources/Japanese.lproj/main.nib/designable.nib \ Resources/Japanese.lproj/main.nib/keyedobjects.nib \ - Resources/ko.lproj/InfoPlist.strings \ Resources/ko.lproj/Localizable.strings \ Resources/ko.lproj/locversion.plist \ Resources/ko.lproj/main.nib/designable.nib \ Resources/ko.lproj/main.nib/keyedobjects.nib \ - Resources/no.lproj/InfoPlist.strings \ Resources/no.lproj/Localizable.strings \ Resources/no.lproj/locversion.plist \ Resources/no.lproj/main.nib/designable.nib \ Resources/no.lproj/main.nib/keyedobjects.nib \ - Resources/pl.lproj/InfoPlist.strings \ Resources/pl.lproj/Localizable.strings \ Resources/pl.lproj/locversion.plist \ Resources/pl.lproj/main.nib/designable.nib \ Resources/pl.lproj/main.nib/keyedobjects.nib \ - Resources/pt.lproj/InfoPlist.strings \ Resources/pt.lproj/Localizable.strings \ Resources/pt.lproj/locversion.plist \ Resources/pt.lproj/main.nib/designable.nib \ Resources/pt.lproj/main.nib/keyedobjects.nib \ - Resources/pt_PT.lproj/InfoPlist.strings \ Resources/pt_PT.lproj/Localizable.strings \ Resources/pt_PT.lproj/locversion.plist \ Resources/pt_PT.lproj/main.nib/designable.nib \ Resources/pt_PT.lproj/main.nib/keyedobjects.nib \ - Resources/ro.lproj/InfoPlist.strings \ Resources/ro.lproj/Localizable.strings \ Resources/ro.lproj/locversion.plist \ Resources/ro.lproj/main.nib/designable.nib \ Resources/ro.lproj/main.nib/keyedobjects.nib \ - Resources/ru.lproj/InfoPlist.strings \ Resources/ru.lproj/Localizable.strings \ Resources/ru.lproj/locversion.plist \ Resources/ru.lproj/main.nib/designable.nib \ Resources/ru.lproj/main.nib/keyedobjects.nib \ - Resources/sk.lproj/InfoPlist.strings \ Resources/sk.lproj/Localizable.strings \ Resources/sk.lproj/locversion.plist \ Resources/sk.lproj/main.nib/designable.nib \ Resources/sk.lproj/main.nib/keyedobjects.nib \ - Resources/Spanish.lproj/InfoPlist.strings \ Resources/Spanish.lproj/Localizable.strings \ Resources/Spanish.lproj/locversion.plist \ Resources/Spanish.lproj/main.nib/designable.nib \ Resources/Spanish.lproj/main.nib/keyedobjects.nib \ - Resources/sv.lproj/InfoPlist.strings \ Resources/sv.lproj/Localizable.strings \ Resources/sv.lproj/locversion.plist \ Resources/sv.lproj/main.nib/designable.nib \ Resources/sv.lproj/main.nib/keyedobjects.nib \ - Resources/th.lproj/InfoPlist.strings \ Resources/th.lproj/Localizable.strings \ Resources/th.lproj/locversion.plist \ Resources/th.lproj/main.nib/designable.nib \ Resources/th.lproj/main.nib/keyedobjects.nib \ - Resources/tr.lproj/InfoPlist.strings \ Resources/tr.lproj/Localizable.strings \ Resources/tr.lproj/locversion.plist \ Resources/tr.lproj/main.nib/designable.nib \ Resources/tr.lproj/main.nib/keyedobjects.nib \ - Resources/uk.lproj/InfoPlist.strings \ Resources/uk.lproj/Localizable.strings \ Resources/uk.lproj/locversion.plist \ Resources/uk.lproj/main.nib/designable.nib \ Resources/uk.lproj/main.nib/keyedobjects.nib \ Resources/X11.icns \ - Resources/zh_CN.lproj/InfoPlist.strings \ Resources/zh_CN.lproj/Localizable.strings \ Resources/zh_CN.lproj/locversion.plist \ Resources/zh_CN.lproj/main.nib/designable.nib \ Resources/zh_CN.lproj/main.nib/keyedobjects.nib \ - Resources/zh_TW.lproj/InfoPlist.strings \ Resources/zh_TW.lproj/Localizable.strings \ Resources/zh_TW.lproj/locversion.plist \ Resources/zh_TW.lproj/main.nib/designable.nib \ diff --git a/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings deleted file mode 100644 index 8f978d63f..000000000 Binary files a/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings deleted file mode 100644 index 88e1f04ac..000000000 Binary files a/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings deleted file mode 100644 index 88e1f04ac..000000000 Binary files a/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings deleted file mode 100644 index aa37e7555..000000000 Binary files a/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings deleted file mode 100644 index 412169880..000000000 Binary files a/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings deleted file mode 100644 index 2d6330fa7..000000000 Binary files a/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings deleted file mode 100644 index 0e4287d14..000000000 Binary files a/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/ar.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ar.lproj/InfoPlist.strings deleted file mode 100644 index 88e1f04ac..000000000 Binary files a/hw/xquartz/bundle/Resources/ar.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/ca.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ca.lproj/InfoPlist.strings deleted file mode 100644 index 95214ff3e..000000000 Binary files a/hw/xquartz/bundle/Resources/ca.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/cs.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/cs.lproj/InfoPlist.strings deleted file mode 100644 index 0f74e7c57..000000000 Binary files a/hw/xquartz/bundle/Resources/cs.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings deleted file mode 100644 index 88e1f04ac..000000000 Binary files a/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings deleted file mode 100644 index 72eb2b165..000000000 Binary files a/hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings deleted file mode 100644 index 8e4f6474f..000000000 Binary files a/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings deleted file mode 100644 index 3dd6946e1..000000000 Binary files a/hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/hr.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/hr.lproj/InfoPlist.strings deleted file mode 100644 index 7baab082c..000000000 Binary files a/hw/xquartz/bundle/Resources/hr.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/hu.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/hu.lproj/InfoPlist.strings deleted file mode 100644 index 842ef04ae..000000000 Binary files a/hw/xquartz/bundle/Resources/hu.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings deleted file mode 100644 index 4c738f8b2..000000000 Binary files a/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings deleted file mode 100644 index eb1cfb002..000000000 Binary files a/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings deleted file mode 100644 index b9c950214..000000000 Binary files a/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings deleted file mode 100644 index 33c637448..000000000 Binary files a/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings deleted file mode 100644 index 33c637448..000000000 Binary files a/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/ro.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ro.lproj/InfoPlist.strings deleted file mode 100644 index dba225f56..000000000 Binary files a/hw/xquartz/bundle/Resources/ro.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings deleted file mode 100644 index 7f722e4b6..000000000 Binary files a/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings deleted file mode 100644 index 53b3005ed..000000000 Binary files a/hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings deleted file mode 100644 index 1522655dd..000000000 Binary files a/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/th.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/th.lproj/InfoPlist.strings deleted file mode 100644 index 51d294bde..000000000 Binary files a/hw/xquartz/bundle/Resources/th.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/tr.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/tr.lproj/InfoPlist.strings deleted file mode 100644 index 2e003a768..000000000 Binary files a/hw/xquartz/bundle/Resources/tr.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/uk.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/uk.lproj/InfoPlist.strings deleted file mode 100644 index 1153eafe5..000000000 Binary files a/hw/xquartz/bundle/Resources/uk.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings deleted file mode 100644 index b5df36885..000000000 Binary files a/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings deleted file mode 100644 index d56e1de43..000000000 Binary files a/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings and /dev/null differ diff --git a/hw/xquartz/bundle/mk_bundke.sh b/hw/xquartz/bundle/mk_bundke.sh index 288c6a9de..632e5f76b 100755 --- a/hw/xquartz/bundle/mk_bundke.sh +++ b/hw/xquartz/bundle/mk_bundke.sh @@ -12,7 +12,7 @@ for lang in ${localities} ; do mkdir -p ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib [ -d ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib ] || exit 1 - for f in InfoPlist.strings Localizable.strings main.nib/keyedobjects.nib ; do + for f in Localizable.strings main.nib/keyedobjects.nib ; do install -m 644 ${SRCDIR}/Resources/${lang}.lproj/$f ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/${f} done done -- cgit v1.2.3 From 52506f60b6680e11fa418f4e59e7159eb5b7ec39 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Mon, 12 Oct 2015 16:45:41 -0700 Subject: XQuartz: Fix how we calculate the height of the OSX menu bar +[NSScreen mainScreen] does not mean the primary display. It used to mean the one with the key window. When "Displays have separate spaces" is enabled, it means the active screen, the one whose menu bar is mostly opaque. As such, it may not be the screen whose lower-left corner is located at (0, 0). That's why its max-Y is not necessarily comparable to its height. That only works for the primary display. This code could use [[NSScreen screens] firstObject]. This is always the primary display, the one whose lower-left corner is at (0, 0). Once that's done, the above change should be reverted. The height of the visible frame would be the full height of the screen minus the menu bar _and the Dock_ if the Dock is along the bottom of the screen. Actually, there's a theoretically-simpler approach: use -[NSMenu menuBarHeight]. That replaces a long-deprecated method +[NSMenuView menuBarHeight]. However, there was a bug in Tiger that led to the former not working while the latter still worked. I haven't actually checked recently. CrossOver's still-kicking X server code uses this code, which tries all of the above: NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0]; aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight]; if (!aquaMenuBarHeight) aquaMenuBarHeight = [NSMenuView menuBarHeight]; if (!aquaMenuBarHeight) aquaMenuBarHeight = NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]); Reviewed-by: Jeremy Huddleston Sequoia Signed-off-by: Ken Thomases (cherry picked from commit 4513f924a7065edbd267cf96837af94ce5a58a6f) --- hw/xquartz/X11Application.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 8a928baac..d2c5d3083 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1238,8 +1238,16 @@ X11ApplicationMain(int argc, char **argv, char **envp) QuartzModeBundleInit(); /* Calculate the height of the menubar so we can avoid it. */ - aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) - - NSMaxY([[NSScreen mainScreen] visibleFrame]); + aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight]; +#if ! __LP64__ + if (!aquaMenuBarHeight) { + aquaMenuBarHeight = [NSMenuView menuBarHeight]; + } +#endif + if (!aquaMenuBarHeight) { + NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0]; + aquaMenuBarHeight = NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]); + } #ifdef HAVE_LIBDISPATCH eventTranslationQueue = dispatch_queue_create( -- cgit v1.2.3 From 5e7aaf5e93e51e79548da46381c91d0efc4d9885 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 18 Oct 2015 23:03:23 -0700 Subject: XQuartz: Make sure that darwin_all_modifier_mask_additions is 0-terminated Found by ASan X.Org X Server 1.17.99.901 Build Date: 20151018 ================================================================ ==40471==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000101fed7a4 at pc 0x000101584030 bp 0x70000029f920 sp 0x70000029f918 READ of size 4 at 0x000101fed7a4 thread T7 #0 0x10158402f in DarwinEQInit darwinEvents.c:377 #1 0x10157f3bc in InitInput darwin.c:566 #2 0x101be87ad in dix_main main.c:268 #3 0x10159131b in server_thread quartzStartup.c:66 #4 0x7fff8a535c12 in _pthread_body (/usr/lib/system/libsystem_pthread.dylib+0x3c12) #5 0x7fff8a535b8f in _pthread_start (/usr/lib/system/libsystem_pthread.dylib+0x3b8f) #6 0x7fff8a533374 in thread_start (/usr/lib/system/libsystem_pthread.dylib+0x1374) 0x000101fed7a4 is located 0 bytes to the right of global variable 'darwin_all_modifier_mask_additions' defined in 'darwinEvents.c:181:12' (0x101fed7a0) of size 4 SUMMARY: AddressSanitizer: global-buffer-overflow darwinEvents.c:377 DarwinEQInit Shadow bytes around the buggy address: 0x1000203fdaa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000203fdab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000203fdac0: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 0x1000203fdad0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00 0x1000203fdae0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9 =>0x1000203fdaf0: f9 f9 f9 f9[04]f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x1000203fdb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000203fdb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000203fdb20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000203fdb30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000203fdb40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Thread T7 created by T0 here: #0 0x10242ee99 in wrap_pthread_create (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x37e99) #1 0x101591089 in create_thread quartzStartup.c:78 #2 0x101590ed9 in QuartzInitServer quartzStartup.c:95 #3 0x1015697eb in X11ApplicationMain X11Application.m:1277 #4 0x101575dc0 in X11ControllerMain X11Controller.m:984 #5 0x10159171a in server_main quartzStartup.c:127 #6 0x101540fc0 in do_start_x11_server bundle-main.c:436 #7 0x101544869 in _Xstart_x11_server mach_startupServer.c:189 #8 0x101545c96 in mach_startup_server mach_startupServer.c:398 #9 0x7fff8d1b70f3 in mach_msg_server (/usr/lib/system/libsystem_kernel.dylib+0x110f3) #10 0x1015416e7 in main bundle-main.c:774 #11 0x7fff8bd975ac in start (/usr/lib/system/libdyld.dylib+0x35ac) #12 0x0 () Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 3db7e332d374bf8cee581c31b7d50d7ac0509187) --- hw/xquartz/darwinEvents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index 5a5e4dad2..f66cb0d4e 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -178,7 +178,7 @@ static int darwin_x11_modifier_mask_list[] = { 0 }; -static int darwin_all_modifier_mask_additions[] = { NX_SECONDARYFNMASK, }; +static int darwin_all_modifier_mask_additions[] = { NX_SECONDARYFNMASK, 0 }; static void DarwinUpdateModifiers(int pressed, // KeyPress or KeyRelease -- cgit v1.2.3 From eb9dea1e25388a8fdc31b9b138bd5ece32a3eb54 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 18 Oct 2015 23:01:53 -0700 Subject: XQuartz: Cleanup formatting of DarwinEQInit that was butchered by automation a few years ago Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 27ad21254f257bac6c647315d749ee69f20c24e0) --- hw/xquartz/darwinEvents.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index f66cb0d4e..6964e2009 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -367,14 +367,12 @@ DarwinEQInit(void) { int *p; - for (p = darwin_x11_modifier_mask_list, darwin_all_modifier_mask = 0; *p; - p++) { + for (p = darwin_x11_modifier_mask_list; *p; p++) { darwin_x11_modifier_mask |= *p; } - for (p = darwin_all_modifier_mask_additions, - darwin_all_modifier_mask = darwin_x11_modifier_mask; - *p; p++) { + darwin_all_modifier_mask = darwin_x11_modifier_mask; + for (p = darwin_all_modifier_mask_additions; *p; p++) { darwin_all_modifier_mask |= *p; } @@ -387,7 +385,6 @@ DarwinEQInit(void) */ if (!darwinEvents) { darwinEvents = InitEventList(GetMaximumEventsNum()); - ; if (!darwinEvents) FatalError("Couldn't allocate event buffer\n"); -- cgit v1.2.3 From 8415eca0abc00ec96cb94cd656b58edbfa8f09a3 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Mon, 6 Jul 2015 18:45:51 -0700 Subject: glamor: Use a single glTexImage2D call for core font atlas texture data v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of one glTexSubImage2D call for each glyph. This significantly reduces the amount of time it takes for xterm to start up on a fresh X server with the radeonsi driver. v2: Use GLYPHWIDTHBYTESPADDED instead of hardcoding 4 bytes glyph alignment (Keith Packard) [ajax 1.17: fix up summary as suggested by Michel] Reviewed-by: Keith Packard Signed-off-by: Michel Dänzer Signed-off-by: Keith Packard (cherry picked from commit 732e3b9c08532f40656010eac9d128601cc88c3f) --- glamor/glamor_font.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c index cc0fecf7a..6b3a16abc 100644 --- a/glamor/glamor_font.c +++ b/glamor/glamor_font.c @@ -45,6 +45,7 @@ glamor_font_get(ScreenPtr screen, FontPtr font) unsigned char c[2]; CharInfoPtr glyph; unsigned long count; + char *bits; if (glamor_priv->glsl_version < 130) return NULL; @@ -62,8 +63,6 @@ glamor_font_get(ScreenPtr screen, FontPtr font) if (glamor_font->realized) return glamor_font; - glamor_font->realized = TRUE; - /* Figure out how many glyphs are in the font */ num_cols = font->info.lastCol - font->info.firstCol + 1; num_rows = font->info.lastRow - font->info.firstRow + 1; @@ -81,6 +80,10 @@ glamor_font_get(ScreenPtr screen, FontPtr font) overall_width = glyph_width_bytes * num_cols; overall_height = glyph_height * num_rows; + bits = malloc(overall_width * overall_height); + if (!bits) + return NULL; + /* Check whether the font has a default character */ c[0] = font->info.lastRow + 1; c[1] = font->info.lastCol + 1; @@ -100,12 +103,6 @@ glamor_font_get(ScreenPtr screen, FontPtr font) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - /* Allocate storage */ - glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height, - 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, NULL); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - /* Paint all of the glyphs */ for (row = 0; row < num_rows; row++) { for (col = 0; col < num_cols; col++) { @@ -114,13 +111,29 @@ glamor_font_get(ScreenPtr screen, FontPtr font) (*font->get_glyphs)(font, 1, c, TwoD16Bit, &count, &glyph); - if (count) - glTexSubImage2D(GL_TEXTURE_2D, 0, col * glyph_width_bytes, row * glyph_height, - GLYPHWIDTHBYTES(glyph), GLYPHHEIGHTPIXELS(glyph), - GL_RED_INTEGER, GL_UNSIGNED_BYTE, glyph->bits); + if (count) { + char *dst = bits + row * glyph_height * overall_width + + col * glyph_width_bytes; + char *src = glyph->bits; + unsigned y; + + for (y = 0; y < GLYPHHEIGHTPIXELS(glyph); y++) { + memcpy(dst, src, GLYPHWIDTHBYTES(glyph)); + dst += overall_width; + src += GLYPHWIDTHBYTESPADDED(glyph); + } + } } } + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height, + 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, bits); + + free(bits); + + glamor_font->realized = TRUE; + return glamor_font; } -- cgit v1.2.3 From fb17307b1bbb6842a2c76c0a934c4f50aaea69d1 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Fri, 10 Jul 2015 15:28:52 +0900 Subject: glamor: Use glamor_prepare_access_box() for PutImage/GetImage fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes slow text display in xdvi. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91260 Signed-off-by: Michel Dänzer Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Eric Anholt (cherry picked from commit 1a18513a4eb3fa22459dd9f7d8f0e275aff679ec) --- glamor/glamor_image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c index b38b41212..90fda4079 100644 --- a/glamor/glamor_image.c +++ b/glamor/glamor_image.c @@ -88,7 +88,7 @@ static void glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { - if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) + if (glamor_prepare_access_box(drawable, GLAMOR_ACCESS_RW, x, y, w, h)) fbPutImage(drawable, gc, depth, x, y, w, h, leftPad, format, bits); glamor_finish_access(drawable); } @@ -150,7 +150,7 @@ static void glamor_get_image_bail(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { - if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) + if (glamor_prepare_access_box(drawable, GLAMOR_ACCESS_RO, x, y, w, h)) fbGetImage(drawable, x, y, w, h, format, plane_mask, d); glamor_finish_access(drawable); } -- cgit v1.2.3 From a420301a8bc9376a174315bc32d3cd7e89dacd7f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 15 Jul 2015 17:56:11 +1000 Subject: glamor: make current in prepare paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lots of the accel paths only make current once they start doing someting, so a lot of them call the bail paths without make current, which means on PRIME systems for example we end up in the wrong context. Add a prepare pixmap in the prepare fallback path. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90667 Signed-off-by: Dave Airlie Signed-off-by: Eric Anholt Reviewed-and-Tested-by: Michel Dänzer Reviewed-by: Eric Anholt (cherry picked from commit db5337afb248edf81087cf8d74006fc496d70589) --- glamor/glamor_prepare.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c index fb85d9082..40b7b4feb 100644 --- a/glamor/glamor_prepare.c +++ b/glamor/glamor_prepare.c @@ -45,6 +45,8 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) return TRUE; + glamor_make_current(glamor_priv); + RegionInit(®ion, box, 1); /* See if it's already mapped */ -- cgit v1.2.3 From 92effabee1fe7225709acdca4adb2783b78392d4 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Wed, 22 Jul 2015 15:37:23 +0900 Subject: glamor: Make our EGL context current before calling into GL in glamor_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, the context of another screen may be current, or no context at all if glamor_egl_init failed for another screen. Signed-off-by: Michel Dänzer Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Eric Anholt (cherry picked from commit 0a458a908ec071a4da5d22c760581e0c5ec885ce) --- glamor/glamor.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/glamor/glamor.c b/glamor/glamor.c index a8cc810d1..21252bcca 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -379,6 +379,20 @@ glamor_init(ScreenPtr screen, unsigned int flags) goto fail; } + glamor_priv->saved_procs.close_screen = screen->CloseScreen; + screen->CloseScreen = glamor_close_screen; + + /* If we are using egl screen, call egl screen init to + * register correct close screen function. */ + if (flags & GLAMOR_USE_EGL_SCREEN) { + glamor_egl_screen_init(screen, &glamor_priv->ctx); + } else { + if (!glamor_glx_screen_init(&glamor_priv->ctx)) + goto fail; + } + + glamor_make_current(glamor_priv); + if (epoxy_is_desktop_gl()) glamor_priv->gl_flavor = GLAMOR_GL_DESKTOP; else @@ -463,18 +477,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_set_debug_level(&glamor_debug_level); - glamor_priv->saved_procs.close_screen = screen->CloseScreen; - screen->CloseScreen = glamor_close_screen; - - /* If we are using egl screen, call egl screen init to - * register correct close screen function. */ - if (flags & GLAMOR_USE_EGL_SCREEN) { - glamor_egl_screen_init(screen, &glamor_priv->ctx); - } else { - if (!glamor_glx_screen_init(&glamor_priv->ctx)) - goto fail; - } - glamor_priv->saved_procs.create_screen_resources = screen->CreateScreenResources; screen->CreateScreenResources = glamor_create_screen_resources; -- cgit v1.2.3 From 2a561fac70c8b04305eab6372298a128e6553d3f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 23 Sep 2015 11:19:00 +1000 Subject: glx: fix regression with copy sub buffer disappearing So copy sub buffer isn't a core extensions it's a driver extension which means we are using totally the wrong interface to query for it here, which means bad things happen when you roll out this code, for instance MESA_copy_sub_buffer stops working. This is just the hack I'm sticking in Fedora to avoid the regression for now, but hopefully will inspire us. Reviewed-by: Adam Jackson Signed-off-by: Dave Airlie (cherry picked from commit 6da3f5d04f6a1cda0c858280f9561f9fbc323275) --- glx/glxdriswrast.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index e25ca4768..938d5bde9 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -396,6 +396,9 @@ initializeExtensions(__GLXDRIscreen * screen) const __DRIextension **extensions; int i; + __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); + LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); + if (screen->swrast->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); @@ -416,8 +419,6 @@ initializeExtensions(__GLXDRIscreen * screen) if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { screen->copySubBuffer = (const __DRIcopySubBufferExtension *) extensions[i]; - __glXEnableExtension(screen->glx_enable_bits, - "GLX_MESA_copy_sub_buffer"); } if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { -- cgit v1.2.3 From 23d52080a5d9c03dc2707e71f6d878c58d000a55 Mon Sep 17 00:00:00 2001 From: Fredrik Höglund Date: Thu, 10 Sep 2015 23:33:20 +0200 Subject: present: Don't stash the MSC value when present_get_ust_msc fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we stash an uninitalized value, and later use it to compute the msc_offset for the window. Also initialize ust and crtc_msc so we never use uninitalized values when present_get_ust_msc fails. This fixes clients getting stuck waiting indefinitely for an idle event when a CRTC is turned off. Signed-off-by: Fredrik Höglund Reviewed-by: Michel Dänzer (cherry picked from commit f6ce23fbfc8804204fa103f98b94478387b94040) --- present/present.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/present/present.c b/present/present.c index a6346015e..7ddffbd28 100644 --- a/present/present.c +++ b/present/present.c @@ -710,9 +710,9 @@ present_pixmap(WindowPtr window, present_notify_ptr notifies, int num_notifies) { - uint64_t ust; + uint64_t ust = 0; uint64_t target_msc; - uint64_t crtc_msc; + uint64_t crtc_msc = 0; int ret; present_vblank_ptr vblank, tmp; ScreenPtr screen = window->drawable.pScreen; @@ -734,13 +734,15 @@ present_pixmap(WindowPtr window, target_crtc = present_get_crtc(window); } - present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc); + ret = present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc); target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc); - /* Stash the current MSC away in case we need it later - */ - window_priv->msc = crtc_msc; + if (ret == Success) { + /* Stash the current MSC away in case we need it later + */ + window_priv->msc = crtc_msc; + } /* Adjust target_msc to match modulus */ -- cgit v1.2.3 From abfda3b941281e12cec35e36dd0e9d87e59ce699 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 19 May 2015 11:31:25 -0400 Subject: glx: Implement GLX_ARB_context_flush_control This extension allows clients to opt out of the implicit glFlush on context release, which is quite nice for performance for clients using multiple contexts. The server doesn't really need to be aware of the client's decision, at least for direct contexts, but it does need to not reject the context attribute out of hand. This patch won't do anything unless built against a Mesa that defines the __DRI2_FLUSH_CONTROL extension (and a new enough glxext.h, but that's been there since 10.3 at least). Reviewed-by: James Jones Signed-off-by: Adam Jackson (cherry picked from commit 995ff11422eb49160abfe276f471e412b16cab9d) --- glx/createcontext.c | 15 +++++++++++++++ glx/extension_string.c | 1 + glx/extension_string.h | 3 ++- glx/glxcmds.c | 20 +++++++++++++++++++- glx/glxcontext.h | 5 +++++ glx/glxdri2.c | 7 +++++++ glx/glxdriswrast.c | 8 ++++++++ 7 files changed, 57 insertions(+), 2 deletions(-) diff --git a/glx/createcontext.c b/glx/createcontext.c index cbeddec26..d06bc1f7f 100644 --- a/glx/createcontext.c +++ b/glx/createcontext.c @@ -87,6 +87,9 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) int minor_version = 0; uint32_t flags = 0; uint32_t render_type = GLX_RGBA_TYPE; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + uint32_t flush = GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB; +#endif __GLXcontext *ctx = NULL; __GLXcontext *shareCtx = NULL; __GLXscreen *glxScreen; @@ -194,6 +197,15 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) break; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + case GLX_CONTEXT_RELEASE_BEHAVIOR_ARB: + flush = attribs[2 * i + 1]; + if (flush != GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB + && flush != GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB) + return BadValue; + break; +#endif + default: return BadValue; } @@ -333,6 +345,9 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) ctx->drawPriv = NULL; ctx->readPriv = NULL; ctx->resetNotificationStrategy = reset; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + ctx->releaseBehavior = flush; +#endif /* Add the new context to the various global tables of GLX contexts. */ diff --git a/glx/extension_string.c b/glx/extension_string.c index 4bef96f0b..e881d2109 100644 --- a/glx/extension_string.c +++ b/glx/extension_string.c @@ -72,6 +72,7 @@ struct extension_info { static const struct extension_info known_glx_extensions[] = { /* GLX_ARB_get_proc_address is implemented on the client. */ /* *INDENT-OFF* */ + { GLX(ARB_context_flush_control), VER(0,0), N, }, { GLX(ARB_create_context), VER(0,0), N, }, { GLX(ARB_create_context_profile), VER(0,0), N, }, { GLX(ARB_create_context_robustness), VER(0,0), N, }, diff --git a/glx/extension_string.h b/glx/extension_string.h index e7d393297..bac7b0624 100644 --- a/glx/extension_string.h +++ b/glx/extension_string.h @@ -36,7 +36,8 @@ enum { /* GLX_ARB_get_proc_address is implemented on the client. */ - ARB_create_context_bit = 0, + ARB_context_flush_control_bit = 0, + ARB_create_context_bit, ARB_create_context_profile_bit, ARB_create_context_robustness_bit, ARB_fbconfig_float_bit, diff --git a/glx/glxcmds.c b/glx/glxcmds.c index f5f2babb8..cbd4ede39 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -334,6 +334,19 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, */ glxc->resetNotificationStrategy = GLX_NO_RESET_NOTIFICATION_ARB; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + /* The GLX_ARB_context_flush_control spec says: + * + * "The default value [for GLX_CONTEXT_RELEASE_BEHAVIOR] is + * CONTEXT_RELEASE_BEHAVIOR_FLUSH, and may in some cases be changed + * using platform-specific context creation extensions." + * + * Without using glXCreateContextAttribsARB, there is no way to specify a + * non-default release behavior. + */ + glxc->releaseBehavior = GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB; +#endif + /* Add the new context to the various global tables of GLX contexts. */ if (!__glXAddContext(glxc)) { @@ -626,7 +639,12 @@ DoMakeCurrent(__GLXclientState * cl, /* ** Flush the previous context if needed. */ - if (prevglxc->hasUnflushedCommands) { + Bool need_flush = GL_TRUE; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB) + need_flush = GL_FALSE; +#endif + if (prevglxc->hasUnflushedCommands && need_flush) { if (__glXForceCurrent(cl, tag, (int *) &error)) { glFlush(); prevglxc->hasUnflushedCommands = GL_FALSE; diff --git a/glx/glxcontext.h b/glx/glxcontext.h index 677898a67..0733281d7 100644 --- a/glx/glxcontext.h +++ b/glx/glxcontext.h @@ -108,6 +108,11 @@ struct __GLXcontext { */ GLenum resetNotificationStrategy; + /** + * Context release behavior + */ + GLenum releaseBehavior; + /* ** Buffers for feedback and selection. */ diff --git a/glx/glxdri2.c b/glx/glxdri2.c index bcd57a4a3..6fb3d9278 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -921,6 +921,13 @@ initializeExtensions(__GLXDRIscreen * screen) "AIGLX: enabled GLX_ARB_create_context_robustness\n"); } +#ifdef __DRI2_FLUSH_CONTROL + if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_context_flush_control\n"); + } +#endif + /* Ignore unknown extensions */ } } diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index 938d5bde9..e8e53bfdb 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -425,6 +425,14 @@ initializeExtensions(__GLXDRIscreen * screen) screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; /* GLX_EXT_texture_from_pixmap is always enabled. */ } + +#ifdef __DRI2_FLUSH_CONTROL + if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_context_flush_control\n"); + } +#endif + } } -- cgit v1.2.3 From 288b355f48c58cbe458cf92d78246a8abcccd946 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 19 Jul 2015 08:24:39 -0700 Subject: Xserver.man: -retro is used when starting the server, not the stipple MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alan Coopersmith Reviewed-by: Michel Dänzer Signed-off-by: Eric Anholt (cherry picked from commit 6916d32ab3ec1aa922094abce7fac22884ee4e83) --- man/Xserver.man | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/Xserver.man b/man/Xserver.man index 3bf844f98..ac410cd71 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -238,7 +238,7 @@ turns off auto-repeat. turns on auto-repeat. .TP 8 .B -retro -starts the stipple with the classic stipple and cursor visible. The default +starts the server with the classic stipple and cursor visible. The default is to start with a black root window, and to suppress display of the cursor until the first time an application calls XDefineCursor(). For kdrive servers, this implies -zap. -- cgit v1.2.3 From 75399d32f686e8aaa11a5afafacf9fdfad3d1bb4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Jul 2015 13:54:00 -0700 Subject: glamor: Don't try to free the pixmap priv if we fail to allocate FBO. Fixes a regression since a2a2f6e34bd49e7ae31779274d52e800595660bc. I missed this in testing on x86, because we never fail to allocate an FBO. We do hit this path on VC4, though. Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie (cherry picked from commit ea03e314f98e5d8ed7bf7a508006a3d84014bde5) --- glamor/glamor.c | 1 - 1 file changed, 1 deletion(-) diff --git a/glamor/glamor.c b/glamor/glamor.c index 21252bcca..6c2ff28d9 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -207,7 +207,6 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, if (fbo == NULL) { fbDestroyPixmap(pixmap); - free(pixmap_priv); return fbCreatePixmap(screen, w, h, depth, usage); } -- cgit v1.2.3 From 71e4b536cd16c1880889e5a3a88f550674c12882 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 4 Aug 2015 13:17:01 -0400 Subject: xwayland: Don't (double) destroy RANDR resources in CloseScreen By the time we get here we've already been through FreeAllResources, which has already torn down the RANDR objects, so on the second regeneration you get: Invalid read of size 4 at 0x51C6F0: RRCrtcDestroy (rrcrtc.c:659) by 0x4285F5: xwl_output_destroy (xwayland-output.c:191) by 0x426464: xwl_close_screen (xwayland.c:112) by 0x4B7F77: CursorCloseScreen (cursor.c:187) by 0x536013: AnimCurCloseScreen (animcur.c:106) by 0x539841: present_close_screen (present_screen.c:64) by 0x43E496: dix_main (main.c:351) by 0x30D70206FF: (below main) (libc-start.c:289) Address 0x4cc6640 is 0 bytes inside a block of size 728 free'd at 0x4A07D6A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x51BCCF: RRCrtcDestroyResource (rrcrtc.c:689) by 0x45CD91: doFreeResource (resource.c:872) by 0x45DE56: FreeClientResources (resource.c:1138) by 0x45DF06: FreeAllResources (resource.c:1153) by 0x43E3BD: dix_main (main.c:321) by 0x30D70206FF: (below main) (libc-start.c:289) Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard (cherry picked from commit 11f4cc47a815c5d6284b1338e748e2605b2dd779) --- hw/xwayland/xwayland-output.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 155cbc109..7e5484c7d 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -188,8 +188,6 @@ void xwl_output_destroy(struct xwl_output *xwl_output) { wl_output_destroy(xwl_output->output); - RRCrtcDestroy(xwl_output->randr_crtc); - RROutputDestroy(xwl_output->randr_output); free(xwl_output); } -- cgit v1.2.3 From 02c94ccddf4fc9ea08555e929b051201ad5fbc79 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 4 Aug 2015 13:17:02 -0400 Subject: xwayland: Don't (double) destroy input resources in CloseScreen By the time we get here we've already done CloseDownDevices, so on the second regeneration you get: Invalid read of size 4 at 0x43402A: RemoveDevice (devices.c:1125) by 0x427902: xwl_seat_destroy (xwayland-input.c:568) by 0x42649C: xwl_close_screen (xwayland.c:116) by 0x4B7F67: CursorCloseScreen (cursor.c:187) by 0x536003: AnimCurCloseScreen (animcur.c:106) by 0x539831: present_close_screen (present_screen.c:64) by 0x43E486: dix_main (main.c:351) by 0x30D70206FF: (below main) (libc-start.c:289) Address 0x980e1a0 is 64 bytes inside a block of size 904 at 0x4A07D6A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x434158: RemoveDevice (devices.c:1157) by 0x42F77B: CloseDeviceList (devices.c:1017) by 0x430246: CloseDownDevices (devices.c:1047) by 0x43E3EB: dix_main (main.c:333) by 0x30D70206FF: (below main) (libc-start.c:289) Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Signed-off-by: Keith Packard (cherry picked from commit 533fb627398e20f863234d780f4463e37007515b) --- hw/xwayland/xwayland-input.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 4639048d9..f4d8fabd4 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -565,8 +565,6 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id) void xwl_seat_destroy(struct xwl_seat *xwl_seat) { - RemoveDevice(xwl_seat->pointer, FALSE); - RemoveDevice(xwl_seat->keyboard, FALSE); wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); if (xwl_seat->cursor_frame_cb) -- cgit v1.2.3 From 3aacda0aea221f703d469de82a8a6778677b34d0 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 13 Aug 2015 09:25:36 +1000 Subject: rootless: fix warnings due to lack of const keeping. Signed-off-by: Dave Airlie Reviewed-by: Keith Packard Signed-off-by: Keith Packard (cherry picked from commit 7f506b8099d23c2f045ad26cc5cff00109b69d7b) --- miext/rootless/rootlessCommon.h | 4 ++-- miext/rootless/rootlessGC.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index fd9c941f4..3e194818f 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -70,8 +70,8 @@ extern DevPrivateKeyRec rootlessWindowOldPixmapPrivateKeyRec; // RootlessGCRec: private per-gc data typedef struct { - GCFuncs *originalFuncs; - GCOps *originalOps; + const GCFuncs *originalFuncs; + const GCOps *originalOps; } RootlessGCRec; // RootlessScreenRec: per-screen private data diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c index 4fba26c8d..235b3ab7c 100644 --- a/miext/rootless/rootlessGC.c +++ b/miext/rootless/rootlessGC.c @@ -403,7 +403,7 @@ RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc) #define GCOP_UNWRAP(pGC) \ RootlessGCRec *gcrec = (RootlessGCRec *) \ dixLookupPrivate(&(pGC)->devPrivates, rootlessGCPrivateKey); \ - GCFuncs *saveFuncs = pGC->funcs; \ + const GCFuncs *saveFuncs = pGC->funcs; \ (pGC)->funcs = gcrec->originalFuncs; \ (pGC)->ops = gcrec->originalOps; -- cgit v1.2.3 From 00b3f5a2eda7b819057d9e150754dc0a509f6e39 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 13 Aug 2015 09:25:37 +1000 Subject: rootless: rename w->_w to avoid shadow warnings fixes: In file included from rootlessWindow.c:51:0: rootlessWindow.c: In function 'RootlessResizeWindow': rootlessCommon.h:198:19: warning: declaration of 'w' shadows a parameter [-Wshadow] WindowPtr w = pWin; \ ^ rootlessWindow.c:1292:9: note: in expansion of macro 'HUGE_ROOT' HUGE_ROOT(pWin); ^ rootlessWindow.c:1262:35: note: shadowed declaration is here unsigned int w, unsigned int h, WindowPtr pSib) ^ In file included from rootlessWindow.c:51:0: rootlessCommon.h:207:19: warning: declaration of 'w' shadows a parameter [-Wshadow] WindowPtr w = pWin; \ ^ rootlessWindow.c:1296:9: note: in expansion of macro 'NORMAL_ROOT' NORMAL_ROOT(pWin); ^ rootlessWindow.c:1262:35: note: shadowed declaration is here unsigned int w, unsigned int h, WindowPtr pSib) ^ Signed-off-by: Dave Airlie Reviewed-by: Keith Packard Signed-off-by: Keith Packard (cherry picked from commit d4710004367ab8eab794a12385ca7ed3acc9a0e0) --- miext/rootless/rootlessCommon.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index 3e194818f..7fdea22b3 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -194,19 +194,19 @@ extern RegionRec rootlessHugeRoot; #define HUGE_ROOT(pWin) \ do { \ - WindowPtr w = pWin; \ - while (w->parent) \ - w = w->parent; \ - saveRoot = w->winSize; \ - w->winSize = rootlessHugeRoot; \ + WindowPtr _w = pWin; \ + while (_w->parent) \ + _w = _w->parent; \ + saveRoot = _w->winSize; \ + _w->winSize = rootlessHugeRoot; \ } while (0) #define NORMAL_ROOT(pWin) \ do { \ - WindowPtr w = pWin; \ - while (w->parent) \ - w = w->parent; \ - w->winSize = saveRoot; \ + WindowPtr _w = pWin; \ + while (_w->parent) \ + _w = _w->parent; \ + _w->winSize = saveRoot; \ } while (0) // Returns TRUE if this window is a top-level window (i.e. child of the root) -- cgit v1.2.3 From e9385b42a3f6cb1eadd5080019b9faf9538e5608 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 17 Aug 2015 18:37:10 -0700 Subject: mi: Always initialize edge1 and edge2 in miLineArc This eliminates a warning generated when miLineArcD is inlined and the compiler can't figure out that edge1 and edge2 are always initialized before being used. Signed-off-by: Keith Packard Reviewed-by: Dave Airlie (cherry picked from commit bca4f4b56c7619d17f9df46f7aac392ea01a9429) --- mi/miwideline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mi/miwideline.c b/mi/miwideline.c index 452d74fc1..6f0b9bcbd 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -1458,7 +1458,7 @@ miLineArc(DrawablePtr pDraw, int xorgi = 0, yorgi = 0; Spans spanRec; int n; - PolyEdgeRec edge1, edge2; + PolyEdgeRec edge1 = { 0 }, edge2 = { 0 }; int edgey1, edgey2; Bool edgeleft1, edgeleft2; -- cgit v1.2.3 From 1688b7517e91dba84244c01d1a01fa8145b4367a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 30 Aug 2015 15:26:40 +0200 Subject: remove bogus \/ escapes some X manuals use then escape sequence \/ when they want to render a slash. That's bad because \/ is not a slash but an italic correction, never producing any output, having no effect at all in terminal output, and only changing spacing in a minor way in typeset output. Signed-off-by: Matthieu Herrb Reviewed-by: Mark Kettenis Signed-off-by: Keith Packard (cherry picked from commit 634e357be2ec400f63bd5c42f706b709b6ddabc3) --- hw/xfree86/man/Xorg.man | 2 +- man/Xserver.man | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man index 3ff6aef89..d88cc24dc 100644 --- a/hw/xfree86/man/Xorg.man +++ b/hw/xfree86/man/Xorg.man @@ -46,7 +46,7 @@ On most platforms, the "Local" connection type is a UNIX-domain socket. On some System V platforms, the "local" connection types also include STREAMS pipes, named pipes, and some other mechanisms. .TP 4 -.I TCP\/IP +.I TCP/IP .B Xorg listens on port .RI 6000+ n , diff --git a/man/Xserver.man b/man/Xserver.man index ac410cd71..1cf242d59 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -428,7 +428,7 @@ elapse between autorepeat-generated keystrokes). loads keyboard description in \fIfilename\fP on server startup. .SH "NETWORK CONNECTIONS" The X server supports client connections via a platform-dependent subset of -the following transport types: TCP\/IP, Unix Domain sockets, DECnet, +the following transport types: TCP/IP, Unix Domain sockets, DECnet, and several varieties of SVR4 local connections. See the DISPLAY NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to specify which transport type clients should try to use. -- cgit v1.2.3 From e863ab57eb94f32485a501e547eedc96f9249ad1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 29 Jul 2015 11:30:15 -0400 Subject: glxproxy: Fix an obvious thinko in QueryExtensionsString MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc 5.1 throws a rather amusing warning here: glxcmdsswap.c: In function ‘__glXSwapQueryExtensionsString’: glxcmdsswap.c:439:1: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn] __glXSwapQueryExtensionsString(__GLXclientState * cl, GLbyte * pc) This is entirely accurate, albeit curiously phrased: swapping some bits hanging off the end of a null pointer will make Xdmx crash, so from the perspective of code generation the function will indeed not return. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson (cherry picked from commit dfa8b37cfb2589f2474f6fcc755dde77bfdd6fed) --- hw/dmx/glxProxy/glxcmdsswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c index 600a6e1cb..5b1722d57 100644 --- a/hw/dmx/glxProxy/glxcmdsswap.c +++ b/hw/dmx/glxProxy/glxcmdsswap.c @@ -438,7 +438,7 @@ __glXSwapUseXFont(__GLXclientState * cl, GLbyte * pc) int __glXSwapQueryExtensionsString(__GLXclientState * cl, GLbyte * pc) { - xGLXQueryExtensionsStringReq *req = NULL; + xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; -- cgit v1.2.3 From d2e4a9d4ac2f479de23e15af5e528cfa2bffb30f Mon Sep 17 00:00:00 2001 From: Felix Janda Date: Mon, 17 Aug 2015 20:25:53 +0200 Subject: On linux use instead of is obsolete. Using instead fixes building with musl libc. Reviewed-by: Adam Jackson Signed-off-by: Felix Janda (cherry picked from commit e8e3368298c98a1292bb1c727e2f3d56539e2eac) --- hw/xfree86/os-support/xf86_OSlib.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h index 6190fe6a0..95c3a7365 100644 --- a/hw/xfree86/os-support/xf86_OSlib.h +++ b/hw/xfree86/os-support/xf86_OSlib.h @@ -183,11 +183,7 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; #include #include -#ifdef __linux__ -#include -#else /* __GLIBC__ */ #include -#endif #ifdef __sparc__ #include #endif -- cgit v1.2.3 From f92c0b9f94deaa03f792c3c93efd802fec268e8f Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Tue, 12 May 2015 16:39:22 -0600 Subject: Allow system call restarts upon signal interruption The X server frequently deals with SIGIO and SIGALRM interruptions. If process execution is inside certain blocking system calls when these signals arrive, e.g. with the kernel blocked on a contended semaphore, the system calls will be interrupted. Some system calls are automatically restartable (the kernel re-executes them with the same parameters once the signal handler returns) but only if the signal handler allows it. Set SA_RESTART on the signal handlers to enable this convenient behaviour. Reviewed-by: Adam Jackson Signed-off-by: Daniel Drake (cherry picked from commit 94ab7455abc213fc96760e29ab2e943ec682fb22) --- hw/xfree86/os-support/shared/sigio.c | 2 +- os/utils.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index 45949f7a3..c746d02fc 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -178,7 +178,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) } sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGIO); - sa.sa_flags = 0; + sa.sa_flags = SA_RESTART; sa.sa_handler = xf86SIGIO; sigaction(SIGIO, &sa, &osa); xf86SigIOFuncs[i].fd = fd; diff --git a/os/utils.c b/os/utils.c index 74d73b305..881d173e3 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1220,6 +1220,7 @@ SmartScheduleInit(void) memset((char *) &act, 0, sizeof(struct sigaction)); /* Set up the timer signal function */ + act.sa_flags = SA_RESTART; act.sa_handler = SmartScheduleTimer; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); -- cgit v1.2.3 From 0134dc1b56e8c7c19f655e583ff3f3ba0d6cae4e Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Wed, 20 May 2015 13:16:12 -0600 Subject: Keep SIGALRM restart flag after Popen Commit 94ab7455 added SA_RESTART to the SIGALRM handler. However, the Popen code tears down and recreates the SIGALRM handler via OsSignal(), and this flag is dropped at this time. Clean the code to use just a single codepath for creating this signal handler, always applying SA_RESTART. [ajax: Fixed commit id] Reviewed-by: Adam Jackson Signed-off-by: Daniel Drake (cherry picked from commit 1f915e8b524dd02011158aa038935970684c7630) --- os/utils.c | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/os/utils.c b/os/utils.c index 881d173e3..2b23430a4 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1208,14 +1208,15 @@ SmartScheduleTimer(int sig) SmartScheduleTime += SmartScheduleInterval; } -void -SmartScheduleInit(void) +static int +SmartScheduleEnable(void) { + int ret = 0; #ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; if (SmartScheduleDisable) - return; + return 0; memset((char *) &act, 0, sizeof(struct sigaction)); @@ -1224,11 +1225,40 @@ SmartScheduleInit(void) act.sa_handler = SmartScheduleTimer; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); - if (sigaction(SIGALRM, &act, 0) < 0) { + ret = sigaction(SIGALRM, &act, 0); +#endif + return ret; +} + +static int +SmartSchedulePause(void) +{ + int ret = 0; +#ifdef SMART_SCHEDULE_POSSIBLE + struct sigaction act; + + if (SmartScheduleDisable) + return 0; + + memset((char *) &act, 0, sizeof(struct sigaction)); + + act.sa_handler = SIG_IGN; + sigemptyset(&act.sa_mask); + ret = sigaction(SIGALRM, &act, 0); +#endif + return ret; +} + +void +SmartScheduleInit(void) +{ + if (SmartScheduleDisable) + return; + + if (SmartScheduleEnable() < 0) { perror("sigaction for smart scheduler"); SmartScheduleDisable = TRUE; } -#endif } #ifdef SIG_BLOCK @@ -1403,8 +1433,6 @@ static struct pid { int pid; } *pidlist; -OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */ - void * Popen(const char *command, const char *type) { @@ -1427,8 +1455,7 @@ Popen(const char *command, const char *type) } /* Ignore the smart scheduler while this is going on */ - old_alarm = OsSignal(SIGALRM, SIG_IGN); - if (old_alarm == SIG_ERR) { + if (SmartSchedulePause() < 0) { close(pdes[0]); close(pdes[1]); free(cur); @@ -1441,7 +1468,7 @@ Popen(const char *command, const char *type) close(pdes[0]); close(pdes[1]); free(cur); - if (OsSignal(SIGALRM, old_alarm) == SIG_ERR) + if (SmartScheduleEnable() < 0) perror("signal"); return NULL; case 0: /* child */ @@ -1616,7 +1643,7 @@ Pclose(void *iop) /* allow EINTR again */ OsReleaseSignals(); - if (old_alarm && OsSignal(SIGALRM, old_alarm) == SIG_ERR) { + if (SmartScheduleEnable() < 0) { perror("signal"); return -1; } -- cgit v1.2.3 From 10a944889228acdeaf471766407fc84c8947e931 Mon Sep 17 00:00:00 2001 From: Ian Scott Date: Thu, 21 May 2015 16:13:12 -0700 Subject: Xephyr: Paint with subimage for non-Glamor & non-XSHM case This improves the case for when we paint an area without SHM. xcb_image_subimage() is used to create a subimage for the damaged area, which is converted to native format if necessary. Signed-off-by: Ian Scott Reviewed-by: Chris Wilson (cherry picked from commit a579e6ba7763749d51d16e3a54941e06939df07a) --- hw/kdrive/ephyr/hostx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 71c1691c4..e19f57b2c 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -1039,11 +1039,13 @@ hostx_paint_rect(KdScreenInfo *screen, sx, sy, dx, dy, width, height, FALSE); } else { - /* This is slow and could be done better */ - xcb_image_t *img = xcb_image_native (HostX.conn, scrpriv->ximg, 1); - xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, 0, 0, 0); - if (scrpriv->ximg != img) + xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx, sy, + width, height, 0, 0, 0); + xcb_image_t *img = xcb_image_native(HostX.conn, subimg, 1); + xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, dx, dy, 0); + if (subimg != img) xcb_image_destroy(img); + xcb_image_destroy(subimg); } xcb_aux_sync(HostX.conn); -- cgit v1.2.3 From daf15b551631e8a98960e629039bef1880de8f82 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 10 Jun 2015 13:20:59 -0400 Subject: render: Simplify SProcRenderScale Since ProcRenderScale throws BadImplementation anyway it's pointless to waste time carefully swapping the request. Signed-off-by: Adam Jackson Reviewed-by: Alan Coopersmith (cherry picked from commit 67dd34fa734085ed67ba7790820fe4743d48b60f) --- render/render.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/render/render.c b/render/render.c index 723f380c2..93e43e7a3 100644 --- a/render/render.c +++ b/render/render.c @@ -2099,20 +2099,7 @@ SProcRenderComposite(ClientPtr client) static int SProcRenderScale(ClientPtr client) { - REQUEST(xRenderScaleReq); - REQUEST_SIZE_MATCH(xRenderScaleReq); - swaps(&stuff->length); - swapl(&stuff->src); - swapl(&stuff->dst); - swapl(&stuff->colorScale); - swapl(&stuff->alphaScale); - swaps(&stuff->xSrc); - swaps(&stuff->ySrc); - swaps(&stuff->xDst); - swaps(&stuff->yDst); - swaps(&stuff->width); - swaps(&stuff->height); - return (*ProcRenderVector[stuff->renderReqType]) (client); + return BadImplementation; } static int -- cgit v1.2.3 From 49d04a43360267fb7cbbeec0ea4985ba224fb59c Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Thu, 17 Sep 2015 16:04:33 -0700 Subject: privates: Clear screen-specific keys during CloseScreen The modesetting driver corrupts memory when used after a server regeneration because not enough memory is allocated for its pixmap privates. This happens because its call to dixRegisterScreenSpecificPrivateKey() does nothing because key->initialized is still TRUE from the first server generation. However, the key is not in the screen's linked list of screen-specific privates because that's freed and reallocated during the server generation loop in dix_main(). Fix this by clearing key->initialized before CloseScreen and add a call to dixFreeScreenSpecificPrivates() for GPU screens. v2: Just set key->initialized to FALSE and move dixFreeScreenSpecificPrivates() calls to after CloseScreen. v3: Move dixFreeScreenSpecificPrivates() calls back to just before CloseScreen. Signed-off-by: Aaron Plattner Reviewed-by: Keith Packard (cherry picked from commit 82eb490b0a341729f25d0c42a937fe29d99da521) --- dix/main.c | 1 + dix/privates.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/dix/main.c b/dix/main.c index 09f9504b8..7c6ac943f 100644 --- a/dix/main.c +++ b/dix/main.c @@ -337,6 +337,7 @@ dix_main(int argc, char *argv[], char *envp[]) for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) { ScreenPtr pScreen = screenInfo.gpuscreens[i]; FreeScratchPixmapsForScreen(pScreen); + dixFreeScreenSpecificPrivates(pScreen); (*pScreen->CloseScreen) (pScreen); dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); free(pScreen); diff --git a/dix/privates.c b/dix/privates.c index e03b2255b..969d0141c 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -642,6 +642,15 @@ dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key, void dixFreeScreenSpecificPrivates(ScreenPtr pScreen) { + DevPrivateType t; + + for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) { + DevPrivateKey key; + + for (key = pScreen->screenSpecificPrivates[t].key; key; key = key->next) { + key->initialized = FALSE; + } + } } /* Initialize screen-specific privates in AddScreen */ -- cgit v1.2.3 From a85808ce3fc26511996d01e7e6ec1192b8c3d216 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 18 Sep 2015 08:44:07 -0700 Subject: Remove DECnet from Xserver.man DECnet support died in modularization (X11R7.0) Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith (cherry picked from commit 9d65a0de95a20632f2a6a04ba596dcdd76d9f5e2) --- man/Xserver.man | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/man/Xserver.man b/man/Xserver.man index 1cf242d59..10b7b970d 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -428,7 +428,7 @@ elapse between autorepeat-generated keystrokes). loads keyboard description in \fIfilename\fP on server startup. .SH "NETWORK CONNECTIONS" The X server supports client connections via a platform-dependent subset of -the following transport types: TCP/IP, Unix Domain sockets, DECnet, +the following transport types: TCP/IP, Unix Domain sockets, and several varieties of SVR4 local connections. See the DISPLAY NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to specify which transport type clients should try to use. @@ -457,8 +457,8 @@ If no other authorization mechanism is being used, this list initially consists of the host on which the server is running as well as any machines listed in the file \fI/etc/X\fBn\fI.hosts\fR, where \fBn\fP is the display number of the server. Each line of the file should -contain either an Internet hostname (e.g. expo.lcs.mit.edu) or a DECnet -hostname in double colon format (e.g. hydra::) or a complete name in the format +contain either an Internet hostname (e.g. expo.lcs.mit.edu) +or a complete name in the format \fIfamily\fP:\fIname\fP as described in the \fIxhost\fP(1) manual page. There should be no leading or trailing spaces on any lines. For example: .sp @@ -466,7 +466,6 @@ There should be no leading or trailing spaces on any lines. For example: .nf joesworkstation corporate.company.com -star:: inet:bigcpu local: .fi -- cgit v1.2.3 From 7a53179425ab5112adcace1489cad6e8072af6b1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 6 Oct 2014 10:02:22 +0100 Subject: randr/prime: Don't stop on the first pipe when disabling ReplaceScanoutPixmap As we define sizeFits based on whether a CRTC is active, and skip trying to redirect the scanout on a disable pipe, we then attempt to undo it later and fail because crtc->scanout_pixmap != DRI2_Pixmap and !sizeFits. Paper over this failure by skipping unredirected CRTC when disabling. v2: Unwind upon failure Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84653 Signed-off-by: Chris Wilson Cc: Dave Airlie Reported-by: Christoph Haag Tested-by: Christoph Haag Reviewed-by: Alex Deucher (cherry picked from commit 245040f0d0b937efe14d947468a641a95398776a) --- randr/rrcrtc.c | 67 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index dca0691ac..349874514 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1663,23 +1663,30 @@ Bool RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) { rrScrPriv(pDrawable->pScreen); - int i; - Bool size_fits = FALSE; - Bool changed = FALSE; Bool ret = TRUE; + PixmapPtr *saved_scanout_pixmap; + int i; + + saved_scanout_pixmap = malloc(sizeof(PixmapPtr)*pScrPriv->numCrtcs); + if (saved_scanout_pixmap == NULL) + return FALSE; for (i = 0; i < pScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pScrPriv->crtcs[i]; + Bool size_fits; + + saved_scanout_pixmap[i] = crtc->scanout_pixmap; if (!crtc->mode && enable) continue; + if (!crtc->scanout_pixmap && !enable) + continue; - changed = FALSE; - if (crtc->mode && crtc->x == pDrawable->x && - crtc->y == pDrawable->y && - crtc->mode->mode.width == pDrawable->width && - crtc->mode->mode.height == pDrawable->height) - size_fits = TRUE; + size_fits = (crtc->mode && + crtc->x == pDrawable->x && + crtc->y == pDrawable->y && + crtc->mode->mode.width == pDrawable->width && + crtc->mode->mode.height == pDrawable->height); /* is the pixmap already set? */ if (crtc->scanout_pixmap == pPixmap) { @@ -1687,32 +1694,48 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) if (enable == FALSE) { /* set scanout to NULL */ crtc->scanout_pixmap = NULL; - changed = TRUE; - } else { - /* if the size fits then we are already setup */ - if (size_fits) - return TRUE; + } + else if (!size_fits) { /* if the size no longer fits then drop off */ crtc->scanout_pixmap = NULL; - changed = TRUE; + pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap); + + (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y, + crtc->rotation, crtc->numOutputs, crtc->outputs); + saved_scanout_pixmap[i] = crtc->scanout_pixmap; ret = FALSE; } - } else { + else { + /* if the size fits then we are already setup */ + } + } + else { if (!size_fits) - return FALSE; - if (enable) { + ret = FALSE; + else if (enable) crtc->scanout_pixmap = pPixmap; - pScrPriv->rrCrtcSetScanoutPixmap(crtc, pPixmap); - changed = TRUE; - } + else + /* reject an attempt to disable someone else's scanout_pixmap */ + ret = FALSE; } + } + + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + + if (crtc->scanout_pixmap == saved_scanout_pixmap[i]) + continue; - if (changed && pScrPriv->rrCrtcSet) { + if (ret) { pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap); (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y, crtc->rotation, crtc->numOutputs, crtc->outputs); } + else + crtc->scanout_pixmap = saved_scanout_pixmap[i]; } + free(saved_scanout_pixmap); + return ret; } -- cgit v1.2.3 From c72d4f00277c977faecd697ef3407518f11f909d Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Tue, 31 Mar 2015 09:06:46 +0200 Subject: randr: Remove senseless checks for xf86RandR12Key When xf86RandR12Key is not set we will not get to the places where these tests are done as the functions in question are not called. In most cases we would have crashed before these checks anyway. Signed-off-by: Egbert Eich Reviewed-by: Keith Packard (cherry picked from commit 3cd7d33380953f2a315dd79ab74d7340c83fd80a) --- hw/xfree86/modes/xf86RandR12.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index b1c306a88..5c1ba71da 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -683,11 +683,9 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, Bool ret = FALSE; int c; - if (xf86RandR12Key) { - if (randrp->virtualX == -1 || randrp->virtualY == -1) { - randrp->virtualX = pScrn->virtualX; - randrp->virtualY = pScrn->virtualY; - } + if (randrp->virtualX == -1 || randrp->virtualY == -1) { + randrp->virtualX = pScrn->virtualX; + randrp->virtualY = pScrn->virtualY; } if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); @@ -730,7 +728,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); #if RANDR_12_INTERFACE - if (xf86RandR12Key && pScreen->root && ret) + if (pScreen->root && ret) RRScreenSizeNotify(pScreen); #endif return ret; @@ -826,9 +824,6 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen) xf86RandR12ScreenSetSize(pScreen, width, height, mmWidth, mmHeight); } - if (xf86RandR12Key == NULL) - return TRUE; - if (randrp->virtualX == -1 || randrp->virtualY == -1) { randrp->virtualX = pScrn->virtualX; randrp->virtualY = pScrn->virtualY; -- cgit v1.2.3 From abe44851018d0e5bace2971682e724aa7444e96f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 21 Sep 2015 07:16:16 +0100 Subject: os/xdmcp: Remove dead 'restart' code The X server used to wait for the user to hit a key or move the mouse before restarting the session after a keepalive failure. This, presumably, was to avoid having the X server continuously spew XDMCP protocol on the network while the XDM server was dead. Switching into this state was removed from the server some time before XFree86 4.3.99.16, so the remaining bits of code have been dead for over a decade, and no-one ever noticed. Reviewed-by: Adam Jackson Signed-off-by: Keith Packard (cherry picked from commit a3a40291330bad10401fe2bcdbc097ce742b026a) --- os/xdmcp.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/os/xdmcp.c b/os/xdmcp.c index b265db338..b1ee5d255 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -199,8 +199,6 @@ static void send_packet(void); static void timeout(void); -static void restart(void); - static void XdmcpBlockHandler(void *data , struct timeval **wt, void *LastSelectMask); @@ -708,9 +706,7 @@ XdmcpWakeupHandler(void *data, /* unused */ #endif XFD_ANDSET(&devicesReadable, last_select_mask, &EnabledDevices); if (XFD_ANYSET(&devicesReadable)) { - if (state == XDM_AWAIT_USER_INPUT) - restart(); - else if (state == XDM_RUN_SESSION) + if (state == XDM_RUN_SESSION) keepaliveDormancy = defaultKeepaliveDormancy; } if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION) @@ -936,14 +932,6 @@ timeout(void) send_packet(); } -static void -restart(void) -{ - state = XDM_INIT_STATE; - timeOutRtx = 0; - send_packet(); -} - static int XdmcpCheckAuthentication(ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type) { -- cgit v1.2.3 From 9a4ea1f5ea7f813d28cf322aca6f2ea8c427bd1a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 21 Sep 2015 07:16:17 +0100 Subject: os/xdmcp: Just send XDMCP keepalive packets once every three minutes There was a complicated scheme to increase the time between keepalives from 3 minutes up to as much as 24 hours in an attempt to reduce network traffic from idle X terminals. X terminals receiving X traffic, or receiving user input would use the 3 minute value; X terminals without any network traffic would use a longer value. However, this was actually broken -- any activity in the X server, either client requests or user input, would end up resetting the keepalive timeout, so a user mashing on the keyboard would never discover that the XDMCP master had disappeared and have the session terminated, which was precisely the design goal of the XDMCP keepalive mechanism. Instead of attempting to fix this, accept the cost of a pair of XDMCP packets once every three minutes and just perform keepalives regularly. This will also make reworking the block and wakeup handler APIs to eliminate select masks easier. Reviewed-by: Adam Jackson Signed-off-by: Keith Packard (cherry picked from commit db1089eafc1c5371fa0030202de588d2e2b4f8e5) --- os/xdmcp.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/os/xdmcp.c b/os/xdmcp.c index b1ee5d255..7939b4138 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -84,8 +84,6 @@ static int req_socklen; static CARD32 SessionID; static CARD32 timeOutTime; static int timeOutRtx; -static CARD32 defaultKeepaliveDormancy = XDM_DEF_DORMANCY; -static CARD32 keepaliveDormancy = XDM_DEF_DORMANCY; static CARD16 DisplayNumber; static xdmcp_states XDM_INIT_STATE = XDM_OFF; @@ -632,6 +630,7 @@ XdmcpOpenDisplay(int sock) if (state != XDM_AWAIT_MANAGE_RESPONSE) return; state = XDM_RUN_SESSION; + timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; sessionSocket = sock; } @@ -689,7 +688,6 @@ XdmcpWakeupHandler(void *data, /* unused */ int i, void *pReadmask) { fd_set *last_select_mask = (fd_set *) pReadmask; - fd_set devicesReadable; if (state == XDM_OFF) return; @@ -704,13 +702,6 @@ XdmcpWakeupHandler(void *data, /* unused */ FD_CLR(xdmcpSocket6, last_select_mask); } #endif - XFD_ANDSET(&devicesReadable, last_select_mask, &EnabledDevices); - if (XFD_ANYSET(&devicesReadable)) { - if (state == XDM_RUN_SESSION) - keepaliveDormancy = defaultKeepaliveDormancy; - } - if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION) - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; } else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0) { if (state == XDM_RUN_SESSION) { @@ -1399,15 +1390,8 @@ recv_alive_msg(unsigned length) if (XdmcpReadCARD8(&buffer, &SessionRunning) && XdmcpReadCARD32(&buffer, &AliveSessionID)) { if (SessionRunning && AliveSessionID == SessionID) { - /* backoff dormancy period */ state = XDM_RUN_SESSION; - if ((GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds) > - keepaliveDormancy * 1000) { - keepaliveDormancy <<= 1; - if (keepaliveDormancy > XDM_MAX_DORMANCY) - keepaliveDormancy = XDM_MAX_DORMANCY; - } - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; + timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; } else { XdmcpDeadSession("Alive response indicates session dead"); -- cgit v1.2.3 From 8810c46a98a107cf53b30696cfad6e388b73024d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 21 Sep 2015 15:23:23 -0400 Subject: rootless: Fix bogus handling of broken root clip gcc quite correctly complains about this: In file included from ../../include/scrnintstr.h:51:0, from rootlessValTree.c:98: In function 'RegionUninit.isra.1', inlined from 'RegionEmpty' at ../../include/regionstr.h:194:5, inlined from 'RootlessMiValidateTree' at rootlessValTree.c:490:9: ../../include/regionstr.h:166:9: warning: attempt to free a non-heap object 'RegionBrokenData' [-Wfree-nonheap-object] free((_pReg)->data); So that'd crash if you ever got there. RegionNull will do almost the same thing only without the free(), so let's do that instead; it might still not be an entirely sane way to recover, but it at least won't crash. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson (cherry picked from commit fa0bb01899d586e02cf51892c17edd22e462a46c) --- miext/rootless/rootlessValTree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c index 0f7b76cb6..409e6a092 100644 --- a/miext/rootless/rootlessValTree.c +++ b/miext/rootless/rootlessValTree.c @@ -487,7 +487,7 @@ RootlessMiValidateTree(WindowPtr pRoot, /* Parent to validate */ if (RegionBroken(&pRoot->clipList) && !RegionBroken(&pRoot->borderClip)) { // fixme this might not work, but hopefully doesn't happen anyway. kind = VTBroken; - RegionEmpty(&pRoot->clipList); + RegionNull(&pRoot->clipList); ErrorF("ValidateTree: BUSTED!\n"); } -- cgit v1.2.3 From 9cb53672b4b4c847544c37888db6e2ae354697a2 Mon Sep 17 00:00:00 2001 From: Robert Hooker Date: Fri, 3 Dec 2010 23:39:51 -0500 Subject: Add DRI2 2.2/2.3 events and requests to protocol.txt Reviewed-by: Adam Jackson Signed-off-by: Robert Hooker (cherry picked from commit 272ba9f021c6d08ebd6a2d96da3737f5630bcbd5) --- dix/protocol.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dix/protocol.txt b/dix/protocol.txt index c22379581..fa2fcb106 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -124,6 +124,13 @@ R004 DRI2:DestroyDrawable R005 DRI2:GetBuffers R006 DRI2:CopyRegion R007 DRI2:GetBuffersWithFormat +R008 DRI2:SwapBuffers +R009 DRI2:GetMSC +R010 DRI2:WaitMSC +R011 DRI2:WaitSBC +R012 DRI2:SwapInterval +V000 DRI2:BufferSwapComplete +V001 DRI2:InvalidateBuffers R000 Extended-Visual-Information:QueryVersion R001 Extended-Visual-Information:GetVisualInfo R000 FontCache:QueryVersion -- cgit v1.2.3 From a55bfcc0df09920a5e3ec9f923d5168992a63f29 Mon Sep 17 00:00:00 2001 From: Robert Hooker Date: Fri, 3 Dec 2010 23:42:27 -0500 Subject: Add new GLX events errors and requests to protocol.txt Based off of glproto 1.4.11. Reviewed-by: Adam Jackson Signed-off-by: Robert Hooker (cherry picked from commit 3cd56dd2cfbfcce6ba68c22450d51139208993ab) --- dix/protocol.txt | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/dix/protocol.txt b/dix/protocol.txt index fa2fcb106..f78ed58dc 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -159,6 +159,20 @@ R017 GLX:VendorPrivateWithReply R018 GLX:QueryExtensionsString R019 GLX:QueryServerString R020 GLX:ClientInfo +R021 GLX:GetFBConfigs +R022 GLX:CreatePixmap +R023 GLX:DestroyPixmap +R024 GLX:CreateNewContext +R025 GLX:QueryContext +R026 GLX:MakeContextCurrent +R027 GLX:CreatePbuffer +R028 GLX:DestroyPbuffer +R029 GLX:GetDrawableAttributes +R030 GLX:ChangeDrawableAttributes +R031 GLX:CreateWindow +R032 GLX:DeleteWindow +R033 GLX:SetClientInfoARB +R034 GLX:CreateContextAttribsARB R101 GLX:NewList R102 GLX:EndList R103 GLX:DeleteLists @@ -201,6 +215,26 @@ R139 GLX:GetTexLevelParameteriv R140 GLX:IsEnabled R141 GLX:IsList R142 GLX:Flush +R143 GLX:AreTexturesResident +R144 GLX:DeleteTextures +R145 GLX:GenTextures +R146 GLX:IsTexture +R147 GLX:GetColorTable +R148 GLX:GetColorTableParameterfv +R149 GLX:GetColorTableParameterfv +R150 GLX:GetConvolutionFilter +R151 GLX:GetConvolutionParameterfv +R152 GLX:GetConvolutionParameteriv +R153 GLX:GetSeparableFilter +R154 GLX:GetHistogram +R155 GLX:GetHistogramParameterfv +R156 GLX:GetHistogramParameteriv +R157 GLX:GetMinmax +R158 GLX:GetMinmaxParameterfv +R159 GLX:GetMinmaxParameteriv +R160 GLX:GetCompressedTexImage +V000 GLX:PbufferClobber +V001 GLX:BufferSwapComplete E000 GLX:BadContext E001 GLX:BadContextState E002 GLX:BadDrawable @@ -210,6 +244,10 @@ E005 GLX:BadCurrentWindow E006 GLX:BadRenderRequest E007 GLX:BadLargeRequest E008 GLX:UnsupportedPrivateRequest +E009 GLX:BadFBConfig +E010 GLX:BadPbuffer +E011 GLX:BadCurrentDrawable +E012 GLX:BadWindow R000 LBX:QueryVersion R001 LBX:StartProxy R002 LBX:StopProxy -- cgit v1.2.3 From 5c5bc6a9c2050562e9330c0b7b98a5261ee0b113 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 7 Sep 2010 15:50:26 +0300 Subject: dix: remove dead extensions to protocol.txt lbx and mbe. Reviewed-by: Adam Jackson Signed-off-by: Tiago Vignatti (cherry picked from commit 593270038d8983b99aa0aaa24509da3cb944be5c) --- dix/protocol.txt | 59 -------------------------------------------------------- 1 file changed, 59 deletions(-) diff --git a/dix/protocol.txt b/dix/protocol.txt index f78ed58dc..4633e0830 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -248,51 +248,6 @@ E009 GLX:BadFBConfig E010 GLX:BadPbuffer E011 GLX:BadCurrentDrawable E012 GLX:BadWindow -R000 LBX:QueryVersion -R001 LBX:StartProxy -R002 LBX:StopProxy -R003 LBX:Switch -R004 LBX:NewClient -R005 LBX:CloseClient -R006 LBX:ModifySequence -R007 LBX:AllowMotion -R008 LBX:IncrementPixel -R009 LBX:Delta -R010 LBX:GetModifierMapping -R011 LBX:QueryTag -R012 LBX:InvalidateTag -R013 LBX:PolyPoint -R014 LBX:PolyLine -R015 LBX:PolySegment -R016 LBX:PolyRectangle -R017 LBX:PolyArc -R018 LBX:FillPoly -R019 LBX:PolyFillRectangle -R020 LBX:PolyFillArc -R021 LBX:GetKeyboardMapping -R022 LBX:QueryFont -R023 LBX:ChangeProperty -R024 LBX:GetProperty -R025 LBX:TagData -R026 LBX:CopyArea -R027 LBX:CopyPlane -R028 LBX:PolyText8 -R029 LBX:PolyText16 -R030 LBX:ImageText8 -R031 LBX:ImageText16 -R032 LBX:QueryExtension -R033 LBX:PutImage -R034 LBX:GetImage -R035 LBX:BeginLargeRequest -R036 LBX:LargeRequestData -R037 LBX:EndLargeRequest -R038 LBX:InternAtoms -R039 LBX:GetWinAttrAndGeom -R040 LBX:GrabCmap -R041 LBX:ReleaseCmap -R042 LBX:AllocColor -R043 LBX:Sync -E000 LBX:BadLbxClient R000 MIT-SCREEN-SAVER:QueryVersion R001 MIT-SCREEN-SAVER:QueryInfo R002 MIT-SCREEN-SAVER:SelectInput @@ -310,20 +265,6 @@ V000 MIT-SHM:Completion E000 MIT-SHM:BadShmSeg R000 MIT-SUNDRY-NONSTANDARD:SetBugMode R001 MIT-SUNDRY-NONSTANDARD:GetBugMode -R000 Multi-Buffering:GetBufferVersion -R001 Multi-Buffering:CreateImageBuffers -R002 Multi-Buffering:DestroyImageBuffers -R003 Multi-Buffering:DisplayImageBuffers -R004 Multi-Buffering:SetMBufferAttributes -R005 Multi-Buffering:GetMBufferAttributes -R006 Multi-Buffering:SetBufferAttributes -R007 Multi-Buffering:GetBufferAttributes -R008 Multi-Buffering:GetBufferInfo -R009 Multi-Buffering:CreateStereoWindow -R010 Multi-Buffering:ClearImageBufferArea -V000 Multi-Buffering:ClobberNotify -V001 Multi-Buffering:UpdateNotify -E000 Multi-Buffering:BadBuffer R000 RANDR:QueryVersion R001 RANDR:OldGetScreenInfo R002 RANDR:SetScreenConfig -- cgit v1.2.3 From 32f3432ea65f2eec01a7eed0e9bf93e1bc082241 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 22 Sep 2015 19:25:39 -0700 Subject: protocol.txt: Remove extensions that died before Xorg was born Adobe-DPS-Extension, DEC-XTRAP, X3D-PEX, XIE Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith (cherry picked from commit 1ea8fb96bc6a95d98dd67fc9d4c4e4b858383d34) --- dix/protocol.txt | 182 ------------------------------------------------------- 1 file changed, 182 deletions(-) diff --git a/dix/protocol.txt b/dix/protocol.txt index 4633e0830..cf612b598 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -6,20 +6,6 @@ # # This is a security-sensitive file, please set permissions as appropriate. # -R001 Adobe-DPS-Extension:Init -R002 Adobe-DPS-Extension:CreateContext -R003 Adobe-DPS-Extension:CreateSpace -R004 Adobe-DPS-Extension:GiveInput -R005 Adobe-DPS-Extension:GetStatus -R006 Adobe-DPS-Extension:DestroySpace -R007 Adobe-DPS-Extension:Reset -R008 Adobe-DPS-Extension:NotifyContext -R009 Adobe-DPS-Extension:CreateContextFromID -R010 Adobe-DPS-Extension:XIDFromContext -R011 Adobe-DPS-Extension:ContextFromXID -R012 Adobe-DPS-Extension:SetStatusMask -R013 Adobe-DPS-Extension:CreateSecureContext -R014 Adobe-DPS-Extension:NotifyWhenReady R000 Apple-DRI:QueryVersion R001 Apple-DRI:QueryDirectRenderingCapable R002 Apple-DRI:CreateSurface @@ -65,22 +51,6 @@ R003 DAMAGE:Subtract R004 DAMAGE:Add V000 DAMAGE:Notify E000 DAMAGE:BadDamage -R000 DEC-XTRAP:Reset -R001 DEC-XTRAP:GetAvailable -R002 DEC-XTRAP:Config -R003 DEC-XTRAP:StartTrap -R004 DEC-XTRAP:StopTrap -R005 DEC-XTRAP:GetCurrent -R006 DEC-XTRAP:GetStatistics -R007 DEC-XTRAP:SimulateXEvent -R008 DEC-XTRAP:GetVersion -R009 DEC-XTRAP:GetLastInpTime -V000 DEC-XTRAP:Event -E002 DEC-XTRAP:BadIO -E004 DEC-XTRAP:BadStatistics -E005 DEC-XTRAP:BadDevices -E007 DEC-XTRAP:BadScreen -E008 DEC-XTRAP:BadSwapReq R000 DMX:DMXQueryVersion R001 DMX:DMXGetScreenCount R002 DMX:DMXGetScreenInfoDEPRECATED @@ -614,125 +584,6 @@ E014 X11:BadIDChoice E015 X11:BadName E016 X11:BadLength E017 X11:BadImplementation -R001 X3D-PEX:GetExtensionInfo -R002 X3D-PEX:GetEnumeratedTypeInfo -R003 X3D-PEX:GetImpDepConstants -R004 X3D-PEX:CreateLookupTable -R005 X3D-PEX:CopyLookupTable -R006 X3D-PEX:FreeLookupTable -R007 X3D-PEX:GetTableInfo -R008 X3D-PEX:GetPredefinedEntries -R009 X3D-PEX:GetDefinedIndices -R010 X3D-PEX:GetTableEntry -R011 X3D-PEX:GetTableEntries -R012 X3D-PEX:SetTableEntries -R013 X3D-PEX:DeleteTableEntries -R014 X3D-PEX:CreatePipelineContext -R015 X3D-PEX:CopyPipelineContext -R016 X3D-PEX:FreePipelineContext -R017 X3D-PEX:GetPipelineContext -R018 X3D-PEX:ChangePipelineContext -R019 X3D-PEX:CreateRenderer -R020 X3D-PEX:FreeRenderer -R021 X3D-PEX:ChangeRenderer -R022 X3D-PEX:GetRendererAttributes -R023 X3D-PEX:GetRendererDynamics -R024 X3D-PEX:BeginRendering -R025 X3D-PEX:EndRendering -R026 X3D-PEX:BeginStructure -R027 X3D-PEX:EndStructure -R028 X3D-PEX:OutputCommands -R029 X3D-PEX:Network -R030 X3D-PEX:CreateStructure -R031 X3D-PEX:CopyStructure -R032 X3D-PEX:DestroyStructures -R033 X3D-PEX:GetStructureInfo -R034 X3D-PEX:GetElementInfo -R035 X3D-PEX:GetStructuresInNetwork -R036 X3D-PEX:GetAncestors -R037 X3D-PEX:GetDescendants -R038 X3D-PEX:FetchElements -R039 X3D-PEX:SetEditingMode -R040 X3D-PEX:SetElementPointer -R041 X3D-PEX:SetElementPointerAtLabel -R042 X3D-PEX:ElementSearch -R043 X3D-PEX:StoreElements -R044 X3D-PEX:DeleteElements -R045 X3D-PEX:DeleteElementsToLabel -R046 X3D-PEX:DeleteBetweenLabels -R047 X3D-PEX:CopyElements -R048 X3D-PEX:ChangeStructureRefs -R049 X3D-PEX:CreateNameSet -R050 X3D-PEX:CopyNameSet -R051 X3D-PEX:FreeNameSet -R052 X3D-PEX:GetNameSet -R053 X3D-PEX:ChangeNameSet -R054 X3D-PEX:CreateSearchContext -R055 X3D-PEX:CopySearchContext -R056 X3D-PEX:FreeSearchContext -R057 X3D-PEX:GetSearchContext -R058 X3D-PEX:ChangeSearchContext -R059 X3D-PEX:SearchNetwork -R060 X3D-PEX:CreatePhigsWks -R061 X3D-PEX:FreePhigsWks -R062 X3D-PEX:GetWksInfo -R063 X3D-PEX:GetDynamics -R064 X3D-PEX:GetViewRep -R065 X3D-PEX:RedrawAllStructures -R066 X3D-PEX:UpdateWorkstation -R067 X3D-PEX:RedrawClipRegion -R068 X3D-PEX:ExecuteDeferredActions -R069 X3D-PEX:SetViewPriority -R070 X3D-PEX:SetDisplayUpdateMode -R071 X3D-PEX:MapDCtoWC -R072 X3D-PEX:MapWCtoDC -R073 X3D-PEX:SetViewRep -R074 X3D-PEX:SetWksWindow -R075 X3D-PEX:SetWksViewport -R076 X3D-PEX:SetHlhsrMode -R077 X3D-PEX:SetWksBufferMode -R078 X3D-PEX:PostStructure -R079 X3D-PEX:UnpostStructure -R080 X3D-PEX:UnpostAllStructures -R081 X3D-PEX:GetWksPostings -R082 X3D-PEX:GetPickDevice -R083 X3D-PEX:ChangePickDevice -R084 X3D-PEX:CreatePickMeasure -R085 X3D-PEX:FreePickMeasure -R086 X3D-PEX:GetPickMeasure -R087 X3D-PEX:UpdatePickMeasure -R088 X3D-PEX:OpenFont -R089 X3D-PEX:CloseFont -R090 X3D-PEX:QueryFont -R091 X3D-PEX:ListFonts -R092 X3D-PEX:ListFontsWithInfo -R093 X3D-PEX:QueryTextExtents -R094 X3D-PEX:MatchRenderingTargets -R095 X3D-PEX:Escape -R096 X3D-PEX:EscapeWithReply -R097 X3D-PEX:Elements -R098 X3D-PEX:AccumulateState -R099 X3D-PEX:BeginPickOne -R100 X3D-PEX:EndPickOne -R101 X3D-PEX:PickOne -R102 X3D-PEX:BeginPickAll -R103 X3D-PEX:EndPickAll -R104 X3D-PEX:PickAll -E000 X3D-PEX:ColorTypeError -E001 X3D-PEX:erStateError -E002 X3D-PEX:FloatingPointFormatError -E003 X3D-PEX:LabelError -E004 X3D-PEX:LookupTableError -E005 X3D-PEX:NameSetError -E006 X3D-PEX:PathError -E007 X3D-PEX:FontError -E008 X3D-PEX:PhigsWksError -E009 X3D-PEX:PickMeasureError -E010 X3D-PEX:PipelineContextError -E011 X3D-PEX:erError -E012 X3D-PEX:SearchContextError -E013 X3D-PEX:StructureError -E014 X3D-PEX:OutputCommandError R000 XC-APPGROUP:QueryVersion R001 XC-APPGROUP:Create R002 XC-APPGROUP:Destroy @@ -876,39 +727,6 @@ E003 XFree86-VidModeExtension:ModeUnsuitable E004 XFree86-VidModeExtension:ExtensionDisabled E005 XFree86-VidModeExtension:ClientNotLocal E006 XFree86-VidModeExtension:ZoomLocked -R001 XIE:QueryImageExtension -R002 XIE:QueryTechniques -R003 XIE:CreateColorList -R004 XIE:DestroyColorList -R005 XIE:PurgeColorList -R006 XIE:QueryColorList -R007 XIE:CreateLUT -R008 XIE:DestroyLUT -R009 XIE:CreatePhotomap -R010 XIE:DestroyPhotomap -R011 XIE:QueryPhotomap -R012 XIE:CreateROI -R013 XIE:DestroyROI -R014 XIE:CreatePhotospace -R015 XIE:DestroyPhotospace -R016 XIE:ExecuteImmediate -R017 XIE:CreatePhotoflo -R018 XIE:DestroyPhotoflo -R019 XIE:ExecutePhotoflo -R020 XIE:ModifyPhotoflo -R021 XIE:RedefinePhotoflo -R022 XIE:PutClientData -R023 XIE:GetClientData -R024 XIE:QueryPhotoflo -R025 XIE:Await -R026 XIE:Abort -E000 XIE:ColorListError -E001 XIE:LUTError -E002 XIE:PhotofloError -E003 XIE:PhotomapError -E004 XIE:PhotospaceError -E005 XIE:ROIError -E006 XIE:FloError R000 XINERAMA:QueryVersion R001 XINERAMA:GetState R002 XINERAMA:GetScreenCount -- cgit v1.2.3 From d135b4cf6bc427f6f83f57ff70c673b64a6ae6af Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 22 Sep 2015 19:25:41 -0700 Subject: protocol.txt: Add Present 1.0 requests Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith (cherry picked from commit 7e6b7c799455fdeac082cf2a064fe1ba432e92ca) --- dix/protocol.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dix/protocol.txt b/dix/protocol.txt index cf612b598..871f7c6f9 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -235,6 +235,11 @@ V000 MIT-SHM:Completion E000 MIT-SHM:BadShmSeg R000 MIT-SUNDRY-NONSTANDARD:SetBugMode R001 MIT-SUNDRY-NONSTANDARD:GetBugMode +R000 Present:QueryVersion +R001 Present:Pixmap +R002 Present:NotifyMSC +R003 Present:SelectInput +R004 Present:QueryCapabilities R000 RANDR:QueryVersion R001 RANDR:OldGetScreenInfo R002 RANDR:SetScreenConfig -- cgit v1.2.3 From 0b2a9db19bad7567ea30341f3432ae384a21c106 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 22 Sep 2015 19:25:42 -0700 Subject: protocol.txt: Add DRI3 1.0 requests Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith (cherry picked from commit 424ba5de56e2ddf173bb0d26daa821f12897f18f) --- dix/protocol.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dix/protocol.txt b/dix/protocol.txt index 871f7c6f9..0f49dd75b 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -101,6 +101,12 @@ R011 DRI2:WaitSBC R012 DRI2:SwapInterval V000 DRI2:BufferSwapComplete V001 DRI2:InvalidateBuffers +R000 DRI3:QueryVersion +R001 DRI3:Open +R002 DRI3:PixmapFromBuffer +R003 DRI3:BufferFromPixmap +R004 DRI3:FenceFromFD +R005 DRI3:FDFromFence R000 Extended-Visual-Information:QueryVersion R001 Extended-Visual-Information:GetVisualInfo R000 FontCache:QueryVersion -- cgit v1.2.3 From 92f6b363972c13f564e1f8f555783fe9cb557db5 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 22 Sep 2015 19:25:43 -0700 Subject: protocol.txt: Add MIT-SHM 1.2 requests Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith (cherry picked from commit a31bbc450a08622aadafc264b3efe57e465eaecb) --- dix/protocol.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dix/protocol.txt b/dix/protocol.txt index 0f49dd75b..731844c15 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -237,6 +237,8 @@ R002 MIT-SHM:Detach R003 MIT-SHM:PutImage R004 MIT-SHM:GetImage R005 MIT-SHM:CreatePixmap +R006 MIT-SHM:AttachFd +R007 MIT-SHM:CreateSegment V000 MIT-SHM:Completion E000 MIT-SHM:BadShmSeg R000 MIT-SUNDRY-NONSTANDARD:SetBugMode -- cgit v1.2.3 From a22b828dad72091210234a9e671c93015c970ac6 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Sun, 5 Jun 2011 23:32:26 +0200 Subject: man: Fix case for MIT-unspecified. include/site.h says that COMPILEDDISPLAYCLASS is MIT-unspecified, rather than MIT-Unspecified. Fix the manpage accordingly. Signed-off-by: Cyril Brulebois Reviewed-by: Alan Coopersmith (cherry picked from commit 4803f7139131cee7bbf50b32d667d6e60302df09) --- man/Xserver.man | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/Xserver.man b/man/Xserver.man index 10b7b970d..bc4c7fc5f 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -391,7 +391,7 @@ ends. .B \-class \fIdisplay-class\fP XDMCP has an additional display qualifier used in resource lookup for display-specific options. This option sets that value, by default it -is "MIT-Unspecified" (not a very useful value). +is "MIT-unspecified" (not a very useful value). .TP 8 .B \-cookie \fIxdm-auth-bits\fP When testing XDM-AUTHENTICATION-1, a private key is shared between the -- cgit v1.2.3 From 26a5364d507dff012283dc5d6f86b80c5936a807 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Wed, 27 Jul 2011 10:52:31 +0200 Subject: render: Allow single-stop gradients The Render specification allows single-stop gradients and pixman 0.22 (X server requires >= 0.27.2 now) can rasterize them correctly. [ajax: update commit message] Signed-off-by: Andrea Canciani Reviewed-by: Soren Sandmann (cherry picked from commit 7ed0c3912e1cbab960df308b9d4ea618be757fd2) --- render/picture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/render/picture.c b/render/picture.c index 6ff31ba02..cef7032a2 100644 --- a/render/picture.c +++ b/render/picture.c @@ -896,7 +896,7 @@ CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, { PicturePtr pPicture; - if (nStops < 2) { + if (nStops < 1) { *error = BadValue; return 0; } @@ -936,7 +936,7 @@ CreateRadialGradientPicture(Picture pid, xPointFixed * inner, PicturePtr pPicture; PictRadialGradient *radial; - if (nStops < 2) { + if (nStops < 1) { *error = BadValue; return 0; } @@ -979,7 +979,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, { PicturePtr pPicture; - if (nStops < 2) { + if (nStops < 1) { *error = BadValue; return 0; } -- cgit v1.2.3 From 833e3e84a077766b16b42d2b24931c14cd00bfb9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 20 Oct 2011 11:44:28 +0100 Subject: exa: initialise mask_off_x and mask_off_y These get used at the end of the function in a calculation, even though the result isn't used its not pretty. Pointed out by coverity. Signed-off-by: Dave Airlie Reviewed-by: Alan Coopersmith (cherry picked from commit 4c7cefe24001279a558dd875949d40ede49ef702) --- exa/exa_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exa/exa_render.c b/exa/exa_render.c index e3e552697..fc3ddea79 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -636,7 +636,7 @@ exaTryDriverComposite(CARD8 op, RegionRec region; BoxPtr pbox; int nbox; - int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y; + int src_off_x, src_off_y, mask_off_x = 0, mask_off_y = 0, dst_off_x, dst_off_y; PixmapPtr pSrcPix = NULL, pMaskPix = NULL, pDstPix; ExaPixmapPrivPtr pSrcExaPix = NULL, pMaskExaPix = NULL, pDstExaPix; -- cgit v1.2.3 From 293d0efe3c742f5010cddf5ad0420d0d1c43959b Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Mon, 7 Oct 2013 17:57:14 +0300 Subject: randr: Allow RRSelectInput for ProviderChange and ResourceChange events [ajax: To be clear, we already have code to emit these events, and it looks like it works, but to get them you'd have had to also ask for one of the other notify types. This makes it possible to listen for e.g. ProviderChange alone.] Reviewed-by: Adam Jackson Signed-off-by: Michal Srb (cherry picked from commit 91c7acfc3447a0073dd1db260cf05115d94ce7e8) --- randr/rrdispatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index b9346d3f9..7fee2bf9c 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -92,7 +92,9 @@ ProcRRSelectInput(ClientPtr client) RRCrtcChangeNotifyMask | RROutputChangeNotifyMask | RROutputPropertyNotifyMask | - RRProviderPropertyNotifyMask)) { + RRProviderChangeNotifyMask | + RRProviderPropertyNotifyMask | + RRResourceChangeNotifyMask)) { ScreenPtr pScreen = pWin->drawable.pScreen; rrScrPriv(pScreen); -- cgit v1.2.3 From 5c0aea5fb3bda98a442b982b4622cc81a700ebd7 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Mon, 14 Oct 2013 17:07:29 +0300 Subject: xfree86: Fix the 1792x1344-75 EST III mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The correct refresh rate for this mode is 75, not 85. Reviewed-by: Adam Jackson Signed-off-by: Ville Syrjälä (cherry picked from commit 98e170971c6b06d64a5bc7418bf6ae6ae985a3ae) --- hw/xfree86/modes/xf86EdidModes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 6fb0f9b92..f24294ee3 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -713,7 +713,7 @@ static const struct { {1600, 1200, 75, 0}, {1600, 1200, 85, 0}, {1792, 1344, 60, 0}, - {1792, 1344, 85, 0}, + {1792, 1344, 75, 0}, {1856, 1392, 60, 0}, {1856, 1392, 75, 0}, {1920, 1200, 60, 1}, -- cgit v1.2.3 From 20bdec91712957c069c410ed34045f4090821ac7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 27 Jan 2014 09:44:48 +0000 Subject: render: Fix leak of filter params ==11097== 2,048 (+1,640) bytes in 32 (+26) blocks are definitely lost in loss record 1,570 of 1,719 ==11097== at 0x4C2A2DB: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==11097== by 0x225EF3: SetPicturePictFilter (filter.c:339) ==11097== by 0x22DF4F: ProcRenderSetPictureFilter (render.c:1773) ==11097== by 0x15D25D: Dispatch (dispatch.c:432) ==11097== by 0x14C7B9: main (main.c:298) [ajax: Fixed whitespace] Reviewed-by: Adam Jackson Signed-off-by: Chris Wilson (cherry picked from commit c7f84c880bbbb508016ad80390a11961b1c4214d) --- render/picture.c | 1 + 1 file changed, 1 insertion(+) diff --git a/render/picture.c b/render/picture.c index cef7032a2..fdf034a62 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1392,6 +1392,7 @@ FreePicture(void *value, XID pid) if (--pPicture->refcnt == 0) { free(pPicture->transform); + free(pPicture->filter_params); if (pPicture->pSourcePict) { if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) -- cgit v1.2.3 From 87151fefb06dc96fac79e93a3151300bd8037f3d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 5 May 2014 11:10:06 -0700 Subject: x86emu: Fix some set-but-not-used warnings. Reviewed-by: Adam Jackson Signed-off-by: Eric Anholt (cherry picked from commit e6f8a0340b72113474ccfbf1ea447558b705995a) --- hw/xfree86/x86emu/debug.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/xfree86/x86emu/debug.c b/hw/xfree86/x86emu/debug.c index cbea9947f..72a06ffb8 100644 --- a/hw/xfree86/x86emu/debug.c +++ b/hw/xfree86/x86emu/debug.c @@ -233,9 +233,7 @@ X86EMU_dump_memory(u16 seg, u16 off, u32 amt) u32 start = off & 0xfffffff0; u32 end = (off + 16) & 0xfffffff0; u32 i; - u32 current; - current = start; while (end <= off + amt) { printk("%04x:%04x ", seg, start); for (i = start; i < off; i++) @@ -261,8 +259,6 @@ x86emu_single_step(void) static int breakpoint; static int noDecode = 1; - char *p; - if (DEBUG_BREAK()) { if (M.x86.saved_ip != breakpoint) { return; @@ -279,7 +275,7 @@ x86emu_single_step(void) offset = M.x86.saved_ip; while (!done) { printk("-"); - p = fgets(s, 1023, stdin); + (void)fgets(s, 1023, stdin); cmd = parse_line(s, ps, &ntok); switch (cmd) { case 'u': -- cgit v1.2.3 From 616239c15d03f5b527288965f7eee0edebdcf20f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 21 Sep 2015 07:16:13 +0100 Subject: Xext/xselinux: Warning fixes There's a 'const char *' adventure here that I'm mostly ignoring; some client information gets const poisoned. Worked around by adding a couple of casts. Ick. Added an _X_ATTRIBUTE_PRINTF to SELinuxLog. Ignore a couple of unused return values. Reviewed-by: Adam Jackson Signed-off-by: Keith Packard (cherry picked from commit 9af111fe045d82192bacc722940e1d92a8ba4cbd) --- Xext/xselinux_hooks.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c index 48219a9e0..e69bfe7ae 100644 --- a/Xext/xselinux_hooks.c +++ b/Xext/xselinux_hooks.c @@ -147,7 +147,7 @@ SELinuxLabelClient(ClientPtr client) strncpy(subj->command, cmdname, COMMAND_LEN - 1); if (!cached) - free(cmdname); /* const char * */ + free((void *) cmdname); /* const char * */ } finish: @@ -294,6 +294,9 @@ SELinuxAudit(void *auditdata, audit->extension ? audit->extension : ""); } +static int +SELinuxLog(int type, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(2, 3); + static int SELinuxLog(int type, const char *fmt, ...) { @@ -316,6 +319,7 @@ SELinuxLog(int type, const char *fmt, ...) va_start(ap, fmt); vsnprintf(buf, MAX_AUDIT_MESSAGE_LENGTH, fmt, ap); rc = audit_log_user_avc_message(audit_fd, aut, buf, NULL, NULL, NULL, 0); + (void) rc; va_end(ap); LogMessageVerb(X_WARNING, 0, "%s", buf); return 0; @@ -476,7 +480,7 @@ SELinuxExtension(CallbackListPtr *pcbl, void *unused, void *calldata) } /* Perform the security check */ - auditdata.extension = rec->ext->name; + auditdata.extension = (char *) rec->ext->name; rc = SELinuxDoCheck(subj, obj, SECCLASS_X_EXTENSION, rec->access_mode, &auditdata); if (rc != Success) -- cgit v1.2.3 From 62e2aa02efe45198d6b013530d269815ebd4c9ba Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 21 Sep 2015 22:36:41 -0700 Subject: dri2: better checks for integer overflow in GetBuffers* Check for integer overflow before using stuff->count in a multiplication, to avoid compiler optimizing out due to undefined behaviour, but only after we've checked to make sure stuff->count is in the range of the request we're parsing. Reported-by: jes@posteo.de Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith (cherry picked from commit 6ca496b7c3ccfd677c8c1bee88cc509a5e3c9e04) --- hw/xfree86/dri2/dri2ext.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 221ec530b..520b7cfb8 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -269,9 +269,11 @@ ProcDRI2GetBuffers(ClientPtr client) int status, width, height, count; unsigned int *attachments; - REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4); - if (stuff->count > (INT_MAX / 4)) + REQUEST_AT_LEAST_SIZE(xDRI2GetBuffersReq); + /* stuff->count is a count of CARD32 attachments that follows */ + if (stuff->count > (INT_MAX / sizeof(CARD32))) return BadLength; + REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * sizeof(CARD32)); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) @@ -297,7 +299,13 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client) int status, width, height, count; unsigned int *attachments; - REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * (2 * 4)); + REQUEST_AT_LEAST_SIZE(xDRI2GetBuffersReq); + /* stuff->count is a count of pairs of CARD32s (attachments & formats) + that follows */ + if (stuff->count > (INT_MAX / (2 * sizeof(CARD32)))) + return BadLength; + REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, + stuff->count * (2 * sizeof(CARD32))); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; -- cgit v1.2.3 From 025ae119a7561a911533ca69c8232147273af300 Mon Sep 17 00:00:00 2001 From: Arcady Goldmints-Orlov Date: Thu, 4 Oct 2012 14:22:13 -0700 Subject: Fix alphamap interactions with wfb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set a destructor function on pixman images and call fbFinishAccess() from there, rather than directly from free_pixman_pict(). This ensures that fbFinishAccess() gets called even if pixman still has a reference to the image after free_pixman_pict(), as is the case for alphamaps. [ajax: Squash an unused variable warning in the non-wfb build] Reviewed-by: Aaron Plattner Signed-off-by: Arcady Goldmints-Orlov Reviewed-by: Søren Sandmann (cherry picked from commit fbac451724f7e1b8ce6b6e0505cc33ccd41c5158) --- fb/fbpict.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index c8378ad90..5f6c88ec8 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -345,6 +345,11 @@ static pixman_image_t *image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map); +static void image_destroy(pixman_image_t *image, void *data) +{ + fbFinishAccess((DrawablePtr)data); +} + static void set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map) @@ -429,6 +434,10 @@ set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip, break; } + if (pict->pDrawable) + pixman_image_set_destroy_function(image, &image_destroy, + pict->pDrawable); + pixman_image_set_filter(image, filter, (pixman_fixed_t *) pict->filter_params, pict->filter_nparams); @@ -481,8 +490,8 @@ image_from_pict(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) void free_pixman_pict(PicturePtr pict, pixman_image_t * image) { - if (image && pixman_image_unref(image) && pict->pDrawable) - fbFinishAccess(pict->pDrawable); + if (image) + pixman_image_unref(image); } Bool -- cgit v1.2.3 From 0c5ef339ae36b530745b883347accf11b21b1fd6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 14 Dec 2011 15:55:22 +0000 Subject: render: Propagate allocation failure from createSourcePicture() All the callers were already checking for failure, except that createSourcePicture() itself was failing to check whether it successfully allocated the Picture. [ajax: Rebase, fix line wrap of preceding line] Signed-off-by: Chris Wilson Reviewed-by: Jeremy Huddleston (cherry picked from commit 211d4c2d353b5e379716484055a3f58235ea65f4) --- render/picture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/render/picture.c b/render/picture.c index fdf034a62..6e23e2bbf 100644 --- a/render/picture.c +++ b/render/picture.c @@ -856,7 +856,11 @@ createSourcePicture(void) { PicturePtr pPicture; - pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, PRIVATE_PICTURE); + pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, + PRIVATE_PICTURE); + if (!pPicture) + return 0; + pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; -- cgit v1.2.3 From 8a30fd207cd4f560696ffd4463284ef123970e96 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 14 Oct 2015 15:13:34 -0700 Subject: mi: Correct a miscall of abs() to instead call fabs() miarc.c:1714:9: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value,Semantic Issue] if (abs(parc->angle2) >= 360.0) ^ miarc.c:1714:9: note: use function 'fabs' instead [Semantic Issue] if (abs(parc->angle2) >= 360.0) ^~~ fabs Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Alan Coopersmith (cherry picked from commit 610dd8a58a75bb6a5b7d7abbae476d1cc4be519e) --- mi/miarc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mi/miarc.c b/mi/miarc.c index e8bc87e3e..d26f67486 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -1712,7 +1712,7 @@ miGetArcPts(SppArcPtr parc, /* points to an arc */ y1 = y2; } /* adjust the last point */ - if (abs(parc->angle2) >= 360.0) + if (fabs(parc->angle2) >= 360.0) poly[cpt + i - 1] = poly[0]; else { poly[cpt + i - 1].x = (miDcos(st + et) * parc->width / 2.0 + xc); -- cgit v1.2.3 From 0f051cb4c3af6c3b906c2f210e3b6858dd7a5f53 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 14 Oct 2015 15:13:35 -0700 Subject: randr: Correct a miscall of abs() to instead call fabs() rrtransform.c:124:22: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value,Semantic Issue] if ((v = abs(f_transform->m[j][i])) > max) ^ rrtransform.c:124:22: note: use function 'fabs' instead [Semantic Issue] if ((v = abs(f_transform->m[j][i])) > max) ^~~ fabs Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Alan Coopersmith (cherry picked from commit 9f0fcd14b52f8481cbb3b3b9c6e06f64ff003cc8) --- randr/rrtransform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randr/rrtransform.c b/randr/rrtransform.c index c8a27498f..f3f1b1e65 100644 --- a/randr/rrtransform.c +++ b/randr/rrtransform.c @@ -121,7 +121,7 @@ RRTransformRescale(struct pixman_f_transform *f_transform, double limit) for (j = 0; j < 3; j++) for (i = 0; i < 3; i++) - if ((v = abs(f_transform->m[j][i])) > max) + if ((v = fabs(f_transform->m[j][i])) > max) max = v; scale = limit / max; for (j = 0; j < 3; j++) -- cgit v1.2.3 From a88460ca82c7aed00177a5bb733b98a7f9b45968 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 14 Oct 2015 15:13:36 -0700 Subject: xdmauth: Correct miscall of abs() to instrad call labs() xdmauth.c:230:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value,Semantic Issue] if (abs(now - client->time) > TwentyFiveMinutes) { ^ xdmauth.c:230:13: note: use function 'labs' instead [Semantic Issue] if (abs(now - client->time) > TwentyFiveMinutes) { ^~~ labs xdmauth.c:302:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value,Semantic Issue] if (abs(client->time - now) > TwentyMinutes) { ^ xdmauth.c:302:9: note: use function 'labs' instead [Semantic Issue] if (abs(client->time - now) > TwentyMinutes) { ^~~ labs Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Alan Coopersmith (cherry picked from commit 85eb90ea45e89033b97bf71a13c5c70fec8f6871) --- os/xdmauth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/xdmauth.c b/os/xdmauth.c index f11cbb997..482bc67db 100644 --- a/os/xdmauth.c +++ b/os/xdmauth.c @@ -227,7 +227,7 @@ XdmClientAuthTimeout(long now) prev = 0; for (client = xdmClients; client; client = next) { next = client->next; - if (abs(now - client->time) > TwentyFiveMinutes) { + if (labs(now - client->time) > TwentyFiveMinutes) { if (prev) prev->next = next; else @@ -299,7 +299,7 @@ XdmAuthorizationValidate(unsigned char *plain, int length, } now += clockOffset; XdmClientAuthTimeout(now); - if (abs(client->time - now) > TwentyMinutes) { + if (labs(client->time - now) > TwentyMinutes) { free(client); if (reason) *reason = "Excessive XDM-AUTHORIZATION-1 time offset"; -- cgit v1.2.3 From 2ae94d6e8978faff330e9433eddf1697ba4693f6 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 14 Oct 2015 15:13:42 -0700 Subject: xdmcp: Declare XdmcpFatal _X_NORETURN xdmcp.c:1404:1: warning: function 'XdmcpFatal' could be declared with attribute 'noreturn' [-Wmissing-noreturn,Semantic Issue] Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Alan Coopersmith (cherry picked from commit 9a2a05a9a7ba02921fa29844c4cad41243c41326) --- os/xdmcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os/xdmcp.c b/os/xdmcp.c index 7939b4138..5bdcbe9c9 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -1399,6 +1399,7 @@ recv_alive_msg(unsigned length) } } +_X_NORETURN static void XdmcpFatal(const char *type, ARRAY8Ptr status) { -- cgit v1.2.3 From 82000d6d0376bdd5c6bb4e0daefcb85879f7c5c7 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sun, 18 Oct 2015 23:12:50 -0700 Subject: glx: Fix header length error checking in __glXDisp_RenderLarge glxcmds.c:2206:46: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare,Semantic Issue] if ((cmdlen = safe_pad(hdr->length)) < 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ Reviewed-by: Adam Jackson Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit e09875701b980b8c4578fb310a922c9934c34eef) --- glx/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index cbd4ede39..0416dac09 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -2182,7 +2182,7 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) __GLXrenderSizeData entry; int extra = 0; int left = (req->length << 2) - sz_xGLXRenderLargeReq; - size_t cmdlen; + int cmdlen; int err; /* -- cgit v1.2.3 From 0ca79007c940b09bd81823fc2e2276f08057247c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 21 Sep 2015 07:16:12 +0100 Subject: fonts: Continue when font calls return Suspended more than once Patch 3ab6cd31cbdf8095b2948034fce5fb645422d8da fixed Xinerama interactions with font servers by not putting clients to sleep multiple times. However, it introduced additional changes dealing with libXfont routine returning Suspended more than once for the same request. This additional change was to abandon processing of the current request and free the closure data by jumping to 'xinerama_sleep' in each of the functions. Font library functions shouldn't return Suspended more than once, except for ListFontsWithInfo, which produces multiple replies, and thus ends up returning Suspended many times during processing. With the jump to xinerama_sleep occurring after the first reply was processed, the closure for the request was freed and future calls into the ListFontsWithInfo callback resulted in dereferencing freed memory. This patch removes the added branches, reverting the code to its previous behaviour, which permitted multiple Suspended returns and simply waited for the client to be signaled again so that the callback could continue processing the request. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson (cherry picked from commit f9a04d19aef77bf787b8d322305a6971d24a6ba1) --- dix/dixfonts.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index bc2732fb9..ddcb18bc1 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -314,8 +314,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doOpenFont, c); - else - goto xinerama_sleep; return TRUE; } break; @@ -363,7 +361,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c) c->fontid, FontToXError(err)); } ClientWakeup(c->client); - xinerama_sleep: for (i = 0; i < c->num_fpes; i++) { FreeFPE(c->fpe_list[i]); } @@ -596,8 +593,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); - else - goto xinerama_sleep; return TRUE; } @@ -623,8 +618,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); - else - goto xinerama_sleep; return TRUE; } if (err == Successful) @@ -642,8 +635,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); - else - goto xinerama_sleep; return TRUE; } if (err == FontNameAlias) { @@ -788,7 +779,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) bail: ClientWakeup(client); - xinerama_sleep: for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); free(c->fpe_list); @@ -888,8 +878,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsWithInfo, c); - else - goto xinerama_sleep; return TRUE; } if (err == Successful) @@ -905,8 +893,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsWithInfo, c); - else - goto xinerama_sleep; return TRUE; } } @@ -1040,7 +1026,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) WriteSwappedDataToClient(client, length, &finalReply); bail: ClientWakeup(client); - xinerama_sleep: for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); free(c->reply); @@ -1297,8 +1282,6 @@ doPolyText(ClientPtr client, PTclosurePtr c) client_state = START_SLEEP; continue; /* on to steps 3 and 4 */ } - else - goto xinerama_sleep; return TRUE; } else if (lgerr != Successful) { @@ -1352,7 +1335,6 @@ doPolyText(ClientPtr client, PTclosurePtr c) } if (ClientIsAsleep(client)) { ClientWakeup(c->client); - xinerama_sleep: ChangeGC(NullClient, c->pGC, clearGCmask, clearGC); /* Unreference the font from the scratch GC */ @@ -1477,8 +1459,6 @@ doImageText(ClientPtr client, ITclosurePtr c) ClientSleep(client, (ClientSleepProcPtr) doImageText, c); } - else - goto xinerama_sleep; return TRUE; } else if (lgerr != Successful) { @@ -1501,7 +1481,6 @@ doImageText(ClientPtr client, ITclosurePtr c) } if (ClientIsAsleep(client)) { ClientWakeup(c->client); - xinerama_sleep: ChangeGC(NullClient, c->pGC, clearGCmask, clearGC); /* Unreference the font from the scratch GC */ -- cgit v1.2.3 From 88f22fc5dac502c7d57d0b53defda75b44dab985 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 21 Oct 2015 11:36:06 +0200 Subject: linux: Do not call FatalError from xf86CloseConsole FatalError ends up calling xf86CloseConsole itself, so calling FatalError from within xf86CloseConsole is not a good idea. Make switch_to log errors using xf86Msg(X_WARNING, ...) and return success (or failure). This makes switch_to match the other error checking done in xf86CloseConsole which all logs warnings and continues. Add checking of the return value in xf86OpenConsole and call FatalError there when switch_to fails, to preserve the error-handling behavior of xf86OpenConsole. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1269210 Reviewed-by: Adam Jackson Signed-off-by: Hans de Goede (cherry picked from commit 2092f12a243b9f7682f542b593b77c96d455ec89) --- hw/xfree86/os-support/linux/lnx_init.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 94853070d..4acaf33d1 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -62,18 +62,24 @@ drain_console(int fd, void *closure) } } -static void +static int switch_to(int vt, const char *from) { int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); - if (ret < 0) - FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno)); + if (ret < 0) { + xf86Msg(X_WARNING, "%s: VT_ACTIVATE failed: %s\n", from, strerror(errno)); + return 0; + } SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); - if (ret < 0) - FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); + if (ret < 0) { + xf86Msg(X_WARNING, "%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); + return 0; + } + + return 1; } #pragma GCC diagnostic push @@ -208,7 +214,8 @@ xf86OpenConsole(void) /* * now get the VT. This _must_ succeed, or else fail completely. */ - switch_to(xf86Info.vtno, "xf86OpenConsole"); + if (!switch_to(xf86Info.vtno, "xf86OpenConsole")) + FatalError("xf86OpenConsole: Switching VT failed\n"); SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); if (ret < 0) @@ -269,7 +276,8 @@ xf86OpenConsole(void) else { /* serverGeneration != 1 */ if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch) { /* now get the VT */ - switch_to(xf86Info.vtno, "xf86OpenConsole"); + if (!switch_to(xf86Info.vtno, "xf86OpenConsole")) + FatalError("xf86OpenConsole: Switching VT failed\n"); } } } -- cgit v1.2.3 From d9344ef3ea4f3009d61240e0fefcfca40eaa7dca Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 16 Feb 2015 09:49:18 +0000 Subject: present: Fix missed notify MSC computation Only treat divisor==0 as async to immediately report the actual vblank. If the user species a non-zero divisor, we should compute the missed vblank properly or else we report too early. Signed-off-by: Chris Wilson Reviewed-by: Mario Kleiner (cherry picked from commit 413cb2ff1d754b5f19d77ff19cddf40793989c03) --- present/present.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/present/present.c b/present/present.c index 7ddffbd28..beb4ff03a 100644 --- a/present/present.c +++ b/present/present.c @@ -933,7 +933,7 @@ present_notify_msc(WindowPtr window, 0, 0, NULL, NULL, NULL, - PresentOptionAsync, + divisor == 0 ? PresentOptionAsync : 0, target_msc, divisor, remainder, NULL, 0); } -- cgit v1.2.3 From 780022a8a5d6f8abd02f8b568f522ce5aed99839 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 26 Oct 2015 13:03:59 -0400 Subject: xserver 1.17.3 Signed-off-by: Adam Jackson --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d8f0e74f6..16832c2c8 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.17.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2015-06-16" -RELEASE_NAME="lambic" +AC_INIT([xorg-server], 1.17.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2015-10-26" +RELEASE_NAME="Pumpkin Spice Latte" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) -- cgit v1.2.3