Commit Graph

34 Commits

Author SHA1 Message Date
Alan Coopersmith 23e83724df Fix spelling/wording issues
Most (but not all) of these were found by using
  codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-05 13:07:33 -07:00
Alexander Volkov 90996f5909 Xephyr: Prefer using MIT-SHM FD-passing when possible
This makes the shared memory visible only for the Xephyr
and the X server to which it is connected.

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-01 11:40:27 -05:00
Adam Jackson c42311a9d7 kdrive: Remove KdOsFuncs
Only the Init slot was used, and Xephyr can just as easily do that
initialization directly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-03 16:00:54 -04:00
Keith Packard fb1edccf3c dix: Call screen block/wakeup handlers closest to blocking [v3]
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-06-20 11:54:57 -07:00
Adam Jackson 6178b1c91c dix: Use OsSignal() not signal()
As the man page for the latter states:

    The effects of signal() in a multithreaded process are unspecified.

We already have an interface to call sigaction() instead, use it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-06-08 11:36:31 -04:00
Keith Packard 58354fcf47 kdrive/ephyr: Use NotifyFd for XCB connection input [v2]
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-12-01 13:55:20 -05:00
Michele Baldessari 924996c41c ephyr: Implement per-screen colormaps
Xephyr's pseudocolor emulation added in:

    commit 81a3b6fe27
    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>
2015-01-02 13:55:14 -08:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
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-11-12 10:25:00 +10:00
Adam Jackson 670ee0757f ephyr: Properly implement hardware cursors (v3)
When dix hands us a new cursor we proxy it through to the host server;
since we keep the host XID on the cursor bits private we can switch
among them with just ChangeWindowAttributes.

v2:
Use xcb-renderutil for argb format lookup (Uli, Keith)
Fall back to core cursors for host RENDER < 0.5 (Keith)
Drop useless ephyrEnableCursor
Consistently create/destroy the cursor image GC on both paths
Treat null cursor from dix as invisible

v3:
Initialize the invisible cursor's image (Keith)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-09-18 15:27:10 -07:00
Laércio de Sousa 3a51418b2d ephyr: set screen size & origin from host X server output's CRTC geometry
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-21 20:14:55 -05:00
Laércio de Sousa 84b02469ef ephyr: enable screen window placement following kdrive -screen option 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-08-21 20:14:55 -05:00
Eric Anholt 6d49548849 Merge remote-tracking branch 'origin/master' into glamor-next
I've done this merge manually to resolve the minor conflict in glamor.c.

Signed-off-by: Eric Anholt <eric@anholt.net>
2014-07-17 18:07:26 -07:00
Keith Packard bfa5c73a36 ephyr: Free damage structure at server reset time
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-07-17 11:26:44 -07:00
Eric Anholt 34884e16bf ephyr: Add support for XV using glamor.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-06-15 23:20:06 +01:00
Eric Anholt 9fe052d90c xephyr: Build support for rendering with glamor using a -glamor option.
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-03-05 13:10:12 -08:00
Eric Anholt 847c856eff ephyr: Move the host screen info into the kdrive screen private.
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-03 14:34:48 -07:00
Keith Packard 9838b7032e Introduce a consistent coding style
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>
2012-03-21 13:54:42 -07:00
Matěj Cepl b27d61e443 Fix UTF-8 encoding
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-06-30 16:38:31 +10:00
Mikhail Gusarov 7ee14154b2 kdrive: Remove unused overlay fb support
Xfbdev, Xephyr and Xfake all use only one framebuffer, so simplify
implementation by removing overlay support.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-01-06 19:47:53 +06:00
Mikhail Gusarov 5337ddcfd9 kdrive: Move Xephyr-specific fields out of KdScreenInfo
memory_base, memory_size, off_screen_base fields in
KdScreenInfo are used only by fake EXA in Xephyr. Move
them into Xephyr, cleanup Xfake and Xfbdev.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-01-06 19:47:53 +06:00
Mikhail Gusarov fb26cb793c Remove unused pShadow field from drivers' private structures
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-01 23:28:14 -08:00
Michel Dänzer 4bf707f018 Revert "Fix up Xephyr build for recent EXA changes."
This reverts commit 4e8d98b61e.
2009-02-27 16:37:27 +01:00
Michel Dänzer 4e8d98b61e Fix up Xephyr build for recent EXA changes.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-25 10:26:36 +01:00
David Nusinow f028e245a7 Bug #10016: Implement WM_CLASS hints in Xephyr. 2008-03-24 16:06:33 -04:00
Dodji Seketeli 50a64c84e1 initial commit of xv support work 2007-10-02 16:45:01 +02:00
Andrew Christan e5e6514ffa Xephyr: add "multiscreen" suport
* This patch adds multiscreen support to Xephyr. For instance,
	  the command line : "Xephyr :4 -ac -screen 320x240 -screen 640x480"
	  will launch with two "screens" - namely two main windows.
	  The first main window represents a screen that has the number :4.0, with
	  a geometry of 320x240 pixels, and the second one represents a screen
	  that has the number :4.1 with a geometry of 640x480.
	  The command line: "DISPLAY=:4.1 xclock" will launch the xclock program
	  on the second screen, for intance.

	*   this patch was edited by Dodji Seketeli <dodji@openedhand.com> for:
	  - better style compliance with the rest of the Xephyr code
	  - make sure Xephyr could be launched with no -screen option. By
	    default that creates a default screen of 640x480 pixel like before
	  - display full titles on the windows - with insctructions to grab
	    keyboard and mouse - like before.
