sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

View file

@ -0,0 +1,84 @@
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SUBDIRS = man
AM_CPPFLAGS = \
@KDRIVE_INCS@ \
@KDRIVE_CFLAGS@ \
@XEPHYR_INCS@ \
@XEPHYR_CFLAGS@ \
-DHAVE_DIX_CONFIG_H \
-I$(top_srcdir) \
-I$(top_srcdir)/glamor \
-I$(top_srcdir)/exa
if XV
XV_SRCS = ephyrvideo.c
endif
if GLAMOR
if XV
GLAMOR_XV_SRCS = ephyr_glamor_xv.c
endif
GLAMOR_SRCS = \
ephyr_glamor_glx.c \
ephyr_glamor_glx.h \
$(GLAMOR_XV_SRCS) \
$()
endif
bin_PROGRAMS = Xephyr
Xephyr_SOURCES = \
ephyr.c \
ephyr.h \
ephyrlog.h \
ephyr_draw.c \
ephyrinit.c \
ephyrcursor.c \
hostx.c \
hostx.h \
$(XV_SRCS) \
$(GLAMOR_SRCS) \
$()
if GLAMOR
AM_CPPFLAGS += $(XLIB_CFLAGS)
XEPHYR_GLAMOR_LIB = \
$(top_builddir)/glamor/libglamor.la \
$(top_builddir)/glamor/libglamor_egl_stubs.la \
$()
endif
Xephyr_LDADD = \
$(top_builddir)/exa/libexa.la \
$(XEPHYR_GLAMOR_LIB) \
@KDRIVE_LIBS@ \
@XEPHYR_LIBS@
Xephyr_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@ $(XEPHYR_GLAMOR_LIB)
Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
relink:
$(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,71 @@
Xephyr README
=============
What Is It ?
============
Xephyr is a a kdrive server that outputs to a window on a pre-existing
'host' X display. Think Xnest but with support for modern extensions
like composite, damage and randr.
Unlike Xnest which is an X proxy, i.e. limited to the
capabilities of the host X server, Xephyr is a real X server which
uses the host X server window as "framebuffer" via fast SHM XImages.
It also has support for 'visually' debugging what the server is
painting.
How To Use
==========
You probably want to run like;
Xephyr :1 -ac -screen 800x600 &
Then set DISPLAY=:1 and run whatever X apps you like.
Use 'xrandr' to change to orientation/size.
There is a '-parent' switch which works just like Xnest's ( for use
with things like matchbox-nest - http://matchbox.handhelds.org ).
There is also a '-host-cursor' switch to set 'cursor acceleration' -
The host's cursor is reused. This is only really there to aid
debugging by avoiding server paints for the cursor. Performance
improvement is negligible.
Send a SIGUSR1 to the server ( eg kill -USR1 `pidof Xephyr` ) to
toggle the debugging mode. In this mode red rectangles are painted to
screen areas getting painted before painting the actual content. The
delay between this can be altered by setting a XEPHYR_PAUSE env var to
a value in microseconds.
Caveats
=======
- Depth is limited to being the same as the host.
*Update* As of 8/11/2004. Xephyr can now do 8bpp & 16bpp
on 24bpp host.
- Rotated displays are currently updated via full blits. This
is slower than a normal oprientated display. Debug mode will
therefore not be of much use rotated.
- The '-host-cursor' cursor is static in its appearance.
- The build gets a warning about 'nanosleep'. I think the various '-D'
build flags are causing this. I haven't figured as yet how to work
around it. It doesn't appear to break anything however.
- Keyboard handling is basic but works.
- Mouse button 5 probably won't work.
Matthew Allum <mallum@o-hand.com> 2004

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,236 @@
/*
* Xephyr - A kdrive X server that runs in a host X window.
* Authored by Matthew Allum <mallum@o-hand.com>
*
* Copyright © 2004 Nokia
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Nokia not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Nokia makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _EPHYR_H_
#define _EPHYR_H_
#include <stdio.h>
#include <unistd.h>
#include <libgen.h>
#include <xcb/xcb_image.h>
#include "os.h" /* for OsSignal() */
#include "kdrive.h"
#include "hostx.h"
#include "exa.h"
#ifdef RANDR
#include "randrstr.h"
#endif
#include "damage.h"
typedef struct _ephyrPriv {
CARD8 *base;
int bytes_per_line;
} EphyrPriv;
typedef struct _ephyrFakexaPriv {
ExaDriverPtr exa;
Bool is_synced;
/* The following are arguments and other information from Prepare* calls
* which are stored for use in the inner calls.
*/
int op;
PicturePtr pSrcPicture, pMaskPicture, pDstPicture;
void *saved_ptrs[3];
PixmapPtr pDst, pSrc, pMask;
GCPtr pGC;
} EphyrFakexaPriv;
typedef struct _ephyrScrPriv {
/* ephyr server info */
Rotation randr;
Bool shadow;
DamagePtr pDamage;
EphyrFakexaPriv *fakexa;
/* Host X window info */
xcb_window_t win;
xcb_window_t win_pre_existing; /* Set via -parent option like xnest */
xcb_window_t peer_win; /* Used for GL; should be at most one */
xcb_image_t *ximg;
Bool win_explicit_position;
int win_x, win_y;
int win_width, win_height;
int server_depth;
const char *output; /* Set via -output option */
unsigned char *fb_data; /* only used when host bpp != server bpp */
xcb_shm_segment_info_t shminfo;
size_t shmsize;
KdScreenInfo *screen;
int mynum; /* Screen number */
unsigned long cmap[256];
ScreenBlockHandlerProcPtr BlockHandler;
/**
* Per-screen Xlib-using state for glamor (private to
* ephyr_glamor_glx.c)
*/
struct ephyr_glamor *glamor;
} EphyrScrPriv;
extern KdCardFuncs ephyrFuncs;
extern KdKeyboardInfo *ephyrKbd;
extern KdPointerInfo *ephyrMouse;
extern miPointerScreenFuncRec ephyrPointerScreenFuncs;
Bool
ephyrInitialize(KdCardInfo * card, EphyrPriv * priv);
Bool
ephyrCardInit(KdCardInfo * card);
Bool
ephyrScreenInitialize(KdScreenInfo *screen);
Bool
ephyrInitScreen(ScreenPtr pScreen);
Bool
ephyrFinishInitScreen(ScreenPtr pScreen);
Bool
ephyrCreateResources(ScreenPtr pScreen);
void
ephyrPreserve(KdCardInfo * card);
Bool
ephyrEnable(ScreenPtr pScreen);
Bool
ephyrDPMS(ScreenPtr pScreen, int mode);
void
ephyrDisable(ScreenPtr pScreen);
void
ephyrRestore(KdCardInfo * card);
void
ephyrScreenFini(KdScreenInfo * screen);
void
ephyrCloseScreen(ScreenPtr pScreen);
void
ephyrCardFini(KdCardInfo * card);
void
ephyrGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs);
void
ephyrPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs);
Bool
ephyrMapFramebuffer(KdScreenInfo * screen);
void *ephyrWindowLinear(ScreenPtr pScreen,
CARD32 row,
CARD32 offset, int mode, CARD32 *size, void *closure);
void
ephyrSetScreenSizes(ScreenPtr pScreen);
Bool
ephyrUnmapFramebuffer(KdScreenInfo * screen);
void
ephyrUnsetInternalDamage(ScreenPtr pScreen);
Bool
ephyrSetInternalDamage(ScreenPtr pScreen);
Bool
ephyrCreateColormap(ColormapPtr pmap);
#ifdef RANDR
Bool
ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations);
Bool
ephyrRandRSetConfig(ScreenPtr pScreen,
Rotation randr, int rate, RRScreenSizePtr pSize);
Bool
ephyrRandRInit(ScreenPtr pScreen);
void
ephyrShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf);
#endif
void
ephyrUpdateModifierState(unsigned int state);
extern KdPointerDriver EphyrMouseDriver;
extern KdKeyboardDriver EphyrKeyboardDriver;
extern Bool ephyrCursorInit(ScreenPtr pScreen);
extern int ephyrBufferHeight(KdScreenInfo * screen);
/* ephyr_draw.c */
Bool
ephyrDrawInit(ScreenPtr pScreen);
void
ephyrDrawEnable(ScreenPtr pScreen);
void
ephyrDrawDisable(ScreenPtr pScreen);
void
ephyrDrawFini(ScreenPtr pScreen);
/* hostx.c glamor support */
Bool ephyr_glamor_init(ScreenPtr pScreen);
Bool ephyr_glamor_create_screen_resources(ScreenPtr pScreen);
void ephyr_glamor_enable(ScreenPtr pScreen);
void ephyr_glamor_disable(ScreenPtr pScreen);
void ephyr_glamor_fini(ScreenPtr pScreen);
void ephyr_glamor_host_paint_rect(ScreenPtr pScreen);
/*ephyvideo.c*/
Bool ephyrInitVideo(ScreenPtr pScreen);
/* ephyr_glamor_xv.c */
#ifdef GLAMOR
void ephyr_glamor_xv_init(ScreenPtr screen);
#else /* !GLAMOR */
static inline void
ephyr_glamor_xv_init(ScreenPtr screen)
{
}
#endif /* !GLAMOR */
#endif

View file

