summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2016-06-08prime: clean up slave bo properly. (v3)Dave Airlie3-0/+11
This is an ABI break, in that we now pass NULL to a function that hasn't accepted it before. Alex Goins had a different patch for this but it wasn't symmetrical, it freed something in a very different place than it allocated it, this attempts to retain symmetry in the releasing of the backing bo. v2: use a new toplevel API, though it still passes NULL to something that wasn't expecting it. v3: pass -1 instead of 0. Signed-off-by: Dave Airlie <airlied@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Alex Goins <agoins at nvidia.com>
2016-06-08xfree86: Remove redundant parse of AIGLX server flagAdam Jackson1-5/+0
Not visible in the patch, but the same stanza is repeated below inside the #ifdef GLXEXT. There's no reason to bother with checking it if we built without GLXEXT so remove the unconditional one. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-06-08xwayland: Call eglBindAPI after eglInitializeMichel Dänzer1-1/+2
Current Mesa Git master checks that the EGL display actually supports the API passed to eglBindAPI, which can only succeed after eglInitialize. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-08dix: Update some comments to reflect the new non-SIGIO input modelAdam Jackson9-18/+12
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-06-08xfree86: Undocument UseSIGIO in xorg.confAdam Jackson1-9/+0
The doc text is wrong at this point, input processing isn't going to vary based on this, so we shouldn't say it does. The only thing this _does_ get used for is DRI1 SwapBuffers (on everything but savage), and if you disable it you're not going to get DRI1 at all, so we really shouldn't even mention it. Still, leave the option wired up to the parser so we don't break any DRI1-driver-using setup relying on it being disabled, and so we don't complain about unused options elsewhere. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2016-06-08dri1: Hide the SIGIO details from driversAdam Jackson2-74/+62
Not being used, and not likely to be useful. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2016-06-08dmx: Remove SIGIO input support here tooAdam Jackson6-305/+2
This code was broken anyway. Note that DEVICE_OFF would make dmx think _no_ devices were using SIGIO anymore, which means 'xinput disable' on your mouse would probably do weird things to your keyboard too. Rather than try to repair that and keep SIGIO working on this one niche DDX, just rip it out and use the thread model like everyone else. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2016-06-08dix: Use OsSignal() not signal()Adam Jackson10-23/+16
As the man page for the latter states: The effects of signal() in a multithreaded process are unspecified. We already have an interface to call sigaction() instead, use it. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-06-03xwayland: sync event queue to check compositor replyOlivier Fourdan3-0/+12
Read and dispatch pending Wayland events to make sure we do not miss a possible reply from the compositor prior to discard a key repeat. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-03xwayland: refactor Wayland event handlingOlivier Fourdan1-12/+25
To be able to reuse some code. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-03xwayland: add a server sync before repeating keysOlivier Fourdan2-1/+77
Key repeat is handled by the X server, but input events need to be processed and forwarded by the Wayland compositor first. Make sure the Wayland compositor is actually processing events, to avoid repeating keys in Xwayland while the Wayland compositor cannot deal with input events for whatever reason, thus not dispatching key release events, leading to repeated keys while the user has already released the key. Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=762618 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-02Merge remote-tracking branch 'daenzer/for-master'Keith Packard3-70/+4
2016-05-31xwayland: Use the CLOCK_MONOTONIC clockJonas Ådahl1-0/+2
By default the X server will try CLOCK_MONOTONIC_COARSE before CLOCK_MONOTONIC, while A Wayland compositor may only support getting their timestamps from the CLOCK_MONOTONIC clock. This causes various issues since it may happen that a timestamp from CLOCK_MONOTONIC retrieved before a sending an X request will still be "later" than the timestamp the X server than gets after receiving the request, due to the fact that CLOCK_MONOTONIC_COARSE has a lower resolution. To avoid these issues, make Xwayland always use CLOCK_MONOTONIC, so that it becomes possible for Wayland compositor only supporting CLOCK_MONOTONIC and X server to use the same clock. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Acked-by: Daniel Stone <daniels@collabora.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-30xfree86/modes: Remove xf86_reload_cursors v2Michel Dänzer3-69/+3
No longer needed now that xf86CursorResetCursor is getting called for each CRTC configuration change. v2: Keep xf86_reload_cursors as a deprecated empty inline function until all drivers stop calling it. (Adam Jackson) Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-30xfree86/modes: Assign xf86_config->cursor in xf86_load_cursor_image v2Michel Dänzer1-1/+1
Fixes a crash on startup in the radeon driver's drmmode_show_cursor() due to xf86_config->cursor == NULL, because no CRTC was enabled yet, so xf86_crtc_load_cursor_image was never called. (Also use scrn->pScreen instead of xf86ScrnToScreen(scrn)) v2: Set xf86_config->cursor at the beginning of xf86_load_cursor_image instead of at the end. Reviewed-by: Keith Packard <keithp@keithp.com>
2016-05-30xfree86: Provide xf86BlockSIGIO and xf86ReleaseSIGIO as wrappers for input mutexKeith Packard2-5/+9
Threaded input doesn't use SIGIO anymore, but existing drivers using xf86BlockSIGIO and xf86ReleaseSIGIO probably want to lock the input mutex during those operations. Provide inline functions to do this which are marked as 'deprecated' so that drivers will get warnings until they are changed. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-29xfree86: Remove event reading code from xf86WakeupKeith Packard1-28/+0
Oops. This didn't get removed when xfree86 was converted over to use the input thread. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-29xfree86: Bump ABI versionsKeith Packard1-3/+3
threaded input can affect drivers that use OsBlockSIGIO when dealing with cursors. Signed-off-by: Keith Packard <keithp@keithp.com> Requested-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-27modesetting: Use new xf86CurrentCursor APIKeith Packard1-2/+1
Use this instead of the (now deprecated) cursor pointer in the xf86CrtcConfigRec. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-05-26kdrive: Use threaded inputKeith Packard1-2/+4
Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26xfree86: Use threaded input mechanism [v2]Keith Packard3-10/+7
Switch the XFree86 DDX over to threaded input v2: Rewrite comment in xf86Helper about silken mouse Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26Create a threaded mechanism for input [v7]Keith Packard2-3/+3
The current SIGIO signal handler method, used at generation of input events, has a bunch of oddities. This patch introduces an alternative way using a thread, which is used to select() all input device file descriptors. A mutex was used to control the access to input structures by the main and input threads. Two pipes to emit alert events (such hotplug ones) and guarantee the proper communication between them was also used. Co-authored-by: Fernando Carrijo <fcarrijo@freedesktop.org> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> v2: Fix non-Xorg link. Enable where supported by default. This also splits out the actual enabling of input threads to DDX-specific patches which follow v3: Make the input lock recursive v4: Use regular RECURSIVE_MUTEXes instead of rolling our own Respect the --disable-input-thread configuration option by providing stubs that expose the same API/ABI. Respond to style comments from Peter Hutterer. v5: use __func__ in inputthread debug and error mesages. Respond to style comments from Peter Hutterer. v6: use AX_PTHREAD instead of inlining pthread tests. Suggested by Emil Velikov <emil.l.velikov@gmail.com> v7: Use pthread_sigmask instead of sigprocmask when using threads Suggested by Adam Jackson <ajax@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-26xfree86: Remove unnecessary errno save/restore in xf86ReadInputKeith Packard1-3/+0
When this code was called from SIGIO, saving and restoring errno could possibly have made sense in some strange environment. Now that this will not be called from a signal handler, there is no reason to do that. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26kdrive: Don't lock input across read in KdNotifyFdKeith Packard1-2/+0
We won't need these locks with the new threaded input code as it holds the input lock across all of the input device I/O operations. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26Remove SIGIO support for input [v5]Keith Packard13-192/+80
This removes all of the SIGIO handling support used for input throughout the X server, preparing the way for using threads for input handling instead. Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls to stub functions input_lock/input_unlock so that we don't lose this information. xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO and OsReleaseSIGIO. v2: Don't change locking order (Peter Hutterer) v3: Comment weird && FALSE in xf86Helper.c Leave errno save/restore in xf86ReadInput Squash with stub adding patch (Peter Hutterer) v4: Leave UseSIGIO config parameter so that existing config files don't break (Peter Hutterer) v5: Split a couple of independent patch bits out of kinput.c (Peter Hutterer) Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26kdrive: Remove unneeded AddEnabledDevice/RemoveEnabledDevice callsKeith Packard1-2/+0
kdrive uses the NotifyFd interface, which handles all of the necessary fd configuration in the OS layer. Having it also use the old EnableDevice interfaces is incorrect. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26xfree86: Add IndirectGLX server flag (v2)Adam Jackson4-0/+18
Not all display managers make it easy (or possible) to modify the command line flags passed to the server, so add a way to get to it from xorg.conf. v2: Fix the FlagOptions list to not have IGLX after the terminator (Alan Coopersmith) Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-26xfree86: Set xf86CrtcConfigRec cursor pointer to NULL in HideCursorKeith Packard3-12/+15
This makes the cursor pointer held by xf86Cursors.c get reset to NULL whenever the cursor isn't displayed, and means that the reference count held in xf86Cursor.c is sufficient to cover the reference in xf86Cursors.c. As HideCursor may be called in the cursor loading path after UseHWCursor or UseHWCursorARGB when HARDWARE_CURSOR_UPDATE_UNHIDDEN isn't set in the Flags field, the setting of the cursor pointer had to be moved to the LoadCursor paths. LoadCursorARGBCheck gets the cursor pointer, but LoadCursorImageCheck does not. For LoadCursorImageCheck, I added a new function, xf86CurrentCursor, which returns the current cursor. With this new function, we can eliminate the cursor pointer from the xf86CrtcConfigRec, once drivers are converted over to use it. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-25xwayland: Move sprite invalidation logic into mipointerKeith Packard1-8/+1
This creates a function that invalidates the current sprite and forces a sprite image reload the next time the sprite is checked, moving that logic out of the xwayland sources and allowing the miPointerRec structure to be removed from the server API. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-05-11xwayland: don't check events as early as InitInputOlivier Fourdan1-5/+0
If data is received during XWayland startup, it will be read early in InitInput() before the connection data is initialized, causing a crash. Remove the wayland rountrips from InitInput() as this is done again in xwl_screen_init() where it seems more appropriate. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-06modesetting: fix build with glamor disabled.Dave Airlie1-0/+4
Fix build without --enable-glamor. Caught by the arm tinderbox. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-04xfree86: drop unneeded strdup for modulepath/logfileEmil Velikov1-12/+2
The destination variable is never freed, thus we even plug some memory leaks. v2: Rebase against updated xf86CheckPrivs() helper. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04xfree86: use the xf86CheckPrivs() helper for modulepath/logfileEmil Velikov1-27/+23
v2: Rebase against updated xf86CheckPrivs() helper. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04xfree86: factor out the check priviliges and print a big warningEmil Velikov1-14/+12
Current message was quite off "file specified must be a relative path" and alike. Just factor it out and use "path/file" as needed. v2: Rework error message, drop "Using default", print actual arg value. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04modesetting: set capabilities up after glamor and enable offload caps.Dave Airlie1-12/+16
This moves the capabilites setting to after glamor is initialised, and enables the offload caps in cases where they work. This enables DRI2 PRIME support with modesetting. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04xf86Crtc: don't set the root window property on slave GPUs.Dave Airlie1-1/+2
Slave GPUs don't have a root window to set this on, so don't. This fixes some crashes I saw just playing around. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04modesetting: set driverPrivate to NULL after closing fd.Dave Airlie1-1/+1
Otherwise ms_ent_priv will return NULL and things will fall apart. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04modesetting: Consistent whitespace in driver.cAlex Goins1-18/+18
For some reason a couple of the dirty functions in driver.c used 8 spaces per tab instead of 4 like the rest of the file. Fix this to make it more consistent and give me more room to work in ms_dirty_update in subsequent commits. v1: N/A v2: N/A v3: N/A v4: Initial commit Signed-off-by: Alex Goins <agoins@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-04XQuartz: Update copyright yearsJeremy Huddleston Sequoia1-2/+2
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-04XQuartz: Add --with-bundle-version and --with-bundle-version-string ↵Jeremy Huddleston Sequoia2-3/+5
configure options Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03XQuartz: Add --with-sparkle-feed-url configure optionJeremy Huddleston Sequoia2-2/+2
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03XQuartz: Update release feed URL to use new https URLJeremy Huddleston Sequoia1-14/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03xfree86: add support for MatchIsTabletPadPeter Hutterer5-0/+19
The tablet pads have been separate kernel devices for a while now and libwacom has labelled them with the udev ID_INPUT_TABLET_PAD for over a year now. Add a new MatchIsTabletPad directive to apply configuration options specifically to the Pad part of a tablet. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-02modesetting: port clean start code from amdgpu. (v2)Dave Airlie3-12/+36
Both radeon and amdgpu don't set the mode until the first blockhandler, this means everything should be rendered on the screen correctly by then. This ports this code, it also removes the tail call of EnterVT from ScreenInit, it really isn't necessary and causes us to set a dirty mode with -modesetting always anyways. v2: reorder set desired modes vs block handler as done for amdgpu. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-02modesetting: add support for background none.Dave Airlie4-26/+106
This adds support using glamor for background None. loosely based off the amdgpu code. relies on the glamor_finish code. Acked-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-29kdrive: Nuke a bunch of dead codeAdam Jackson1-441/+0
gcc6 says: keyboard.c:46:21: warning: ‘linux_to_x’ defined but not used Only referenced by a bunch of long if-0'd code, so chuck it all out. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-29dix: Squash some new gcc6 warningsAdam Jackson1-1/+1
-Wlogical-op now tells us: devices.c:1685:23: warning: logical ‘and’ of equal expressions Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-29x86emu: Change include order to avoid conflict with system headerAndreas Schwab2-9/+1
R_SP is also defined in <sys/ucontext.h> on m68k. Also remove duplicate definitions. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Andreas Schwab <schwab@suse.de>
2016-04-25xwayland-shm: fortify fallocate against EINTRMarek Chalupa1-2/+8
If posix_fallocate or ftruncate is interrupted by signal while working, we return -1 as fd and the allocation process returns BadAlloc error. That causes xwayland clients to abort with 'BadAlloc (insufficient resources for operation)' even when there's a lot of resources available. Fix it by trying again when we get EINTR. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-18xfree86/parser: simplify #ifdef ladderEmil Velikov1-22/+9
Rather than 'hacking' around symbol names and providing macros such as 'Local' just fold things and make the code more readable. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>