2007-10-02 13:49:17 +02:00
Daniel Stone 02d0910511 new KDrive input world order
Convert KDrive to GPE/GKE interface.
Add first-class drivers and enumerate every device separately through
Xi, instead of lamely attempting to aggregate them.
Add XKB support to the Linux keyboard driver.
Add 'thumb button' support to the tslib driver.
Rejig InitInput, so each DDX has to add a list of drivers it supports.
Support NewInputDeviceRequest, et al.
2006-07-21 15:19:51 -04:00
Eric Anholt 2e38fedd29 Add an option to EXA for the DDX to request that EXA hide the pixmap's
devPrivate.ptr when pointing at offscreen memory, outside of
    exaPrepare/FinishAccess(). This was used with fakexa to find (by NULL
    dereference) many instances of un-Prepared CPU access to the
    framebuffer:
- GC tiles used in several ops when fillStyle == FillTiled were never
    Prepared.
- Migration could lead to un-Prepared access to mask data in render's
    Trapezoids and Triangles
- PutImage's UploadToScreen failure fallback failed to Prepare.
2006-03-31 19:41:28 +00:00
Eric Anholt 2822cbc1fb Rearrange EXA driver structures so that there's a hope of maintaining ABI
when extending the driver interface. The card and accel structures are
    merged into the ExaDriverRec, which is to be allocated using
    exaDriverAlloc(). The driver structure also grows exa_major and
    exa_minor, which drivers fill in and have checked by EXA
    (double-checking that the driver really did check that the EXA version
    was correct). Removes exaInitCard(), which is replaced by the driver
    filling in the rec by hand, and the exaGetVersion() and related
    EXA_*VERSION which are replaced by always using the XFree86 loadable
    module versioning.
2006-03-09 06:04:07 +00:00
Eric Anholt 9d8c0e4bcb Add a new flag to ephyr, "-fakexa", which turns on an EXA acceleration
implementation that calls fb to get its work done. The purpose is to
    have a trusted EXA driver for use with testing changes to the core of
    EXA. However, fakexa has not received much testing yet, lacks offscreen
    pixmaps support, and doesn't reliably provide garbage when EXA doesn't
    get its syncing right. All of these should be fixed soon.
2006-03-07 19:57:46 +00:00
Adam Jackson 7fd73d2953 Build fixes: XSERVER_LIBS -> KDRIVE_LIBS, config.h -> kdrive-config.h 2005-12-27 08:29:50 +00:00
Matthew Allum 4220a0c4cc Make Xephyr work without shadow fb 2005-08-05 09:08:32 +00:00
Matthew Allum 5620122206 Fix issues with focus in and modifiers from host confusing Xephr 2005-06-23 16:50:07 +00:00
Matthew Allum 2d065c4c33 Added ephyr server sources 2004-08-31 16:33:05 +00:00