platform/upstream/xorg-server.git
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>
10 years agopresent: Don't abandon presents which are already queued for flip
Keith Packard [Thu, 12 Dec 2013 22:52:35 +0000 (14:52 -0800)]
present: Don't abandon presents which are already queued for flip

Presents which are not marked 'queued' and are in the window present
list are waiting for the flip event; discarding those won't work very
well (it'll end up trashing displayed content for the next frame), so
skip over those when looking for duplicate frame presents

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agopresent: Handle PresentOptionAsync for copy mode
Keith Packard [Thu, 12 Dec 2013 22:17:40 +0000 (14:17 -0800)]
present: Handle PresentOptionAsync for copy mode

Check for Async flag and execute immediately if set, otherwise wait
for the next appropriate vblank before copying.

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoBump version to 1.14.99.905 (1.15 RC5) xorg-server-1.14.99.905
Keith Packard [Thu, 19 Dec 2013 22:31:07 +0000 (14:31 -0800)]
Bump version to 1.14.99.905 (1.15 RC5)

Another week, another RC. This should be the last before 1.15 final

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Thu, 19 Dec 2013 22:14:59 +0000 (14:14 -0800)]
Merge remote-tracking branch 'whot/for-keith'

10 years agolibglamoregl: remove -I$(top_srcdir)/src
Gaetan Nadon [Tue, 10 Dec 2013 16:13:32 +0000 (11:13 -0500)]
libglamoregl: remove -I$(top_srcdir)/src

Automake always provide -I. It is at the beginning of the list of compiler
options.

Not needed either to find glamor_egl.c source.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoMake: remove cruft copied over from the X server makefiles
Gaetan Nadon [Tue, 10 Dec 2013 16:13:31 +0000 (11:13 -0500)]
Make: remove cruft copied over from the X server makefiles

In toplevel makefile:
nostdinc: only xserver, no other X modules
aclocaldir: no local macros to install
xkb_path: xserver only
"Gross hack": xserver only

In src/makefile:
SOLARIS_ASM_CFLAGS; server only
XORG_INCS: undefined variable
DIX_CFLAGS: undefined variable

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoglamor: fix leak in xv code.
Dave Airlie [Fri, 13 Dec 2013 01:33:46 +0000 (11:33 +1000)]
glamor: fix leak in xv code.

This loop needed to go one higher, not sure if this fixes the leak
MrCooper was seeing on irc, but it fixes a leak.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoFix glamor_egl->egl_create_image_khr makes pointer from integer
Gaetan Nadon [Sun, 8 Dec 2013 21:43:08 +0000 (16:43 -0500)]
Fix glamor_egl->egl_create_image_khr makes pointer from integer

This is a warning, but a real problem can occur on some system.

Reported-by: Fabio Pedretti <fabio.ped@libero.it>
Reviewed-by: Axel Davy <davyaxel@free.fr>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoAdd DRI3 support to glamor
Axel Davy [Thu, 5 Dec 2013 07:49:15 +0000 (08:49 +0100)]
Add DRI3 support to glamor

This implements some DRI3 helpers to help the DDXs using
glamor to support DRI3.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoFixed some compilation warning/error or error checking.
Zhigang Gong [Tue, 19 Nov 2013 07:16:57 +0000 (15:16 +0800)]
Fixed some compilation warning/error or error checking.

There is one compilation error ,cast int to pointer, when built without
libgbm, reported by Gaetan Nadon.
And some error checking after memory allocation, reported by Seth Arnold.
There are still some similar issues in the largepixmap implementation.
They are relatively more complicate due to the heavy usage of RegionXXX
APIs which may allocate implicitly. Will fix them in the future.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Tested-by: Gaetan Nadon <memsize@videotron.ca>
10 years agoAllow to create textured pixmaps from gbm_bo without using gem names
Axel Davy [Mon, 18 Nov 2013 21:52:22 +0000 (22:52 +0100)]
Allow to create textured pixmaps from gbm_bo without using gem names

This implements glamor_egl_create_textured_pixmap_from_gbm_bo,
which is similar to glamor_egl_create_textured_pixmap, except
it takes a gbm_bo as argument.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoglamor: remove unused variable
Fabio Pedretti [Mon, 4 Nov 2013 11:08:42 +0000 (12:08 +0100)]
glamor: remove unused variable

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agofixup picture in SetWindowPixmap
Maarten Lankhorst [Wed, 6 Nov 2013 09:25:27 +0000 (10:25 +0100)]
fixup picture in SetWindowPixmap

