Commit Graph

14673 Commits

Author SHA1 Message Date
Keith Packard
90d326fcc6 glamor: Remove _nf rendering functions
These were used by the non-standard glamor implementation in the intel
driver.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:39 -07:00
Keith Packard
697f8581e0 glamor: Eliminate GLAMOR_USE_SCREEN and GLAMOR_USE_PICTURE_SCREEN
Remove these defines as we start to remove support for non-standard
glamor layering as used by the intel driver.

v2: Rebase on the blockhandler change and the Xephyr init failure
    change (by anholt), fix stray NO_DRI3 addition to xwayland.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:39 -07:00
Keith Packard
28ff815c4b glamor: Eliminate GLAMOR_CREATE_PIXMAP_MAP and GLAMOR_MEMORY_MAP
GLAMOR_MEMORY_MAP was only used with GLAMOR_CREATE_PIXMAP_MAP, and
GLAMOR_CREATE_PIXMAP_MAP doesn't appear to be used anywhere, so just
remove both of them.

v2: Fix a stray whitespace bug that was introduced (change by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:39 -07:00
Maarten Lankhorst
0e1372e1bd glamor: GL_TEXTURE_MAX_LEVEL is not available on GLES2
Remove the calls to GL_TEXTURE_MAX_LEVEL. Setting the filtering is
a sufficient hint to the driver about texture mipmap allocation.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-03-24 12:01:38 -07:00
Maarten Lankhorst
c1f35c3d86 glamor: Use GL_FRAMEBUFFER instead of GL_READ_FRAMEBUFFER
The latter might not be available on GLES2.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:38 -07:00
Maarten Lankhorst
b66501b4fd glamor: do not check for gl errors in glamor_build_program
According to Eric Anholt the check for glGetError is not needed here.
Because a opengl error might be set before this function is called
keeping the check could result in glamor_build_program returning
failure when building the shader succeeded.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:38 -07:00
Maarten Lankhorst
7c6f483670 glamor: only use (un)pack_subimage when available
Check for GL_EXT_unpack_subimage and GL_NV_pack_subimage to
check if GL_(UN)PACK_ROW_LENGTH is available. Set the offsets
manually to prevent calls to GL_(UN)PACK_SKIP_*.

v2: Check support for GL_NV_pack_subimage as suggested by Matt Turner.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:38 -07:00
Olivier Fourdan
4f534c26c6 xwayland: Add dependency on glamor libs
So that Xwayland gets re-linked each time glamor is modified.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:38 -07:00
Olivier Fourdan
251a067993 ephyr: Fail if glamor is requested but not usable
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:38 -07:00
Jürg Billeter
0a78b599b3 int10: Fix error check for pci_device_map_legacy
pci_device_map_legacy returns 0 on success.

Signed-off-by: Jürg Billeter <j@bitron.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Egbert Eich
21b896939c symbols: Fix sdksyms.sh to cope with gcc5
Gcc5 adds additional lines stating line numbers before and
after __attribute__() which need to be skipped.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Tested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Alan Coopersmith
7ea64fb437 Clear ListenTransConns entries in CloseWellKnownConnections
Since _XSERVTransClose frees the connection pointer passed to it,
remove that pointer from the array, so we don't try to double free it
if we come back into CloseWellKnownConnections again.

Should fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=6665 in which
the shutdown section of the main() loop called CloseWellKnownConnections()
and then moved on to ddxGiveUp(), which failed to release the VT and thus
called AbortServer(), which called CloseWellKnownConnections() again.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Emil Velikov
6d3cf35a6f autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Michal Srb
5c4202ea85 Expose GetMaster to modules.
Add _X_EXPORT to GetMaster function. It is required by tigervnc's VNC module.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Peter Hutterer
f485a1af64 Drop valuator mask argument from GetKeyboardEvents
Nothing was using it and if anyone had they would've gotten a warning and
noticed that it doesn't actually work. Drop this, it has been unused for years.

Input ABI 22

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2015-03-13 12:31:21 +10:00
Dave Airlie
9d9bd38fe1 os/access: fix regression in server interpreted auth
This was reported on irc on Fedora when rawhide went to 1.17.1.

regression occured in: 2566835b43
 os: Eliminate uninitialized value warnings from access.c

siAddrMatch doesn't need addr to be a useful value, it checks
some things like localuser without having an address at all.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Keith Packard
3a06faf3fc Mark development version for 1.18
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-02-10 22:16:53 -08:00
Alan Coopersmith
4a758f59a8 dmx: include header for DMXExtensionInit() in dmx.c
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:45 -08:00
Alan Coopersmith
a0e44ddfb0 dmx: constify GCOps & GCFuncs pointers
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:45 -08:00
Alan Coopersmith
9682c47e22 dmx: Mark glxIsExtensionSupported as a const char *
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:45 -08:00
Alan Coopersmith
45ec646d77 dmx: remove redundant redeclarations of variables from other headers
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
1033b85196 dmx: remove redundant declaration of dmxFontPrivateIndex from dmxfont.h
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
ac64a653fb dmx: glxproxy prototype cleanup
Gets rid of 107 -Wmissing-prototypes & -Wredundant-decls warnings
from gcc 4.8

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
bd563fd48f dmx: more unshadowing of variables
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
57e08fae82 dmx: attempt to untangle nested loops using same index variable
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
0fbebad724 dmx: remove unused variables
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
f358f0d50c dmx: fix printf format argument warnings
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
11af200b00 dmx: move format strings inline so gcc can check
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
5e01eac10e dmx: Add _X_ATTRIBUTE_PRINTF to dmxConfigLog() & dmxConfigOutput()
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 <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
9e002dfcd7 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 <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-10 18:14:44 -08:00
Olivier Fourdan
20079c36cf xkb: Check strings length against request size
Ensure that the given strings length in an XkbSetGeometry request remain
within the limits of the size of the request.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-10 14:28:28 -08:00
Olivier Fourdan
81c90dc8f0 xkb: Don't swap XkbSetGeometry data in the input buffer
The XkbSetGeometry request embeds data which needs to be swapped when the
server and the client have different endianess.

_XkbSetGeometry() invokes functions that swap these data directly in the
input buffer.

However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once
(if there is more than one keyboard), thus causing on swapped clients the
same data to be swapped twice in memory, further causing a server crash
because the strings lengths on the second time are way off bounds.

To allow _XkbSetGeometry() to run reliably more than once with swapped
clients, do not swap the data in the buffer, use variables instead.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-10 14:28:18 -08:00
Keith Packard
28f6427aec Update to version 1.17.0
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-02-02 07:41:06 +01:00
Dave Airlie
697b696e5e config/udev: Respect seat assignments when assigned devices
Jonathan Dieter posted a few patches to do this inside the Xorg
server but it makes no sense to do it there, just have the code
we use to probe the device list at startup check seat assignments
using the same code we check at hotplug time.

Bugilla: https://bugzilla.redhat.com/show_bug.cgi?id=1183654
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Jonathan Dieter <jdieter@lesbg.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-30 14:09:24 +01:00
Dave Airlie
df1b401f57 randr: attempt to fix primary on slave output (v2)
If the user wants to set one of the slave devices as
the primary output, we shouldn't fail to do so,
we were returning BadMatch which was tripping up
gnome-settings-daemon and bad things ensues.

Fix all the places we use primaryOutput to work
out primaryCrtc and take it into a/c when slave
gpus are in use.

v2: review from Aaron, fix indent, unhide has_primary from
macro. I left the int vs Bool alone to be consistent with
code below, a future patch could fix both.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-26 16:23:10 -08:00
Adel Gadllah
62fcd364ac dri2: Set vdpau driver name if ddx does not provide any driver name
Currently when the ddx does not set any driver name we set DRI2 driver but
not the VDPAU driver name. The result is that VDPAU drivers will not get found
by libvdpau when the modesetting driver is being used.

Just assume that the VDPAU driver matches the DRI2 driver name, this is true
for nouveau, r300, r600 and radeonsi i.e all VDPAU drivers currently supported
by mesa.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-26 10:42:26 -08:00
Nikhil Mahale
fe4c774c57 os: Fix timer race conditions
Fixing following kind of race-conditions -

    WaitForSomething()
    |
    ---->  // timers -> timer-1 -> timer-2 -> null
           while (timers && (int) (timers->expires - now) <= 0)
               // prototype - DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
               DoTimer(timers, now, &timers)
               |
               |
               ----> OsBlockSignals();  .... OS Signal comes just before blocking it,
                                        .... timer-1 handler gets called.
                                             // timer-1 gets served and scheduled again;
                                             // timers -> timer-2 -> timer-1 -> null
                                        ....
                     *prev = timer->next;
                      timer->next = NULL;   // timers -> null
                      // timers list gets corrupted here and timer-2 gets removed from list.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86288
Signed-off-by: Nikhil Mahale <nmahale@nvidia.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>

v2: Apply warning fixes from Keith Packard <keithp@keithp.com>

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-26 10:40:30 -08:00
Keith Packard
58f28b0427 Update to version 1.16.99.902
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:59:39 -08:00
Jason Ekstrand
fef2f6357b modesetting: Return the crtc for a drawable even if it's rotated
All of our checks for what crtc we are on take rotation into account so we
select the correct crtc.  The only problem is that we weren't returning it
we were rotated.  This caused X to think DRI3 apps were not on any crtc and
limit them to 1 FPS.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:50:11 -08:00
Jason Ekstrand
3dcd591fa9 modesetting: Add support for using RandR shadow buffers
This replaces the stubs for shadow buffer creation/allocation with actual
functions and adds a shadow_destroy function.  With this, we actually get
shadow buffers and RandR now works properly.  Most of this is copied from
the xf86-video-intel driver and modified for modesetting.

v2 Jason Ekstrand <jason.ekstrand@intel.com>:
 - Fix build with --disable-glamor
 - Set the pixel data pointer in the pixmap header for dumb shadow bo's
 - Call drmmode_create_bo with the right bpp

v2 Jason Ekstrand <jason.ekstrand@intel.com>:
 - Make shadow buffers per-crtc and leave shadow_enable alone

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:50:00 -08:00
Jason Ekstrand
7c656bfcae modesetting: Add drmmode_bo_has_bo and drmmode_bo_map helper function
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:49:38 -08:00
Jason Ekstrand
b4703a5a6e modesetting: Refactor drmmode_glamor_new_screen_pixmap
The original drmmode_glamor_new_screen_pixmap function was specific to the
primary screen pixmap.  This commit pulls the guts out into a new, more
general, drmmode_set_pixmap_bo function for setting a buffer on a pixmap.
The new function also properly tears down the glamor bits if the buffer
being set is NULL.  The drmmode_glamor_new_screen_pixmap function is now
just a 3-line wrapper around drmmode_set_pixmap_bo.

v2 Jason Ekstrand <jason.ekstrand@intel.com>:
 - Re-arranged code in drmmode_set_pixmap_bo and
   drmmode_glamor_handle_new_screen_pixmap so that glamor_set_screen_pixmap
   only gets called for the screen pixmap
 - Guard the call to glamor_set_screen_pixmapa with a drmmode->glamor check

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:49:33 -08:00
Adam Jackson
bb23fbf5bb dix: make RegionInit legal C++
The CVE fix in:

    commit 97015a07b9
    Author: Alan Coopersmith <alan.coopersmith@oracle.com>
    Date:   Wed Jan 22 22:37:15 2014 -0800

        dix: integer overflow in RegionSizeof() [CVE-2014-8092 3/4]

offended the C++ demons:

../../include/regionstr.h:147:45: error: invalid conversion from 'void*' to
'pixman_region16_data_t* {aka pixman_region16_data*}' [-fpermissive]

Normally this isn't a problem, because around here we have the sense and
common decency to not use C++, but this does make tigervnc fail to build,
which is a little rude of us.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:35:49 -08:00
Chris Wilson
0829310148 dri2: SourceOffloads may be for DRI3 only
As a DDX may declare offload support without supporting DRI2
(because it is using an alternative acceleration mechanism like DRI3),
when iterating the list of offload_source Screens to find a matching
DRI2 provider we need to check before assuming it is DRI2 capable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88514
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:11:30 -08:00
Carlos Olmedo Escobar
f27d743c18 Avoid possible null pointer dereference.
Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:03:57 -08:00
Carlos Sánchez de La Lama
437d2ec5f2 randr: swap num-preferred field on RRGetOutputInfo reply
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88614
Signed-off-by: Carlos Sánchez de La Lama <csanchezdll@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:01:42 -08:00
Keith Packard
3d12941b40 drivers/modesetting: Save current BlockHandler on return in msBlockHandler
If the BlockHandler chain is modified while it is active, we need to
re-fetch the current value and store it in our private for use the
next time through.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 09:06:41 -08:00
Dave Airlie
b3e496c6d2 glamor: use screen blockhandler rather than dix one (v3)
This adds glamor into the block handler call chain
in the correct place.

This should fix interactions between glamor and drivers
requiring damage from glamor.

v2: okay don't consolidate, just leave things wierd for now
remove blcokhandler in screen close.

v3: block handler wrapping the right way.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 09:06:36 -08:00
Markus Wick
5af2f5b7d2 xwayland: Set glamor filter to nearest
glEGLImageTargetTexture2DOES only set the first level.
Mesa handles this new texture as incomplete and renders a black screen.
We also want to prevent linear filtering.

https://bugs.freedesktop.org/show_bug.cgi?id=81800

Signed-off-by: Markus Wick <markus@selfnet.de>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-17 07:47:53 +13:00
Keith Packard
5f2e8ac51c Merge remote-tracking branch 'whot/for-keith' 2015-01-10 14:51:57 +13:00