Commit Graph

14619 Commits

Author SHA1 Message Date
Adam Jackson
b184a863c1 fb: Hide some zero-width line details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:52 -04:00
Adam Jackson
266cd552bd fb: Hide glyph implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:48 -04:00
Adam Jackson
e572bcc7f4 fb: Remove even/odd tile slow-pathing
Again, clearly meant to be a fast path, but this turns out not to be the
case.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:46 -04:00
Adam Jackson
836bb27726 fb: Remove unused fbReduceRasterOp
Appears to have been cargo-culted in from cfb and then never used.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:44 -04:00
Adam Jackson
167ccd33e0 fb: Move fbStipple*Bits near their only consumer
And remove fbStippleTable since gcc can't figure that out itself.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:41 -04:00
Adam Jackson
7430fdb689 fb: Remove even/odd stipple slow-pathing
This is clearly meant to be a fast path, but it appears to be a net
loss at this point.

If you really wanted to ricer-tune here, note that the inner loop of
fbBltOne is a bit too complicated for gcc (at least 4.8.2), it doesn't
specialize the loop for the handful of legal values of bitsPerDst, which
means computing at runtime what could have been const-propped.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:38 -04:00
Adam Jackson
a198373685 fb: FB_SHIFT is 5 (and FB_UNIT is 32)
The other paths don't build or work, PCI and other buses are almost
always 32 bit data paths, and X doesn't really support pixels bigger
than that anyway.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:37 -04:00
Adam Jackson
3d35bd6b79 fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane
gcc doesn't appear to be smart enough to fold away the indirection here,
even if you make fbLaneTable const.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:30 -04:00
Adam Jackson
86ce626297 mi: Fold micursor.c into mipointer.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:29 -04:00
Adam Jackson
3b63900e90 mi: Fold mipolyutil.c into mipoly.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:28 -04:00
Adam Jackson
21b041ef48 mi: Fold mipoly{con,gen}.c into mipoly.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:26 -04:00
Adam Jackson
7679afd4da mi: Fold mifpolycon.c into miarc.c
Also put mifpoly.h on a diet, and stop including it from places that
don't need it.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:24 -04:00
Adam Jackson
f307ef10f4 mi: Fold mispans.c into miwideline.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:22 -04:00
Adam Jackson
707965407a mi: Unexport arc fill implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:21 -04:00
Adam Jackson
ce8fff5cd6 mi: Unexport subpixel polygon implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:19 -04:00
Adam Jackson
a085ba82bd mi: Unexport span group implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:18 -04:00
Adam Jackson
c15c886ee7 mi: Unexport polygon edge table implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:16 -04:00
Adam Jackson
9bdc9b0113 mi: Unexport wide line details
XAA wanted these, once upon a time, but that's gone now.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:01 -04:00
Keith Packard
d181e52ceb glamor: Free converted bits in _glamor_upload_bits_to_pixmap_texture fast path
When uploading bits to a texture which need reformatting to match a
supported GL format, a temporary buffer is allocated to hold the
reformatted bits. This gets freed in the general path, but is not
freed in the fast path because that includes an early return before
the call to free.

This patch removes the early return and places the general case under
an 'else' block, so that both paths reach the call to free.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-26 17:00:17 -07:00
Andreas Hartmetz
55b27ed70c glamor: Don't free memory we are going to use.
glamor_color_convert_to_bits() returns its second argument on
success, NULL on error, and need_free_bits already makes sure that
"bits" aliasing converted_bits is freed in the success case.
Looks like the memory leak that was supposed to be fixed in
6e50bfa706 only occurred in the error
case.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-26 17:00:17 -07:00
Alan Coopersmith
16a32c53f6 If fork fails in System(), don't fallthrough to exec()
In the unlikely event of a failure in creating processes, signal
masks will fall from the panels above you.  Secure your mask before
telling your child what to do, since it won't exist, and you will
instead cause the server itself to be replaced by a shell running
the target program.

Found by Coverity #53397: Missing break in switch
Execution falls through to the next case statement or default;
 this might indicate a common typo.
In System: Missing break statement between cases in switch statement (CWE-484)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-23 17:32:14 -07:00
Alan Coopersmith
7e5bc49d1e Allocate enough room for both reset & flags attributes
ctx_attribs had room for 3 pairs of attributes, but if both flags & reset
attributes were being returned it was storing 4 pairs in the array.

