summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-06-11dri2: Reuse unused flags in GetBuffers protocol to pass last SBCHEADmasterChris Wilson3-5/+23
Allow mesa/dri2 to implement GLX_EXT_buffer_age by reporting the sbc of when the current back buffer was defined. As this may require ddx support, only set the value if enabled by the ddx and report the new semantics via a DRI2GetParam request. v2: From Martin Peres - Fix a NULL-pointer dereference Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-08dri2: Pass swap-interval=0 ScheduleSwap requests to the ddxChris Wilson2-5/+14
Allow the DDXes to opt-in and handle swap-interval=0 requests for themselves, for example by using asynchronous pageflips, rather than forcing a blit. This has the important side-effect of also disambiguating CopyRegion calls to always be client requests. References: http://lists.x.org/archives/xorg-devel/2011-June/023102.html References: http://lists.x.org/archives/xorg-devel/2012-February/029336.html Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-08dri2: Allow GetBuffers to match any formatChris Wilson1-5/+8
Since the introduction of DRI2GetBuffersWithFormat, the old DRI2GetBuffers interface would always recreate all buffers all the time as it was no longer agnostic to the format value being set by the DDXes. This causes an issue with clients intermixing the two requests, rendering any sharing or caching of buffers (e.g. for triple buffering) void. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-02glamor: don't do render ops with matching source/dest (v3)Dave Airlie2-1/+17
XRender defines this, GL really doesn't like it. kwin 4.x and qt 4.x seem to make this happen for the gradient in the titlebar, and on radeonsi/r600 hw this draws all kinds of wrong. v2: bump this up a level, and check it earlier. (I assume the XXXX was for this case.) v3: add same code to largepixmap paths (Keith) Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-05-27xwayland: Throttle our cursor surface updates with a frame callbackRui Matos3-1/+31
In some extreme cases with animated cursors at a high frame rate we could end up filling the wl_display outgoing buffer and end up with wl_display_flush() failing. In any case, using the frame callback to throttle ourselves is the right thing to do. Signed-off-by: Rui Matos <tiagomatos@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-26present: Copy unflip contents back to the Screen PixmapChris Wilson1-4/+4
As we unflip after the flip Window no longer passes the pixel ownership test for the full Screen Pixmap, we can no longer utilize that Window to copy the contents back to the backing pixmap. To first flip means that the Window was originally backed by the Screen Pixmap and wholly covered the Pixmap, thus we need to copy the last frame contents to the Screen Pixmap when the flip chain is complete. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2015-05-26backtrace.c: Fix word cast to a pointerVicente Olivert Riera1-2/+2
backtrace.c uses a word size provided by libunwind. In some architectures like MIPS, libunwind makes that word size 64-bit for all variants of the architecture. In the lines #90 and #98, backtrace.c tries to do a cast to a pointer, which fails in all MIPS variants with 32-bit pointers, like MIPS32 or MIPS64 n32, because it's trying to do a cast from a 64-bit wide variable to a 32-bit pointer: Making all in os make[2]: Entering directory `/home/test/test/1/output/build/xserver_xorg-server-1.15.1/os' CC WaitFor.lo CC access.lo CC auth.lo CC backtrace.lo backtrace.c: In function 'xorg_backtrace': backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname && ^ backtrace.c:98:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (void *)(pip.start_ip + off)); ^ cc1: some warnings being treated as errors make[2]: *** [backtrace.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. Related: https://bugs.freedesktop.org/show_bug.cgi?id=79939 Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-26xwayland: default to local user if no xauth file given. [CVE-2015-3164 3/3]Ray Strode1-0/+2
Right now if "-auth" isn't passed on the command line, we let any user on the system connect to the Xwayland server. That's clearly suboptimal, given Xwayland is generally designed to be used by one user at a time. This commit changes the behavior, so only the user who started the X server can connect clients to it. Signed-off-by: Ray Strode <rstrode@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-26os: support new implicit local user access mode [CVE-2015-3164 2/3]Ray Strode3-4/+130
If the X server is started without a '-auth' argument, then it gets started wide open to all local users on the system. This isn't a great default access model, but changing it in Xorg at this point would break backward compatibility. Xwayland, on the other hand is new, and much more targeted in scope. It could, in theory, be changed to allow the much more secure default of a "user who started X server can connect clients to that server." This commit paves the way for that change, by adding a mechanism for DDXs to opt-in to that behavior. They merely need to call LocalAccessScopeUser() in their init functions. A subsequent commit will add that call for Xwayland. Signed-off-by: Ray Strode <rstrode@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-26xwayland: Enable access control on open sockets [CVE-2015-3164 1/3]Ray Strode1-1/+1
Xwayland currently allows wide-open access to the X sockets it listens on, ignoring Xauth access control. This commit makes sure to enable access control on the sockets, so one user can't snoop on another user's X-over-wayland applications. Signed-off-by: Ray Strode <rstrode@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-20test: add tests for new valuator mask featuresPeter Hutterer1-0/+63
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-20dix: hook up the unaccelerated valuator masksPeter Hutterer2-7/+24
If present, access the unaccelerated valuator mask values for DGA and XI2 raw events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-20dix: Add unaccelerated valuators to the ValuatorMaskPeter Hutterer4-4/+93
Allows a mask to carry both accelerated and unaccelerated motion at the same time. This is required for xf86-input-libinput where the pointer acceleration happens in libinput already, but parts of the server, specifically raw events and DGA rely on device-specific unaccelerated data. To ease integration add this as a second set to the ValuatorMask rather than extending all APIs to carry a second, possibly NULL set of valuators. Note that a valuator mask should only be used in either accel/unaccel or standard mode at any time. Switching requires either a valuator_mask_zero() call or unsetting all valuators one-by-one. Trying to mix the two will produce a warning. The server has a shortcut for changing a mask with the valuator_mask_drop_unaccelerated() call. This saves us from having to loop through all valuators on every event, we can just drop the bits we know we don't want. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-20dix: fix indentationPeter Hutterer1-2/+2
from 9ff89a2e469ab0ac5af57d0fc115127feb1c0d99 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-20xfree86: drop if 0 hunkPeter Hutterer1-12/+0
Disabled in 2005. bye bye. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18config: remove 10-evdev.conf, let the evdev driver install that filePeter Hutterer2-42/+2
Now that we have two likely drivers that fight for control over the input devices (evdev and libinput) let's move the respective driver assignment to each package. So you get what you install. https://bugs.freedesktop.org/show_bug.cgi?id=89023 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-14Revert "glx/dri2: Disable AIGLX if indirect GLX is disabled"Keith Packard1-3/+0
This reverts commit d61ae18074e53c2cdfb13cc37693b526160d6ca7. If the DRI2 provider is disabled, then we don't advertise the correct GLX extensions to clients, and things like GLES fail. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90442 Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-05-14glamor: Replace CompositeGlyphs code [v2]Keith Packard9-1978/+589
New composite glyphs code uses the updated glamor program infrastructure to create efficient shaders for drawing render text. Glyphs are cached in two atlases (one 8-bit, one 32-bit) in a simple linear fashion. When the atlas fills, it is discarded and a new one constructed. v2: Eric Anholt changed the non-GLSL 130 path to use quads instead of two triangles for a significant performance improvement on hardware with quads. Someone can fix the GLES quads emulation if they want to make it faster there. v3: Eric found more dead code to delete Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Adapt glamor_program API to handle render accelerationKeith Packard8-30/+347
This extends the existing API to support options needed for render accleration, including an additional fragment, 'combine', (which provides a place to perform the source IN mask operation before the final OP dest state) and an additional 'defines' parameter which provides a way to add target-dependent values without using a uniform. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Compute GLSL version from GL_SHADING_LANGUAGE_VERSION (v3)Keith Packard1-9/+39
Use code from Piglit project to compute GLSL version for either GL or GLES. The Piglit code was originally written by Chad Versace. v2: bail if the parse fails (requested by Eric Anholt) v3: Use version 1.20 for GLES until we fix our programs (Eric Anholt) Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Remove destination drawable argument from glamor_set_textureKeith Packard2-8/+4
This argument wasn't used at all. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Pass depth to glamor_pm_is_solid and glamor_set_planemaskKeith Packard7-17/+16
Instead of passing the destination drawable, just pass the depth, as the underlying functions need only that to check whether the planemask is going to work. This API change will allow higher level functions to not need the destination pixmap. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-12Xephyr: Fix broken image when endianess of client machine and host-Xserver ↵Egbert Eich1-2/+10
differ The image is created in the native byte order of the machine Xephyr is rendered on however drawn in the image byte order of the Xephyr server. Correct byte order in the xcb_image_t structure and convert to native before updating the window. If depths of Xephyr and host server differ this is already taken care of by the depth conversion routine. It is a terrible wase to always convert and transmit the entire image no matter of the size of the damaged area. One should probably use sub-images here. For now we leave this as an exercise. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12Xephyr: Fix screen image draw for the non-Glamor & non-XHSM caseEgbert Eich1-1/+1
xcb_image_put() prints the entire image, therefore don't use an offset. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12Xephyr: Fix compile when debugging is enabledEgbert Eich1-1/+1
Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12Xephyr: Print default server display number if none is specifiedEgbert Eich1-1/+1
Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12Xephyr: Don't crash when no command line argument is specifiedEgbert Eich4-5/+12
The DDX specific command line parsing function only gets called if command line arguments are present. Therefore this function is not suitable to initialize mandatory global variables. Replace main() instead. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12glamor: fix build when DRI3 is not definedJonathan Gray1-1/+5
Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12glamor: remove const from the return type of glamor_get_drawable_location()Jonathan Gray2-2/+2
Fixes a build error with gcc 4.2.1 on OpenBSD due to -Werror=return-type from xorg-macros. error: type qualifiers ignored on function return type Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12modesetting: Include dix-config.h from dumb_bo.cMichel Dänzer1-0/+4
Fixes mmap failures with 32-bit builds. Signed-off-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-12Add AC_SYS_LARGEFILE defines to dix-config.hMichel Dänzer1-0/+6
Without this, AC_SYS_LARGEFILE doesn't actually have any effect. Signed-off-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-11Merge remote-tracking branch 'evelikov/master'Keith Packard5-97/+26
2015-05-11Merge remote-tracking branch 'ajax/xserver-next'Keith Packard4-2/+15
2015-05-11xwayland: Fix error stringsRobert Ancell3-5/+5
Fix missing newlines from error string and fix grammar. Signed-off-by: Robert Ancell <robert.ancell@canonical.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-11Merge remote-tracking branch 'airlied/for-keithp'Keith Packard14-56/+577
2015-05-11modesetting: Fix software cursor fallbackAdel Gadllah1-2/+2
The code in drmmode_set_cursor does not properly handle the case where drmModeSetCursor2 returns any other error than EINVAL and silently fails to set a cursor. So only return when the drmModeSetCursor2 succeeds (i.e returns 0) and disable the cursor2 usage on EINVAL. References: https://bugzilla.redhat.com/show_bug.cgi?id=1205725 Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-11xwayland: Implement smooth scrollingDima Ryazanov2-41/+16
We don't even need to simulate button clicks; it's done automatically. This also fixes scrolling in Qt5 apps. Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-11dix: Do not allow device transform to be set on valuatorless devicesJason Gerecke1-0/+3
If a device does not have any valuators, it makes no sense to set the device transformation. Return a BadMatch error to let the caller know that they're trying something stupid. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-11dix/events: Set currentTime to the given time stamp in NoticeTimeRui Matos1-0/+1
The refactoring in commit efc1035ca958f2c9d266338a308518a0834b1773 removed the actual update of currentTime. Signed-off-by: Rui Matos <tiagomatos@gmail.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-11Merge remote-tracking branch 'jturney/mingw-build-fixes'Keith Packard4-2/+12
2015-05-07shm: Fix xselinux resource initialization for xinerama pixmapsBrent Collins1-0/+6
This is necessary to avoid a NULL pointer deference when the pixmap is used later. [ajax: massaged commit message, fixed it to compile] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89748 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Brent Collins <bcollins@trustedcs.com>
2015-05-07shm: Fix use-after-free in ShmDestroyPixmapChris Wilson1-2/+2
We pass the pPixmap->drawable.id to the ShmDetachSegment function after the pPixmap is freed. Fortunately, we don't use the value inside ShmDetachSegment and can simply pass zero instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michel Dänzer <michel@daenzer.net>
2015-05-07glx/dri2: Disable AIGLX if indirect GLX is disabledChris Wilson1-0/+3
There is no point in setting up the acceleration for indirect GLX if indirect GLX is itself disabled. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-07dix: Fix image byte order on big endian hardwareOlivier Fourdan1-0/+2
Make sure X_BIG_ENDIAN/X_LITTLE_ENDIAN are defined before actually using them. Otherwise, image byte order could be wrong on big endian hardware even though endianess detection is correct. Reported-by: Tim Waugh <twaugh@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2015-05-07xfree86: Return NULL from xf86CompatOutput if no compat_output is definedJason Gerecke1-0/+2
If no compat_output is defined, we inadvertently (attempt to) return whatever data is at index -1. Instead, return NULL since that's what callers are expecting. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-05-07xwayland: Fix error stringsRobert Ancell3-5/+5
Fix missing newlines from error string and fix grammar. Signed-off-by: Robert Ancell <robert.ancell@canonical.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-04-27modesetting: add tile property support (v2.1)Dave Airlie2-0/+43
This adds tiling support to the server modesetting driver, it retrieves the tile info from the kernel and translates it into the server format and exposes the property. v2.1: fix resetting tile property (Chris) Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27modesetting: add dynamic connector hotplug support (MST) (v3)Dave Airlie1-16/+197
This is ported from the same code in the ati and intel drivers, It uses the same option name as nvidia and the other DDXes to disable tearing down outputs as it is hard to avoid racing with clients. v2: address two issues with DeleteUnusedDP12 enabled, reported by Daniel Martin, a) check we have a mode_output before destroying it b) only delete *unused* displays (thanks Aaron for clarifying) so we check if the output has a crtc and if it does we don't delete it. v3: drop the option to delete unused displays, just encode behaviour into the randr spec. Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27modesetting: stop caching mode resourcesDave Airlie2-18/+19
There is no need to cache the mode resources and with dynamic connectors for mst support we don't want to. So first clean that up before adding dynamic connector support. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27xf86Crtc/monitors: create initial monitors for tiled outputsDave Airlie3-3/+78
This creates an automatic monitor for a tiled monitor at startup. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>