@ -0,0 +1,533 @@
/*
* Copyright © 2006 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "ephyr.h"
#include "exa_priv.h"
#include "fbpict.h"
#define EPHYR_TRACE_DRAW 0
#if EPHYR_TRACE_DRAW
#define TRACE_DRAW() ErrorF("%s\n", __FUNCTION__);
#else
#define TRACE_DRAW() do { } while (0)
#endif
/* Use some oddball alignments, to expose issues in alignment handling in EXA. */
#define EPHYR_OFFSET_ALIGN 24
#define EPHYR_PITCH_ALIGN 24
#define EPHYR_OFFSCREEN_SIZE (16 * 1024 * 1024)
#define EPHYR_OFFSCREEN_BASE (1 * 1024 * 1024)
/**
* Forces a real devPrivate.ptr for hidden pixmaps, so that we can call down to
* fb functions.
*/
static void
ephyrPreparePipelinedAccess(PixmapPtr pPix, int index)
{
KdScreenPriv(pPix->drawable.pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
assert(fakexa->saved_ptrs[index] == NULL);
fakexa->saved_ptrs[index] = pPix->devPrivate.ptr;
if (pPix->devPrivate.ptr != NULL)
return;
pPix->devPrivate.ptr = fakexa->exa->memoryBase + exaGetPixmapOffset(pPix);
}
/**
* Restores the original devPrivate.ptr of the pixmap from before we messed with
* it.
*/
static void
ephyrFinishPipelinedAccess(PixmapPtr pPix, int index)
{
KdScreenPriv(pPix->drawable.pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
pPix->devPrivate.ptr = fakexa->saved_ptrs[index];
fakexa->saved_ptrs[index] = NULL;
}
/**
* Sets up a scratch GC for fbFill, and saves other parameters for the
* ephyrSolid implementation.
*/
static Bool
ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
ChangeGCVal tmpval[3];
ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST);
fakexa->pDst = pPix;
fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen);
tmpval[0].val = alu;
tmpval[1].val = pm;
tmpval[2].val = fg;
ChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground,
tmpval);
ValidateGC(&pPix->drawable, fakexa->pGC);
TRACE_DRAW();
return TRUE;
}
/**
* Does an fbFill of the rectangle to be drawn.
*/
static void
ephyrSolid(PixmapPtr pPix, int x1, int y1, int x2, int y2)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
fbFill(&fakexa->pDst->drawable, fakexa->pGC, x1, y1, x2 - x1, y2 - y1);
}
/**
* Cleans up the scratch GC created in ephyrPrepareSolid.
*/
static void
ephyrDoneSolid(PixmapPtr pPix)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
FreeScratchGC(fakexa->pGC);
ephyrFinishPipelinedAccess(pPix, EXA_PREPARE_DEST);
}
/**
* Sets up a scratch GC for fbCopyArea, and saves other parameters for the
* ephyrCopy implementation.
*/
static Bool
ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
Pixel pm)
{
ScreenPtr pScreen = pDst->drawable.pScreen;
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
ChangeGCVal tmpval[2];
ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST);
ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC);
fakexa->pSrc = pSrc;
fakexa->pDst = pDst;
fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen);
tmpval[0].val = alu;
tmpval[1].val = pm;
ChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval);
ValidateGC(&pDst->drawable, fakexa->pGC);
TRACE_DRAW();
return TRUE;
}
/**
* Does an fbCopyArea to take care of the requested copy.
*/
static void
ephyrCopy(PixmapPtr pDst, int srcX, int srcY, int dstX, int dstY, int w, int h)
{
ScreenPtr pScreen = pDst->drawable.pScreen;
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
fbCopyArea(&fakexa->pSrc->drawable, &fakexa->pDst->drawable, fakexa->pGC,
srcX, srcY, w, h, dstX, dstY);
}
/**
* Cleans up the scratch GC created in ephyrPrepareCopy.
*/
static void
ephyrDoneCopy(PixmapPtr pDst)
{
ScreenPtr pScreen = pDst->drawable.pScreen;
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
FreeScratchGC(fakexa->pGC);
ephyrFinishPipelinedAccess(fakexa->pSrc, EXA_PREPARE_SRC);
ephyrFinishPipelinedAccess(fakexa->pDst, EXA_PREPARE_DEST);
}
/**
* Reports that we can always accelerate the given operation. This may not be
* desirable from an EXA testing standpoint -- testing the fallback paths would
* be useful, too.
*/
static Bool
ephyrCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
PicturePtr pDstPicture)
{
/* Exercise the component alpha helper, so fail on this case like a normal
* driver
*/
if (pMaskPicture && pMaskPicture->componentAlpha && op == PictOpOver)
return FALSE;
return TRUE;
}
/**
* Saves off the parameters for ephyrComposite.
*/
static Bool
ephyrPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask,
PixmapPtr pDst)
{
KdScreenPriv(pDst->drawable.pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST);
if (pSrc != NULL)
ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC);
if (pMask != NULL)
ephyrPreparePipelinedAccess(pMask, EXA_PREPARE_MASK);
fakexa->op = op;
fakexa->pSrcPicture = pSrcPicture;
fakexa->pMaskPicture = pMaskPicture;
fakexa->pDstPicture = pDstPicture;
fakexa->pSrc = pSrc;
fakexa->pMask = pMask;
fakexa->pDst = pDst;
TRACE_DRAW();
return TRUE;
}
/**
* Does an fbComposite to complete the requested drawing operation.
*/
static void
ephyrComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
KdScreenPriv(pDst->drawable.pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
fbComposite(fakexa->op, fakexa->pSrcPicture, fakexa->pMaskPicture,
fakexa->pDstPicture, srcX, srcY, maskX, maskY, dstX, dstY,
w, h);
}
static void
ephyrDoneComposite(PixmapPtr pDst)
{
KdScreenPriv(pDst->drawable.pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
if (fakexa->pMask != NULL)
ephyrFinishPipelinedAccess(fakexa->pMask, EXA_PREPARE_MASK);
if (fakexa->pSrc != NULL)
ephyrFinishPipelinedAccess(fakexa->pSrc, EXA_PREPARE_SRC);
ephyrFinishPipelinedAccess(fakexa->pDst, EXA_PREPARE_DEST);
}
/**
* Does fake acceleration of DownloadFromScren using memcpy.
*/
static Bool
ephyrDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst,
int dst_pitch)
{
KdScreenPriv(pSrc->drawable.pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
unsigned char *src;
int src_pitch, cpp;
if (pSrc->drawable.bitsPerPixel < 8)
return FALSE;
ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC);
cpp = pSrc->drawable.bitsPerPixel / 8;
src_pitch = exaGetPixmapPitch(pSrc);
src = fakexa->exa->memoryBase + exaGetPixmapOffset(pSrc);
src += y * src_pitch + x * cpp;
for (; h > 0; h--) {
memcpy(dst, src, w * cpp);
dst += dst_pitch;
src += src_pitch;
}
exaMarkSync(pSrc->drawable.pScreen);
ephyrFinishPipelinedAccess(pSrc, EXA_PREPARE_SRC);
return TRUE;
}
/**
* Does fake acceleration of UploadToScreen using memcpy.
*/
static Bool
ephyrUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src,
int src_pitch)
{
KdScreenPriv(pDst->drawable.pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
unsigned char *dst;
int dst_pitch, cpp;
if (pDst->drawable.bitsPerPixel < 8)
return FALSE;
ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST);
cpp = pDst->drawable.bitsPerPixel / 8;
dst_pitch = exaGetPixmapPitch(pDst);
dst = fakexa->exa->memoryBase + exaGetPixmapOffset(pDst);
dst += y * dst_pitch + x * cpp;
for (; h > 0; h--) {
memcpy(dst, src, w * cpp);
dst += dst_pitch;
src += src_pitch;
}
exaMarkSync(pDst->drawable.pScreen);
ephyrFinishPipelinedAccess(pDst, EXA_PREPARE_DEST);
return TRUE;
}
static Bool
ephyrPrepareAccess(PixmapPtr pPix, int index)
{
/* Make sure we don't somehow end up with a pointer that is in framebuffer
* and hasn't been readied for us.
*/
assert(pPix->devPrivate.ptr != NULL);
return TRUE;
}
/**
* In fakexa, we currently only track whether we have synced to the latest
* "accelerated" drawing that has happened or not. It's not used for anything
* yet.
*/
static int
ephyrMarkSync(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
fakexa->is_synced = FALSE;
return 0;
}
/**
* Assumes that we're waiting on the latest marker. When EXA gets smarter and
* starts using markers in a fine-grained way (for example, waiting on drawing
* to required pixmaps to complete, rather than waiting for all drawing to
* complete), we'll want to make the ephyrMarkSync/ephyrWaitMarker
* implementation fine-grained as well.
*/
static void
ephyrWaitMarker(ScreenPtr pScreen, int marker)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
fakexa->is_synced = TRUE;
}
/**
* This function initializes EXA to use the fake acceleration implementation
* which just falls through to software. The purpose is to have a reliable,
* correct driver with which to test changes to the EXA core.
*/
Bool
ephyrDrawInit(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
EphyrPriv *priv = screen->card->driver;
EphyrFakexaPriv *fakexa;
Bool success;
fakexa = calloc(1, sizeof(*fakexa));
if (fakexa == NULL)
return FALSE;
fakexa->exa = exaDriverAlloc();
if (fakexa->exa == NULL) {
free(fakexa);
return FALSE;
}
fakexa->exa->memoryBase = (CARD8 *) (priv->base);
fakexa->exa->memorySize = priv->bytes_per_line * ephyrBufferHeight(screen);
fakexa->exa->offScreenBase = priv->bytes_per_line * screen->height;
/* Since we statically link against EXA, we shouldn't have to be smart about
* versioning.
*/
fakexa->exa->exa_major = 2;
fakexa->exa->exa_minor = 0;
fakexa->exa->PrepareSolid = ephyrPrepareSolid;
fakexa->exa->Solid = ephyrSolid;
fakexa->exa->DoneSolid = ephyrDoneSolid;
fakexa->exa->PrepareCopy = ephyrPrepareCopy;
fakexa->exa->Copy = ephyrCopy;
fakexa->exa->DoneCopy = ephyrDoneCopy;
fakexa->exa->CheckComposite = ephyrCheckComposite;
fakexa->exa->PrepareComposite = ephyrPrepareComposite;
fakexa->exa->Composite = ephyrComposite;
fakexa->exa->DoneComposite = ephyrDoneComposite;
fakexa->exa->DownloadFromScreen = ephyrDownloadFromScreen;
fakexa->exa->UploadToScreen = ephyrUploadToScreen;
fakexa->exa->MarkSync = ephyrMarkSync;
fakexa->exa->WaitMarker = ephyrWaitMarker;
fakexa->exa->PrepareAccess = ephyrPrepareAccess;
fakexa->exa->pixmapOffsetAlign = EPHYR_OFFSET_ALIGN;
fakexa->exa->pixmapPitchAlign = EPHYR_PITCH_ALIGN;
fakexa->exa->maxX = 1023;
fakexa->exa->maxY = 1023;
fakexa->exa->flags = EXA_OFFSCREEN_PIXMAPS;
success = exaDriverInit(pScreen, fakexa->exa);
if (success) {
ErrorF("Initialized fake EXA acceleration\n");
scrpriv->fakexa = fakexa;
}
else {
ErrorF("Failed to initialize EXA\n");
free(fakexa->exa);
free(fakexa);
}
return success;
}
void
ephyrDrawEnable(ScreenPtr pScreen)
{
}
void
ephyrDrawDisable(ScreenPtr pScreen)
{
}
void
ephyrDrawFini(ScreenPtr pScreen)
{
}
/**
* exaDDXDriverInit is required by the top-level EXA module, and is used by
* the xorg DDX to hook in its EnableDisableFB wrapper. We don't need it, since
* we won't be enabling/disabling the FB.
*/
void
exaDDXDriverInit(ScreenPtr pScreen)
{
ExaScreenPriv(pScreen);
pExaScr->migration = ExaMigrationSmart;
pExaScr->checkDirtyCorrectness = TRUE;
}

