summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-09-29xf86-video-modesetting: Support new vblank kernel API [v2]drm-vblankKeith Packard1-1/+49
drmCrtcGetSequence returns the current vblank sequence and time. drmCrtcQueueSequence queues an event for delivery at a specified vblank sequence. Use these (when available) in preference to drmWaitVBlank. v2: Move bit of code from first patch (thanks, Michel Dänzer) Signed-off-by: Keith Packard <keithp@keithp.com>
2017-09-29xf86-video-modesetting: Add ms_queue_vblank helper [v3]Keith Packard5-97/+95
This provides an API wrapper around the kernel interface for queueing a vblank event, simplifying all of the callers. v2: Fix missing '|' in computing vbl.request.type v3: Remove spurious bit of next patch (thanks, Michel Dänzer) Signed-off-by: Keith Packard <keithp@keithp.com>
2017-09-27sync: Fix delta value checkLouis-Francis Ratté-Boulianne1-1/+1
While transitionning from CARD64 to int64, the GreaterThan call as mistakenly been transformed into ">=". That was at least causing problems with Mutter. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-26modesetting: Skip no-longer-present connectors when resetting BAD linksKeith Packard1-1/+4
Outputs may have NULL mode_output (connector) pointers if the connector disappears while the server is running. Skip these when resetting outputs with BAD link status. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-26xfree86: Hush some warnings when Xv is disabledAdam Jackson1-1/+1
Spotted by Appveyor: xf86Crtc.c:3281:1: warning: ‘xf86_crtc_box_area’ defined but not used [-Wunused-function] xf86_crtc_box_area(BoxPtr box) ^~~~~~~~~~~~~~~~~~ xf86Crtc.c:3268:1: warning: ‘x86_crtc_box’ defined but not used [-Wunused-function] x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) ^~~~~~~~~~~~ xf86Crtc.c:3256:1: warning: ‘x86_crtc_box_intersect’ defined but not used [-Wunused-function] x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-09-25test: Fix a thinko in simple-xinitAdam Jackson1-1/+1
Spotted by clang courtesy of the shiny new OSX Travis target: simple-xinit.c:90:65: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [10]' [-Wsizeof-array-decay] ret = read(displayfd, display_string, sizeof(display_string - 1)); Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-09-25suid: Include sysmacros.h to fix build after glibc-2.25Nick Sarnie1-0/+3
[Added HAVE_SYS_SYSMACROS_H guard - ajax] Signed-off-by: Nick Sarnie <commendsarnex@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-23travis: Also build on OSXJon Turney2-2/+43
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-09-23meson: Make it possible to build for 32-bit targetsJon Turney1-1/+1
Setting glx_align64 to '' gives a null string in the arguments list passed to the compiler. This is taken as an input filename, leading to: "cc: error: : No such file or directory" Instead, assign an empty list to glx_align64, which gets flattened to nothing in the arguments list. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-09-20glx: Be a bit more paranoid in glx client cleanupAdam Jackson1-0/+1
This would probably crash (via double-free) if you had multiple GPUs and an indirect context. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-09-20meson: Use dependency version_compare()Daniel Stone2-7/+3
We can check the version on an existing dependency, rather than spinning up pkg-config again just to check the right version. Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-09-20Build: Use dri3proto/libdrm CFLAGSDaniel Stone2-1/+2
Make sure we get the CFLAGS required for building DRI3 into the command line. Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-09-20sync: Clean up a bit of header formatting.Eric Anholt1-8/+5
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-09-20sync: Convert from "CARD64" to int64_t.Eric Anholt6-182/+190
The extension was using the name CARD64 to represent 64-bit values, with a #define from CARD64 to XSyncValue, a struct with a pair of 32-bit values representing a signed 64-bit value. This interfered with protocol headers using CARD64 to try to actually store a uint64_t. Now that stdint.h exists, let's just use that here, instead. v2: Fix alarm delta changes. v3: Do the potentially overflowing math as uint and convert to int afterward, out of C spec paranoia. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-09-20test: Add basic SYNC tests.Eric Anholt4-1/+316
I couldn't find any, and I was modifying the implementation, so I had to write some. I would like the test to end with a "make sure there weren't any stray unchecked errors", but I didn't figure out how to do that. v2: Extend sync tests to cover alarm delta and waitvalue changes. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-09-20test: Return error from simple-xinit if the client crashes.Eric Anholt1-0/+3
I want to be able to call client tests with simple-xinit, so assertion failures should be an error. v2: Clean up identical returns. Signed-off-by: Eric Anholt <eric@anholt.net>
2017-09-20meson: Add Xvfb and Xephyr-glamor testing.Eric Anholt4-0/+39
The Xvfb tests are passing and Xephyr-glamor is failing for me, but it fails identically on autotools. It's disabled on Travis for now because the >10 minutes of silence during testing times out the entire build. v2: Fix the disable on travis. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-20meson: Move Xvfb build under an option.Eric Anholt2-1/+5
Autotools also had it as an option. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-18Add an .appveyor.yml for AppVeyor CIJon Turney1-0/+29
This currently does an autotools build using Cygwin. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-18Revert "dmx: fix linking"Jon Turney1-2/+1
Since commit 3ef16dfb9830bd6b41ae428f4f213ae0c35c1056, "dmx: fix linking", linking dmx is broken for me: CCLD Xdmx.exe ../../render/.libs/librender.a(glyph.o): In function `HashGlyph': /wip/xserver/build.x86_64/../render/glyph.c:168: undefined reference to `x_sha1_init' /wip/xserver/build.x86_64/../render/glyph.c:174: undefined reference to `x_sha1_update' /wip/xserver/build.x86_64/../render/glyph.c:177: undefined reference to `x_sha1_update' /wip/xserver/build.x86_64/../render/glyph.c:180: undefined reference to `x_sha1_final' ../../render/.libs/librender.a(mipict.o): In function `miClipPictureReg': /wip/xserver/build.x86_64/../render/mipict.c:233: undefined reference to `pixman_region_n_rects' /wip/xserver/build.x86_64/../render/mipict.c:234: undefined reference to `pixman_region_n_rects' /wip/xserver/build.x86_64/../render/mipict.c:235: undefined reference to `pixman_region_rectangles' /wip/xserver/build.x86_64/../render/mipict.c:236: undefined reference to `pixman_region_rectangles' /wip/xserver/build.x86_64/../render/mipict.c:248: undefined reference to `pixman_region_init' /wip/xserver/build.x86_64/../render/mipict.c:251: undefined reference to `pixman_region_not_empty' /wip/xserver/build.x86_64/../render/mipict.c:261: undefined reference to `pixman_region_not_empty' ../../render/.libs/librender.a(mipict.o): In function `miComputeCompositeRegion': /wip/xserver/build.x86_64/../render/mipict.c:340: undefined reference to `pixman_region_init' The change this was fixing appears to be effectively reverted by 542d9f6807ac06b70f564ccab10af69fa21a1221, so just revert commit 3ef16dfb9830bd6b41ae428f4f213ae0c35c1056. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-13modesetting: Blacklist EVDI devices from PRIME syncDawid Kurek1-0/+5
UDL (usb) devices are blacklisted because of they weird behaviour when it comes to vblank events. As EVDI uses very similar model of handling vblanks it should be treated similarly. When doing a page flip, EVDI does not wait for real vblank, but simulates it by adding constant delay. It also does not support DRM_IOCTL_WAIT_VBLANK. In contrast to UDL, EVDI uses platform devices, thus instead of 'usb' in path they all have 'platform'. It is possible to blacklist by 'platform', so without explicitly saying 'evdi', but it might be misleading when it comes to real reason for it. Signed-off-by: Dawid Kurek <dawid.kurek@displaylink.com>
2017-09-13dri2: sort DRI2InfoPtr::version checking in ascending orderEmil Velikov1-6/+5
Makes it easer to follow if 8 is between 7 and 9 ;-) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-09-13xwayland: Avoid repeatedly looping through window ancestor chainRoman Gilg3-27/+31
Calling xwl_window_from_window means looping through the window ancestor chain whenever it is called on a child window or on an automatically redirected window. Since these properties and the potential ancestor's xwl_window are constant between window realization and unrealization, we can omit the looping by always putting the respective xwl_window in the Window's private field on its realization. If the Window doesn't feature an xwl_window on its own, it's the xwl_window of its first ancestor with one. Signed-off-by: Roman Gilg <subdiff@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-13xwayland: add envvar XWAYLAND_NO_GLAMOROlivier Fourdan1-0/+7
Not all compositors allow for customizing the Xwayland command line, gnome-shell/mutter for example have the command line and path to Xwayland binary hardcoded, which makes it harder for users to disable glamor acceleration in Xwayland (glamor being used by default). Add an environment variable XWAYLAND_NO_GLAMOR to disable glamor support in Xwayland. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-09-13meson: Move the BUILD_DATE/TIME setup to configure time.Eric Anholt1-4/+2
By having it as a custom_target with build_always, every "ninja -C build" would rebuild Xorg for the new date/time, even if the rest of Xorg didn't change. We could build the rest of Xorg into a static lib, and regenerate date/time when the static lib changes and link that into a final Xorg, but BUILD_DATE/TIME is such a dubious feature (compared to including a git sha, which is easy with meson) it doesn't seem worth the build time cost. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-13meson: Include BUILD_DATE in the meson xf86Build.h.Eric Anholt1-1/+1
Due to a typo, I only had BUILD_TIME present. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-13meson: Respect SOURCE_DATE_EPOCH for reproducible builds.Eric Anholt1-2/+9
This just copies over Chris Lamb's code from autotools. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-13configure.ac: Make BUILD_{DATE, TIME} respect SOURCE_DATE_EPOCH if setChris Lamb1-2/+8
Whilst working on the Reproducible Builds effort [0], we noticed that xorg-server could not be built reproducibly. One reason is because it embeds a "current" build and date time. This should be compatible with both GNU and BSD date(1). [0] https://reproducible-builds.org/ v2: Fix change in Y-M-D format that broke the build. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-13fb: Check whether the window is enabled directlyAdam Jackson1-1/+1
... instead of its root window. Xwayland's rootless mode empties the root window border clip since its root window has no storage, but redirected windows (the only kind it can show) will have a non-empty border clip anyway, cf. the #ifdef COMPOSITE in miComputeClips. With this change, non-glamor Xwayland's GetImage actually works. Other acceleration layers may need to change to account for this, but this appears to be safe for the existing open source drivers. Only the xfree86 DDX has any problem with losing its framebuffer on VT switch, and even then only for UMS drivers (which excludes glamor, uxa, and sna from consideration). This leaves exa, which already contains code to evict pixmaps to host memory on VT switch. Since the xfree86 core will still empty the root clip on VT switch, while the root window itself may not contain a valid image we won't try to touch it, but GetImage from a redirected window will now work even when switched away. Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-09-13glamor: Avoid overflow between box32 and box16 boxOlivier Fourdan1-5/+6
glamor_compute_transform_clipped_regions() uses a temporary box32 internally which is copied back to a box16 to init the regions16, thus causing a potential overflow. If an overflow occurs, the given region is invalid and the pixmap init region will fail. Simply check that the coordinates won't overflow when copying back to the box16, avoiding a crash later down the line in glamor. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101894 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Tested-by: Fabrice Bellet <fabrice@bellet.info> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-13glamor: handle NULL source pictureOlivier Fourdan1-2/+3
COMPOSITE_REGION() can pass NULL as a source picture, make sure we handle that nicely in both glamor_composite_clipped_region() and glamor_composite_choose_shader(). Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101894 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-12glx: Fix visual fbconfig matching with respect to swap methodThomas Hellstrom1-0/+9
For the built in visuals, we'd typically select the "best" fbconfig without considering the swap method. If the client then requests a specific swap method, say GLX_SWAP_COPY_OML, it may well happen that the first fbconfig matching requirements would have been paired with the 32-bit compositing visual, and the client would render a potentially transparent window. Fix this so that we try to match fbconfigs with the same swap method to all built-in visuals. That would guarantee that selecting a specific swap- method would not influence the chance of getting a compositing visual. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-12glx: Work around a GLX_OML swap method in older dri driversThomas Hellstrom1-0/+7
The swapMethod config member would typically contain an arbitrary value on older dri drivers. Fix this so that if we detect an illegal value, return GLX_SWAP_UNDEFINED_OML. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-08glx: remove unused systemTimeExtensionEmil Velikov4-27/+0
Not even a single DRI2/DRISW driver in mesa ever used this. Appears to be a dri1 artefact copy/pasted in the dri2/drisw codebase. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-09-06test: fix compiler warningPeter Hutterer1-1/+1
signal-logging.c:182:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06glamor: use the lowercase xnf.*alloc APIEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06xwayland: use the lowercase xnf.*alloc APIEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-05xwayland: Fix a segfault with pointer lockingOlivier Fourdan1-0/+3
Xwayland would crash in some circumstances while trying to issue a pointer locking when the cursor is hidden when there is no seat focus window set. The crash signature looks like: #0 zwp_pointer_constraints_v1_lock_pointer () #1 xwl_pointer_warp_emulator_lock () at xwayland-input.c:2584 #2 xwl_seat_maybe_lock_on_hidden_cursor () at xwayland-input.c:2756 #3 xwl_seat_maybe_lock_on_hidden_cursor () at xwayland-input.c:2765 #4 xwl_seat_cursor_visibility_changed () at xwayland-input.c:2768 #5 xwl_set_cursor () at xwayland-cursor.c:245 #6 miPointerUpdateSprite () at mipointer.c:468 #7 miPointerDisplayCursor () at mipointer.c:206 #8 CursorDisplayCursor () at cursor.c:150 #9 AnimCurDisplayCursor () at animcur.c:220 #10 ChangeToCursor () at events.c:936 #11 ActivatePointerGrab () at events.c:1542 #12 GrabDevice () at events.c:5120 #13 ProcGrabPointer () at events.c:4908 #14 Dispatch () at dispatch.c:478 #15 dix_main () at main.c:276 xwl_pointer_warp_emulator_lock() tries to use the surface from the xwl_seat->focus_window leading to a NULL pointer dereference when that value is NULL. Check that xwl_seat->focus_window is not NULL earlier in the stack in xwl_seat_maybe_lock_on_hidden_cursor() and return early if not the case to avoid the crash. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=102474 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-04xwayland: No grab handler without protocol supportOlivier Fourdan1-9/+22
If the compositor has no support for the Xwayland keyboard grab protocol, there is no need to set-up our keyboard grab handler. 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-08-30os: Fix warning in LockServerAdam Jackson1-1/+1
The meson build gives me: ../os/utils.c: In function ‘LockServer’: ../os/utils.c:310:40: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); ^~~~~~~~~ ../os/utils.c:310:5: note: ‘snprintf’ output between 12 and 13 bytes into a destination of size 12 snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Which seems to be due to the %d part meaning that a negative number's - sign would be one wider than we're expecting. Fine, just coerce it to unsigned. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-08-22glx: Fix error generation for non-reply vendor private requestsAdam Jackson2-4/+2
Discarding the return value here is just wrong. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22xwin: automake: remove unused {SRCS, DEFS}_{NATIVEGDI, PRIMARYFB}Emil Velikov1-5/+1
Left over from the following commits: 8465ee788fd xwin: Remove native GDI engine (v2) c79f824bf66 xwin: Remove primary DirectDraw engine v2: drop leading - in the makefile Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk> (v1)
2017-08-22xwin: remove always true/set XWIN_RANDR conditional/defineEmil Velikov3-8/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22xwin: remove always true/set XWIN_MULTIWINDOW conditional/defineEmil Velikov24-145/+5
v2: drop trailing endif (Jon) Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22xwin: remove always true/set XWIN_CLIPBOARD conditional/defineEmil Velikov17-68/+1
v2: drop trailing endif (Jon) Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22os: make MitGenerateCookie() independent of XCSECURITYEmil Velikov2-30/+0
Analogous to previous commit. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22os: make GenerateRandomData() independent of XCSECURITYEmil Velikov2-12/+2
The function itself does not depend on the macro. Move it outside of the ifdef guard and remove the identical copy in XWIN. This is step 1 towards removing the duplication in winauth.c and moving the OS specifics to os/ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22xwin/glx: remove unused __GLXWinScreen::glx_enable_bitsEmil Velikov1-3/+0
All the relevant code already uses the ::base::glx_enable_bits one. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-21glx: Remove some unused stuff from glxserver.hAdam Jackson2-14/+1
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-08-21glx: Inline some reply swapping codeAdam Jackson3-141/+52
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>