platform/upstream/xorg-server.git
10 years agopseudoramiX: Only compile on XQUARTZ and XWIN
Keith Packard [Thu, 23 Jan 2014 03:17:24 +0000 (19:17 -0800)]
pseudoramiX: Only compile on XQUARTZ and XWIN

PseudoramiXExtensionInit() is not defined in extinit.h if it won't be
used and we get a compiler warning when compiling the pseudoramiX code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agopseudoramiX: Add _X_ATTRIBUTE_PRINTF attributes to debug functions.
Keith Packard [Thu, 23 Jan 2014 03:16:36 +0000 (19:16 -0800)]
pseudoramiX: Add _X_ATTRIBUTE_PRINTF attributes to debug functions.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoWarning fixes in glx
Keith Packard [Fri, 15 Nov 2013 09:00:53 +0000 (18:00 +0900)]
Warning fixes in glx

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodix: Praise clients which haven't run for a while, rather than idle clients
Keith Packard [Wed, 22 Jan 2014 19:01:59 +0000 (11:01 -0800)]
dix: Praise clients which haven't run for a while, rather than idle clients

A client which is ready, but hasn't run for a while, should receive
the same benefit as one which has simply been idle for a while. Use
the smart_stop_tick to see how long it has been since a client has
run instead of smart_check_tick, which got reset each time a client
was ready, even if it didn't get to run.

Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotest/signal-formatting: Ignore compiler warnings
Keith Packard [Sun, 12 Jan 2014 18:53:31 +0000 (10:53 -0800)]
test/signal-formatting: Ignore compiler warnings

The signal formatting tests intentionally include code which generates
warnings with the current X server warning flags. Turn the compiler
warnings off

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agotest/hashtabletest: Clean up -Wshadow errors
Keith Packard [Sun, 12 Jan 2014 18:44:22 +0000 (10:44 -0800)]
test/hashtabletest: Clean up -Wshadow errors

Declare 'XID id' local to each scope it is used in, rather than having
the first use be a function-wide declaration.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agotest/xi2: Clean up -Wshadow warnings
Keith Packard [Sun, 12 Jan 2014 18:42:37 +0000 (10:42 -0800)]
test/xi2: Clean up -Wshadow warnings

protocol-common declares a bunch of pretty generic names; fix shadows
of these names.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agokdrive/ephyr: Remove extra 'i' variable in ProcXF86DRIGetDrawableInfo
Keith Packard [Sun, 12 Jan 2014 18:42:01 +0000 (10:42 -0800)]
kdrive/ephyr: Remove extra 'i' variable in ProcXF86DRIGetDrawableInfo

Just re-use the top-level one

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agorandr: Eliminate -Wshadow warnings
Keith Packard [Sun, 15 Dec 2013 09:57:09 +0000 (01:57 -0800)]
randr: Eliminate -Wshadow warnings

Don't use rrScrPriv for nested screen private fetching.

Eliminate a duplicate fetch of the randr screen private in rrCheckPixmapBounding.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agohw/xnest: Eliminate shadowed names
Keith Packard [Sun, 15 Dec 2013 09:56:36 +0000 (01:56 -0800)]
hw/xnest: Eliminate shadowed names

Just rename stuff; nothing fancy here.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agohw/vfb: Rename screenInfo parameter to screen_info
Keith Packard [Sun, 15 Dec 2013 09:55:43 +0000 (01:55 -0800)]
hw/vfb: Rename screenInfo parameter to screen_info

Avoid shadowing the global screenInfo value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agokdrive: Fix -Wshadow errors
Keith Packard [Sun, 15 Dec 2013 09:55:06 +0000 (01:55 -0800)]
kdrive: Fix -Wshadow errors

Just rename stuff to avoid conflicts.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoexa: Fix -Wshadow warnings
Keith Packard [Sun, 15 Dec 2013 09:53:50 +0000 (01:53 -0800)]
exa: Fix -Wshadow warnings

In exa_accel, there was a duplicate fetch of a pixmap private field.