View file

@ -0,0 +1,429 @@
/*
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/** @file ephyr_glamor_glx.c
*
* Separate file for hiding Xlib and GLX-using parts of xephyr from
* the rest of the server-struct-aware build.
*/
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#undef Xcalloc
#undef Xrealloc
#undef Xfree
#include <X11/Xlib-xcb.h>
#include <xcb/xcb_aux.h>
#include <pixman.h>
#include <epoxy/glx.h>
#include "ephyr_glamor_glx.h"
#include "os.h"
#include <X11/Xproto.h>
/* until we need geometry shaders GL3.1 should suffice. */
/* Xephyr has its own copy of this for build reasons */
#define GLAMOR_GL_CORE_VER_MAJOR 3
#define GLAMOR_GL_CORE_VER_MINOR 1
/** @{
*
* global state for Xephyr with glamor.
*
* Xephyr can render with multiple windows, but all the windows have
* to be on the same X connection and all have to have the same
* visual.
*/
static Display *dpy;
static XVisualInfo *visual_info;
static GLXFBConfig fb_config;
Bool ephyr_glamor_gles2;
Bool ephyr_glamor_skip_present;
/** @} */
/**
* Per-screen state for Xephyr with glamor.
*/
struct ephyr_glamor {
GLXContext ctx;
Window win;
GLXWindow glx_win;
GLuint tex;
GLuint texture_shader;
GLuint texture_shader_position_loc;
GLuint texture_shader_texcoord_loc;
/* Size of the window that we're rendering to. */
unsigned width, height;
GLuint vao, vbo;
};
static GLint
ephyr_glamor_compile_glsl_prog(GLenum type, const char *source)
{
GLint ok;
GLint prog;
prog = glCreateShader(type);
glShaderSource(prog, 1, (const GLchar **) &source, NULL);
glCompileShader(prog);
glGetShaderiv(prog, GL_COMPILE_STATUS, &ok);
if (!ok) {
GLchar *info;
GLint size;
glGetShaderiv(prog, GL_INFO_LOG_LENGTH, &size);
info = malloc(size);
if (info) {
glGetShaderInfoLog(prog, size, NULL, info);
ErrorF("Failed to compile %s: %s\n",
type == GL_FRAGMENT_SHADER ? "FS" : "VS", info);
ErrorF("Program source:\n%s", source);
free(info);
}
else
ErrorF("Failed to get shader compilation info.\n");
FatalError("GLSL compile failure\n");
}
return prog;
}
static GLuint
ephyr_glamor_build_glsl_prog(GLuint vs, GLuint fs)
{
GLint ok;
GLuint prog;
prog = glCreateProgram();
glAttachShader(prog, vs);
glAttachShader(prog, fs);
glLinkProgram(prog);
glGetProgramiv(prog, GL_LINK_STATUS, &ok);
if (!ok) {
GLchar *info;
GLint size;
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &size);
info = malloc(size);
glGetProgramInfoLog(prog, size, NULL, info);
ErrorF("Failed to link: %s\n", info);
FatalError("GLSL link failure\n");
}
return prog;
}
static void
ephyr_glamor_setup_texturing_shader(struct ephyr_glamor *glamor)
{
const char *vs_source =
"attribute vec2 texcoord;\n"
"attribute vec2 position;\n"
"varying vec2 t;\n"
"\n"
"void main()\n"
"{\n"
" t = texcoord;\n"
" gl_Position = vec4(position, 0, 1);\n"
"}\n";
const char *fs_source =
"#ifdef GL_ES\n"
"precision mediump float;\n"
"#endif\n"
"\n"
"varying vec2 t;\n"
"uniform sampler2D s; /* initially 0 */\n"
"\n"
"void main()\n"
"{\n"
" gl_FragColor = texture2D(s, t);\n"
"}\n";
GLuint fs, vs, prog;
vs = ephyr_glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source);
fs = ephyr_glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, fs_source);
prog = ephyr_glamor_build_glsl_prog(vs, fs);
glamor->texture_shader = prog;
glamor->texture_shader_position_loc = glGetAttribLocation(prog, "position");
assert(glamor->texture_shader_position_loc != -1);
glamor->texture_shader_texcoord_loc = glGetAttribLocation(prog, "texcoord");
assert(glamor->texture_shader_texcoord_loc != -1);
}
xcb_connection_t *
ephyr_glamor_connect(void)
{
dpy = XOpenDisplay(NULL);
if (!dpy)
return NULL;
XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
return XGetXCBConnection(dpy);
}
void
ephyr_glamor_set_texture(struct ephyr_glamor *glamor, uint32_t tex)
{
glamor->tex = tex;
}
static void
ephyr_glamor_set_vertices(struct ephyr_glamor *glamor)
{
glVertexAttribPointer(glamor->texture_shader_position_loc,
2, GL_FLOAT, FALSE, 0, (void *) 0);
glVertexAttribPointer(glamor->texture_shader_texcoord_loc,
2, GL_FLOAT, FALSE, 0, (void *) (sizeof (float) * 8));
glEnableVertexAttribArray(glamor->texture_shader_position_loc);
glEnableVertexAttribArray(glamor->texture_shader_texcoord_loc);
}
void
ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
struct pixman_region16 *damage)
{
GLint old_vao;
/* Skip presenting the output in this mode. Presentation is
* expensive, and if we're just running the X Test suite headless,
* nobody's watching.
*/
if (ephyr_glamor_skip_present)
return;
glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx);
glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao);
glBindVertexArray(glamor->vao);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glUseProgram(glamor->texture_shader);
glViewport(0, 0, glamor->width, glamor->height);
if (!ephyr_glamor_gles2)
glDisable(GL_COLOR_LOGIC_OP);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, glamor->tex);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glBindVertexArray(old_vao);
glXSwapBuffers(dpy, glamor->glx_win);
}
/**
* Xlib-based handling of xcb events for glamor.
*
* We need to let the Xlib event filtering run on the event so that
* Mesa's dri2_glx.c userspace event mangling gets run, and we
* correctly get our invalidate events propagated into the driver.
*/
void
ephyr_glamor_process_event(xcb_generic_event_t *xev)
{
uint32_t response_type = xev->response_type & 0x7f;
/* Note the types on wire_to_event: there's an Xlib XEvent (with
* the broken types) that it returns, and a protocol xEvent that
* it inspects.
*/
Bool (*wire_to_event)(Display *dpy, XEvent *ret, xEvent *event);
XLockDisplay(dpy);
/* Set the event handler to NULL to get access to the current one. */
wire_to_event = XESetWireToEvent(dpy, response_type, NULL);
if (wire_to_event) {
XEvent processed_event;
/* OK they had an event handler. Plug it back in, and call
* through to it.
*/
XESetWireToEvent(dpy, response_type, wire_to_event);
xev->sequence = LastKnownRequestProcessed(dpy);
wire_to_event(dpy, &processed_event, (xEvent *)xev);
}
XUnlockDisplay(dpy);
}
static int
ephyr_glx_error_handler(Display * _dpy, XErrorEvent * ev)
{
return 0;
}
struct ephyr_glamor *
ephyr_glamor_glx_screen_init(xcb_window_t win)
{
int (*oldErrorHandler) (Display *, XErrorEvent *);
static const float position[] = {
-1, -1,
1, -1,
1, 1,
-1, 1,
0, 1,
1, 1,
1, 0,
0, 0,
};
GLint old_vao;
GLXContext ctx;
struct ephyr_glamor *glamor;
GLXWindow glx_win;
glamor = calloc(1, sizeof(struct ephyr_glamor));
if (!glamor) {
FatalError("malloc");
return NULL;
}
glx_win = glXCreateWindow(dpy, fb_config, win, NULL);
if (ephyr_glamor_gles2) {
static const int context_attribs[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB, 2,
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES_PROFILE_BIT_EXT,
0,
};
if (epoxy_has_glx_extension(dpy, DefaultScreen(dpy),
"GLX_EXT_create_context_es2_profile")) {
ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True,
context_attribs);
} else {
FatalError("Xephyr -glamor_gles2 requires "
"GLX_EXT_create_context_es2_profile\n");
}
} else {
if (epoxy_has_glx_extension(dpy, DefaultScreen(dpy),
"GLX_ARB_create_context")) {
static const int context_attribs[] = {
GLX_CONTEXT_PROFILE_MASK_ARB,
GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
GLX_CONTEXT_MAJOR_VERSION_ARB,
GLAMOR_GL_CORE_VER_MAJOR,
GLX_CONTEXT_MINOR_VERSION_ARB,
GLAMOR_GL_CORE_VER_MINOR,
0,
};
oldErrorHandler = XSetErrorHandler(ephyr_glx_error_handler);
ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True,
context_attribs);
XSync(dpy, False);
XSetErrorHandler(oldErrorHandler);
} else {
ctx = NULL;
}
if (!ctx)
ctx = glXCreateContext(dpy, visual_info, NULL, True);
}
if (ctx == NULL)
FatalError("glXCreateContext failed\n");
if (!glXMakeCurrent(dpy, glx_win, ctx))
FatalError("glXMakeCurrent failed\n");
glamor->ctx = ctx;
glamor->win = win;
glamor->glx_win = glx_win;
ephyr_glamor_setup_texturing_shader(glamor);
glGenVertexArrays(1, &glamor->vao);
glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao);
glBindVertexArray(glamor->vao);
glGenBuffers(1, &glamor->vbo);
glBindBuffer(GL_ARRAY_BUFFER, glamor->vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof (position), position, GL_STATIC_DRAW);
ephyr_glamor_set_vertices(glamor);
glBindVertexArray(old_vao);
return glamor;
}
void
ephyr_glamor_glx_screen_fini(struct ephyr_glamor *glamor)
{
glXMakeCurrent(dpy, None, NULL);
glXDestroyContext(dpy, glamor->ctx);
glXDestroyWindow(dpy, glamor->glx_win);
free(glamor);
}
xcb_visualtype_t *
ephyr_glamor_get_visual(void)
{
xcb_screen_t *xscreen =
xcb_aux_get_screen(XGetXCBConnection(dpy), DefaultScreen(dpy));
int attribs[] = {
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER, 1,
None
};
int event_base = 0, error_base = 0, nelements;
GLXFBConfig *fbconfigs;
if (!glXQueryExtension (dpy, &error_base, &event_base))
FatalError("Couldn't find GLX extension\n");
fbconfigs = glXChooseFBConfig(dpy, DefaultScreen(dpy), attribs, &nelements);
if (!nelements)
FatalError("Couldn't choose an FBConfig\n");
fb_config = fbconfigs[0];
free(fbconfigs);
visual_info = glXGetVisualFromFBConfig(dpy, fb_config);
if (visual_info == NULL)
FatalError("Couldn't get RGB visual\n");
return xcb_aux_find_visual_by_id(xscreen, visual_info->visualid);
}
void
ephyr_glamor_set_window_size(struct ephyr_glamor *glamor,
unsigned width, unsigned height)
{
if (!glamor)
return;
glamor->width = width;
glamor->height = height;
}

