Keith Packard [Wed, 2 Apr 2014 03:54:22 +0000 (20:54 -0700)]
glamor: Bail from composite when pixmap cannot be uploaded
I think the sense of the return value was just flipped here; if you
return TRUE, then the calling code assumes that the pixmap *has* been
uploaded and that an FBO is available. When it tries to use it, it
crashes though. Returning false makes the caller bail back to software.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:21 +0000 (20:54 -0700)]
glamor: Remove warning message when pixmap cannot be stored in a texture
This happens when you have 4bpp pixmaps; it's not an error, so stop
flooding the log file when it happens.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:20 +0000 (20:54 -0700)]
glamor: Public polyLines function is glamor_poly_lines_nf
There was a spurious declaratoin in glamor.h for glamor_poly_line_nf
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:19 +0000 (20:54 -0700)]
glamor: Initialize XV shaders from glamor_xv_init instead of glamor_init
The glamor_init calls to glamor_init_xv_shader were never getting run
because GLAMOR_XV was never defined. Instead of trying to make that
work, fix glamor_xv_init to make the call instead.
Further, just get rid of the glamor_fini_xv_shader function entirely
as the shader program will be destroyed when the context is destroyed
at server reset time.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:18 +0000 (20:54 -0700)]
glamor: SetWindowPixmap is not related to RENDER
Move the configuration of screen->SetWindowPixmap out from under it.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:15 +0000 (20:54 -0700)]
glamor: glamor_poly_point_nf cannot fail for non-DDX pixmaps
All of the glamor _nf functions must check to see if the DDX can
access the pixmap directly before returning failure back to the
driver; this restructures the point code to split out the _nf checking
from the _gl code.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Fri, 21 Mar 2014 20:13:27 +0000 (13:13 -0700)]
Revert "glx: Make sure we get an FBConfig the root window's visual."
This reverts commit
b5a61239e2fef167c229154d7919ff862503e3f3.
Not only did I screw up and introduce a warning, it turns out
glXChooseFBConfig() explicitly ignores this attribute. Thanks, GLX.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Keith Packard [Thu, 3 Apr 2014 17:44:28 +0000 (10:44 -0700)]
Merge remote-tracking branch 'whot/for-keith'
Peter Hutterer [Wed, 2 Apr 2014 03:55:10 +0000 (13:55 +1000)]
Revert "xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP"
This was the wrong fix to the problem, and it triggered a change in XKB
behavior: previously a button event would unlock a latched modifier, now it
doesn't anymore.
https://bugs.freedesktop.org/show_bug.cgi?id=73155
Note that the new behavior is is strictly spec compliant but we've had the
other behavior for a long time so we shouldn't break it.
The bug this patch originally fixed was a null-pointer dereference when
releasing button events on server shutdown. This was addressed by the commit
below, so the need for this patch has gone away anyway.
commit
3e4be4033aed78b2bb3a18d51f0963989efd1af3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri Jan 25 11:47:32 2013 +1000
dix: when shutting down slave devices, shut down xtest devices last
This reverts commit
2decff6393a44b56d80d53570718f95354fde454.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 1 Apr 2014 09:24:17 +0000 (11:24 +0200)]
xf86LogInit: log to XDG_DATA_HOME when not running as root
When no logfile was specified (xf86LogFileFrom == X_DEFAULT) and we're not
running as root log to $XDG_DATA_HOME/xorg/Xorg.#.log as Xorg won't be able to
log to the default /var/log/... when it is not running as root.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 26 Mar 2014 11:24:49 +0000 (12:24 +0100)]
configure: Change DEFAULT_LOGPREFIX to really be a filename prefix
Rather then a full path prefix, this is a preparation patch for adding
support for logging to another location when not running as root.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Keith Packard [Tue, 1 Apr 2014 06:24:56 +0000 (23:24 -0700)]
Merge remote-tracking branch 'jturney/master'
Adam Jackson [Thu, 27 Mar 2014 15:48:39 +0000 (11:48 -0400)]
mi: Hush extension initialization (#75870)
Printing these as ErrorF is fairly obnoxious, since it means the
non-hardware servers now spew stuff to the console for entirely routine
events. And actually, printing these at all is fairly obnoxious, since
a) we're printing a line for every extension, whether it's enabled or
not, and b) we're not actually initializing the extension at this point.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Tue, 25 Mar 2014 15:21:16 +0000 (08:21 -0700)]
fb: fix fast-path blt detection
The width parameter is used to disable the blit fast-path (memcpy) when
source and destination rows overlap in memory. This check was added in [0].
Unfortunately, the calculation to determine if source and destination
lines overlapped was incorrect:
(1) it converts width from pixels to bytes, but width is actually in
bits, not pixels.
(2) it adds this byte offset to dst/srcLine, which implicitly converts
the offset from bytes to sizeof(FbBits).
Fix both of these by converting addresses to byte pointers and width
to bytes and doing comparisons on the resulting byte address.
For example:
A 32-bpp 1366 pixel-wide row will have
width = 1366 * 32 = 43712 bits
bpp = 32
(bpp >> 3) = 4
width * (bpp >> 3) = 174848 FbBits
(FbBits *)width => 699392 bytes
So, "careful" was true if the destination line was within 699392 bytes,
instead of just within its 1366 * 4 = 5464 byte row.
This bug causes us to take the slow path for large non-overlapping rows
that are "close" in memory. As a data point, XGetImage(1366x768) on my
ARM chromebook was taking ~140 ms, but with this fixed, it now takes
about 60 ms.
XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()
[0] commit
e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
Author: Adam Jackson <ajax@redhat.com>
Date: Thu Apr 21 16:37:11 2011 -0400
fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right. That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption. Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)
v3: Convert to byte units
This first checks to make sure the blt is byte aligned, converts all
of the data to byte units and then compares for byte address range
overlap between source and dest.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Jon TURNEY [Mon, 11 Mar 2013 14:34:32 +0000 (14:34 +0000)]
Handle -displayfd and an explicit display number sensibly
Handle -displayfd and an explicit display number sensibly, e.g. use the
explicitly specified display number, and write it to the displayfd
v2: displayfd might be 0, so use -1 as invalid value
v3: Rebase for addition of NoListenAll flag
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Jon TURNEY [Mon, 24 Mar 2014 17:32:10 +0000 (17:32 +0000)]
Fix build when configured --enable-debug
Include os.h for ErrorF() to fix implicit-function-declaration warnings when
configured with --enable-debug.
hw/xfree86/parser/DRI.c: In function 'xf86parseDRISection':
hw/xfree86/parser/DRI.c:87:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration]
hw/xfree86/parser/Extensions.c: In function 'xf86parseExtensionsSection':
hw/xfree86/parser/Extensions.c:77:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Jon TURNEY [Mon, 24 Mar 2014 17:32:09 +0000 (17:32 +0000)]
Fix ephyr build with --disable-glamor
See http://tinderbox.x.org/builds/2014-03-23-0010/logs/xserver/#build
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Jon TURNEY [Mon, 24 Feb 2014 20:45:51 +0000 (20:45 +0000)]
Build fbcmap_mi.c once, rather than once for each DDX
Build fbcmap_mi.c once, rather than once for each DDX, and make it part of libfb
or libwfb convenience library.
Since
84e8de1271bb11b5b4b9747ae4647f47333a8ab7 we don't have fbcmap.c
This is a sort of revert of
17d85387d1e6851d35474b65929e268ca64ef65b
v2: Remove libkdrivestubs.la from configure.ac
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Jon TURNEY [Fri, 21 Feb 2014 18:11:33 +0000 (18:11 +0000)]
Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Jon TURNEY [Wed, 7 Sep 2011 11:50:20 +0000 (12:50 +0100)]
Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Julien Cristau [Wed, 26 Mar 2014 22:24:20 +0000 (23:24 +0100)]
Xephyr: restore initial window resize lost in xcb conversion
The XResizeWindow call wasn't replaced by the xcb equivalent, so we
were no longer setting the initial window size, only wm size hints.
Regression from commit a2b73da "Xephyr: start converting hostx.c over to
xcb"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74849
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reported-by: Laércio de Sousa <lbsousajr@gmail.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Wed, 12 Mar 2014 21:35:27 +0000 (14:35 -0700)]
glamor: Add glamor_program PolyPoint implementation
This accelerates poly point when possible by off-loading all geometry
computation to the GPU.
Improves x11perf -dot performance by 28109.5% +/- 1022.01% (n=3)
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Sat, 22 Mar 2014 22:20:49 +0000 (15:20 -0700)]
glamor: Move glamor_poly_segment to separate glamor_segment.c file
There's no reason to mix PolyPoint and PolySegment in the same file.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 12 Mar 2014 21:27:59 +0000 (14:27 -0700)]
glamor: Add infrastructure for generating shaders on the fly
This just adds a bunch of support code to construct shaders from
'facets', which bundle attributes needed for each layer of the
rendering system. At this point, that includes only the primitive and
the fill stuff.
v2: Correct comment in glamor transform about 1/2 pixel correction needed
for GL_POINT. (Eric Anholt)
v3: Rebase on Markus's cleanups (change by anholt)
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Fri, 14 Mar 2014 06:12:27 +0000 (23:12 -0700)]
glamor: Add helper functions to walk pixmap tiling
This adds a few helper functions to make pixmap fbo access symmetrical
between the single fbo and tiled cases.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Fri, 14 Mar 2014 06:11:40 +0000 (23:11 -0700)]
glamor: Add bounding box to one-fbo pixmaps
This lets code treat the one-fbo pixmaps more symmetrically with the
tiled pixmaps.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 19 Mar 2014 04:23:24 +0000 (21:23 -0700)]
glamor: Get testing code using small FBOs working again
Glamor has a mode where pixmaps will be constructed from numerous
small FBOs. This allows testing of the tiled pixmap code without
needing to create huge pixmaps.
However, the render glyph code assumed that it could create a pixmap
large enough for the glyph atlas. Instead of attempting to fix that
(which would be disruptive and not helpful), I've added a new pixmap
creation usage, GLAMOR_CREATE_NO_LARGE which forces allocation of a
single large FBO.
Now that we have pixmaps with varying FBO sizes, I then went around
and fixed the few places using the global FBO max size and replaced
that with the per-pixmap FBO tiling sizes, which were already present
in each large pixmap.
Xephyr has been changed to pass GLAMOR_CREATE_NO_LARGE when it creates
the screen pixmap as it doesn't want to deal with tiling either.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 19 Mar 2014 04:35:41 +0000 (21:35 -0700)]
mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines
The X server still has 'unsigned long' in a few places to hold 32 bit
values. One of those is in miPutImage where it's holding the temporary
planemask for XYPixmap format images.
It computed the highest plane in the source image with 1 << (depth -
1). On 64-bit machines, taking that value and storing it in an
unsigned long promotes it to a signed 64-bit value
(0xffffffff80000000).
Then, it loops over that value, shifting one bit right each time,
waiting for it to go to zero.. That takes 64 iterations, and ends up
with some mystic planemask values *and* walking off the end of the
source image data and out into space.
A simple cast is all that is required to compute the correct initial
plane mask (0x0000000080000000), at which point the loop operates
correctly once again.
Checking the fbPutImage code, I note that this same bug was fixed
in 2006 by Aaron Plattner in commit
f39fd4242902eaa862321d39337f429dd14ebacf
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Keith Packard [Sun, 16 Mar 2014 06:53:53 +0000 (23:53 -0700)]
dix: Allow NULL stipple in ChangeGC
miOpqStipDrawable resets the stipple after painting. When that stipple
was NULL, ChangeGC needs to handle that and not crash.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-off-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:55 +0000 (09:42 +0100)]
glamor: Drop feature dependent optimization on startup.
We don't care that much about startup time to write different code paths...
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:54 +0000 (09:42 +0100)]
glamor: Remove unneeded unbindings.
They are already cleared in glamor_put_vbo_space.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:53 +0000 (09:42 +0100)]
glamor: Always keep GL_ELEMENT_ARRAY_BUFFER bound to the same IB.
We never used glDrawElements() with a different index buffer.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:52 +0000 (09:42 +0100)]
glamor: Select VBO path by ARB_mbr extension.
The mbr path was hard coded enabled for desktop gl and disabled for
gles. But there are both desktop without mbr and GLES with mbr.
v2: Don't forget to update the fini path, too (change by anholt)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:51 +0000 (09:42 +0100)]
glamor: Update GL requirements to 2.1.
We will never ever run on OpenGL 1.2 as we use shaders everywhere.
2.0 may be enough, but we also often use PBOs and our big shaders
won't fit into the first GLSL limits.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:50 +0000 (09:42 +0100)]
glamor: Use epoxy_gl_version() instead of rolling our own.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:49 +0000 (09:42 +0100)]
glamor: Use epoxy_has_gl_extension() instead of rolling our own.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:48 +0000 (09:42 +0100)]
glamor: Use glsl "fract/mod" instead of "while" in gradient shaders.
This fixes gtkperf. It seemed to hang forever.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Tue, 18 Mar 2014 08:42:47 +0000 (09:42 +0100)]
kdrive: Remove duplicated definitions of some XV-related structs.
v2: Fix crash because of removed strdup. (by Markus Wick)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
Gaetan Nadon [Wed, 19 Mar 2014 15:28:57 +0000 (11:28 -0400)]
xfree86: glamor_egl subdir must be distributed - breaks distcheck
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Gaetan Nadon [Wed, 19 Mar 2014 18:17:15 +0000 (14:17 -0400)]
ephyr: typo where "()" should be "$()" in the Makefile - breaks make dist
make[3]: Entering directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr'
make[3]: *** No rule to make target `()', needed by `distdir'. Stop.
make[3]: Leaving directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr'
make[2]: *** [distdir] Error 1
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Hans de Goede [Mon, 24 Mar 2014 15:32:01 +0000 (16:32 +0100)]
systemd-logind: Monitor systemd-logind going away
When we're using server managed-fds through systemd-logind, systemd-logind
*must* keep running while we are using it, as it does things like drmSetMaster
and drmDropMaster for us on vt-switch.
On a systemd-logind restart, we cannot simply re-connect since we will then
get a different fd for the /dev/dri/card# node, and we've tied a lot of
state to the old fd. I've discussed this with the systemd people, and in the
future there may be a restart mechanism were systemd-logind passed fds from
the old logind to the new logind. But for now there answer is simply:
"Don't restart systemd-logind", and there never really is a good reason to
restart it.
So to ensure unpleasentness if people do decide to restart systemd-logind
anyways (or when it crashes), monitor logind going away and make this a fatal
error. This avoids getting a hard-hung machine on the next vt-switch and will
hopefully quickly educate users to not restart systemd-logind while they have
an X session using it active.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Mon, 24 Mar 2014 15:31:59 +0000 (16:31 +0100)]
Buildsys: Create SUID_WRAPPER_DIR before using it
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 25 Mar 2014 18:00:13 +0000 (14:00 -0400)]
suid: adding Xorg.sh.in to EXTRA_DIST is redundant
All files specified in AC_CONFIG_FILES get distributed automatically.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 25 Mar 2014 17:49:02 +0000 (13:49 -0400)]
suid: add generated Xorg.sh to hw/xfree86/.gitignore
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 25 Mar 2014 17:48:52 +0000 (13:48 -0400)]
suid: replace deprecated AC_HELP_STRING with AS_HELP_STRING
Fixes automake warning.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Keith Packard [Tue, 25 Mar 2014 23:06:03 +0000 (16:06 -0700)]
Merge remote-tracking branch 'whot/for-keith'
Emil Velikov [Thu, 26 Sep 2013 19:28:37 +0000 (20:28 +0100)]
miinitext: introduce LoadExtensionList() to replace over LoadExtension()
Looping around LoadExtension() meant that ExtensionModuleList was reallocated
on every extension. Using LoadExtensionList() we pass an array thus the
function can do the reallocation in one go, and then loop and setup the
ExtensionModuleList.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
v2: Update ephyr [Keith Packard]
v3: Eliminate const warnings in LoadExtensionList [Keith Packard]
Signed-off-by: Keith Packard <keithp@keithp.com>
Adam Jackson [Fri, 8 Nov 2013 14:44:24 +0000 (09:44 -0500)]
xkb: Restore XkbCopyDeviceKeymap
Removed in
d35a02a767017f13db4bd4742eef49293d5a30ea, tigervnc 1.2.80 and
xf86-video-nested need it for now.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Kristian Høgsberg [Thu, 20 Mar 2014 03:46:41 +0000 (20:46 -0700)]
os: Add AddClientOnOpenFD() to create a new client for an file descriptor
When the Xwayland server is socket-activated, we need to connect and
initialize the window manager before the activating client gets to
proceed with connecting. We do this by passing a socket file
descriptor for the window manager connection to the Xwayland server,
which then uses this new function to set it up as an X client.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Emil Velikov [Thu, 26 Sep 2013 19:16:31 +0000 (20:16 +0100)]
miinitext: avoid allocating a sentinel ExtensionModule
With all the logic now in place there is no need to allocate a separate
ExtensionModule to be used as a sentinel.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Emil Velikov [Thu, 26 Sep 2013 19:11:40 +0000 (20:11 +0100)]
miinitext: constify staticExtensions
The array is readonly and should not be tampered with.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Emil Velikov [Thu, 26 Sep 2013 19:08:56 +0000 (20:08 +0100)]
miinitext: drop sentinel detection during LoadExtension
All the sentinels from the extension lists were removed, thus the only
case were this would trigger is when the code is broken badly.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Emil Velikov [Thu, 26 Sep 2013 19:08:16 +0000 (20:08 +0100)]
miinitext: move AddStaticExtensions() to LoadExtension()
Separate the function from NewExtensionModule() as the former does
only memory reallocation. No functional change.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Alan Coopersmith [Sat, 22 Mar 2014 21:30:04 +0000 (14:30 -0700)]
Add necessary headers for major()/minor() on Solaris to xf86Xinput.c
Without these, after commit
fdb4ec86c29d85c, it fails to build on Solaris,
with errors of:
xf86Xinput.c: In function 'xf86stat':
xf86Xinput.c:816:5: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration]
xf86Xinput.c:817:5: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]
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>
Keith Packard [Sat, 22 Mar 2014 21:09:00 +0000 (14:09 -0700)]
Merge remote-tracking branch 'jturney/master'
Gaetan Nadon [Fri, 17 Jan 2014 14:54:01 +0000 (09:54 -0500)]
Default font path: remove the check for ${sysconfdir}/X11/fontpath.d
The location ${sysconfdir}/X11/fontpath.d is unknown at configuration time
(only at make time) as evidenced by the configuration output:
checking for ${prefix}/etc/X11/fontpath.d... no
Unlike font-util for the X fonts, there is no mechanism to query where
fontpath.d is. Fedora have chosen /etc/X11 and others have followed, but this
is not a standard. It might also be installed at another location, it may or may
not be under the xserver installation prefix. We just don't know. Debian does
not use this at all.
Distros are using --with-default-path when they support fontpath.d, so they
never relied on the server default as it never worked.
The patch essentially is a noop, which leaves the door open for anyone who
could potentially provide a reliable implementation of choosing fontpath.d
when applicable.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Sat, 22 Mar 2014 20:46:15 +0000 (13:46 -0700)]
Merge remote-tracking branch 'jwrdecoede/for-keith'
Jon TURNEY [Wed, 11 Sep 2013 12:36:18 +0000 (13:36 +0100)]
hw/xwin: Fix WM_ENDSESSION crash on x86_64
We need to include xwin-config.h into winmsgwindow.c, so that _XSERVER64 is
defined, so that the layout of ScreenRec type is correct, so that it's privates
can be accessed correctly, so that the WM_GIVEUP message can be sent to the
screen window.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Jon TURNEY [Sun, 16 Jun 2013 12:55:51 +0000 (13:55 +0100)]
hw/xwin: Improve NET_WM_ICON validation
Check that we don't overrun the end of the property data while converting icons
See http://cygwin.com/ml/cygwin-xfree/2013-06/msg00040.html for testcase.
Also, some warning fixes in winXIconToHICON()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Jon TURNEY [Sun, 31 Mar 2013 17:29:07 +0000 (18:29 +0100)]
hw/xwin: Remove obsolete control handling for About dialog
Remove the unused, cygwin-specific handling for ChangeLog, UG and CG buttons in
the About... Dialog. The buttons themselves were removed in commmit
34269a90ea2087f883f5dc8805894fc4998e4b81.
Also remove those window control IDs which are now obsolete.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Oliver Schmidt [Wed, 7 Sep 2011 13:00:56 +0000 (14:00 +0100)]
hw/xwin: Minimize redraw events after resizing/moving windows in multiwindow mode
In multiwindow mode the modal moving/resizing of windows causes a lot of redraw
events to be sent to the X clients after the user releases the mouse button.
During the moving/resizing client windows are not redrawn as long as the mouse
button is pressed, but all redraw/resizing events are queued and executed step
after step after the moving/resizing ends.
Some clients collect and combine multiple redraw or resizing events, other
clients (e.g. xterm) simply execute each redraw or sizing event.
The enclosed patch minimizes the events for clients to only one event after the
user releases the mouse button to end the moving/resizing. This improves the
user experience and reduces strange screen flickerings, especially on slow
platforms.
The enclosed patch modifies winmultiwindowwndproc.c such that the windows events
WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE that are sent by Windows when the modal
window resizing/moving begins or ends are considered. Only after WM_EXITSIZEMOVE
is the redraw/resizing executed.
Signed-off-by: Oliver Schmidt <oschmidt-mailinglists@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Jon TURNEY [Mon, 7 Nov 2011 20:54:10 +0000 (20:54 +0000)]
hw/xwin: Add '@<WM_CLIENT_MACHINE>' to window name when it's useful to do so
Enhance GetWindowName() so it appends the result of XGetWMClientMachine() when
it is available and useful to do so
Add -hostintitle option to control this behaviour. Add documentation for this
option to man page and -help text.
Also, fix warning in UpdateName()
v2: Provide a HOST_NAME_MAX definition for MinGW
v3: Use '@host' rather than ' (on host)'. Don't add host if it's already in the
title.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Colin Harrison [Fri, 14 Mar 2014 15:44:54 +0000 (15:44 +0000)]
hw/xwin: Remove prototype for non-existent winMWExtWMUpdateIcon()
winMWExtWMUpdateIcon() was removed in commit
527cf13135cfd279733060e0028bbfbe02be5167
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Colin Harrison [Fri, 14 Mar 2014 15:40:43 +0000 (15:40 +0000)]
hw/xwin: Use AllocDevicePair()
Use AllocDevicePair() rather than allocating Windows keyboard and pointer
devices individually.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Colin Harrison [Fri, 14 Mar 2014 15:36:59 +0000 (15:36 +0000)]
hw/xwin: Consistently use 'L' for long int constants
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Colin Harrison [Fri, 14 Mar 2014 15:36:24 +0000 (15:36 +0000)]
hw/xwin: Remove an unneeded include
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Colin Harrison [Fri, 14 Mar 2014 15:34:04 +0000 (15:34 +0000)]
hw/xwin: Use boolean AND rather than bitwise AND in WIN_POLLING_MOUSE_TIMER_ID
For clarity, use boolean AND rather than bitwise AND in
WIN_POLLING_MOUSE_TIMER_ID processing.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Colin Harrison [Fri, 14 Mar 2014 15:23:16 +0000 (15:23 +0000)]
hw/xwin: Fix declaration after statement warning in ddxGiveUp()
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Colin Harrison [Fri, 14 Mar 2014 15:09:24 +0000 (15:09 +0000)]
hw/xwin: Fix typo in comment
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Jon TURNEY [Thu, 13 Mar 2014 22:38:43 +0000 (22:38 +0000)]
hw/xwin: Fix const discarded warning in winGenerateAuthorization()
Fix const discarded warning in winGenerateAuthorization() in !XCSECURITY case
In function ‘winGenerateAuthorization’:
hw/xwin/winauth.c:123:38: warning: passing argument 2 of ‘GenerateAuthorization’ discards ‘const’ qualifier from pointer target type [enabled by default]
hw/xwin/winauth.c:99:1: note: expected ‘char *’ but argument is of type ‘const char *’
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Kristian Høgsberg [Wed, 19 Mar 2014 21:03:13 +0000 (14:03 -0700)]
os: Add a mechanism to prevent creating any listen sockets
A socket-activated server will receive its listening sockets from the
parent process and should not create its own sockets. This patch
introduces a NoListen flag that can be set by a DDX to prevent
the server from creating the sockets. When NoListen is enabled, we
also disable the server lock checking, since the parent process is
responsible for checking the lock before picking the display name and
creating the sockets.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Kristian Høgsberg [Wed, 19 Mar 2014 05:05:58 +0000 (22:05 -0700)]
os: Always compile ListenOnOpenFD() and export it
This function was written to allow the X server to inherit the listen
socket from launchd on OS X. The code is not specific to OS X though
and will be useful for on-demand launched Xwayland servers.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Kristian Høgsberg [Wed, 19 Mar 2014 17:27:39 +0000 (10:27 -0700)]
test: Don't add TEST_LDADD to list test
The list test case is always enabled, even if Xorg is disabled.
TEST_LDADD pulls in Xorg files which breaks linking when Xorg is disabled.
The list test doesn't need any libraries, so just remove list_LDADD.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Keith Packard [Wed, 19 Mar 2014 13:43:14 +0000 (06:43 -0700)]
Merge remote-tracking branch 'whot/for-keith'
Kristian Høgsberg [Wed, 12 Mar 2014 06:31:25 +0000 (16:31 +1000)]
xkb: add XkbLoadKeymapFromString
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Keith Packard [Tue, 18 Mar 2014 00:29:56 +0000 (17:29 -0700)]
Merge remote-tracking branch 'anholt/glamor-megaseries'
Michel Dänzer [Mon, 17 Mar 2014 04:16:48 +0000 (13:16 +0900)]
glamor: Move up glamor_priv->flags assignment in glamor_init()
It wasn't assigned yet when it was tested for GLAMOR_NO_DRI3.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Fri, 14 Mar 2014 20:10:04 +0000 (13:10 -0700)]
glx: Make sure we get an FBConfig the root window's visual.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Markus Wick [Thu, 13 Mar 2014 10:17:39 +0000 (11:17 +0100)]
glamor: don't reset the GLSL program
We don't use fixed function rendering, so there is no need to reset
the program at all. This lets the driver avoid checking for state
changes between draw calls when we rebind the same program.
Improves xephyr x11perf -f8text performance by 6.03062% +/- 1.64928%
(n=20)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Wed, 12 Mar 2014 23:24:04 +0000 (00:24 +0100)]
glamor: remove disabled code
This block was disabled since 2011, so there is likely no need to keep it any more.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Alan Coopersmith [Wed, 12 Mar 2014 00:28:10 +0000 (17:28 -0700)]
Remove duplicate assignment of repeat_type_uniform_location
Flagged by cppcheck 1.64:
[glamor/glamor_gradient.c:987] -> [glamor/glamor_gradient.c:991]:
(performance) Variable 'repeat_type_uniform_location' is
reassigned a value before the old one has been used.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Thu, 20 Feb 2014 23:50:03 +0000 (15:50 -0800)]
glamor: Apply debug labels to our shaders.
This will help tools like fips, apitrace, or INTEL_DEBUG=shader_time
provide useful information about the shaders in use.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 12 Jan 2014 05:26:01 +0000 (21:26 -0800)]
glamor: Don't forget to unmap our PBOs before using them to upload.
From the GL_ARB_vertex_buffer_object spec:
After the client has specified the contents of a mapped data store,
and before the data in that store are dereferenced by any GL commands,
the mapping must be relinquished by calling
boolean UnmapBufferARB(enum target);
Our mappings were only getting reaped at PBO destroy time, after the
upload. If the GL implementation wasn't coherent, it would have used
stale data to do the texture upload.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 12 Jan 2014 05:11:18 +0000 (21:11 -0800)]
glamor: Add an assert about an invariant the upload code relies on.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Fri, 10 Jan 2014 07:54:25 +0000 (15:54 +0800)]
glamor: Fix ignoring the ALU during SetSpans().
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Thu, 9 Jan 2014 03:36:30 +0000 (11:36 +0800)]
glamor: Improve the performance of line fallbacks.
If the lines aren't solid-filled vert/horiz solid-filled rectangles,
we fall back. libreoffice has some diagonal lines, and the
performance of the fallback path was atrocious. Just fall back to
mi's spans instead, so that we don't do an upload/download.
Improves x11perf -seg100 by 863.652% +/- 9.8968% (n=5)
Signed-off-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Thu, 9 Jan 2014 02:53:04 +0000 (10:53 +0800)]
glamor: Improve the performance of PolyGlyphBlt.
Using the same idea as the previous PushPixels code, just make points
for each point in the glyph. This is an advantage over the pushpixels
fallback because we can batch the BO mappings and draw calls across
glyphs.
Improves performance of x11perf -f8text by 773.389% +/- 3.50754% (n=10).
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 13:54:48 +0000 (21:54 +0800)]
glamor: Improve the performance of PushPixels by, well, pushing pixels.
Otherwise, mi will fall back to GetSpans()ing the bitmap, walking the
bitmap, computing spans to be filled, and calling FillSpans().
Improves x11perf -f8text by 759.373% +/- 3.33096% (n=166)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Fri, 10 Jan 2014 16:06:21 +0000 (00:06 +0800)]
glamor: Add missing prepares on the GC during fb fallbacks.
We had regressions in CopyPlane reported by xts5, because we were
(successfully!) dereferencing the null pixmap->devPrivate.ptr for a
tile or stipple without having done a prepare.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Fri, 10 Jan 2014 16:00:00 +0000 (00:00 +0800)]
glamor: Rely on nested mappings to handle src==dst and !prepare bugs.
Now that the core deals with that for us, we can avoid all this extra
carefulness.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Fri, 10 Jan 2014 15:43:09 +0000 (23:43 +0800)]
glamor: Allow nested mapping of pixmaps.
The common pattern is to do nested if statements making calls to
prepare_access() and then pop those mappings back off in each set of
braces. Some cases checked for src == dst to avoid leaking mappings,
but others didn't. Others didn't even do the nested mappings, so a
failure in the outer map would result in trying to umap the inner and
failing.
By allowing nested mappings, we can fix both problems by not requiring
the care from the caller, plus we can allow a simpler nesting of all
the prepares in one if statement.
v2: Add a comment about nested unmap behavior, and just reuse the
glamor_access_t enum.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Fri, 10 Jan 2014 15:39:02 +0000 (23:39 +0800)]
glamor: Drop unused GLAMOR_ACCESS_WO.
Nothing was using it, and it was going to complicate the
glamor_prepare_access bugfixing I'm going to do next.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Thu, 13 Mar 2014 17:09:08 +0000 (10:09 -0700)]
glamor: Drop stale comment.
The old Xephyr codebase was using the GL window system framebuffer for
the screen pixmap, but that meant you couldn't texture from it to do
operations sourcing from the screen, so in the version that landed I
instead had the screen just be a plain texture.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Eric Anholt [Fri, 10 Jan 2014 14:42:02 +0000 (22:42 +0800)]
glamor: Replace some goofy enum-likes with a real enum.
This unpacks the bitfield into an int size, but my experience has been
that packing bitfields doesn't matter for performance.
v2: Convert more comparisons against numbers or implicit bool
comparisons to comparisons against the enum names, and fix up some
comments.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 23:22:47 +0000 (07:22 +0800)]
glamor: Fix up doxygen for glamor_fill.c.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 23:05:02 +0000 (07:05 +0800)]
glamor: Rename more solid fill variables to clean up the code.
Now the error path of allocation is more obvious: We leave things in
the a-few-boxes-at-a-time stack memory state.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 23:01:17 +0000 (07:01 +0800)]
glamor: Rename a variable to be more descriptive.
The "valid_" prefix was used above to describe our allocation that
gets reused multiple times, which is totally unrelated.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 22:55:15 +0000 (06:55 +0800)]
glamor: Fix some integer overflow errors.
Imagine a nbox that was (UINT_MAX + small number) / (4 * 2 *
sizeof(float)). We'd malloc a few bytes after the integer overflow,
but glamor_set_normalize_vcoords would write over gigabytes of heap.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 22:53:46 +0000 (06:53 +0800)]
glamor: Drop bogus _X_UNLIKELY.
nbox > 4 is actually quite common for spans handling.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 22:52:32 +0000 (06:52 +0800)]
glamor: Fix stack overflow in glamor_solid vertex handling.
ARRAY_SIZE(vertices) is 32 (floating point values), so we need to
divide by the number of floats in a box like we do in the overflow
case below.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>