Found by Coverity #53442:  Out-of-bounds write
This could cause an immediate crash or incorrect computations.
In create_driver_context: Out-of-bounds write to a buffer (CWE-119)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-23 17:31:59 -07:00
Adam Jackson
cffd4e4a4e mi: Mark the span blit routines as _X_COLD
On gcc, __attribute__((cold)) means:

- consider calls to the function to be unlikely for branch prediction
- optimize the function for size
- emit the function in a dedicated cold text section

It's not worth deleting these routines even though there are no longer
in-tree consumers, but we can at least keep them out of i$ at runtime.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-23 17:30:32 -07:00
Keith Packard
de55aafa8f Merge remote-tracking branch 'ajax/xwin' 2014-10-23 17:28:24 -07:00
Adam Jackson
462bf87c4d render: Always store client clip as a region
This does have one semantic change.  FixesCreateRegionFromPicture used to
throw BadImplementation if you tried to create a region from a picture
with no client clip.  I changed that to BadMatch here since that more
honestly describes what's going on.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-23 14:35:49 -07:00
Adam Jackson
3f4edd2e3f xinerama: Fix access mode in GetImage's drawable lookup
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-23 14:29:49 -07:00
William ML Leslie
942e18e17e Xephyr: option to disable grabbing the host
This patch makes it possible to use C-S key combinations
within Xephyr without losing access to the host window manager's
commands.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-10-22 14:16:16 -07:00
Jon TURNEY
7ea4a21fee configure.ac: Force --disable-libdrm on Cygwin
This is now needed to avoid trying to build the modesetting driver by default
when building the Xorg DDX on Cygwin.

http://tinderbox.x.org/builds/2014-09-18-0011/logs/xserver/#build

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-10-09 16:49:29 +01:00
Jon TURNEY
883927d2e8 configure.ac: Avoid "Your OS is unknown" warning when configuring for Cygwin
Don't emit "Your OS is unknown" warning when configuring with --enable-xorg to
build the XOrg DDX for Cygwin.

The list of supported OSes is getting a bit unwieldy, so just remove it.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-10-09 16:42:50 +01:00
Jon TURNEY
549b3175af hw/xwin: Fix unused variable warning in winCreateMsgWindow()
winmsgwindow.c:99:11: warning: variable ‘winClass’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:35:54 +01:00
Jon TURNEY
5adfb566fe hw/xwin: Fix redundant declaration warning in winprefslex.l
winprefslex.l:40:12: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls]
winprefsyacc.h:130:5: note: previous declaration of ‘yyparse’ was here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:35:20 +01:00
Jon TURNEY
8f062f7380 hw/xwin: Fix warning in yyerror()
winprefsyacc.y:257:3: warning: nested extern declaration of ‘yylineno’ [-Wnested-externs]

Promote yylineno declaration to file scope

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:34:48 +01:00
Jon TURNEY
f0f0c92a08 hw/xwin: Fix const warning in winPrefsLoadPreferences()
winprefs.c:643:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:34:12 +01:00
Jon TURNEY
593c6b1934 hw/xwin: Fix const warnings in winprefsyacc.y
winprefsyacc.y:174:5: warning: passing argument 1 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default]
winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’
winprefsyacc.y:174:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default]
winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’
winprefsyacc.y:175:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default]
winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’
winprefsyacc.y:178:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default]
winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’
winprefsyacc.c:1737:9: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default]
winprefsyacc.y:82:12: note: expected ‘char *’ but argument is of type ‘const char *’
winprefsyacc.c:1854:3: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:33:41 +01:00
Jon TURNEY
394ad25959 hw/xwin: Fix const warning in winCheckDisplayNumber()
InitOutput.c:1032:19: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:33:04 +01:00
Jon TURNEY
701492e5d9 hw/xwin: Fix warning in winXIconToHICON()
winmultiwindowicons.c:403:29: warning: passing argument 8 of ‘XGetWindowProperty’ from incompatible pointer type [enabled by default]
/usr/include/X11/Xlib.h:2688:12: note: expected ‘Atom *’ but argument is of type ‘long unsigned int *’