View file

@ -0,0 +1,83 @@
/*
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/**
* ephyr_glamor_glx.h
*
* Prototypes exposed by ephyr_glamor_glx.c, without including any
* server headers.
*/
#include <xcb/xcb.h>
#include "dix-config.h"
struct ephyr_glamor;
struct pixman_region16;
xcb_connection_t *
ephyr_glamor_connect(void);
void
ephyr_glamor_set_texture(struct ephyr_glamor *ephyr_glamor, uint32_t tex);
xcb_visualtype_t *
ephyr_glamor_get_visual(void);
struct ephyr_glamor *
ephyr_glamor_glx_screen_init(xcb_window_t win);
void
ephyr_glamor_glx_screen_fini(struct ephyr_glamor *glamor);
#ifdef GLAMOR
void
ephyr_glamor_set_window_size(struct ephyr_glamor *glamor,
unsigned width, unsigned height);
void
ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
struct pixman_region16 *damage);
void
ephyr_glamor_process_event(xcb_generic_event_t *xev);
#else /* !GLAMOR */
static inline void
ephyr_glamor_set_window_size(struct ephyr_glamor *glamor,
unsigned width, unsigned height)
{
}
static inline void
ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
struct pixman_region16 *damage)
{
}
static inline void
ephyr_glamor_process_event(xcb_generic_event_t *xev)
{
}
#endif /* !GLAMOR */

View file

@ -0,0 +1,161 @@
/*
* Copyright © 2014 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "kdrive.h"
#include "kxv.h"
#include "ephyr.h"
#include "glamor_priv.h"
#include <X11/extensions/Xv.h>
#include "fourcc.h"
#define NUM_FORMATS 3
static KdVideoFormatRec Formats[NUM_FORMATS] = {
{15, TrueColor}, {16, TrueColor}, {24, TrueColor}
};
static void
ephyr_glamor_xv_stop_video(KdScreenInfo *screen, void *data, Bool cleanup)
{
if (!cleanup)
return;
glamor_xv_stop_video(data);
}
static int
ephyr_glamor_xv_set_port_attribute(KdScreenInfo *screen,
Atom attribute, INT32 value, void *data)
{
return glamor_xv_set_port_attribute(data, attribute, value);
}
static int
ephyr_glamor_xv_get_port_attribute(KdScreenInfo *screen,
Atom attribute, INT32 *value, void *data)
{
return glamor_xv_get_port_attribute(data, attribute, value);
}
static void
ephyr_glamor_xv_query_best_size(KdScreenInfo *screen,
Bool motion,
short vid_w, short vid_h,
short drw_w, short drw_h,
unsigned int *p_w, unsigned int *p_h,
void *data)
{
*p_w = drw_w;
*p_h = drw_h;
}
static int
ephyr_glamor_xv_query_image_attributes(KdScreenInfo *screen,
int id,
unsigned short *w, unsigned short *h,
int *pitches, int *offsets)
{
return glamor_xv_query_image_attributes(id, w, h, pitches, offsets);
}
static int
ephyr_glamor_xv_put_image(KdScreenInfo *screen,
DrawablePtr pDrawable,
short src_x, short src_y,
short drw_x, short drw_y,
short src_w, short src_h,
short drw_w, short drw_h,
int id,
unsigned char *buf,
short width,
short height,
Bool sync,
RegionPtr clipBoxes, void *data)
{
return glamor_xv_put_image(data, pDrawable,
src_x, src_y,
drw_x, drw_y,
src_w, src_h,
drw_w, drw_h,
id, buf, width, height, sync, clipBoxes);
}
void
ephyr_glamor_xv_init(ScreenPtr screen)
{
KdVideoAdaptorRec *adaptor;
glamor_port_private *port_privates;
KdVideoEncodingRec encoding = {
0,
"XV_IMAGE",
/* These sizes should probably be GL_MAX_TEXTURE_SIZE instead
* of 2048, but our context isn't set up yet.
*/
2048, 2048,
{1, 1}
};
int i;
glamor_xv_core_init(screen);
adaptor = xnfcalloc(1, sizeof(*adaptor));
adaptor->name = "glamor textured video";
adaptor->type = XvWindowMask | XvInputMask | XvImageMask;
adaptor->flags = 0;
adaptor->nEncodings = 1;
adaptor->pEncodings = &encoding;
adaptor->pFormats = Formats;
adaptor->nFormats = NUM_FORMATS;
adaptor->nPorts = 16; /* Some absurd number */
port_privates = xnfcalloc(adaptor->nPorts,
sizeof(glamor_port_private));
adaptor->pPortPrivates = xnfcalloc(adaptor->nPorts,
sizeof(glamor_port_private *));
for (i = 0; i < adaptor->nPorts; i++) {
adaptor->pPortPrivates[i].ptr = &port_privates[i];
glamor_xv_init_port(&port_privates[i]);
}
adaptor->pAttributes = glamor_xv_attributes;
adaptor->nAttributes = glamor_xv_num_attributes;
adaptor->pImages = glamor_xv_images;
adaptor->nImages = glamor_xv_num_images;
adaptor->StopVideo = ephyr_glamor_xv_stop_video;
adaptor->SetPortAttribute = ephyr_glamor_xv_set_port_attribute;
adaptor->GetPortAttribute = ephyr_glamor_xv_get_port_attribute;
adaptor->QueryBestSize = ephyr_glamor_xv_query_best_size;
adaptor->PutImage = ephyr_glamor_xv_put_image;
adaptor->QueryImageAttributes = ephyr_glamor_xv_query_image_attributes;
KdXVScreenInit(screen, adaptor, 1);
}