When creating a window with recordmydesktop running, the following may happen:

create picture 0x1cd457e0, with drawable 0x1327d1f0
(SetWindowPixmap is called)
destroy picture 0x1cd457e0, with drawable 0x1cd65820

Obtaining format for pixmap 0x1327d1f0 and picture 0x1cd457e0
==7989== Invalid read of size 4
==7989==    at 0x8CAA0CA: glamor_get_tex_format_type_from_pixmap (glamor_utils.h:1252)
==7989==    by 0x8CAD1B7: glamor_download_sub_pixmap_to_cpu (glamor_pixmap.c:1074)
==7989==    by 0x8CA8BB7: _glamor_get_image (glamor_getimage.c:66)
==7989==    by 0x8CA8D2F: glamor_get_image (glamor_getimage.c:92)
==7989==    by 0x29AEF2: miSpriteGetImage (misprite.c:413)
==7989==    by 0x1E7674: compGetImage (compinit.c:148)
==7989==    by 0x1F5E5B: ProcShmGetImage (shm.c:684)
==7989==    by 0x1F686F: ProcShmDispatch (shm.c:1121)
==7989==    by 0x15D00D: Dispatch (dispatch.c:432)
==7989==    by 0x14C569: main (main.c:298)
==7989==  Address 0x1cd457f0 is 16 bytes inside a block of size 120 free'd
==7989==    at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7989==    by 0x228897: FreePicture (picture.c:1477)
==7989==    by 0x228B23: PictureDestroyWindow (picture.c:73)
==7989==    by 0x234C19: damageDestroyWindow (damage.c:1646)
==7989==    by 0x1E92C0: compDestroyWindow (compwindow.c:590)
==7989==    by 0x20FF85: DbeDestroyWindow (dbe.c:1389)
==7989==    by 0x185D46: FreeWindowResources (window.c:907)
==7989==    by 0x1889A7: DeleteWindow (window.c:975)
==7989==    by 0x17EBF1: doFreeResource (resource.c:873)
==7989==    by 0x17FC1B: FreeClientResources (resource.c:1139)
==7989==    by 0x15C4DE: CloseDownClient (dispatch.c:3402)
==7989==    by 0x2AB843: CheckConnections (connection.c:1008)
==7989==
(II) fail to get matched format for dfdfdfdf

The fix is to update the picture pointer when the window pixmap is changed,
so it moves the picture around with the window rather than the pixmap.

This makes FreePicture work correctly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71088
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoFixed an incorrect printf format.
Zhigang Gong [Fri, 1 Nov 2013 16:08:11 +0000 (00:08 +0800)]
Fixed an incorrect printf format.

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

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoRemove useless return statement
Brian Paul [Sat, 19 Oct 2013 22:10:54 +0000 (16:10 -0600)]
Remove useless return statement

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoRemove redundant dispatch->glEnable(GL_TEXTURE_2D)
Brian Paul [Sat, 19 Oct 2013 22:10:53 +0000 (16:10 -0600)]
Remove redundant dispatch->glEnable(GL_TEXTURE_2D)

The same call was already made a few lines earlier.

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoFix _glamor_set_spans() bug (re-used 'n' variable)
Brian Paul [Sat, 19 Oct 2013 22:10:52 +0000 (16:10 -0600)]
Fix _glamor_set_spans() bug (re-used 'n' variable)

n was used as a function parameter.  But inside the for (i=1..n) loop,
n got reassigned as REGION_NUM_RECTS() and then decremented to zero by
the while loop.  This caused the for loop to only iterate once instead
of 'n' times.

This patch renames the n parameter to numPoints.

Found by code inspection.  Untested.

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoglamor_render: fix PictFilters
Grigori Goronzy [Tue, 1 Oct 2013 22:37:57 +0000 (00:37 +0200)]
glamor_render: fix PictFilters

Add Fast/Good/Best and appropriately map to Nearest and
Bilinear. Additionally, add a fallback path for unsupported filters.

Notably, this fixes window shadow rendering with Compiz, which uses
PictFilterConvolution for some odd reason.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
10 years agoUse GL_STATIC_DRAW for element index buffer
Grigori Goronzy [Tue, 1 Oct 2013 22:37:56 +0000 (00:37 +0200)]
Use GL_STATIC_DRAW for element index buffer

The buffer never changes anyway.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>