Looks like this has been wrong since I added it in 527cf131 :-(

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:32:31 +01:00
Jon TURNEY
a14f1d94d5 hw/xwin: Fix format warnings with debug printing of pointers on 64-bit
Fix various pieces of debug output, mainly under --enable-debug, which use a
"%08x" printf format for a pointer type. Use "%p" format for 64-bit portability.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:31:58 +01:00
Jon TURNEY
03d462ddd2 hw/xwin: Fix warnings in glx/glshim.c
glext.h currently requires GL_GLEXT_PROTOTYPES in order to prototype
glCompressedTexImmage* functions

generated_gl_shim.c:2859:6: warning: no previous prototype for 'glCompressedTexImage3DARB' [-Wmissing-prototypes]
generated_gl_shim.c:2866:6: warning: no previous prototype for 'glCompressedTexImage2DARB' [-Wmissing-prototypes]
generated_gl_shim.c:2873:6: warning: no previous prototype for 'glCompressedTexImage1DARB' [-Wmissing-prototypes]
generated_gl_shim.c:2880:6: warning: no previous prototype for 'glCompressedTexSubImage3DARB' [-Wmissing-prototypes]
generated_gl_shim.c:2887:6: warning: no previous prototype for 'glCompressedTexSubImage2DARB' [-Wmissing-prototypes]
generated_gl_shim.c:2894:6: warning: no previous prototype for 'glCompressedTexSubImage1DARB' [-Wmissing-prototypes]
generated_gl_shim.c:2901:6: warning: no previous prototype for 'glGetCompressedTexImageARB' [-Wmissing-prototypes]

Also, explicitly prototype glXGetProcAddressARB(), as glx/glxdri*.c does, as
it's not practical to include glx.h here...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:31:25 +01:00
Jon TURNEY
329e8125aa hw/xwin: Fix compilation with -Werror=declaration-after-statement
xevents.c: In function 'winClipboardInitMonitoredSelections':
xevents.c:129:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < CLIP_NUM_SELECTIONS; ++i)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:30:49 +01:00
Jon TURNEY
97c3298caa hw/xwin: Fix compilation with -Werror=return-type
winshadddnl.c: In function ‘winRedrawScreenShadowDDNL’:
winshadddnl.c:991:9: error: ‘return’ with no value, in function returning non-void [-Werror=return-type]

Just wrong in 1c34e774

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:29:55 +01:00
Keith Packard
61a292adf4 glx: check return from __glXGetAnswerBuffer
This function can return NULL; make sure every caller tests for that.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-09 15:30:52 +02:00
Keith Packard
d634ecdf82 Merge remote-tracking branch 'ajax/dead-code' 2014-10-09 15:08:31 +02:00
Keith Packard
6622f0cb17 Merge remote-tracking branch 'ajax/mi-cleanup' 2014-10-09 15:05:26 +02:00
Keith Packard
f12e7f4980 Merge remote-tracking branch 'anholt/modesetting-glamor' 2014-10-09 14:21:19 +02:00
Alan Coopersmith
da887726ee Use unique display name for each xi2 test program [v3]
make -j 8 check was sporadically failing in different xi2 tests.
After adding the asserts in the previous commit to catch xkb failure
it became easier to catch the failures and see that multiple tests
were running at once trying to write to /tmp/server-(null).xkm and
then delete it, and interfering with each other.

Putting a unique string into the display variable let them each write
to their own file and not interfere with others.

v2: Fix Linux bits:

  Add #include <errno.h> to get a declaration of
  program_invocation_name on Linux.

  Use only the last portion of the pathname so that the resulting
  display name doesn't contain any slashes.

v3: use program_invocation_short_name on Linux

  This is the same as program_invocation_name, except is has
  stripped off any path prefix.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-09 14:15:45 +02:00
Adam Jackson
5ecd7866f7 misc: Fold together some redundant conditionals
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:19:06 +02:00
Adam Jackson
5b07f1db6d fb: fb{Map,Unmap}Window -> fb{Realize,Unrealize}Window
Make the function names match the screen slot name.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00
Adam Jackson
9ed83a694b mi: miSlideAndSizeWindow -> miResizeWindow
Make the function name match the screen slot name.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00
Adam Jackson
939ca767c7 dix: Remove an obfuscatory macro
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00
Adam Jackson
d138d9ccc6 dix: Remove some pointless casting of NULL
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00