View file

@ -0,0 +1,258 @@
/*
* Copyright © 2014 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Author:
* Adam Jackson <ajax@redhat.com>
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "ephyr.h"
#include "ephyrlog.h"
#include "hostx.h"
#include "cursorstr.h"
#include <xcb/render.h>
#include <xcb/xcb_renderutil.h>
static DevPrivateKeyRec ephyrCursorPrivateKey;
typedef struct _ephyrCursor {
xcb_cursor_t cursor;
} ephyrCursorRec, *ephyrCursorPtr;
static ephyrCursorPtr
ephyrGetCursor(CursorPtr cursor)
{
return dixGetPrivateAddr(&cursor->devPrivates, &ephyrCursorPrivateKey);
}
static void
ephyrRealizeCoreCursor(EphyrScrPriv *scr, CursorPtr cursor)
{
ephyrCursorPtr hw = ephyrGetCursor(cursor);
xcb_connection_t *conn = hostx_get_xcbconn();
xcb_pixmap_t source, mask;
xcb_image_t *image;
xcb_gcontext_t gc;
int w = cursor->bits->width, h = cursor->bits->height;
uint32_t gcmask = XCB_GC_FUNCTION |
XCB_GC_PLANE_MASK |
XCB_GC_FOREGROUND |
XCB_GC_BACKGROUND |
XCB_GC_CLIP_MASK;
uint32_t val[] = {
XCB_GX_COPY, /* function */
~0, /* planemask */
1L, /* foreground */
0L, /* background */
None, /* clipmask */
};
source = xcb_generate_id(conn);
mask = xcb_generate_id(conn);
xcb_create_pixmap(conn, 1, source, scr->win, w, h);
xcb_create_pixmap(conn, 1, mask, scr->win, w, h);
gc = xcb_generate_id(conn);
xcb_create_gc(conn, gc, source, gcmask, val);
image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_XY_BITMAP,
1, NULL, ~0, NULL);
image->data = cursor->bits->source;
xcb_image_put(conn, source, gc, image, 0, 0, 0);
xcb_image_destroy(image);
image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_XY_BITMAP,
1, NULL, ~0, NULL);
image->data = cursor->bits->mask;
xcb_image_put(conn, mask, gc, image, 0, 0, 0);
xcb_image_destroy(image);
xcb_free_gc(conn, gc);
hw->cursor = xcb_generate_id(conn);
xcb_create_cursor(conn, hw->cursor, source, mask,
cursor->foreRed, cursor->foreGreen, cursor->foreBlue,
cursor->backRed, cursor->backGreen, cursor->backBlue,
cursor->bits->xhot, cursor->bits->yhot);
xcb_free_pixmap(conn, source);
xcb_free_pixmap(conn, mask);
}
static xcb_render_pictformat_t
get_argb_format(void)
{
static xcb_render_pictformat_t format;
if (format == None) {
xcb_connection_t *conn = hostx_get_xcbconn();
xcb_render_query_pict_formats_cookie_t cookie;
xcb_render_query_pict_formats_reply_t *formats;
cookie = xcb_render_query_pict_formats(conn);
formats =
xcb_render_query_pict_formats_reply(conn, cookie, NULL);
format =
xcb_render_util_find_standard_format(formats,
XCB_PICT_STANDARD_ARGB_32)->id;
free(formats);
}
return format;
}
static void
ephyrRealizeARGBCursor(EphyrScrPriv *scr, CursorPtr cursor)
{
ephyrCursorPtr hw = ephyrGetCursor(cursor);
xcb_connection_t *conn = hostx_get_xcbconn();
xcb_gcontext_t gc;
xcb_pixmap_t source;
xcb_render_picture_t picture;
xcb_image_t *image;
int w = cursor->bits->width, h = cursor->bits->height;
/* dix' storage is PICT_a8r8g8b8 */
source = xcb_generate_id(conn);
xcb_create_pixmap(conn, 32, source, scr->win, w, h);
gc = xcb_generate_id(conn);
xcb_create_gc(conn, gc, source, 0, NULL);
image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_Z_PIXMAP,
32, NULL, ~0, NULL);
image->data = (void *)cursor->bits->argb;
xcb_image_put(conn, source, gc, image, 0, 0, 0);
xcb_free_gc(conn, gc);
xcb_image_destroy(image);
picture = xcb_generate_id(conn);
xcb_render_create_picture(conn, picture, source, get_argb_format(),
0, NULL);
xcb_free_pixmap(conn, source);
hw->cursor = xcb_generate_id(conn);
xcb_render_create_cursor(conn, hw->cursor, picture,
cursor->bits->xhot, cursor->bits->yhot);
xcb_render_free_picture(conn, picture);
}
static Bool
can_argb_cursor(void)
{
static const xcb_render_query_version_reply_t *v;
if (!v)
v = xcb_render_util_query_version(hostx_get_xcbconn());
return v->major_version == 0 && v->minor_version >= 5;
}
static Bool
ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor)
{
KdScreenPriv(screen);
KdScreenInfo *kscr = pScreenPriv->screen;
EphyrScrPriv *scr = kscr->driver;
if (cursor->bits->argb && can_argb_cursor())
ephyrRealizeARGBCursor(scr, cursor);
else
{
ephyrRealizeCoreCursor(scr, cursor);
}
return TRUE;
}
static Bool
ephyrUnrealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor)
{
ephyrCursorPtr hw = ephyrGetCursor(cursor);
if (hw->cursor) {
xcb_free_cursor(hostx_get_xcbconn(), hw->cursor);
hw->cursor = None;
}
return TRUE;
}
static void
ephyrSetCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor, int x,
int y)
{
KdScreenPriv(screen);
KdScreenInfo *kscr = pScreenPriv->screen;
EphyrScrPriv *scr = kscr->driver;
uint32_t attr = None;
if (cursor)
attr = ephyrGetCursor(cursor)->cursor;
else
attr = hostx_get_empty_cursor();
xcb_change_window_attributes(hostx_get_xcbconn(), scr->win,
XCB_CW_CURSOR, &attr);
xcb_flush(hostx_get_xcbconn());
}
static void
ephyrMoveCursor(DeviceIntPtr dev, ScreenPtr screen, int x, int y)
{
}
static Bool
ephyrDeviceCursorInitialize(DeviceIntPtr dev, ScreenPtr screen)
{
return TRUE;
}
static void
ephyrDeviceCursorCleanup(DeviceIntPtr dev, ScreenPtr screen)
{
}
miPointerSpriteFuncRec EphyrPointerSpriteFuncs = {
ephyrRealizeCursor,
ephyrUnrealizeCursor,
ephyrSetCursor,
ephyrMoveCursor,
ephyrDeviceCursorInitialize,
ephyrDeviceCursorCleanup
};
Bool
ephyrCursorInit(ScreenPtr screen)
{
if (!dixRegisterPrivateKey(&ephyrCursorPrivateKey, PRIVATE_CURSOR_BITS,
sizeof(ephyrCursorRec)))
return FALSE;
miPointerInitialize(screen,
&EphyrPointerSpriteFuncs,
&ephyrPointerScreenFuncs, FALSE);
return TRUE;
}

View file