exa_render just had a regular shadowed value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agocomposite: Remove duplicate window pixmap fetch
Keith Packard [Sun, 15 Dec 2013 09:52:58 +0000 (01:52 -0800)]
composite: Remove duplicate window pixmap fetch

There's nothing between the previous fetch and this one that could
cause the window pixmap to have changed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoxfree86: Fix -Wshadow warnings
Keith Packard [Sun, 15 Dec 2013 09:41:19 +0000 (01:41 -0800)]
xfree86: Fix -Wshadow warnings

Just rename variables to eliminate -Wshadow warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoXi: Use 'void *' instead of 'Pointer' (which is going away)
Keith Packard [Sun, 15 Dec 2013 09:40:04 +0000 (01:40 -0800)]
Xi: Use 'void *' instead of 'Pointer' (which is going away)

There's no reason for XI to declare 'typedef char *Pointer' in a
shared header file; assume it will eventually go away and stop using
it here.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoos: Fix -Wshadow errors
Keith Packard [Sun, 15 Dec 2013 09:12:22 +0000 (01:12 -0800)]
os: Fix -Wshadow errors

Rename variables to avoid shadowing globals

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoAdd 'FONT_PATH_NAME_ELEMENT_CONST' to dix-config.h and xorg-server.h
Keith Packard [Fri, 13 Dec 2013 19:25:45 +0000 (11:25 -0800)]
Add 'FONT_PATH_NAME_ELEMENT_CONST' to dix-config.h and xorg-server.h

This signals to the fontsproto code that the X server has been fixed
to allow the name member in a FontPathElement struct to be declared
const to eliminate piles of warnings when assigning string constants
to them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoIgnore a couple of format-nonliteral warnings
Keith Packard [Fri, 13 Dec 2013 19:24:00 +0000 (11:24 -0800)]
Ignore a couple of format-nonliteral warnings

These are generated in code which uses sprintf as a convenient way to
construct strings from various pieces.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoinclude: GetClientResolutions is declared in font.h
Keith Packard [Wed, 11 Dec 2013 19:55:37 +0000 (11:55 -0800)]
include: GetClientResolutions is declared in font.h

No need to have a duplicate definition here.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Wed, 22 Jan 2014 19:33:53 +0000 (11:33 -0800)]
Merge remote-tracking branch 'whot/for-keith'

10 years agoMerge remote-tracking branch 'dlespiau/20131216-4k'
Keith Packard [Wed, 22 Jan 2014 19:32:35 +0000 (11:32 -0800)]
Merge remote-tracking branch 'dlespiau/20131216-4k'

10 years agoIf EAGAIN == EWOULDBLOCK, only need to check errno for one of them
Alan Coopersmith [Sat, 4 Jan 2014 08:09:45 +0000 (00:09 -0800)]
If EAGAIN == EWOULDBLOCK, only need to check errno for one of them

Solaris <sys/errno.h> has:
 #define EWOULDBLOCK       EAGAIN
so checking (errno == EAGAIN || errno == EWOULDBLOCK) is overkill.

This leads cppcheck 1.62 to complain:
[xserver/os/io.c:365] -> [xserver/os/io.c:365]: (style) Same expression on both sides of '||'.
[xserver/os/io.c:941] -> [xserver/os/io.c:941]: (style) Same expression on both sides of '||'.

This quiets it, and reduces the number of calls Solaris Studio cc
generates to the __errno() function to get the thread-specific errno value.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'jeremyhu/master'
Keith Packard [Wed, 22 Jan 2014 19:28:54 +0000 (11:28 -0800)]
Merge remote-tracking branch 'jeremyhu/master'

10 years agoMerge remote-tracking branch 'anholt/xserver-unifdef'
Keith Packard [Wed, 22 Jan 2014 19:27:36 +0000 (11:27 -0800)]
Merge remote-tracking branch 'anholt/xserver-unifdef'

10 years agoMerge remote-tracking branch 'anholt/glamor-external-rebase'
Keith Packard [Wed, 22 Jan 2014 19:22:35 +0000 (11:22 -0800)]
Merge remote-tracking branch 'anholt/glamor-external-rebase'

