summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-28auth: remove AuthToIDFunc and associated functions. Not used anymore.HEADmasterMatthieu Herrb2-10/+3
And the current code for MitToId has a use-after-free() issue. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-02-28Use arc4random_buf(3) if available to generate cookies.Matthieu Herrb3-0/+15
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2017-02-28Use timingsafe_memcmp() to compare MIT-MAGIC-COOKIES CVE-2017-2624Matthieu Herrb5-2/+56
Provide the function definition for systems that don't have it. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-02-27os: log a bug whenever WriteToClient is called from the input threadPeter Hutterer3-0/+12
The input thread should generate events, not send them. Make it easier to find the instances where it's doing so. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-23Revert "xwayland: bump wayland-protocols version to 1.7"Olivier Fourdan1-1/+1
This reverts commit 371ff0c969a38a0013688391bbd7375bc7b6f933. Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-23xwayland: use _XWAYLAND_ALLOW_COMMITS propertyPekka Paalanen2-0/+124
The X11 window manager (XWM) of a Wayland compositor can use the _XWAYLAND_ALLOW_COMMITS property to control when Xwayland sends wl_surface.commit requests. If the property is not set, the behaviour remains what it was. XWM uses the property to inhibit commits until the window is ready to be shown. This gives XWM time to set up the window decorations and internal state before Xwayland does the first commit. XWM can use this to ensure the first commit carries fully drawn decorations and the window management state is correct when the window becomes visible. Setting the property to zero inhibits further commits, and setting it to non-zero allows commits. Deleting the property allows commits. When the property is changed from zero to non-zero, there will be a commit on next block_handler() call provided that some damage has been recorded. Without this patch (i.e. with the old behaviour) Xwayland can and will commit the surface very soon as the application window has been realized and drawn into. This races with XWM and may cause visible glitches. v3: - introduced a simple setter for xwl_window::allow_commits - split xwl_window_property_allow_commits() out of xwl_property_callback() - check MakeAtom(_XWAYLAND_ALLOW_COMMITS) v2: - use PropertyStateCallback instead of XACE, based on the patch "xwayland: Track per-window support for netwm frame sync" by Adam Jackson - check property type is XA_CARDINAL - drop a useless memcpy() Weston Bug: https://phabricator.freedesktop.org/T7622 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-23xwayland: fix 'buffer' may be used uninitialized warningPekka Paalanen1-1/+1
Fix the following warning due to --disable-glamor: CC Xwayland-xwayland.o In file included from /home/pq/local/include/wayland-client.h:40:0, from xwayland.h:35, from xwayland.c:26: xwayland.c: In function ‘block_handler’: /home/pq/local/include/wayland-client-protocol.h:3446:2: warning: ‘buffer’ may be used uninitialized in this function [-Wmaybe-uninitialized] wl_proxy_marshal((struct wl_proxy *) wl_surface, ^ xwayland.c:466:23: note: ‘buffer’ was declared here struct wl_buffer *buffer; ^ Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-23xwayland: refactor into xwl_window_post_damage()Pekka Paalanen1-23/+33
Refactor xwl_screen_post_damage() and split the window specific code into a new function xwl_window_post_damage(). This is a pure refactoring, there are no behavioral changes. An assert is added to xwl_window_post_damage() to ensure frame callbacks are not leaked if a future patch changes the call. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-23dix: Add a callback chain for window property state changeAdam Jackson2-0/+17
This will be used by in-server features that need to react to property changes. The first one will be _XWAYLAND_ALLOW_COMMITS. Signed-off-by: Adam Jackson <ajax@redhat.com> [Pekka: add commit message body] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-23dix: Pass the whole property into deliverPropertyNotifyEventAdam Jackson1-7/+7
Instead of just the atom. No functional change. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-23tests: Fix guards for ld -wrapMihail Konev2-98/+46
Fixes XQuartz build. Regressed-in: 23f6dbc96e47be6cbeed78cc9ef303987c3e29a9 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-02-23glamor: Fix missing declaration in dash vertex shaderDr.-Ing. Dieter Jurzitza1-0/+1
Fixes a GLSL compilation error: Failed to compile VS: 0:13(43): error: `pos' undeclared 0:13(14): error: operands to arithmetic operators must be numeric 0:13(13): error: operands to arithmetic operators must be numeric Tested-by: Stefan Dirsch <sndirsch@suse.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-23os: Fix iteration over busfaultsChris Wilson1-6/+7
Fixes a regression from commit 41da295eb50fa08eaacd0ecde99f43a716fcb41a Author: Keith Packard <keithp@keithp.com> Date: Sun Nov 3 13:12:40 2013 -0800 Trap SIGBUS to handle truncated shared memory segments that causes the SIGBUS handler to fail to chain up correctly and corrupts nearby memory instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-23inputthread: Initialise inputThreadInfo->changed before useChris Wilson1-0/+2
==8734== Thread 2 InputThread: ==8734== Conditional jump or move depends on uninitialised value(s) ==8734== at 0x2FDB05: InputThreadDoWork (inputthread.c:333) ==8734== by 0x6924423: start_thread (pthread_create.c:333) ==8734== by 0x6C229BE: clone (clone.S:105) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-20os: remove unused define MAX_TIMES_PEROlivier Fourdan1-1/+0
Remove leftover from commit e10ba9e, MAX_TIMES_PER is not used anymore. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-16mi: Add include guards to migc.hAdam Jackson1-0/+5
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16fb: Remove stray references to fbHasVisualTypesAdam Jackson2-5/+0
Removed in 84e8de12. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16fb: Remove unused fbGetFreeCompClip macroAdam Jackson1-1/+0
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16wfb: Hide init function decls behind FB_ACCESS_WRAPPERAdam Jackson1-3/+2
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16wfb: Add missing rename for fbGlyphsAdam Jackson1-0/+1
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16prime: Clear PixmapDirtyUpdateRec::damage when it's destroyedMichel Dänzer1-3/+12
The root window, and by extension any damage records referencing it, may be destroyed before shared pixmaps referencing it, which resulted in use-after-free / double-free in PixmapStopDirtyTracking. Fixes: b5b292896f64 ("prime: Sync shared pixmap from root window instead of screen pixmap") Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-16xwayland: bump wayland-protocols version to 1.7Olivier Fourdan1-1/+1
Xwayland support for pointer locking in confinement requires wayland-protocols version 1.7 or later. Update the required version in configure.ac to match the minimal required version of wayland-protocols. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-16xfree86: Reorganize the reserved ScrnInfoRec slotsAdam Jackson1-20/+7
First, move them to the end of the struct, for marginally better cache locality for the struct members that actually have meaning; move the existing slots at the end of the struct up near some others with similar meanings. Second, only keep four slots each of integer, data pointer, and function pointer; we've rarely used this escape hatch so this is still plenty. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16xfree86: Remove unused chipID/Rev from ScrnInfoRecAdam Jackson1-3/+0
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16xfree86: Remove memClk from ScrnInfoRecAdam Jackson2-2/+0
Never set by the core, not used in any modern driver. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16xfree86: Remove Option "BiosBase" (v2)Adam Jackson7-43/+1
Just no. The ddxDesign chunk removes the whole para about xf86FixPciResource, since it turns out that function doesn't exist at all anymore. The only drivers that reference this at all are i128 and mga, and even then only in the non-pciaccess path. v2: - Update commentary about i128/mga - Don't remove the BiosBase keyword from the config parser since that would turn a no-op into a fatal error (Aaron Plattner) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16xfree86: Drop virtualFrom from ScrnInfoRecAdam Jackson3-13/+2
Seriously not worth the effort of tracking this, especially now that competent drivers don't have a limit. The sis driver does inspect this member, but hilariously does so only so it can print the same information as the core does. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16xfree86: Remove max[HV]Value from ScrnInfoRecAdam Jackson3-32/+0
Only mach64 and rendition actually use this feature. Everyone else just checks it in their ValidMode hook, they can too. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16xfree86: Fix a comment about ScrnInfoRecAdam Jackson1-5/+1
We don't actually need (or intend) to keep this struct the same across revisions. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-14DetermineClientCmd: try using /proc/pid/cmdline on Solaris tooAlan Coopersmith1-39/+47
Solaris 11.3.5 introduced support for /proc/pid/cmdline, so try it first, and if we can't open it, then fallback to /proc/pid/psinfo as we did before. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-02-09xfree86: Bump video ABI to 24.0Adam Jackson1-1/+1
c02f6a68 changed the layout of xf86CrtcFuncs. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-08xwayland: Apply output rotation for screen sizeOlivier Fourdan1-12/+16
Previously, we would swap the width/height of the Xwayland output based on the output rotation, so that the overall screen size would match the actual rotation of each output. Problem is the RandR's ConstrainCursorHarder() handler will also apply the output rotation, meaning that when the output is rotated, the pointer will be constrained within the wrong dimension. Moreover, XRandR assumes the original output width/height are unchanged when the output is rotated, so by changing the Xwayland output width and height based on rotation, Xwayland causes XRandr to report the wrong output sizes (an output of size 1024x768 rotated left or right should remain 1024x768, not 768x1024). So to avoid this issue and keep things consistent between Wayland and Xwayland outputs, leave the actual width/height unchanged but apply the rotation when computing the screen size. This fixes both the output size being wrong in "xrandr -q" and the pointer being constrained in the wrong dimension with rotated with weston. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-08xwayland: CRTC should support all rotationsOlivier Fourdan1-1/+8
If the Wayland compositor sets a rotation on the output, Xwayland translates the transformation as an xrandr rotation for the given output. However, if the rotation is not supported by the CRTC, this is not a valid setup and xrandr queries will fail. Pretend we support all rotations and reflections so that the configuration remains a valid xrandr setup. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-08damage: Validate source pictures bound to windows before unwrappingMichel Dänzer2-1/+11
The lower layers also do this, but no damage may be reported there, since we unwrap before calling down. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99220 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-02-08xwayland: Add hack for FWXGA resolution #99574Svitozar Cherepii1-0/+7
For some applications (like fullscreen games) it matters for XRandr resolution to be correctly set and equal to root window resolution. In XServer there is already hack for this, adapted it for XWayland. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99574 Signed-off-by: Svitozar Cherepii <razotivs@gmail.com> Tested-by: Svitozar Cherepii <razotivs@gmail.com> Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-08present: Allow flipping with PRIME slave outputsMichel Dänzer1-16/+0
Works fine now. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-08prime: Sync shared pixmap from root window instead of screen pixmapMichel Dänzer1-4/+12
The screen pixmap doesn't receive updates while there's a Present flip window. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-08modesetting: allow switching from software to hardware cursors (v5).Michael Thayer2-18/+13
Currently if modesetting ever fails to set a hardware cursor it will switch to using a software cursor and never go back. Change this to only permanently switch to a software cursor if -ENXIO is returned (which means hardware cursors not supported), and to otherwise still try a hardware cursor first every time a new one is set. This is needed because hardware may be able to handle some cursors in hardware and others not, or virtual hardware may be able to handle hardware cursors at some times and not others. Changes since v1, v2 and v3: * take into account the switch to load_cursor_argb_check * keep the permanent software cursor fall-back if -ENXIO is returned * move parts of v3 into separate patches Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
2017-02-08modesetting: Immediately handle failure to set HW cursor, v5Michael Thayer2-11/+5
Based on v4 by Alexandre Courbot <acourbot@nvidia.com> There is currently no reliable way to report failure to set a HW cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM ioctl fails (which currently happens at least with modesetting on Tegra for format incompatibility reasons). As failures are currently handled by setting the HW cursor size to (0,0), the fallback to SW cursor will not happen until the next time the cursor changes and xf86CursorSetCursor() is called again. In the meantime, the cursor will be invisible to the user. This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans. This allows to propagate errors up to xf86CursorSetCursor(), which can then fall back to using the SW cursor immediately. v5: - Removed parts of patch already committed as part of 14c21ea1. - Adjusted code slightly to match surrounding code. - Effectively reverted af916477 which is made unnecessary by this patch. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
2017-02-08xfree86: Immediately handle failure to set HW cursor, v5Michael Thayer4-15/+53
Based on v4 by Alexandre Courbot <acourbot@nvidia.com> There is currently no reliable way to report failure to set a HW cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM ioctl fails (which currently happens at least with modesetting on Tegra for format incompatibility reasons). As failures are currently handled by setting the HW cursor size to (0,0), the fallback to SW cursor will not happen until the next time the cursor changes and xf86CursorSetCursor() is called again. In the meantime, the cursor will be invisible to the user. This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans. This allows to propagate errors up to xf86CursorSetCursor(), which can then fall back to using the SW cursor immediately. v5: Updated the patch to apply to current git HEAD, split up into two patches (server and modesetting driver) and adjusted the code slightly to match surrounding code. I also removed the new exported function ShowCursorCheck(), as instead just changing ShowCursor() to return Bool should not affect its current callers. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
2017-02-08dmx: fix linkingMihail Konev1-1/+2
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-08dri1: Remove some dead event codeAdam Jackson1-7/+0
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-08xwayland: replace hardcoded function name with __func__ in error msgPeter Hutterer2-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-06xfree86: Take input_lock() for xf86ScreenCheckHWCursorChris Wilson1-7/+20
2017-02-06xfree86: Take input lock for xf86TransparentCursorChris Wilson1-0/+4
2017-02-06xfree86: Take the input lock for xf86RecolorCursorChris Wilson1-6/+18
xf86RecolorCursor() may be called directly from XRecolorCursor as well as from xf86ScreenSetCursor(). In the latter case, the input lock is already held, but not for the former and so we need to add a wrapper function that acquires the input lock before performing xf86RecolorCursor() References: https://bugs.freedesktop.org/show_bug.cgi?id=99358
2017-02-01present: disable page flip only when a slave crtc is activeQiang Yu1-1/+13
This prevents the tearing of moving window in a composite WM desktop when output slave is attached but none of its crtc is really active. Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-01loader: Handle mod->VersionInfo == NULLMichel Dänzer1-10/+11
This can happen when a module fails to load: Program received signal SIGSEGV, Segmentation fault. UnloadModule (_mod=0x5555559d9280) at ../../../../hw/xfree86/loader/loadmod.c:848 848 name = mod->VersionInfo->modname; (gdb) bt #0 UnloadModule (_mod=0x5555559d9280) at ../../../../hw/xfree86/loader/loadmod.c:848 #1 0x00005555555ddd1b in LoadModule (module=module@entry=0x5555559c7ce0 "fbdev", options=0x0, modreq=modreq@entry=0x0, errmaj=errmaj@entry=0x7fffffffe8ec) at ../../../../hw/xfree86/loader/loadmod.c:824 #2 0x00005555555edfe9 in xf86LoadModules (list=list@entry=0x5555559dcf50, optlist=optlist@entry=0x0) at ../../../../hw/xfree86/common/xf86Init.c:1506 #3 0x00005555555ee7bc in InitOutput (pScreenInfo=pScreenInfo@entry=0x5555559abf80 <screenInfo>, argc=argc@entry=4, argv=argv@entry=0x7fffffffeb18) at ../../../../hw/xfree86/common/xf86Init.c:484 #4 0x00005555555a885c in dix_main (argc=4, argv=0x7fffffffeb18, envp=<optimized out>) at ../../dix/main.c:197 #5 0x00007ffff5d582b1 in __libc_start_main (main=0x555555593130 <main>, argc=4, argv=0x7fffffffeb18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffeb08) at ../csu/libc-start.c:291 #6 0x000055555559316a in _start () Fixes: 8e83eacb9e2d ("loader: Remove unused path and name from ModuleDescPtr") Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-25dri2: refine dri2_probe_driver_name (v2)Qiang Yu2-20/+30
V2: 1. update comment 2. check bustype if PCI 3. configure add libdrm version check for drmGetDevice Get PCI information from info->fd with drmGetDevice instead of assuming the info->fd is the first entity of scrn which is not true for multi entities scrn. Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-25tests: shuffle around the linking order to please GNU ldMartin Peres1-1/+5
Classic GNU ld resolves symbol dependencies only forward, while GOLD seems to work regardless of the specified library order. Suggested-by: Eero Tamminen <eero.t.tamminen@intel.com> Reviewed-by: Mihail Konev <k.mvc@ya.ru> Signed-off-by: Martin Peres <martin.peres@linux.intel.com>