@ -0,0 +1,405 @@
/*
* Xephyr - A kdrive X server that runs in a host X window.
* Authored by Matthew Allum <mallum@o-hand.com>
*
* Copyright © 2004 Nokia
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Nokia not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Nokia makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "ephyr.h"
#include "ephyrlog.h"
#include "glx_extinit.h"
extern Window EphyrPreExistingHostWin;
extern Bool EphyrWantGrayScale;
extern Bool EphyrWantResize;
extern Bool EphyrWantNoHostGrab;
extern Bool kdHasPointer;
extern Bool kdHasKbd;
extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present;
extern Bool ephyrNoXV;
void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id);
void processOutputArg(const char *output, char *parent_id);
void processScreenArg(const char *screen_size, char *parent_id);
int
main(int argc, char *argv[], char *envp[])
{
hostx_use_resname(basename(argv[0]), 0);
return dix_main(argc, argv, envp);
}
void
InitCard(char *name)
{
EPHYR_DBG("mark");
KdCardInfoAdd(&ephyrFuncs, 0);
}
void
InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
{
KdInitOutput(pScreenInfo, argc, argv);
}
void
InitInput(int argc, char **argv)
{
KdKeyboardInfo *ki;
KdPointerInfo *pi;
if (!SeatId) {
KdAddKeyboardDriver(&EphyrKeyboardDriver);
KdAddPointerDriver(&EphyrMouseDriver);
if (!kdHasKbd) {
ki = KdNewKeyboard();
if (!ki)
FatalError("Couldn't create Xephyr keyboard\n");
ki->driver = &EphyrKeyboardDriver;
KdAddKeyboard(ki);
}
if (!kdHasPointer) {
pi = KdNewPointer();
if (!pi)
FatalError("Couldn't create Xephyr pointer\n");
pi->driver = &EphyrMouseDriver;
KdAddPointer(pi);
}
}
KdInitInput();
}
void
CloseInput(void)
{
KdCloseInput();
}
#if INPUTTHREAD
/** This function is called in Xserver/os/inputthread.c when starting
the input thread. */
void
ddxInputThreadInit(void)
{
}
#endif
#ifdef DDXBEFORERESET
void
ddxBeforeReset(void)
{
}
#endif
void
ddxUseMsg(void)
{
KdUseMsg();
ErrorF("\nXephyr Option Usage:\n");
ErrorF("-parent <XID> Use existing window as Xephyr root win\n");
ErrorF("-sw-cursor Render cursors in software in Xephyr\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-output <NAME> Attempt to run Xephyr fullscreen (restricted to given output geometry)\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
ErrorF("-resizeable Make Xephyr windows resizeable\n");
#ifdef GLAMOR
ErrorF("-glamor Enable 2D acceleration using glamor\n");
ErrorF("-glamor_gles2 Enable 2D acceleration using glamor (with GLES2 only)\n");
ErrorF("-glamor-skip-present Skip presenting the output when using glamor (for internal testing optimization)\n");
#endif
ErrorF
("-fakexa Simulate acceleration using software rendering\n");
ErrorF("-verbosity <level> Set log verbosity level\n");
ErrorF("-noxv do not use XV\n");
ErrorF("-name [name] define the name in the WM_CLASS property\n");
ErrorF
("-title [title] set the window title in the WM_NAME property\n");
ErrorF("-no-host-grab Disable grabbing the keyboard and mouse.\n");
ErrorF("\n");
}
void
processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id)
{
KdCardInfo *card;
InitCard(0); /*Put each screen on a separate card */
card = KdCardInfoLast();
if (card) {
KdScreenInfo *screen;
unsigned long p_id = 0;
Bool use_geometry;
screen = KdScreenInfoAdd(card);
KdParseScreen(screen, screen_size);
screen->driver = calloc(1, sizeof(EphyrScrPriv));
if (!screen->driver)
FatalError("Couldn't alloc screen private\n");
if (parent_id) {
p_id = strtol(parent_id, NULL, 0);
}
use_geometry = (strchr(screen_size, '+') != NULL);
EPHYR_DBG("screen number:%d\n", screen->mynum);
hostx_add_screen(screen, p_id, screen->mynum, use_geometry, output);
}
else {
ErrorF("No matching card found!\n");
}
}
void
processScreenArg(const char *screen_size, char *parent_id)
{
processScreenOrOutputArg(screen_size, NULL, parent_id);
}
void
processOutputArg(const char *output, char *parent_id)
{
processScreenOrOutputArg("100x100+0+0", output, parent_id);
}
int
ddxProcessArgument(int argc, char **argv, int i)
{
static char *parent = NULL;
EPHYR_DBG("mark argv[%d]='%s'", i, argv[i]);
if (!strcmp(argv[i], "-parent")) {
if (i + 1 < argc) {
int j;
/* If parent is specified and a screen argument follows, don't do
* anything, let the -screen handling init the rest */
for (j = i; j < argc; j++) {
if (!strcmp(argv[j], "-screen")) {
parent = argv[i + 1];
return 2;
}
}
processScreenArg("100x100", argv[i + 1]);
return 2;
}
UseMsg();
exit(1);
}
else if (!strcmp(argv[i], "-screen")) {
if ((i + 1) < argc) {
processScreenArg(argv[i + 1], parent);
parent = NULL;
return 2;
}
UseMsg();
exit(1);
}
else if (!strcmp(argv[i], "-output")) {
if (i + 1 < argc) {
processOutputArg(argv[i + 1], NULL);
return 2;
}
UseMsg();
exit(1);
}
else if (!strcmp(argv[i], "-sw-cursor")) {
hostx_use_sw_cursor();
return 1;
}
else if (!strcmp(argv[i], "-host-cursor")) {
/* Compatibility with the old command line argument, now the default. */
return 1;
}
else if (!strcmp(argv[i], "-fullscreen")) {
hostx_use_fullscreen();
return 1;
}
else if (!strcmp(argv[i], "-grayscale")) {
EphyrWantGrayScale = 1;
return 1;
}
else if (!strcmp(argv[i], "-resizeable")) {
EphyrWantResize = 1;
return 1;
}
#ifdef GLAMOR
else if (!strcmp (argv[i], "-glamor")) {
ephyr_glamor = TRUE;
ephyrFuncs.initAccel = ephyr_glamor_init;
ephyrFuncs.enableAccel = ephyr_glamor_enable;
ephyrFuncs.disableAccel = ephyr_glamor_disable;
ephyrFuncs.finiAccel = ephyr_glamor_fini;
return 1;
}
else if (!strcmp (argv[i], "-glamor_gles2")) {
ephyr_glamor = TRUE;
ephyr_glamor_gles2 = TRUE;
ephyrFuncs.initAccel = ephyr_glamor_init;
ephyrFuncs.enableAccel = ephyr_glamor_enable;
ephyrFuncs.disableAccel = ephyr_glamor_disable;
ephyrFuncs.finiAccel = ephyr_glamor_fini;
return 1;
}
else if (!strcmp (argv[i], "-glamor-skip-present")) {
ephyr_glamor_skip_present = TRUE;
return 1;
}
#endif
else if (!strcmp(argv[i], "-fakexa")) {
ephyrFuncs.initAccel = ephyrDrawInit;
ephyrFuncs.enableAccel = ephyrDrawEnable;
ephyrFuncs.disableAccel = ephyrDrawDisable;
ephyrFuncs.finiAccel = ephyrDrawFini;
return 1;
}
else if (!strcmp(argv[i], "-verbosity")) {
if (i + 1 < argc && argv[i + 1][0] != '-') {
int verbosity = atoi(argv[i + 1]);
LogSetParameter(XLOG_VERBOSITY, verbosity);
EPHYR_LOG("set verbosiry to %d\n", verbosity);
return 2;
}
else {
UseMsg();
exit(1);
}
}
else if (!strcmp(argv[i], "-noxv")) {
ephyrNoXV = TRUE;
EPHYR_LOG("no XVideo enabled\n");
return 1;
}
else if (!strcmp(argv[i], "-name")) {
if (i + 1 < argc && argv[i + 1][0] != '-') {
hostx_use_resname(argv[i + 1], 1);
return 2;
}
else {
UseMsg();
return 0;
}
}
else if (!strcmp(argv[i], "-title")) {
if (i + 1 < argc && argv[i + 1][0] != '-') {
hostx_set_title(argv[i + 1]);
return 2;
}
else {
UseMsg();
return 0;
}
}
else if (argv[i][0] == ':') {
hostx_set_display_name(argv[i]);
}
/* Xnest compatibility */
else if (!strcmp(argv[i], "-display")) {
hostx_set_display_name(argv[i + 1]);
return 2;
}
else if (!strcmp(argv[i], "-sync") ||
!strcmp(argv[i], "-full") ||
!strcmp(argv[i], "-sss") || !strcmp(argv[i], "-install")) {
return 1;
}
else if (!strcmp(argv[i], "-bw") ||
!strcmp(argv[i], "-class") ||
!strcmp(argv[i], "-geometry") || !strcmp(argv[i], "-scrns")) {
return 2;
}
/* end Xnest compat */
else if (!strcmp(argv[i], "-no-host-grab")) {
EphyrWantNoHostGrab = 1;
return 1;
}
else if (!strcmp(argv[i], "-sharevts") ||
!strcmp(argv[i], "-novtswitch")) {
return 1;
}
else if (!strcmp(argv[i], "-layout")) {
return 2;
}
return KdProcessArgument(argc, argv, i);
}
void
OsVendorInit(void)
{
EPHYR_DBG("mark");
if (SeatId)
hostx_use_sw_cursor();
if (hostx_want_host_cursor())
ephyrFuncs.initCursor = &ephyrCursorInit;
if (serverGeneration == 1) {
if (!KdCardInfoLast()) {
processScreenArg("640x480", NULL);
}
hostx_init();
}
}
#ifdef X_PRIVSEP
void
priv_vendor_init(void)
{
}
#endif
KdCardFuncs ephyrFuncs = {
ephyrCardInit, /* cardinit */
ephyrScreenInitialize, /* scrinit */
ephyrInitScreen, /* initScreen */
ephyrFinishInitScreen, /* finishInitScreen */
ephyrCreateResources, /* createRes */
ephyrScreenFini, /* scrfini */
ephyrCardFini, /* cardfini */
0, /* initCursor */
0, /* initAccel */
0, /* enableAccel */
0, /* disableAccel */
0, /* finiAccel */
ephyrGetColors, /* getColors */
ephyrPutColors, /* putColors */
ephyrCloseScreen, /* closeScreen */
};

