summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-06-16wip: wire up si backend for vfbglxfeAdam Jackson2-55/+78
2017-06-16glx: Add dispatch frontendAdam Jackson3-0/+911
This allows multiple GLX backends to coexist within a single server. There are three categories of requests. QueryVersion is just hardwired to return 1.4. The client info requests are dispatched to every backend, because it is needed when computing GetString replies and the BE is better positioned to do that intersection than the FE. For all other requests, we establish a mapping between the XID/tag and the backend as they are created. For XIDs we set up a mirror resource (with the same XID) that points to the backend, which makes lifetime management easy. Tags are trickier. XXX and in fact don't work yet. The plan is to create a fake (client-namespace) XID for the tag, but the tag ID itself is only mentioned in the MakeCurrent reply, so the backends will need to call up; and with that in mind, we may as well just allocate the tags in the FE. This effectively maps tags into the XID space. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16hashtable: Add ht_walkAdam Jackson2-0/+18
This is obviously linear, but at least there's a bailout. And we expect the hash tables this will be called on will be small. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Simplify DrawableGone a littleAdam Jackson1-5/+3
currentClient is always set if either drawable is set, and the 'next' pointer is just being paranoid; the loseCurrent hook is not allowed to delete the context from under us. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Fix making an indirect surfaceless context currentAdam Jackson1-12/+0
We can't tell the difference (in __glXForceCurrent) between the window being lost previously, and simply having no drawables. So don't bother. The unbind in DrawableGone will clear the drawable binding, and we'll assuredly fail later if we really do need the drawable. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Fix current client and drawable tracking for direct contextsAdam Jackson1-14/+12
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Wait{GL,X} are operations on a context, not a drawableAdam Jackson4-10/+15
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Push internal glF{lus,inis}h calls into the backendAdam Jackson8-7/+40
These calls are appropriate for indirect contexts; when we're building without indirect support we don't want to reference libGL at all. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Don't flush an arbitrary GL context from DrawableGoneAdam Jackson1-2/+0
The current context at this point could be anything; we've done nothing to bind the context whose drawable is about to go away. There's not really much point in doing the flush anyway since any rendering is going to be thrown away, so just do nothing. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Handle multithreaded clients a bit betterAdam Jackson5-61/+61
The code was requiring that all RenderLarge packets composing a single request be consecutive. The client-side library does not enforce this; if multiple contexts are current in different threads, they could easily interleave requests. Move the large request state into the context, and move the check into __glXForceCurrent, which necessarily gets called every place that it could matter. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Remove glx{Suspend,Resume}ClientsAdam Jackson2-66/+1
This is handled correctly in the DRI extensions now. Importantly it is not done for DRI3, and does not need to be. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16dri2: DRI2 clients are VT clientsAdam Jackson3-54/+5
The AIGLX code no longer needs to wrap VT switching. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16dri1: DRI1 clients are VT clientsAdam Jackson2-0/+7
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16xfree86: Add VT client trackingAdam Jackson2-0/+60
A VT client is one that needs to be put to sleep when we don't own the VT, and woken up when we regain it. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Normalize event/error translationAdam Jackson3-8/+11
Stash a pointer to our extension entry and look up the bases from there every time, instead of keeping a static variable. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16hack: Disable accum-buffer visualsAdam Jackson1-0/+19
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx/drisw: Use scratch GCs for swrastPutImageAdam Jackson1-28/+5
The scratch GC defaults to the same state as our persistent GCs. Except for the "draw" GC, which would generate graphics exposures for... well, no reason really, PutImage doesn't generate graphics exposures. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx/drisw: Remove unused glx_enable_bitsAdam Jackson1-2/+0
Sloppy of me! Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx/dri2: Don't chirp when falling back to softwareAdam Jackson1-2/+0
This isn't an error if the screen isn't accelerated in the first place. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Remove some indirection around EXT_texture_from_pixmapAdam Jackson5-32/+15
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glx: Remove __glXReplyAdam Jackson9-74/+69
Static data bad, hulk smash. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16dmx: Remove some not-very-interesting debug printsAdam Jackson1-63/+0
gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it might, and we also don't care. Just delete all this. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16dmx: Silence an unused-result warningAdam Jackson1-1/+2
Modern glibc is very insistent that you care about whether write() succeeds: ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’: ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(priv->fd, &event, sizeof(event)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16glxproxy: Fix __glXActiveScreens allocationAdam Jackson3-4/+4
Apparently this has been broken for about ten years, eesh. We were never allocating any storage for this array, so the first attempt at using GLX with Xdmx would crash the server. Promote it to an array and use __glXNumActiveScreens to detect whether GLX is actually enabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34851 Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16xfree86: Move DRICreatePCIBusID to the PCI codeAdam Jackson4-14/+14
This symbol is used by some DRI2+ drivers and there's nothing DRI1-specific about it. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16xfree86: Remove unused xf86EnableVTSwitchAdam Jackson2-42/+3
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16dix: Remove extension aliasesAdam Jackson5-61/+4
This appears to be essentially unused. The only known client-side library for the SELinux extension is xcb, which does not look for the name "Flask". The "SGI-GLX" alias for GLX appears to be a bit of superstition at this point, NVIDIA's driver does not expose it and Mesa does not check for it. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-16include: Remove some unused macrosAdam Jackson1-5/+0
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-06-13travis: Enable ccache.Eric Anholt1-2/+3
We bind-mount the cache directory into the container. Cuts build time from about 4 minutes to 2. Signed-off-by: Eric Anholt <eric@anholt.net>
2017-06-13travis: Add a build script for Travis CI.Eric Anholt2-0/+26
This currently does a meson build using a docker image I've prepared. The Dockerfile source is at: https://github.com/anholt/xserver-travis Docker proved to be necessary to cut the build time per Travis push. If some day we end up using meson in more of the X stack, we may be able to move more dependencies out of the docker image and into the CI build (putting the I in CI). Until then, we'll have to do docker image rebuilds when dependencies are added/updated. To enable Travis CI on your github repository, see the first two steps of the docs at: https://docs.travis-ci.com/user/getting-started/ Once you do that, pushing branches to your github repo will trigger builds, which will send you email if they fail. Current build status can be veiewed your account on travis-ci.org: https://travis-ci.org/anholt/xserver
2017-06-13meson: Fix test for whether we've built glamor-EGL.Eric Anholt1-1/+1
This matches the test we use for going into the glamor_egl subdir in ../../meson.build.
2017-06-13dmx: Remove includes of glxtokens.hEric Anholt2-2/+0
Our top-level glx.h include already provides all of the tokens we use, and fixes redefinition warnings in the meson build. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2017-06-13os: Set oc->fd to -1 when connection is closedKeith Packard1-0/+1
This ensures that we don't use the now-closed file descriptor in the future. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2017-06-13os: Check oc->trans_conn before using oc->fd in YieldControlNoInputKeith Packard1-10/+9
oc->trans_conn is set to NULL when the connection is closed. At this point, oc->fd is no longer valid and shouldn't be used. Move dereference of oc->fd up into YieldControlNoInput where the state of oc->trans_conn can be checked in a single place. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2017-06-13os: Don't call ospoll_listen/ospoll_mute after connection is closedKeith Packard1-4/+6
In set_poll_client, check oc->trans_conn to make sure the connection is still running before changing the ospoll configuration of the file descriptor in case some other bit of the server is now using this file descriptor. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2017-06-13os: Use CloseDownFileDescriptor from AbortClient, including ospoll_removeKeith Packard3-11/+12
AbortClient performs most of the same operations as CloseDownFileDescriptor except that it doesn't call ospoll_remove, leaving that unaware that the file descriptor has been closed. If the file descriptor is re-used before the server comes back around to clean up, and that new file descriptor is passed to SetNotifyFd, then that function will mistakenly re-interpret the stale ClientPtr returned by ospoll_data as a struct notify * instead and mangle data badly. To fix this, the patch does: 1) Change CloseDownFileDescriptor so that it can be called multiple times on the same OsCommPtr. The calls related to the file descriptor are moved inside the check for trans_conn and oc->trans_conn is set to NULL after cleaning up. 2) Move the XdmcpCloseDisplay call into CloseDownFileDescriptor. I don't think the actually matters as we just need to know at some point that the session client has exited. Moving it avoids the possibility of having this accidentally trigger from another client with the same fd which closes down at around the same time. 3) Change AbortClient to call CloseDownFileDescriptor. This makes sure that all of the fd-related clean up happens in the same way everywhere, in particular ensures that ospoll is notified about the closed file descriptor at the time it is closed and not some time later. Debian-bug: https://bugs.debian.org/862824 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2017-06-13os: Eliminate ConnectionTranslationKeith Packard2-140/+1
This infrastructure is no longer read, only written; the mapping from fd to client is now handled by ospoll. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2017-06-12glamor: Clarify variable names in glamor_copy_cpu_fboKeith Packard1-17/+23
This function creates a temporary pixmap to hold data being moved from the source to the destination. However, it labeled all of the variables associated with this as src_, which makes it confusing to read the code. Rename them tmp_ instead. Also fix the comment describing the function to note that it copies from CPU to GPU, not GPU to GPU. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-13glamor: Fix temporary pixmap coordinate offsetsMichel Dänzer1-2/+2
The previous values happened to work in basic cases, but not in general if the destination is a subwindow or has a border. Fixes crash with xli, which moves a large subwindow inside a smaller parent window for scrolling. No regressions with xterm, x11perf -copyplane or the xscreensaver phosphor hack. Bug: https://bugs.debian.org/857983 Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-13modesetting: Validate the atom for enum propertiesAdam Jackson1-1/+2
The client could have said anything here, and if what they said doesn't actually name an atom NameForAtom() will return NULL, and strcmp() will be unhappy about that. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-12xwayland: Implement tablet_tool_wheel for scrollingJason Gerecke2-0/+26
The 'tablet_tool_wheel' function for tablet scrolling was added back in 8a1defcc634 but left unimplemented. This commit fills in the necessary details, using the "clicks" count as the number of discrete scroll up/down events to send. 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>
2017-06-12xwayland: Correct off-by-one error in tablet button numberingJason Gerecke1-2/+2
The 'tablet_tool_frame' function treats the button masks as though they are zero-indexed, but 'tablet_tool_button_state' treats them as one- indexed. The result is that an e.g. middle click event recieved from Wayland will be sent from the X server as a right-click instead. Fixes: 773b04748d0 ("xwayland: handle button events after motion events") 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>
2017-06-07xwayland: Remove two unused proc pointers.Carlos Garnacho1-2/+0
Xwayland doesn't override these, so we don't need defining those in the xwl_screen struct. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07Xi: Use WarpPointerProc hook on XI pointer warping implementationCarlos Garnacho1-0/+4
Just like we do with XWarpPointer's. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: Lock the pointer if it is confined and has no cursorCarlos Garnacho1-1/+28
In the typical pattern in games of "hide cursor, grab with a confineTo, warp constantly the pointer to the middle of the window" the last warping step is actually rather optional. Some games may choose to just set up a grab with confineTo argument, and trust that they'll get correct relative X/Y axis values despite the hidden cursor hitting the confinement window edge. To cater for these cases, lock the pointer whenever there is a pointer confinement and the cursor is hidden. This ensures the pointer position is in sync with the compositor's when it's next shown again, and more importantly resorts to the relative pointer for event delivery. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: Update root window size when desktop size changesCarlos Garnacho2-1/+6
This fixes grabs on InputOnly windows whose parent is the root window failing with GrabNotViewable. This is due to window->borderSize/windowSize being computed as clipped by its parent, resulting in a null region. Setting up the right size on the root window makes the InputOnly size correct too, so the GrabNotViewable paths aren't hit anymore. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: "Accept" confineTo on InputOnly windowsCarlos Garnacho1-0/+9
Of sorts, actually make it confine to the pointer focus, as the InputOnly window is entirely invisible to xwayland accounting, we don't have a xwl_window for it. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: Allow pointer warp on root/None windowCarlos Garnacho1-0/+20
Of sorts, as we can't honor pointer warping across the whole root window coordinates, peek the pointer focus in these cases. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07dix: assume warping on the RootWindow always happens on visible coordsCarlos Garnacho1-1/+1
If the root window borderClip region is null, the PointInWindowIsVisible() check fails if pointer warping is attempted on the root window, making the warping operation bail out early. Assume coordinates always lay inside the root window for this case, the actual position will be clamped later within screen coordinates anyway. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-05glamor: Store the actual EGL/GLX context pointer in lastGLContextMichel Dänzer1-2/+2
Fixes subtle breakage which could sometimes trigger after a server reset with multiple screens using glamor: Screen A enters glamor_close_screen last and calls various cleanup functions, which at some point call glamor_make_current to make sure screen A's GL context is current. This sets lastGLContext to screen A's &glamor_priv->ctx. Finally, glamor_close_screen calls glamor_release_screen_priv, which calls free(glamor_priv). Later, screen B enters glamor_init, which allocates a new glamor_priv. With bad luck, this can return the same pointer which was previously used for screen A's glamor_priv. So when screen B's glamor_init calls glamor_make_current, lastGLContext == &glamor_priv->ctx, so MakeCurrent isn't called for screen B's GL context, and the following OpenGL API calls triggered by glamor_init mess up screen A's GL context. The observed end result of this was a crash in glamor_get_vbo_space because glamor_priv->vbo didn't match the GL context, though there might be other possible outcomes. Assigning the actual GL context pointer to lastGLContext prevents this by preventing the false negative test in glamor_make_current. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>