summaryrefslogtreecommitdiff
path: root/hw/kdrive/ephyr/ephyr.c
AgeCommit message (Collapse)AuthorFilesLines
2016-07-18Remove readmask from screen block/wakeup handlerKeith Packard1-2/+2
With no users of the interface needing the readmask anymore, we can remove it from the argument passed to these functions. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-06-20ephyr: Process only the last expose or configure available from the serverKeith Packard1-5/+22
Delay expose or configure processing until the event queue is empty so that we don't end up processing a long series of events one at a time. Expose events already have a check waiting for the last in a series, this further improves that by discarding multiple series of events. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-06-20ephyr: Process queued X events before blocking [v2]Keith Packard1-19/+33
If we end up reading all pending X events in the course of other server execution, then our notify FD callback won't get invoked and we won't process them. Fix this by noting that there are queued events in the block handler, setting the poll timeout to zero and queuing a work proc to clear the event queue. v2: use a work proc to clear the event queue rather than doing it in the block handler directly. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-06-20ephyr: Handle window resize when using glamorKeith Packard1-2/+14
Under glamor, we need to re-create the screen pixmap at the new size so that we can ask glamor for the associated texture. Fortunately, we can simply use ephyr_glamor_create_screen_resources to create the new pixmap. Because this is being done after the server has started, we need to walk the window heirarchy and reset any windows pointing at the old pixmap. I could easily be convinced that this TraverseTree should be moved to miSetScreenPixmap. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-06-20ephyr: Don't configure window while responding to configure eventsKeith Packard1-0/+2
This leads to and endless sequence of window resizes. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-06-20dix: Call screen block/wakeup handlers closest to blocking [v3]Keith Packard1-16/+27
The screen block and wakeup handlers are the only ones which provide a well known ordering between the wrapping layers; placing these as close as possible to the server blocking provides a way for the driver to control the flow of execution correctly. Switch the shadow code to run in the screen block handler so that it now occurrs just before the server goes to sleep. Switch glamor to call down to the driver after it has executed its own block handler piece, in case the driver needs to perform additional flushing work after glamor has called glFlush. These changes ensure that the following modules update the screen in the correct order: animated cursors (uses RegisterBlockAndWakeupHandlers dynamically) composite (dynamic wrapping) misprite (dynamic wrapping) shadow (static wrapping) glamor (static wrapping) driver (static wrapping) It looks like there's still a bit of confusion between composite and misprite; if composite updates after misprite, then it's possible you'd exit the block handler chain with the cursor left hidden. To fix that, misprite should be wrapping during ScreenInit time and not unwrapping. And composite might as well join in that fun, just to make things consistent. [v2] Unwrap BlockHandler in shadowCloseScreen (ajax) [v3] ephyr: Use screen block handler for flushing changes ephyr needs to make sure it calls glXSwapBuffers after glamor finishes its rendering. As the screen block handler is now called last, we have to use that instead of a registered block/wakeup handler to make sure the GL rendering is done before we copy it to the front buffer. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-26Remove SIGIO support for input [v5]Keith Packard1-2/+2
This removes all of the SIGIO handling support used for input throughout the X server, preparing the way for using threads for input handling instead. Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls to stub functions input_lock/input_unlock so that we don't lose this information. xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO and OsReleaseSIGIO. v2: Don't change locking order (Peter Hutterer) v3: Comment weird && FALSE in xf86Helper.c Leave errno save/restore in xf86ReadInput Squash with stub adding patch (Peter Hutterer) v4: Leave UseSIGIO config parameter so that existing config files don't break (Peter Hutterer) v5: Split a couple of independent patch bits out of kinput.c (Peter Hutterer) Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-01kdrive/ephyr: map host X server's keymap into Xephyr, if supportedLaércio de Sousa1-8/+20
Currently Xephyr doesn't inherit host X server's keymap, which may lead to keymap mismatches when using a non-US keyboard in a window inside Xephyr. This patch makes Xephyr change its keymap to match host X server's one (unless XKB support is disabled), using xcb-xkb to retrieve the needed XKB controls. This implementation is analogous to Xnest one at commit 83fef4235. Supersedes: https://patchwork.freedesktop.org/patch/67504 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-01-28xephyr: Remove DRI1Adam Jackson1-76/+0
This only worked if the backend server supported DRI1, which is stunningly unlikely these days. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-12-01kdrive/ephyr: Use NotifyFd for XCB connection input [v2]Keith Packard1-2/+4
Eliminates polling every 20ms for device input. v2: rename ephyrPoll to ephyrXcbNotify and fix the API so it can be used directly for SetNotifyFd. Thanks to Daniel Martin <consume.noise@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> Cc: Daniel Martin <consume.noise@gmail.com>
2015-10-06kdrive: Delete unused TOUCHSCREEN define.Jamey Sharp1-1/+0
There's nothing in configure to enable this, and KdTsPhyScreen isn't defined anywhere. [ajax: Rebase, also clean up Xfbdev] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Jamey Sharp <jamey@minilop.net>
2015-09-21ephyr: move host_has_extension() implementation to hostx.cLaércio de Sousa1-11/+1
This is a trivial patch that moves host_has_extension() implementation from ephyr.c to hostx.c so that it can be called by hostx.c internal functions. Also rename function to hostx_has_extension() for consistency. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2015-08-28debug output format fix in ephyrProcessMouseMotion()Jon TURNEY1-2/+2
xorg/xserver/hw/kdrive/ephyr/ephyr.c:979:9: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘ScreenPtr’ [-Werror=format=] This looks like a genuine bug, and ephyrCursorScreen->myNum was meant here rather than ephyrCursorScreen v2: Insert a ":" as well Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-07Synchronize capslock in Xnest and XephyrOlivier Fourdan1-1/+7
In Xnest or Xephyr, pressing CapsLock when focus is on another window does not update the state in the nested X server. This is because when synchronizing the lock modifier, sending a keypress or a key release only is not sufficient to toggle the state, unlike regular modifiers, one has to emulate a full press/release to lock or unlock the modifier. 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>
2015-01-02ephyr: Implement per-screen colormapsMichele Baldessari1-1/+1
Xephyr's pseudocolor emulation added in: commit 81a3b6fe27567b4f91033ece69996aa6bf8d01a3 Author: Matthew Allum <breakfast@10.am> Date: Mon Nov 8 22:39:47 2004 +0000 Add support to Xephyr for lower depths than hosts only tracks one global colormap for the whole (Xephyr) display. Move this to per-screen state so each screen's colormap can be correct. [ajax: rebased to 1.17, cleaned up commit message] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michele Baldessari <michele@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-11-12Drop trailing whitespacesPeter Hutterer1-7/+7
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-22Xephyr: option to disable grabbing the hostWilliam ML Leslie1-3/+9
This patch makes it possible to use C-S key combinations within Xephyr without losing access to the host window manager's commands. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-10-09dix: Drop the third argument from WindowExposuresProcPtrAdam Jackson1-1/+1
A careful read shows that it was always NULL. It hasn't always been; as the DDX spec indicates, it was the "occluded region that has backing store", but since that backing store code is long gone, we can nuke it. mi{,Overlay}WindowExposures get slightly simpler here, and will get even simpler in just a moment. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-08-21ephyr: set screen size & origin from host X server output's CRTC geometryLaércio de Sousa1-1/+4
If a given output is passed via new -output option, Xephyr will query host X server for its info. If the following conditions are met: a. RandR extension is enabled in host X server; b. supported RandR version in host X server is 1.2 or newer; c. the given output name is valid; d. the given output is connected; then Xephyr will get output's CRTC geometry and use it to set its own screen size and origin. It's just like starting Xephyr in fullscreen mode, but restricted to the given output's CRTC geometry (fake "Zaphod mode"). This is the main feature needed for Xephyr-based single-card multiseat setups where we don't have separate screens to start Xephyr in fullscreen mode safely. Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-21ephyr: enable screen window placement following kdrive -screen option ↵Laércio de Sousa1-1/+2
extended syntax With this patch, one can launch Xephyr with option "-screen WxH+X+Y" to place its window origin at (X,Y). This patch relies on a previous one that extends kdrive -screen option syntax to parse +X+Y substring as expected. If +X+Y is not passed in -screen argument string, let the WM place the window for us, as before. Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-07-17Merge remote-tracking branch 'origin/master' into glamor-nextEric Anholt1-0/+6
I've done this merge manually to resolve the minor conflict in glamor.c. Signed-off-by: Eric Anholt <eric@anholt.net>
2014-07-17ephyr: Free damage structure at server reset timeKeith Packard1-0/+6
The usual mechanism for freeing a damage structure when the pixmap is destroyed does not work for the screen pixmap as it isn't freed in the normal way. The existing driver cleanup function, scrfini, is called after the wrapped CloseScreen functions, including damageCloseScreen, are called and thus ephyr can't free the damage structure at that point. Deal with this by providing an early CloseScreen hook in KdCloseScreen which ephyr can use to free the damage structure before damage itself shuts down. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2014-06-15ephyr: Add support for XV using glamor.Eric Anholt1-1/+3
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-03-05xephyr: Pass incoming XCB events to the Xlib event filter.Eric Anholt1-0/+3
This is the same thing that Qt ended up doing to get DRI2's event mangling to happen despite using an XCB event loop. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-03-05xephyr: Build support for rendering with glamor using a -glamor option.Eric Anholt1-10/+32
v2: Avoid making the Ximage for the screen that we'll never use, and drive the screen pixmap creation for glamor ourselves. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> (v1) Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-07ephyr: Repaint entire screen when colormap is updatedKeith Packard1-0/+15
Any time the colormap is changed, the entire screen needs to be repainted to match. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22Merge remote-tracking branch 'whot/for-keith'Keith Packard1-1/+26
2014-01-12Replace 'pointer' type with 'void *'Keith Packard1-4/+4
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-09ephyr: don't allow a shift+ctrl keygrab if mod1 was enabledPeter Hutterer1-1/+26
Xephyr wants ctrl+shift to grab the window, but that conflicts with ctrl+alt+shift key combos. Remember the modifier state on key presses and releases, if mod1 is pressed, we need ctrl, shift and mod1 released before we allow a shift-ctrl grab activation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-10ephyr: Fix compilation when ./configure'd with --enable-debugJon TURNEY1-4/+4
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessMouseMotion’: /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:946:188: error: ‘ephyrCurScreen’ undeclared (first use in this function) /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonPress’: /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:980:186: error: ‘ephyrCurScreen’ undeclared (first use in this function) /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonRelease’: /jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:1007:186: error: ‘ephyrCurScreen’ undeclared (first use in this function) Fix ephyr compilation when ./configure'd with --enable-debug after commit 46cf6bf5692ef751ec9d17ae2292565d4b13f14b, some instances of ephyrCurScreen were not converted to screen->pScreen->myNum. v2: Don't use a trivial local variable which will be unused when ./configure'd with --disable-debug Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-14kdrive: modify ephyr events to use POINTER_DESKTOP and scale them to thatPeter Hutterer1-1/+8
A multi-head Xephyr instance has the pointer stuck on one screen because of bad coordinate calculation. The coordinates passed to GetPointerEvents are per-screen, so the cursor gets stuck on the left-most screen by default. Adjust and mark the events as POINTER_DESKTOP, so the DIX can adjust them accordingly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-30kdrive/ephyr: Don't discard one-time driver structure at server resetKeith Packard1-2/+0
KdScreenInfo is constructed at server startup time, and not re-generated at server reset time. Freeing the 'driver' element at reset time means this information is lost, and the server crashes pretty quickly afterwards. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-04Merge remote-tracking branch 'anholt/ephyr-fixes'Keith Packard1-120/+319
2013-09-10damage: Implicitly unregister on destroyAdam Jackson1-3/+0
There's no reason not to, and it simplifies quite a few callers. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10mipointer: Remove EnqueueEvent from miPointerScreenFuncRecAdam Jackson1-1/+0
No DDX overrode this, and we never actually called through that slot anyway. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10mipointer: Flatten calls to mieqSwitchScreenAdam Jackson1-1/+0
No DDX was overriding this. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-03ephyr: Do grab/ungrab for ctrl+shift, not just shift+ctrl.Eric Anholt1-3/+6
Given that the window title says "ctrl+shift", having pressing those keys in that order not ungrab you is fairly mean. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03ephyr: Move event processing into ephyr.c.Eric Anholt1-95/+299
No more extra event structure to translate between hostx.c and ephyr.c! Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03ephyr: Move the host screen info into the kdrive screen private.Eric Anholt1-23/+3
We can include xcb bits from the same place as server headers, so there's no need to hide them any more. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03ephyr: Expose a single function for detecting extensions.Eric Anholt1-1/+13
v2: Fix trying to include xcb-dri in the non-dri-build case (Noted by Julien) Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03Xephyr: stop loading the host's keymapJulien Cristau1-1/+1
This isn't used anywhere. v2: Rebase to the top of the patch series (anholt) Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1) Signed-off-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Eric Anholt <eric@anholt.net>
2013-03-04ephyr: Fix crash on 24bpp host framebufferDaniel Martin1-4/+2
Use bytes_per_line and bits_per_pixel from the created XImage to fix https://bugzilla.redhat.com/show_bug.cgi?id=518960 Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-02-18ephyr: Add -resizeable optionDaniel Martin1-0/+1
With this option passed, ephyr windows can be resized like normal windows on the fly, without the need of an explicit parent window. Signed-off-by: Daniel Martin <daniel.martin@secunet.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-06Fix up formatting of initializers for arrays of structsAlan Coopersmith1-17/+16
The indenter seems to have gotten confused by initializing arrays of structs with the struct defined inline - for predefined structs it did a better job, so match that. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-08-06ephyr: Resize screen automatically when parent window is resizedVic Lee1-0/+47
Bugzilla: https://bugs.freedesktop.org/25804 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Vic Lee <llyzs@163.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10GLX: Remove unused noGlxVisualInitDaniel Stone1-14/+1
No-one ever did anything with this variable except assign its default value to it. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-03Drop custom sigio block/unblock functions from kdrive, ephyr and dmxPeter Hutterer1-22/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-03-21Introduce a consistent coding styleKeith Packard1-754/+711
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-30Fix UTF-8 encodingMatěj Cepl1-1/+1
Report to find out all non-UTF-8 files created by cat extensions |xargs -I XXXX find . -name \*.XXXX |while read FILE ; do if ( iconv -f utf8 -t ucs2 $FILE >/dev/null 2>/dev/null ) ; then /bin/true else echo $FILE fi done >>report Signed-off-by: Matěj Cepl <mcepl@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> [Daniel: git am failed for me, so I redid it. The method listed in the commit message also failed, so I just used file/grep/iconv. The results are the same though.] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-25Xephyr: fix pointer coordinate translation when screen is rotatedTomas Frydrych1-2/+23
In the Xephyr case the position of the pointer relative toward the Xephyr window is controlled by the host server without taking into account rotation of the Xephyr screen. Consequently the pointer coords must always be translated when the fb is rotated. Signed-off-by: Tomas Frydrych <tomas@sleepfive.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>