AgeCommit message (Collapse)AuthorFilesLines
2016-10-28Bump to (1.19 RC2)xorg-server- Packard1-3/+3
Signed-off-by: Keith Packard <>
2016-10-28dix: Bump MAXHASHSIZE for the resource db [v2]Keith Packard1-24/+9
[This was originally a workaround for a client-side resource leak: Obviously that's a broken app, but the performance problem it illustrates - that walking the linked list ends up burning all your CPU time - is real enough. - ajax] v2: Replace with a shorter code sequence which computes the same results for all but numBits == 7 Reviewed-by: Adam Jackson <> Signed-off-by: Keith Packard <>
2016-10-28Merge remote-tracking branch 'jturney/master'Keith Packard2-3/+10
2016-10-28os: Recompute whether any clients are ready after ProcessWorkQueue() (bug 98030)Keith Packard1-1/+3
If a work proc wakes up a sleeping client and it is ready to execute, we need to re-compute the local 'are_ready' value before deciding what timeout value to use in WaitForSomething. Bugzilla: Signed-off-by: Keith Packard <> Reviewed-by: Hans de Goede <>
2016-10-28ephyr: Leave window unmapped for -glamor-skip-present [v2]Keith Packard1-1/+5
If we're never painting anything in the window, we probably don't need to map it. v2: Drop ephyr_glamor_gles2 from hostx.c Signed-off-by: Keith Packard <> Reviewed-by: Eric Anholt <>
2016-10-28ramdac: Check sPriv != NULL in xf86CheckHWCursor()Alex Goins1-0/+4
xf86CheckHWCursor() would dereference sPriv without NULL checking it. If Option "SWCursor" is specified, sPriv == NULL. In this case we should assume that HW cursors are not supported. Signed-off-by: Alex Goins <> Reviewed-by: Andy Ritger <> Signed-off-by: Keith Packard <>
2016-10-27glx/dri2: Don't build DRI loader if DRI2 isn't enabledJon Turney2-3/+10
This partially reverts 501d8e2b. Signed-off-by: Jon Turney <> Reviewed-by: Emil Velikov <>
2016-10-27inputthread: On Linux leave the main thread's name as-isPeter Hutterer1-0/+2
On Linux, setting the main thread's name changes the program name (/proc/self/comm). Setting it to MainThread breaks scripts that rely on the command name, e.g. ps -C Xorg. Signed-off-by: Peter Hutterer <> Signed-off-by: Hans de Goede <>
2016-10-26xwayland: Activate and enable touch devicesOlivier Fourdan1-3/+4
On some random condition, a touch event may trigger a crash in Xwayland in GetTouchEvents(). The (simplified) backtrace goes as follow: (gdb) bt #0 GetTouchEvents() at getevents.c:1892 #1 QueueTouchEvents() at getevents.c:1866 #2 xwl_touch_send_event() at xwayland-input.c:652 #5 wl_closure_invoke() from #6 dispatch_event() from #7 wl_display_dispatch_queue_pending() from #8 xwl_read_events() at xwayland.c:483 #9 ospoll_wait() at ospoll.c:412 #10 WaitForSomething() at WaitFor.c:222 #11 Dispatch() at dispatch.c:412 #12 dix_main() at main.c:287 #13 __libc_start_main() at libc-start.c:289 #14 _start () The crash occurs when trying to access the sprite associated with the touch device, which appears to be NULL. Reason being the device itself is more a keyboard device than a touch device. Moreover, it appears the device is neither enabled nor activated (inited=0, enabled=0) which doesn't seem right, but matches the code in init_touch() from xwayland-input.c which would enable the device if it was previously existing and otherwise would create the device but not activate it. Make sure we do activate and enable touch devices just like we do for other input devices such as keyboard and pointer. Signed-off-by: Olivier Fourdan <> Reviewed-by: Hans de Goede <>
2016-10-26xwayland: Transform pointer enter event coordinatesRui Matos1-1/+4
Pointer enter event coordinates are surface relative and we need them to be screen relative for pScreen->SetCursorPosition(). Signed-off-by: Rui Matos <> Reviewed-by: Eric Engestrom <> Reviewed-by: Jonas Ådahl <> Signed-off-by: Hans de Goede <>
2016-10-26modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORTNikhil Mahale1-2/+0
Commit c7e8d4a6ee9542f56cd241cf7a960fb8223a6b22 had already unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT but commit 9257b1252da9092ddc676fec9aabe2b33dfad272 didn't notice that. Signed-off-by: Nikhil Mahale <> Reviewed-by: Hans de Goede <> Signed-off-by: Hans de Goede <>
2016-10-26xfree86: Xorg.wrap: Do not require root rights for cards with 0 outputsHans de Goede1-1/+1
Prior to this commit the Xorg.wrap code to detect if root rights are necessary checked for DRM_IOCTL_MODE_GETRESOURCES succeeding *and* reporting more then 0 output connectors. DRM_IOCTL_MODE_GETRESOURCES succeeding alone is enough to differentiate between old drm only cards (which need ums and thus root) and kms capable cards. Some hybrid gfx laptops have 0 output connectors on one of their 2 GPUs, resulting in Xorg needlessly running as root. This commits removes the res.count_connectors > 0 check, fixing this. Signed-off-by: Hans de Goede <> Reviewed-by: Eric Engestrom <>
2016-10-26DRI2: Sync radeonsi_pci_ids.h from MesaMichel Dänzer1-0/+12
Fixes DRI2 client driver name mapping for newer AMD GPUs with the modesetting driver, allowing the DRI2 extension to initialize. Signed-off-by: Michel Dänzer <> Reviewed-by: Alex Deucher <> Signed-off-by: Hans de Goede <>
2016-10-26modesetting: fix glamor ifdefMihail Konev1-0/+2
Add a missing ifdef needed for --disable-glamor. Signed-off-by: Mihail Konev <> Reviewed-by: Jon Turney <> Signed-off-by: Hans de Goede <>
2016-10-26xwin: make glx optional againMihail Konev1-2/+2
Commit 501d8e2b removed --enable-aiglx, but made xwin always be --enable-glx. Signed-off-by: Mihail Konev <> Reviewed-by: Emil Velikov <> Reviewed-by: Jon Turney <> Signed-off-by: Hans de Goede <>
2016-10-26ddx: add new call to purge input devices that weren't addedPeter Hutterer7-0/+57
Special case for the systemd-logind case in xfree86: when we're vt-switched away and a device is plugged in, we get a paused fd from logind. Since we can't probe the device or do anything with it, we store that device in the xfree86 and handle it later when we vt-switch back. The device is not added to inputInfo.devices until that time. When the device is removed while still vt-switched away, the the config system never notifies the DDX. It only runs through inputInfo.devices and our device was never added to that. When a device is plugged in, removed, and plugged in again while vt-switched away, we have two entries in the xfree86-specific list that refer to the same device node, both pending for addition later. On VT switch back, the first one (the already removed one) will be added successfully, the second one (the still plugged-in one) fails. Since the fd is correct, the device works until it is removed again. The removed devices' config_info (i.e. the syspath) doesn't match the actual device we addded tough (the input number increases with each plug), it doesn't get removed, the fd remains open and we lose track of the fd count. Plugging the device in again leads to a dead device. Fix this by adding a call to notify the DDX to purge any remainders of devices with the given config_info, that's the only identifiable bit we have at this point. Signed-off-by: Peter Hutterer <> Reviewed-by: Hans de Goede <>
2016-10-26xfree86: swap the list of paused devices to an xorg_listPeter Hutterer1-11/+20
No functional changes but it makes it easier to remove elements from the middle of the list (future patch). We don't have an init call into this file, so the list is manually initialized. Signed-off-by: Peter Hutterer <> Reviewed-by: Hans de Goede <>
2016-10-26xfree86: use the right option traversal list to search for an optionPeter Hutterer1-11/+7
They're identically laid-out structs but let's use the right type to search for our desired value. Signed-off-by: Peter Hutterer <> Reviewed-by: Hans de Goede <>
2016-10-25glamor: don't look for non-existing EGL_KHR_platform_baseEmil Velikov1-11/+8
The extension does not exist in the registry, thus needs to know they're using EGL 1.5 in order to determine the eglGetPlatformDisplay function pointer is valid. Thus brings us into some lovely circular dependency. Since mesa won't be able (in the foreseeable future) to export the KHR flavour of extension (another way one could assume that EGL 1.5 is available) just drop all the heuristics and use the EGL_EXT_platform_base extension. In practise (checked with the Mali driver) any EGL 1.5 driver will advertise support for EGL_EXT_platform_base. Reviewed-by: Adam Jackson <> Signed-off-by: Emil Velikov <>
2016-10-15os/inputthread: Ensure pollfd refreshingMihail Konev1-1/+4
When putting a device node into a poll-request list, do not overwrite a "please-remove" element with the same fd, so that a closed device file is ospoll_remove'd prior to being ospoll_add'ed. Before, the opposite order was possible, resulting in ospoll_add considering the newly opened file being already polled, should it have a fd for which the "please-remove" has not been procesed yet. In this case, no further events would be seen from the device. Signed-off-by: Mihail Konev <> Regressed-in: 52d6a1e832a5e62289dd4f32824ae16a78dfd7e8 Bugzilla: Patchwork: Hit-and-Reduced-by: Hans de Goede <> Reviewed-and-Reduced-by: Peter Hutterer <> Reviewed-by: Keith Packard <> Signed-off-by: Keith Packard <>
2016-10-13xf86Cursor: Take the input lock in xf86Set/MoveCursorMichel Dänzer1-3/+14
Prevents the HW cursor from intermittently jumping around when the cursor image is changed while the cursor is being moved. This is hardly noticeable in normal operation but can be quite confusing when stepping through these codepaths in a debugger. Reviewed-by: Hans de Goede <>
2016-10-13xf86Cursor: Use PRIME master xf86CursorScreenRec::HotX/Y for slavesMichel Dänzer1-4/+16
xf86CursorScreenRec::HotX/Y contain 0 for PRIME slave screens. Fixes incorrect HW cursor position on PRIME slave screens. Also hoist the hotspot translation out from xf86ScreenSet/MoveCursor to xf86Set/MoveCursor, since the hotspot position is a property of the cursor, not the screen. v2: * Squash patches 1 & 2 of the v1 series, since it's basically the same problem * Use the master screen's xf86CursorScreenRec::HotX/Y instead of CursorRec::bits->x/yhot, since CursorRec::bits can be NULL (Hans de Goede) Reviewed-by: Hans de Goede <>
2016-10-10glx/dri2: Don't include drm headersAdam Jackson1-2/+0
They're not needed, and they won't be present on win32. Signed-off-by: Adam Jackson <> Reviewed-by: Emil Velikov <>
2016-10-06Fix id in error when resource does not existPeter Harris1-2/+6
Always set client->errorValue before returning an error. Test program: int main(int argc, char *argv[]) { int screen = 0; xcb_connection_t *c = xcb_connect(NULL, &screen); if (!c) { printf("Cannot connect\n"); return 1; } xcb_void_cookie_t tok = xcb_free_gc_checked(c, BAD_VALUE); xcb_g_context_error_t *err = (xcb_g_context_error_t *)xcb_request_check(c, tok); if (!err) { printf("Unexpected request success\n"); return 1; } if (err->bad_value != BAD_VALUE) { printf("Error: Got 0x%X, expected 0x%X\n", err->bad_value, BAD_VALUE); return 1; } printf("Success! Got expected bad value of 0x%X\n", BAD_VALUE); return 0; } Reviewed-by: Adam Jackson <> Signed-off-by: Peter Harris <>
2016-10-05glamor: Use eglGetPlatformDisplay{,EXT} if we canAdam Jackson4-9/+93
eglGetDisplay forces the implementation to guess which kind of display it's been handed. glvnd does something different from Mesa, and in general it's impossible for the library to get this right. Add a new inline that gets the logic right, and works around a quirk in epoxy. Signed-off-by: Adam Jackson <> Reviewed-by: Eric Anholt <>
2016-10-05test: Use $XSERVER_BUILDDIR for Xvfb executable pathMichel Dänzer1-1/+1
Fixes make check with out-of-tree builds. Signed-off-by: Michel Dänzer <> Reviewed-by: Keith Packard <> Reviewed-by: Eric Anholt <>
2016-10-05xfree86/dri: remove libdrm runtime checksEmil Velikov1-21/+1
As of last commit all the places in our require version 2.3.1 (released back in 2007) or later. With the latter introducing the 1.3.0 version, as returned by drmGetLibVersion. Signed-off-by: Emil Velikov <> Reviewed-by: Adam Jackson <> bump the required libdrm version to 2.3.1Emil Velikov1-1/+1
It fixes a bug where the version reported by drmGetLibVersion() was 'wrong'. See libdrm commit 79038751ffe("libdrm: add support for server side functionality in libdrm") for details. Signed-off-by: Emil Velikov <> Reviewed-by: Adam Jackson <> use $LIBDRM over libdrm when using pkg-configEmil Velikov1-2/+2
The former contains the minimum required version which is required. Strictly speaking Xephyr/Xwayland may require version greater than the current 2.3.0, although I've personally haven't checked the specifics. Signed-off-by: Emil Velikov <> Reviewed-by: Adam Jackson <> default to DRI=yes on solaris platformsEmil Velikov1-1/+1
Afaict there's little-to-no reason/way one would want xserver without DRI support on Solaris platforms. This will allow us to simplify/fix all the libdrm detection in the next commit. Cc: Alan Coopersmith <> Signed-off-by: Emil Velikov <> Reviewed-by: Alan Coopersmith <> Reviewed-by: Adam Jackson <> remove --enable-aiglx optionEmil Velikov3-49/+4
Presently the option guards both direct and accelerated indirect GLX. As such when one toggles it off they end up without any acceleration. Remove the option all together until we have the time to split/rework things. Cc: Jon Turney <> Reviewed-by: Adam Jackson <> Signed-off-by: Emil Velikov <>
2016-10-05xfree86: remove aiglx cmd/xorg.conf optionEmil Velikov4-21/+3
The option is misleading and using it leads to disabling both direct and accelerated indirect GLX. In such cases the xserver GLX attempts to match DRISW (IGLX) configs with the DRI2/3 ones (direct GLX) leading to all sorts of fun experience. Remove the option until we get a clear split and control over direct vs indirect GLX. Reviewed-by: Adam Jackson <> Signed-off-by: Emil Velikov <>
2016-10-05glx: drisw is not accelerated IGLX, reflect that in log messagesEmil Velikov1-3/+3
The messages from glxdricommon.c (used by drisw) still have the A, but at least we're don't have it locally. Reviewed-by: Adam Jackson <> Signed-off-by: Emil Velikov <>
2016-10-05glamor: Fix pixmap offset for bitplane in glamor_copy_fbo_cpuOlivier Fourdan1-8/+10
Commit cba28d5 - "glamor: Handle bitplane in glamor_copy_fbo_cpu" introduced a regression as the computed pixmap offset would not match the actual coordinates and write data elsewhere in memory causing a segfault in fbBltOne(). Translate the pixmap coordinates so that the data is read and written at the correct location. Bugzilla: Signed-off-by: Olivier Fourdan <> Reviewed-and-Tested-by: Michel Dänzer <>
2016-10-05xwayland: Add pointer warp emulatorJonas Ådahl4-2/+322
Emulate pointer warps by locking the pointer and sending relative motion events instead of absolute. X will keep track of the "fake" pointer cursor position given the relative motion events, and the client warping the cursor will warp the faked cursor position. Various requirements need to be met for the pointer warp emulator to enable: The cursor must be invisible: since it would not be acceptable that a fake cursor position would be different from the visual representation of the cursor, emulation can only be done when there is no visual representation done by the Wayland compositor. Thus, for the emulator to enable, the cursor must be hidden, and would the cursor be displayed while the emulator is active, the emulator would be destroyed. The window that is warped within must be likely to have pointer focus. For example, warping outside of the window region will be ignored. The pointer warp emulator will disable itself once the fake cursor position leaves the window region, or the cursor is made visible. This makes various games depending on pointer warping (such as 3D first-person shooters and stategy games using click-to-drag-map like things) work. Signed-off-by: Jonas Ådahl <>
2016-10-05xwayland: Translate a pointer grab with confineTo to pointer confinementJonas Ådahl3-0/+101
Translate grabbing a pointer device with confineTo set to a window into confining the Wayland pointer using the pointer constraints protocol. This makes clients that depend on the pointer not going outside of the window region, such as certain games and virtual machines viewers, to function more properly. Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05xwayland: Bind pointer constraints globalJonas Ådahl4-1/+24
Will be used by the pointer warp emulator. Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05xwayland: Put getting a xwl_window from a Window in a helperJonas Ådahl1-2/+7
Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05xwayland: Set unaccelerated pointer motion delta if availableJonas Ådahl2-15/+82
If there was an relative pointer motion within the same frame as an absolute pointer motion, provide both the absolute coordinate and the unaccelerated delta when setting the valuator mask. If a frame contained only a relative motion, queue an absolute motion with an unchanged position, but still pass the unaccelerated motion event. If the wl_seat advertised by the compositor is not new enough, assume each relative and absolute pointer motion arrives within their own separate frames. Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05xwayland: Dispatch pointer motion events on wl_pointer.frame if possibleJonas Ådahl2-13/+68
Wait until wl_pointer.frame with dispatching the pointer motion event, if wl_pointer.frame is supported by the compositor. This will later be used to combine unaccelerated motion deltas with the absolute motion delta. Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05xwayland: Add a new input device used for pointer warping/lockingKrzysztof Sobiecki2-0/+72
Generating relative and absolute movement events from the same input device is problematic, because an absolute pointer device doesn't expect to see any relative motion events. To be able to generate relative pointer motion events including unaccelerated deltas, create a secondary pointer device 'xwayland-relative-pointer', and use that for emitting relative motion events. Signed-off-by: Krzysztof Sobiecki <> Signed-off-by: Jonas Ådahl <>
2016-10-05xwayland: Move pointer button initialization into helperJonas Ådahl1-17/+27
We'll later use this for initializing buttons for the relative pointer since they need to be the same. Signed-off-by: Jonas Ådahl <>
2016-10-05xwayland: Split up device class init/release into functionsJonas Ådahl1-53/+90
Put device class initialization in init_[device_class](xwl_seat) and releasing in release_[device class](xwl_seat). The purpose is to make it easier to add more type of initialization here later, without making the function too large. Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05xwayland: Bind the relative pointer managerJonas Ådahl5-5/+37
Will be used for getting unaccelerated motion events and later for relative motions used by a pointer warp emulator. Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05dix: Add valuator_mask_set_absolute_unacceleratedJonas Ådahl2-1/+17
Add a valuator mask setter for setting absolute coordinate combined with unaccelerated motion deltas. This will later be used by Xwayland to combine a wl_pointer.motion() event with the unaccelerated delta of a wp_relative_pointer.relative_motion() event. Signed-off-by: Jonas Ådahl <> Reviewed-by: Peter Hutterer <>
2016-10-05xwayland: Apply touch abs axes transformation before posting eventsCarlos Garnacho1-9/+8
The way we map the touch absolute device to screen coordinates can't work across wl_output mode and geometry events. Instead, set up a fixed coordinate space, and transform touch events according to the screen coordinate space as they happen. Reviewed-by: Adam Jackson <> Signed-off-by: Carlos Garnacho <>
2016-10-05xwayland: Apply "last pointer window" check only to the pointer deviceCarlos Garnacho1-19/+40
The checks in xwayland's XYToWindow handler pretty much assumes that the sprite is managed by the wl_pointer, which is not entirely right, given 1) The Virtual Core Pointer may be controlled from other interfaces, and 2) there may be other SpriteRecs than the VCP's. This makes XYToWindow calls return a sprite trace with just the root window if any of those two assumptions are broken, eg. on touch events. So turn the check upside down, first assume that the default XYToWindow proc behavior is right, and later cut down the spriteTrace if the current device happens to be the pointer and is out of focus. We work our way to the device's lastSlave here so as not to break assumption #1 above. Reviewed-by: Adam Jackson <> Signed-off-by: Carlos Garnacho <> Acked-by: Olivier Fourdan <>
2016-10-04fb: XYPixmap format PutImage includes all planes in depthKeith Packard1-1/+1
Unlike GetImage, for which the provided planemask restricts the data delivered, for PutImage in XYPixmap format, all of the planes in the drawable depth are sent and those outside the plane mask are simply ignored. Reviewed-by: Adam Jackson <> Signed-off-by: Keith Packard <>
2016-09-30glamor: spans: fixup wrong count on glDrawArraysMark Yao1-1/+1
In commit 9e9fcf5 (glamor: Add a helper function for the common GL_QUADS fallback pattern.), the glDrawArrays count change was accidentally changed to nbox. Fixes xlogo with MESA_GL_VERSION_OVERRIDE=2.1 and MESA_GLSL_VERSION_OVERRIDE=120 Signed-off-by: Mark Yao <> Reviewed-by: Eric Anholt <>
2016-09-29glamor: Fix link failure on GLES2.Eric Anholt1-2/+1
Current Mesa requires that the precision qualifier on uniforms matches between stages, even if (as in this case) the uniform isn't used in one of the stages. Signed-off-by: Eric Anholt <> Reviewed-by: Keith Packard <>