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>
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>
Eric Anholt [Sat, 4 Jan 2014 21:28:52 +0000 (13:28 -0800)]
glamor: Drop duplicated lines for getting pixmap state in GetImage.
No change in generated code size -- apparently the compiler figured it
out.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Tue, 31 Dec 2013 02:41:57 +0000 (18:41 -0800)]
glamor: Return the stride/size for glamor_dri3_name_from_pixmap(), too.
Just like for a caller of glamor_dri3_fd_from_pixmap(), otherwise the
consumer of that named buffer has no idea what GL chose for the
stride.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Tue, 31 Dec 2013 02:33:09 +0000 (18:33 -0800)]
glamor: Drop the body of the function for enabling DRI3 extensions.
The flag is already being set at glamor_egl_screen_init() time, so no
need for the driver to separately call this. That said, leave the
function around to keep the ABI compatibility.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Tue, 31 Dec 2013 02:29:50 +0000 (18:29 -0800)]
sync: Add a header include necessary to use misyncstr.h
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Eric Anholt [Sat, 28 Dec 2013 21:46:17 +0000 (13:46 -0800)]
glamor: Do glyph private init at screeninit time, and other stuff at CSR.
This hasn't actually been a problem, since the server hasn't allocated
any glyphs before our glyph private initialization during
CreateScreenResources. But it's generally not X Server style to do
things this way.
Now that glamor itself drives both parts of glyphs setup, DDX drivers
no longer need to tell glamor to initialize glyphs. We do retain the
old public symbol so they can keep running with no changes.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sat, 28 Dec 2013 02:45:44 +0000 (18:45 -0800)]
glamor: Move the EGL image to the normal pixmap private.
There's no reason to hide EGL from the rest of glamor, now that we
have epoxy.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sat, 28 Dec 2013 02:27:56 +0000 (18:27 -0800)]
glamor: Use epoxy_has_egl_extension() instead of rolling our own.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
Eric Anholt [Sun, 5 Jan 2014 10:45:05 +0000 (02:45 -0800)]
glamor: Drop the set of the context to NULL at the end of glamor ops.
The theory here was that it (which I copied from EGL) existed to fix
up context switching with indirect GLX. But indirect GLX won't even
try to set the context again unless its lastContext field is cleared,
so we need to solve this a different way.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Eric Anholt [Fri, 28 Feb 2014 01:55:50 +0000 (17:55 -0800)]
xephyr: Don't forget to glViewport() before drawing the screen.
Fixes misrendering with cairogears. I had noticed the failure while
trying to figure out what was going on with traps. Cairogears was
apparently putting its results on the screen through putimage, which
is a texture upload, so the last GL drawing was done to the size of
the cairogears window, not the size of the xephyr screen.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Kristian Høgsberg [Wed, 12 Mar 2014 07:20:17 +0000 (17:20 +1000)]
xkb: add KeymapOrDefault
Helper function to return a default map if the keymap compilation failed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Kristian Høgsberg [Wed, 12 Mar 2014 07:18:22 +0000 (17:18 +1000)]
xkb: factor out xkb loading to LoadXkm
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Peter Hutterer [Wed, 12 Mar 2014 06:08:15 +0000 (16:08 +1000)]
xkb: add a callback to xkbcomp
This provides a callback to write to xkbcomp's buffer once everything is
prepared.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Peter Hutterer [Wed, 12 Mar 2014 07:17:25 +0000 (17:17 +1000)]
xkb: constify XkbDDXOpenConfigFile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Hans de Goede [Wed, 12 Mar 2014 15:00:23 +0000 (16:00 +0100)]
xf86Xinput: release server managed fd before removing the device from the list
So that the fd in use test in systemd_logind_release_fd works properly.
Note we cannot change the test inside systemd_logind_release_fd as it must
work for devices which were never added to the xf86InputDevs too.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 12 Mar 2014 13:57:24 +0000 (14:57 +0100)]
systemd-logind: Correctly deal with InputDevs sharing a device-node
InputDevices may share a single device-node, this happens ie with Wacom
tablets.
This patch makes take_fd and release_fd properly deal with this, together
with the earlier patch for updating the fd in all matching xf86InputDevs
on pause / resume this completes support for such shared device-nodes.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 12 Mar 2014 11:58:22 +0000 (12:58 +0100)]
systemd-logind: Add a systemd_logind_set_input_fd_for_all_devs helper
And use it where appropriate.
Setting the fd for all matching InputDevices is necessary when we've
multiple InputDevices sharing a single device-node, such as happens with
Wacom tablets.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 12 Mar 2014 12:19:32 +0000 (13:19 +0100)]
systemd_logind_find_info_ptr_by_devnum: Move to higher inside the file
This is a preparation patch for adding support for server managed fds
for InputDevices where multiple input devices share the same device node (and
thus also their major and minor).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 12 Mar 2014 11:45:40 +0000 (12:45 +0100)]
systemd_logind_find_info_ptr_by_devnum: Add a start argument
Modify systemd_logind_find_info_ptr_by_devnum to take a start argument, so
that it can be used to find all occurences of a devnum in an InputInfo list,
rather then just the first.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 11 Mar 2014 10:38:09 +0000 (11:38 +0100)]
Remove config_odev_add_*attribute checks in various places
Note that there are more callers but those were already not doing any
error checking.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 11 Mar 2014 10:28:15 +0000 (11:28 +0100)]
config_odev*: Use XNF alloc functions
config_odev* functions are called in code-paths were we already use
XNF* functions in other places, so which are not oom safe already.
Besides that oom is something which should simply never happen, so aborting
when it does is as good a response as any other.
While switching to XNF functions also fixup an unchecked strdup case.
Note the function prototypes are kept unchanged, as they are part of the
server ABI.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 5 Mar 2014 15:41:14 +0000 (16:41 +0100)]
Xorg: Add a suid root wrapper
With the recent systemd-logind changes it is possible to install the Xorg
binary without suid root rights and still have everything working as it
should *if* the user only has cards which are supported by kms.
This commit adds a little suid root wrapper, which is a bit weird, first we
strip the suid-root bit of the Xorg binary, and then we add a wrapper ?
The function of this wrapper is to see if a system still needs root-rights,
if it does not (it supports kms and the kms drivers are properly loaded),
then it will immediately drop all elevated rights before executing the real
Xorg binary. If it finds (some) cards which don't support kms, or no cards
at all, then it will execute the Xorg server with elevated rights so that
ie the nvidia binary driver and the vesa driver can keep working normally.
To make it possible for security concious users who don't need the root
rights to completely remove the wrapper, Xorg is started in a 3 step process
when the wrapper is enabled during build time:
1) A simple shell script which checks if the wrapper is there, if it is
it executes the wrapper, if not it directly executes the real Xorg binary
2) The wrapper gets executed, does its checks, normally drops all elevated
rights and then executes the real Xorg binary
3) The real Xorg binary does its thing
This allows distributions to put the wrapper binary in a separate package, and
will allow users to remove this package. IE the plan with Fedora is to make
"legacy" drivers depend on the wrapper pkg, and since our default install
contains some legacy drivers it will be part of the default install, but
users can later yum remove it (which will also automatically remove the
legacy driver packages as those won't work without it anyways).
The wrapper is loosely modelled after the existing Debian Xwrapper, it
uses the same config-file + config-file format, and also allows restricting
Xserver execution (through the wrapper) to console users only.
There also is a new needs_root_rights config file directive, which can
be used to override the auto-detection the wrapper does.
Hopefully this will allow Debian to replace their own wrapper with this
upstream one.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Rui Matos [Fri, 7 Mar 2014 22:32:27 +0000 (14:32 -0800)]
xkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device
This will also make it useful for cases when we have a new keymap to
apply to a device but don't have a source device.
Reviewed-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>
Rui Matos [Fri, 7 Mar 2014 22:32:28 +0000 (14:32 -0800)]
xkb: Factor out a function to copy a keymap's controls onto another
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Keith Packard [Wed, 12 Mar 2014 05:04:36 +0000 (22:04 -0700)]
Merge remote-tracking branch 'whot/for-keith'
Peter Hutterer [Tue, 25 Feb 2014 21:54:56 +0000 (07:54 +1000)]
config: search for PnPID on all parents (#75513)
The PnPID for a device may not be on the immediate parent, so search up the
device tree until we find one.
X.Org Bug 75513 <http://bugs.freedesktop.org/show_bug.cgi?id=75513>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Wed, 26 Feb 2014 06:20:08 +0000 (16:20 +1000)]
xkb: push locked modifier state down to attached slave devices
Whenever the master changes, push the locked modifier state to the attached
slave devices, then update the indicators. This way, when NumLock or CapsLock
are hit on any device, the LED will light up on all devices. Likewise, a new
keyboard attached to a master device will light up with the correct
indicators.
The indicators are handled per-keyboard, depending on the layout, i.e. if one
keyboard has grp_led:num set, the NumLock LED won't light up on that keyboard.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Peter Hutterer [Wed, 26 Feb 2014 06:16:10 +0000 (16:16 +1000)]
xkb: factor out state update into a function
No functional changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>