10 years agoautoconf: fix warning by replacing AC_WARN with AC_MSG_WARN
Gaetan Nadon [Sun, 22 Dec 2013 00:58:32 +0000 (19:58 -0500)]
autoconf: fix warning by replacing AC_WARN with AC_MSG_WARN

A warning about the macro generating the warnings to the user...

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoxorg-tls: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE
Gaetan Nadon [Sun, 22 Dec 2013 00:58:31 +0000 (19:58 -0500)]
xorg-tls: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE

The code produced in the configure script is identical.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoautoconf: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE
Gaetan Nadon [Sun, 22 Dec 2013 00:58:30 +0000 (19:58 -0500)]
autoconf: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE

The code produced in the configure script is identical.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoautoconf: fix warning, replace AC_TRY_LINK with AC_LINK_IFELSE
Gaetan Nadon [Sun, 22 Dec 2013 00:58:29 +0000 (19:58 -0500)]
autoconf: fix warning, replace AC_TRY_LINK with AC_LINK_IFELSE

The code produced in the configure script is identical.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoautoconf: fix warning by replacing deprecated AC_HELP_STRING
Gaetan Nadon [Sun, 22 Dec 2013 00:58:28 +0000 (19:58 -0500)]
autoconf: fix warning by replacing deprecated AC_HELP_STRING

We can also make do without the workaround introduced in 2005.
The 2.60 autoconf minimum version covers that now.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agolibtool: bump minimum required version to 2.2
Gaetan Nadon [Wed, 4 Dec 2013 18:28:04 +0000 (13:28 -0500)]
libtool: bump minimum required version to 2.2

LT_PREREQ([2.2])
LT_INIT

AC_CONFIG_MACRO_DIR([m4]) is recommended to locate local macros,
which is fully used starting automake 1.14.

ACLOCAL_AMFLAGS in Makefile.am is deprecated since automake 1.14.
The comment is to prevent developers from removing the statement
as suggested in 1.14 which would break earlier versions.

Automake 1.14 is already in use by many.
This patch works on versions prior and post 1.14

References:
Building the X Window System from Source:
http://www.x.org/wiki/Building_the_X_Window_System/#index2h3

Discussion on xorg minimum autotools requirements:
http://lists.x.org/archives/xorg-devel/2013-October/038325.html

Tested with autoconf 2.60, automake 1.10.3 and libtool 2.2

The same upgrade will be applied to libraries and drivers.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoos: restrict display names to digits
Peter Hutterer [Mon, 13 Jan 2014 07:00:23 +0000 (17:00 +1000)]
os: restrict display names to digits

We call atoi() on the server's display to get the socket but otherwise use the
unmodified display for log file name, xkb paths, etc. This results in
Xorg :banana being the equivalent of Xorg :0, except for the log files being
in /var/log/Xorg.banana.log. I'm not sure there's a good use-case for this
behaviour.

Check the display for something that looks reasonable, i.e. digits only, but
do allow for :0.0 (i.e. digits, followed by a period, followed by one or two
digits).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoXQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in Apple...
Jeremy Huddleston Sequoia [Wed, 1 Jan 2014 19:10:41 +0000 (11:10 -0800)]
XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in AppleWMSetWindowMenu

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Check for allocated memory before using it in AppleWMSetWindowMenu
Jeremy Huddleston Sequoia [Wed, 1 Jan 2014 19:04:07 +0000 (11:04 -0800)]
XQuartz: Check for allocated memory before using it in AppleWMSetWindowMenu

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Silence a clang static analysis warning about a memory leak
Jeremy Huddleston Sequoia [Wed, 1 Jan 2014 19:00:40 +0000 (11:00 -0800)]
XQuartz: Silence a clang static analysis warning about a memory leak

It seems the alanyzer can't comprehend dixSetPrivate().

quartz.c:119:12: warning: Potential leak of memory pointed to by 'displayInfo'
    return quartzProcs->AddScreen(index, pScreen);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Silence a clang static analysis warning about a possible memory leak on...