View file

@ -0,0 +1,67 @@
/*
* Xephyr - A kdrive X server that runs in a host X window.
* Authored by Matthew Allum <mallum@openedhand.com>
*
* Copyright © 2007 OpenedHand Ltd
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of OpenedHand Ltd not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. OpenedHand Ltd makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Authors:
* Dodji Seketeli <dodji@openedhand.com>
*/
#ifndef __EPHYRLOG_H__
#define __EPHYRLOG_H__
#include <assert.h>
#include "os.h"
#ifndef DEBUG
/*we are not in debug mode*/
#define EPHYR_LOG(...)
#define EPHYR_LOG_ERROR(...)
#endif /*!DEBUG */
#define ERROR_LOG_LEVEL 3
#define INFO_LOG_LEVEL 4
#ifndef EPHYR_LOG
#define EPHYR_LOG(...) \
LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, "in %s:%d:%s: ",\
__FILE__, __LINE__, __func__) ; \
LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, __VA_ARGS__)
#endif /*nomadik_log */
#ifndef EPHYR_LOG_ERROR
#define EPHYR_LOG_ERROR(...) \
LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, "Error:in %s:%d:%s: ",\
__FILE__, __LINE__, __func__) ; \
LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, __VA_ARGS__)
#endif /*EPHYR_LOG_ERROR */
#ifndef EPHYR_RETURN_IF_FAIL
#define EPHYR_RETURN_IF_FAIL(cond) \
if (!(cond)) {EPHYR_LOG_ERROR("condition %s failed\n", #cond);return;}
#endif /*nomadik_return_if_fail */
#ifndef EPHYR_RETURN_VAL_IF_FAIL
#define EPHYR_RETURN_VAL_IF_FAIL(cond,val) \
if (!(cond)) {EPHYR_LOG_ERROR("condition %s failed\n", #cond);return val;}
#endif /*nomadik_return_val_if_fail */
#endif /*__EPHYRLOG_H__*/

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,193 @@
/*
* Xephyr - A kdrive X server that runs in a host X window.
* Authored by Matthew Allum <mallum@o-hand.com>
*
* Copyright © 2004 Nokia
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Nokia not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Nokia makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _XLIBS_STUFF_H_
#define _XLIBS_STUFF_H_
#include <X11/X.h>
#include <X11/Xmd.h>
#include <xcb/xcb.h>
#include <xcb/render.h>
#include "ephyr.h"
#define EPHYR_WANT_DEBUG 0
#if (EPHYR_WANT_DEBUG)
#define EPHYR_DBG(x, a...) \
fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
#else
#define EPHYR_DBG(x, a...) do {} while (0)
#endif
typedef struct EphyrHostXVars EphyrHostXVars;
typedef struct {
VisualID visualid;
int screen;
int depth;
int class;
unsigned long red_mask;
unsigned long green_mask;
unsigned long blue_mask;
int colormap_size;
int bits_per_rgb;
} EphyrHostVisualInfo;
typedef struct {
int x, y;
int width, height;
int visualid;
} EphyrHostWindowAttributes;
typedef struct {
int x, y, width, height;
} EphyrBox;
typedef struct {
short x1, y1, x2, y2;
} EphyrRect;
int
hostx_want_screen_geometry(KdScreenInfo *screen, int *width, int *height, int *x, int *y);
int
hostx_want_host_cursor(void);
void
hostx_use_sw_cursor(void);
xcb_cursor_t
hostx_get_empty_cursor(void);
void
hostx_get_output_geometry(const char *output,
int *x, int *y,
int *width, int *height);
void
hostx_use_fullscreen(void);
int
hostx_want_fullscreen(void);
int
hostx_want_preexisting_window(KdScreenInfo *screen);
void
hostx_use_preexisting_window(unsigned long win_id);
void
hostx_use_resname(char *name, int fromcmd);
void
hostx_set_title(char *name);
void
hostx_handle_signal(int signum);
int
hostx_init(void);
void
hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Bool use_geometry, const char *output);
void
hostx_set_display_name(char *name);
void
hostx_set_screen_number(KdScreenInfo *screen, int number);
void
hostx_set_win_title(KdScreenInfo *screen, const char *extra_text);
int
hostx_get_depth(void);
int
hostx_get_server_depth(KdScreenInfo *screen);
int
hostx_get_bpp(KdScreenInfo *screen);
void
hostx_get_visual_masks(KdScreenInfo *screen,
CARD32 *rmsk, CARD32 *gmsk, CARD32 *bmsk);
void
hostx_set_cmap_entry(ScreenPtr pScreen, unsigned char idx,
unsigned char r, unsigned char g, unsigned char b);
void *hostx_screen_init(KdScreenInfo *screen,
int x, int y,
int width, int height, int buffer_height,
int *bytes_per_line, int *bits_per_pixel);
void
hostx_paint_rect(KdScreenInfo *screen,
int sx, int sy, int dx, int dy, int width, int height);
Bool
hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls);
void
hostx_size_set_from_configure(Bool);
xcb_connection_t *
hostx_get_xcbconn(void);
xcb_generic_event_t *
hostx_get_event(Bool queued_only);
Bool
hostx_has_queued_event(void);
int
hostx_get_screen(void);
int
hostx_get_window(int a_screen_number);
int
hostx_get_window_attributes(int a_window, EphyrHostWindowAttributes * a_attr);
int
hostx_get_visuals_info(EphyrHostVisualInfo ** a_visuals, int *a_num_entries);
int hostx_create_window(int a_screen_number,
EphyrBox * a_geometry,
int a_visual_id, int *a_host_win /*out parameter */ );
int hostx_destroy_window(int a_win);
int hostx_set_window_geometry(int a_win, EphyrBox * a_geo);
int hostx_set_window_bounding_rectangles(int a_window,
EphyrRect * a_rects, int a_num_rects);
int hostx_has_extension(xcb_extension_t *extension);
int hostx_get_fd(void);
#endif /*_XLIBS_STUFF_H_*/

View file

@ -0,0 +1,2 @@
include $(top_srcdir)/manpages.am
appman_PRE = Xephyr.man

View file

@ -0,0 +1,772 @@
# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/manpages.am
subdir = hw/kdrive/ephyr/man
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
$(top_builddir)/include/xorg-server.h \
$(top_builddir)/include/dix-config.h \
$(top_builddir)/include/xorg-config.h \
$(top_builddir)/include/xkb-config.h \
$(top_builddir)/include/xwin-config.h \
$(top_builddir)/include/version-config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" \
"$(DESTDIR)$(filemandir)"
DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
BASE_FONT_PATH = @BASE_FONT_PATH@
BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@
BUNDLE_VERSION = @BUNDLE_VERSION@
BUNDLE_VERSION_STRING = @BUNDLE_VERSION_STRING@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
DEFAULT_LOGDIR = @DEFAULT_LOGDIR@
DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@
DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DGA_CFLAGS = @DGA_CFLAGS@
DGA_LIBS = @DGA_LIBS@
DIX_CFLAGS = @DIX_CFLAGS@
DIX_LIB = @DIX_LIB@
DLLTOOL = @DLLTOOL@
DLOPEN_LIBS = @DLOPEN_LIBS@
DOT = @DOT@
DOXYGEN = @DOXYGEN@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@
DRI3PROTO_LIBS = @DRI3PROTO_LIBS@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
DSYMUTIL = @DSYMUTIL@
DTRACE = @DTRACE@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
FONT100DPIDIR = @FONT100DPIDIR@
FONT75DPIDIR = @FONT75DPIDIR@
FONTMISCDIR = @FONTMISCDIR@
FONTOTFDIR = @FONTOTFDIR@
FONTROOTDIR = @FONTROOTDIR@
FONTTTFDIR = @FONTTTFDIR@
FONTTYPE1DIR = @FONTTYPE1DIR@
FOP = @FOP@
GBM_CFLAGS = @GBM_CFLAGS@
GBM_LIBS = @GBM_LIBS@
GLAMOR_CFLAGS = @GLAMOR_CFLAGS@
GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_LIBS@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
KDRIVE_INCS = @KDRIVE_INCS@
KDRIVE_LIBS = @KDRIVE_LIBS@
KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@
KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@
KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@
KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@
LD = @LD@
LDFLAGS = @LDFLAGS@
LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIBS = @LIBDRM_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@
LIBSHA1_LIBS = @LIBSHA1_LIBS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@
LIBUNWIND_LIBS = @LIBUNWIND_LIBS@
LIBXCVT_CFLAGS = @LIBXCVT_CFLAGS@
LIBXCVT_LIBS = @LIBXCVT_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAIN_LIB = @MAIN_LIB@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
# xorg-macros.m4 has these bracketed by double underscores, but meson
# wants ats.
# Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS
# 's|/,|/, |g' will add a space to help font path formatting
MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \
"$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \
"$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \
's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \
-e 's|@apploaddir@|$(appdefaultdir)|g' -e \
's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \
's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \
's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \
's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \
's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \
's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \
's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \
-e 's|[@]mandir[@]|$(mandir)|g' -e \
's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \
's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \
's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \
's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \
's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \
's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \
's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \
's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \
's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \
's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \
's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \
's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \
'\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g'
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJC = @OBJC@
OBJCCLD = @OBJCCLD@
OBJCDEPMODE = @OBJCDEPMODE@
OBJCFLAGS = @OBJCFLAGS@
OBJCLINK = @OBJCLINK@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OS_LIB = @OS_LIB@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
PCIACCESS_LIBS = @PCIACCESS_LIBS@
PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
PIXMAN_LIBS = @PIXMAN_LIBS@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PROJECTROOT = @PROJECTROOT@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
PYTHON3 = @PYTHON3@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
RAWCPPFLAGS = @RAWCPPFLAGS@
RELEASE_DATE = @RELEASE_DATE@
SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@
SED = @SED@
SELINUX_CFLAGS = @SELINUX_CFLAGS@
SELINUX_LIBS = @SELINUX_LIBS@
SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHA1_CFLAGS = @SHA1_CFLAGS@
SHA1_LIBS = @SHA1_LIBS@
SHELL = @SHELL@
SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@
SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@
SYSCONFDIR = @SYSCONFDIR@
SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@
SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@
TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
VERSION = @VERSION@
WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@
WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@
WINDRES = @WINDRES@
XCONFIGDIR = @XCONFIGDIR@
XCONFIGFILE = @XCONFIGFILE@
XDMCP_CFLAGS = @XDMCP_CFLAGS@
XDMCP_LIBS = @XDMCP_LIBS@
XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@
XKB_DFLT_MODEL = @XKB_DFLT_MODEL@
XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@
XKB_DFLT_RULES = @XKB_DFLT_RULES@
XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@
XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
XLIB_CFLAGS = @XLIB_CFLAGS@
XLIB_LIBS = @XLIB_LIBS@
XMLTO = @XMLTO@
XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
XNEST_LIBS = @XNEST_LIBS@
XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@
XORG_INCS = @XORG_INCS@
XORG_LIBS = @XORG_LIBS@
XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
XORG_SGML_PATH = @XORG_SGML_PATH@
XORG_SYS_LIBS = @XORG_SYS_LIBS@
XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
XPBPROXY_LIBS = @XPBPROXY_LIBS@
XQUARTZ_LIBS = @XQUARTZ_LIBS@
XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
XQUARTZ_SPARKLE_FEED_URL = @XQUARTZ_SPARKLE_FEED_URL@
XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
XSERVER_LIBS = @XSERVER_LIBS@
XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@
XSHMFENCE_LIBS = @XSHMFENCE_LIBS@
XSLTPROC = @XSLTPROC@
XSL_STYLESHEET = @XSL_STYLESHEET@
XVFB_LIBS = @XVFB_LIBS@
XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
XWINMODULES_LIBS = @XWINMODULES_LIBS@
XWIN_LIBS = @XWIN_LIBS@
XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
YACC = @YACC@
YFLAGS = @YFLAGS@
abi_ansic = @abi_ansic@
abi_extension = @abi_extension@
abi_videodrv = @abi_videodrv@
abi_xinput = @abi_xinput@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
driverdir = @driverdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
extdir = @extdir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
logdir = @logdir@
mandir = @mandir@
mkdir_p = @mkdir_p@
moduledir = @moduledir@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
symbol_visibility = @symbol_visibility@
sysconfdir = @sysconfdir@
sysconfigdir = @sysconfigdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
appmandir = $(APP_MAN_DIR)
#appman_PRE = list of application man page files set by calling Makefile.am
appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
drivermandir = $(DRIVER_MAN_DIR)
#driverman_PRE = list of driver man page files set by calling Makefile.am
driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX))
filemandir = $(FILE_MAN_DIR)
#fileman_PRE = list of file man page files set by calling Makefile.am
fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX))
# The calling Makefile should only contain man page targets
# Otherwise the following three global variables may conflict
EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE)
CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA)
SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man
appman_PRE = Xephyr.man
all: all-am
.SUFFIXES:
.SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/kdrive/ephyr/man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign hw/kdrive/ephyr/man/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_srcdir)/manpages.am:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-appmanDATA: $(appman_DATA)
@$(NORMAL_INSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(appmandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
done
uninstall-appmanDATA:
@$(NORMAL_UNINSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir)
install-drivermanDATA: $(driverman_DATA)
@$(NORMAL_INSTALL)
@list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(drivermandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \
done
uninstall-drivermanDATA:
@$(NORMAL_UNINSTALL)
@list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir)
install-filemanDATA: $(fileman_DATA)
@$(NORMAL_INSTALL)
@list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(filemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \
done
uninstall-filemanDATA:
@$(NORMAL_UNINSTALL)
@list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir)
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-appmanDATA install-drivermanDATA \
install-filemanDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \
uninstall-filemanDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-appmanDATA install-data install-data-am \
install-drivermanDATA install-dvi install-dvi-am install-exec \
install-exec-am install-filemanDATA install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-appmanDATA \
uninstall-drivermanDATA uninstall-filemanDATA
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
.man.$(FILE_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -0,0 +1,96 @@
.\"
.\" Copyright (c) Matthieu Herrb <matthieu@herrb.eu>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.TH Xephyr @appmansuffix@ @vendorversion@
.SH NAME
Xephyr - X server outputting to a window on a pre-existing X display
.SH SYNOPSIS
.B Xephyr
.RI [\fB:\fP display ]
.RI [ option
.IR ... ]
.SH DESCRIPTION
.B Xephyr
is a kdrive server that outputs to a window on a pre-existing "host"
X display.
Think
.I Xnest
but with support for modern extensions like composite, damage and randr.
.PP
Unlike
.I Xnest
which is an X proxy, i.e. limited to the capabilities of the host X server,
.B Xephyr
is a real X server which
uses the host X server window as "framebuffer" via fast SHM XImages.
.PP
It also has support for "visually" debugging what the server is
painting.
.SH OPTIONS
The server accepts all the standard options of Xserver(@appmansuffix@)
and the following additional options:
.TP 8
.BI -screen " width" x height
sets the screen size.
.TP 8
.BI -parent " id"
uses existing window
.I id .
If a
.BI -screen
argument follows a
.BI -parent
argument, this screen is embedded into the given window.
.TP 8
.B -host-cursor
set 'cursor acceleration':
The host's cursor is reused. This is only really there to aid
debugging by avoiding server paints for the cursor. Performance
improvement is negligible.
.TP 8
.B -resizeable
Allow the Xephyr window to be resized, even if not embedded into a parent
window. By default, the Xephyr window has a fixed size.
.TP 8
.B -no-host-grab
Disable grabbing the keyboard and mouse.
.SH "SIGNALS"
Send a SIGUSR1 to the server (e.g. pkill -USR1 Xephyr) to
toggle the debugging mode.
In this mode red rectangles are painted to
screen areas getting painted before painting the actual content.
The
delay between this can be altered by setting a XEPHYR_PAUSE env var to
a value in micro seconds.
.SH CAVEATS
.PP
.IP \(bu 2
Rotated displays are currently updated via full blits. This
is slower than a normal orientated display. Debug mode will
therefore not be of much use rotated.
.IP \(bu 2
The '-host-cursor' cursor is static in its appearance.
.IP \(bu 2
The build gets a warning about 'nanosleep'. I think the various '-D'
build flags are causing this. I haven't figured as yet how to work
round it. It doesn't appear to break anything however.
.IP \(bu 2
Keyboard handling is basic but works.
.IP \(bu 2
Mouse button 5 probably won't work.
.SH "SEE ALSO"
X(@miscmansuffix@), Xserver(@appmansuffix@)
.SH AUTHOR
Matthew Allum <mallum@o-hand.com> 2004

View file

@ -0,0 +1,70 @@
srcs = [
'ephyr.c',
'ephyrinit.c',
'ephyrcursor.c',
'ephyr_draw.c',
'hostx.c',
]
xephyr_dep = [
common_dep,
dependency('xcb'),
dependency('xcb-shape'),
dependency('xcb-render'),
dependency('xcb-renderutil'),
dependency('xcb-aux'),
dependency('xcb-image'),
dependency('xcb-icccm'),
dependency('xcb-shm', version : '>=1.9.3'),
dependency('xcb-keysyms'),
dependency('xcb-randr'),
dependency('xcb-xkb'),
]
xephyr_glamor = []
if build_glamor
srcs += 'ephyr_glamor_glx.c'
if build_xv
srcs += 'ephyr_glamor_xv.c'
endif
xephyr_glamor += glamor
xephyr_glamor += glamor_egl_stubs
xephyr_dep += dependency('x11-xcb')
xephyr_dep += epoxy_dep
endif
if build_xv
srcs += 'ephyrvideo.c'
xephyr_dep += dependency('xcb-xv')
endif
xephyr_server = executable(
'Xephyr',
srcs,
include_directories: [
inc,
include_directories('../src')
],
dependencies: xephyr_dep,
link_with: [
libxserver_main,
libxserver_exa,
xephyr_glamor,
kdrive,
libxserver_fb,
libxserver,
libxserver_config,
libxserver_xkb_stubs,
libxserver_xi_stubs,
libxserver_glx,
libglxvnd,
],
install: true,
)
xephyr_man = configure_file(
input: 'man/Xephyr.man',
output: 'Xephyr.1',
configuration: manpage_config,
)
install_man(xephyr_man)