Jeremy Huddleston Sequoia [Wed, 1 Jan 2014 18:55:10 +0000 (10:55 -0800)]
XQuartz: Silence a clang static analysis warning about a possible memory leak on exit

stub.c:356:9: warning: Potential leak of memory pointed to by 'newargv'
        asl_log(aslc, NULL, ASL_LEVEL_ERR,
        ^~~~~~~
stub.c:356:9: warning: Potential leak of memory pointed to by 'newenvp'
        asl_log(aslc, NULL, ASL_LEVEL_ERR,
        ^~~~~~~
2 warnings generated.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Validate length in appledri before swapping
Jeremy Huddleston Sequoia [Wed, 1 Jan 2014 18:47:52 +0000 (10:47 -0800)]
XQuartz: Validate length in appledri before swapping

Avoids potential memory corruption from bad requests

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Validate screen in AppleDRIQueryDirectRenderingCapable requests
Jeremy Huddleston Sequoia [Wed, 1 Jan 2014 18:39:56 +0000 (10:39 -0800)]
XQuartz: Validate screen in AppleDRIQueryDirectRenderingCapable requests

Return an error to the caller rather than crashing the server on
invalid screens.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Simplify hook_run to quiet static analyzer
Jeremy Huddleston Sequoia [Sun, 29 Dec 2013 20:45:23 +0000 (12:45 -0800)]
XQuartz: Simplify hook_run to quiet static analyzer

x-hook.c:96:9: warning: Called function pointer is an uninitalized pointer value
        (*fun[i])(arg, data[i]);
        ^~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Mark applicationWillTerminate: noreturn
Jeremy Huddleston Sequoia [Sun, 29 Dec 2013 20:41:18 +0000 (12:41 -0800)]
XQuartz: Mark applicationWillTerminate: noreturn

X11Controller.m:938:1: warning: method 'applicationWillTerminate:' could be declared with attribute 'noreturn'
      [-Wmissing-noreturn,Semantic Issue]
{
^

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Fix get_proc_address signature
Jeremy Huddleston Sequoia [Sun, 29 Dec 2013 20:36:51 +0000 (12:36 -0800)]
XQuartz: Fix get_proc_address signature

indirect.c:675:28: warning: incompatible pointer types passing 'glx_gpa_proc (*)(const char *)' to parameter of type
      'glx_gpa_proc' (aka 'glx_func_ptr (*)(const char *)') [-Wincompatible-pointer-types,Semantic Issue]
    __glXsetGetProcAddress(&get_proc_address);
                           ^~~~~~~~~~~~~~~~~
../../../glx/glxserver.h:122:42: note: passing argument to parameter 'get_proc_address' here [Semantic Issue]
void __glXsetGetProcAddress(glx_gpa_proc get_proc_address);
                                         ^

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Fix darwinfb.h header guard
Jeremy Huddleston Sequoia [Sun, 29 Dec 2013 20:31:23 +0000 (12:31 -0800)]
XQuartz: Fix darwinfb.h header guard

./darwinfb.h:28:9: warning: '_DARWIN_FB_H' is used as a header guard here, followed by #define of a different macro
      [-Wheader-guard,Lexical or Preprocessor Issue]
        ^~~~~~~~~~~~
./darwinfb.h:29:9: note: '_DARWIN_DB_H' is defined here; did you mean '_DARWIN_FB_H'? [Lexical or Preprocessor Issue]
        ^~~~~~~~~~~~
        _DARWIN_FB_H

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Silence some static analyzer warnings by annotating referencing counts
Jeremy Huddleston Sequoia [Sun, 29 Dec 2013 20:22:55 +0000 (12:22 -0800)]
XQuartz: Silence some static analyzer warnings by annotating referencing counts

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoClean up a few function prototypes to not place formals in /**/
Keith Packard [Sun, 29 Dec 2013 23:18:28 +0000 (15:18 -0800)]
Clean up a few function prototypes to not place formals in /**/

This just removes the comment markers from around the formals in
several function prototypes near where pointer -> void * changes were
made. There are plenty more of these to fix.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
10 years agoReplace 'pointer' type with 'void *'
Keith Packard [Sun, 15 Dec 2013 09:05:51 +0000 (01:05 -0800)]
Replace 'pointer' type with 'void *'

This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoDon't build dmx by default
Keith Packard [Wed, 11 Dec 2013 20:18:49 +0000 (12:18 -0800)]
Don't build dmx by default

It's clearly un-loved, having piles and piles of warnings. If someone
wants to fix it up to compile without warnings, we can re-enable it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agohw/xfree86: nobus.c shouldn't define a static function
Keith Packard [Wed, 11 Dec 2013 20:18:16 +0000 (12:18 -0800)]
hw/xfree86: nobus.c shouldn't define a static function

Having this function be static generates a compiler warning.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agokdrive/ephyr; Don't redeclare monitorResolution
Keith Packard [Wed, 11 Dec 2013 20:17:45 +0000 (12:17 -0800)]
kdrive/ephyr; Don't redeclare monitorResolution

It's already declared in globals.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agokdrive/ephyr: ddxUseMsg is supposed to return
Keith Packard [Wed, 11 Dec 2013 20:16:51 +0000 (12:16 -0800)]
kdrive/ephyr: ddxUseMsg is supposed to return

I'm not sure why ephyr thinks that ddxUseMsg shouldn't return, but
it's not declared to exit.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agovfb: Remove unused pXWDCmap variable
Keith Packard [Wed, 11 Dec 2013 19:55:01 +0000 (11:55 -0800)]
vfb: Remove unused pXWDCmap variable

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86: Switch int10 code to stdint types
Keith Packard [Wed, 11 Dec 2013 19:32:19 +0000 (11:32 -0800)]
xfree86: Switch int10 code to stdint types

CARD32 is not type compatible with uint32_t and ends up generating a
pile of warnings. Fix this by replacing all of the CARD* types with
stdint types.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86: Don't complain when the SDK dependency file doesn't exist yet
Keith Packard [Wed, 11 Dec 2013 19:31:46 +0000 (11:31 -0800)]
xfree86: Don't complain when the SDK dependency file doesn't exist yet

It won't exist until the build is complete, so don't complain about it

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxkb: Make XkbWriteCountedString take a const char * input parameter
Keith Packard [Sun, 17 Nov 2013 07:35:21 +0000 (23:35 -0800)]
xkb: Make XkbWriteCountedString take a const char * input parameter

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoos: xstrtokenize takes and returns const char * now
Keith Packard [Sun, 17 Nov 2013 07:34:59 +0000 (23:34 -0800)]
os: xstrtokenize takes and returns const char * now

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/vbe: Make VBEValidateModes take const char **
Keith Packard [Sun, 17 Nov 2013 07:33:59 +0000 (23:33 -0800)]
xfree86/vbe: Make VBEValidateModes take const char **

mode names are now const

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/shadowfb: GCFuncs and GCOps are now const
Keith Packard [Sun, 17 Nov 2013 07:33:18 +0000 (23:33 -0800)]
xfree86/shadowfb: GCFuncs and GCOps are now const

Change GC private to match and fix resulting warnings

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/parser: make strings in xf86MatchGroup const
Keith Packard [Sun, 17 Nov 2013 07:32:40 +0000 (23:32 -0800)]
xfree86/parser: make strings in xf86MatchGroup const

and fix resulting warnings

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/int10: mark printk as _X_ATTRIBUTE_PRINTF
Keith Packard [Sun, 17 Nov 2013 07:31:55 +0000 (23:31 -0800)]
xfree86/int10: mark printk as _X_ATTRIBUTE_PRINTF

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/fbdevhw: Fix warnings
Keith Packard [Sun, 17 Nov 2013 07:31:06 +0000 (23:31 -0800)]
xfree86/fbdevhw: Fix warnings

Unused fPtr variable. Deal with string constants.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/exa: xf86GetOptValString returns const char * now
Keith Packard [Sun, 17 Nov 2013 07:30:29 +0000 (23:30 -0800)]
xfree86/exa: xf86GetOptValString returns const char * now

fix exaDDXDriverInit to match.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/dri: Mark DRIDrvMsg and dri_drm_debug_print _X_ATTRIBUTE_PRINTF
Keith Packard [Sun, 17 Nov 2013 07:29:30 +0000 (23:29 -0800)]
xfree86/dri: Mark DRIDrvMsg and dri_drm_debug_print _X_ATTRIBUTE_PRINTF

And fix resulting warnings.

v2: (Adam Jackson) Cast handles through uintptr_t to avoid size change warnings

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/common: handle string constants in xf86Xinput configuration
Keith Packard [Sun, 17 Nov 2013 07:28:48 +0000 (23:28 -0800)]
xfree86/common: handle string constants in xf86Xinput configuration

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/common: Const GC funcs and ops in xf86VAarbiter
Keith Packard [Sun, 17 Nov 2013 07:28:16 +0000 (23:28 -0800)]
xfree86/common: Const GC funcs and ops in xf86VAarbiter

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/config: Kludge around const strings
Keith Packard [Sun, 17 Nov 2013 07:26:19 +0000 (23:26 -0800)]
xfree86/config: Kludge around const strings

defaultFontPath is now a const char * so that it can be initialized
from a string constant. This patch kludges around that by inserting
suitable casts to eliminate warnings. Fixing this 'correctly' would
involve inserting some new variables and conditionals to use them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoconfig/udev: handle const strings
Keith Packard [Sun, 17 Nov 2013 07:25:50 +0000 (23:25 -0800)]
config/udev: handle const strings

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agocomposite: Remove unused pScreen variables
Keith Packard [Sun, 17 Nov 2013 07:24:03 +0000 (23:24 -0800)]
composite: Remove unused pScreen variables

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agotest: Warning cleanup
Keith Packard [Fri, 15 Nov 2013 14:02:05 +0000 (06:02 -0800)]
test: Warning cleanup

const char in test/xfree86.c. Cast values to (intmax_t) for %ju format
in test/signal-logging.c.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxi: More warning cleanup for input
Keith Packard [Fri, 15 Nov 2013 14:00:44 +0000 (06:00 -0800)]
xi: More warning cleanup for input

Lots more const char stuff.

Remove duplicate defs of CoreKeyboardProc and CorePointerProc from
test/xi2/protocol-common.c

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoXext: Clean up warnings in hashtable code
Keith Packard [Fri, 15 Nov 2013 13:55:38 +0000 (05:55 -0800)]
Xext: Clean up warnings in hashtable code

Make keys const void *

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoexa: Clean up warnings
Keith Packard [Fri, 15 Nov 2013 13:41:54 +0000 (05:41 -0800)]
exa: Clean up warnings

Declare GC ops/funcs as const.
Use 'typeof' in the 'swap' macro to capture the right type.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxkb: Clean up warnings
Keith Packard [Fri, 15 Nov 2013 13:28:47 +0000 (05:28 -0800)]
xkb: Clean up warnings

Add const to lots of strings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoos: Clean up warnings
Keith Packard [Fri, 15 Nov 2013 13:19:24 +0000 (05:19 -0800)]
os: Clean up warnings

Just const char stuff.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoXext: Clean up warnings
Keith Packard [Fri, 15 Nov 2013 13:05:44 +0000 (22:05 +0900)]
Xext: Clean up warnings

GC funcs and ops are const.
Remove unused variables.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agodamage: Clean up warnings
Keith Packard [Fri, 15 Nov 2013 13:02:58 +0000 (22:02 +0900)]
damage: Clean up warnings

GC funcs and ops are const now, so all wrappers need to declare them
as such.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoClean up warnings in mi.
Keith Packard [Fri, 15 Nov 2013 13:00:29 +0000 (22:00 +0900)]
Clean up warnings in mi.

A coupel of unused variables, and some debug code with mis-matching
printf format and variable types.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoClean up warnings in DIX
Keith Packard [Fri, 15 Nov 2013 12:57:05 +0000 (21:57 +0900)]
Clean up warnings in DIX

As usual, mostly const char changes. However, filter_device_events had
a potentially uninitialized value, 'raw', which I added a bunch of
checks for. I suspect most of those are 'can't happen', but it's hard
to see that inside the function.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agohw/xfree86: More const declarations for strings
Keith Packard [Fri, 15 Nov 2013 09:07:54 +0000 (18:07 +0900)]
hw/xfree86: More const declarations for strings

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoJust remove dpms functsion from xf86.h
Keith Packard [Fri, 15 Nov 2013 09:06:37 +0000 (18:06 +0900)]
Just remove dpms functsion from xf86.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoBunch of DMX warning fixes
Keith Packard [Fri, 15 Nov 2013 08:55:15 +0000 (17:55 +0900)]
Bunch of DMX warning fixes

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoMore warning fixes in hw/xfree86
Keith Packard [Fri, 15 Nov 2013 08:43:46 +0000 (17:43 +0900)]
More warning fixes in hw/xfree86

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86 warning reduction
Keith Packard [Fri, 15 Nov 2013 08:36:26 +0000 (17:36 +0900)]
xfree86 warning reduction

This gets the easy warnings, mostly constant string problems.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoXext: _X_EXPORT DPMSSet and DPMSSupported
Keith Packard [Sun, 17 Nov 2013 07:44:51 +0000 (23:44 -0800)]
Xext: _X_EXPORT DPMSSet and DPMSSupported

These are needed by drivers, and it's better to export them from here
rather than redefining them in hw/xfree86 and exporting them from there.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoinclude: Make xkbrules structures all const char *
Keith Packard [Sun, 17 Nov 2013 07:43:49 +0000 (23:43 -0800)]
include: Make xkbrules structures all const char *

This lets them be initialized with string constants

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86/common: Warning fixes. Mostly const string handling.
Keith Packard [Fri, 15 Nov 2013 07:56:15 +0000 (16:56 +0900)]
xfree86/common: Warning fixes. Mostly const string handling.

Also removes DPMS functiosn from Xext/dpmsproc.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agohw/xfree86: Lots of constant string support
Keith Packard [Fri, 15 Nov 2013 07:24:15 +0000 (16:24 +0900)]
hw/xfree86: Lots of constant string support

Make lots of string pointers 'const char' so that we can use constant
strings with them without eliciting warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agohw/xfree86: Make strings in DriverRec and ScrnInfoRec const
Keith Packard [Fri, 15 Nov 2013 04:40:30 +0000 (13:40 +0900)]
hw/xfree86: Make strings in DriverRec and ScrnInfoRec const

This avoids compiler warnings when initializing with string constants.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoephyr: don't allow a shift+ctrl keygrab if mod1 was enabled
Peter Hutterer [Thu, 9 Jan 2014 05:29:23 +0000 (15:29 +1000)]
ephyr: don't allow a shift+ctrl keygrab if mod1 was enabled

Xephyr wants ctrl+shift to grab the window, but that conflicts with
ctrl+alt+shift key combos. Remember the modifier state on key presses and
releases, if mod1 is pressed, we need ctrl, shift and mod1 released
before we allow a shift-ctrl grab activation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoXi: Ensure DeviceChanged is emitted after grabs are deactivated
Carlos Garnacho [Thu, 2 Jan 2014 20:33:30 +0000 (21:33 +0100)]
Xi: Ensure DeviceChanged is emitted after grabs are deactivated

When a grab on a slave device is deactivated, the master device must
be checked, just in case there were events from other devices while
the slave device was stolen away by the passive grab. This may
introduce misbehaviors on mismatching valuators and device features
later on UpdateDeviceState().

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoCheckPassiveGrabsOnWindow() needs to handle NULL return value from AllocGrab()
Alan Coopersmith [Tue, 7 Jan 2014 01:10:40 +0000 (17:10 -0800)]
CheckPassiveGrabsOnWindow() needs to handle NULL return value from AllocGrab()

CheckPassiveGrabsOnWindow() calls AllocGrab() which can fail and return NULL.
This return value is not checked, and can cause NULL pointer dereferences.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoGrabDevice() needs to handle NULL return value from AllocGrab()
Alan Coopersmith [Tue, 7 Jan 2014 01:10:39 +0000 (17:10 -0800)]
GrabDevice() needs to handle NULL return value from AllocGrab()

GrabDevice() calls AllocGrab() which can fail and return NULL.
This return value is not checked, and can cause NULL pointer dereferences.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoIf AllocGrab() fails to set up grab, don't copy to a NULL grab
Alan Coopersmith [Tue, 7 Jan 2014 01:10:38 +0000 (17:10 -0800)]
If AllocGrab() fails to set up grab, don't copy to a NULL grab

If either the initial calloc or the xi2mask_new fails, grab is NULL,
but if a src grab is passed in, it was always being written to by
CopyGrab (and if that failed, dereferenced again in teardown).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoBump release to 1.15.99.900
Keith Packard [Thu, 9 Jan 2014 03:10:11 +0000 (11:10 +0800)]
Bump release to 1.15.99.900

The merge window for 1.16 is open

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoxfree86: Use the TMDS maximum frequency to prune modes
Damien Lespiau [Wed, 31 Jul 2013 18:16:45 +0000 (19:16 +0100)]
xfree86: Use the TMDS maximum frequency to prune modes

Instead of only relying on the Range section, we can do better on
HDMI to find out what is the max dot clock the monitor supports. The
HDMI CEA vendor block adds a TMDS max freq we can use.

This makes X not prune 4k resolutions on HDMI.

v2: Replace X_INFO by X_PROBED in the message that prints the max
    TMDS frequency (Chris Wilson)

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoxfree86: Refactor xf86MonitorIsHDMI() using xf86MonitorFindHDMIBlock()
Damien Lespiau [Wed, 7 Aug 2013 14:16:21 +0000 (15:16 +0100)]
xfree86: Refactor xf86MonitorIsHDMI() using xf86MonitorFindHDMIBlock()

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoxfree86: Add a xf86MonitorFindHDMIBlock()
Damien Lespiau [Wed, 31 Jul 2013 18:11:45 +0000 (19:11 +0100)]
xfree86: Add a xf86MonitorFindHDMIBlock()

The HDMI CEA vendor specific block has some interesting information,
such as the maximum TMDS dot clock.

v2: Don't parse CEA blocks with invalid offsets, remove spurious
    brackets (Chris Wilson)

v3: Fix the looping through the CEA data blocks, it had a typo using the
    wrong variable coming from the code it was ported from.
    Replace x << 16 + y << 8 + z by x << 16 | y << 8 | z
    (Chris Wilson)

v4: Remove the stray ';' at the end of "if (*end == 0)".
    (Dominik Behr on IRC)

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoglx: unifdef swrast dri_interface.h values from Mesa 7.1.
Eric Anholt [Mon, 16 Dec 2013 18:52:19 +0000 (10:52 -0800)]
glx: unifdef swrast dri_interface.h values from Mesa 7.1.

We can't remove all the ifdefs (__DRI_TEX_BUFFER_VERSION) because
configure.ac is only checking for that version of Mesa in the absence
of dri2.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglx: unifdef for DRI2 dri_interface.h things in mesa 9.2.
Eric Anholt [Tue, 5 Nov 2013 19:41:06 +0000 (11:41 -0800)]
glx: unifdef for DRI2 dri_interface.h things in mesa 9.2.

Thanks to configure.ac's check, we know that we have a new enough
dri_interface.h that we don't need to conditionalize all this code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoBump version to 1.15.0 xorg-server-1.15.0
Keith Packard [Fri, 27 Dec 2013 17:50:55 +0000 (09:50 -0800)]
Bump version to 1.15.0

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agopresent: Set complete notify mode to Skip as needed
Keith Packard [Thu, 12 Dec 2013 23:48:08 +0000 (15:48 -0800)]
present: Set complete notify mode to Skip as needed

Skipped present pixmap calls were not setting the mode to
PresentCompleteModeSkip for skipped operations.

Signed-off-by: Keith Packard <keithp@keithp.com>