aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/ephyr
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-01-08 13:59:32 +0000
committermarha <marha@users.sourceforge.net>2010-01-08 13:59:32 +0000
commit1ae1f3dee798a8468a415eaa8f1da78e9d3fbae8 (patch)
tree5ff2d27dc0c94b02beedeb4551f677691e606352 /xorg-server/hw/kdrive/ephyr
parentd5ac51b006c039894e4e35102a8e182d21a52efc (diff)
parent91a30d5622174febaa2107b010effcf2fb5b9a2e (diff)
downloadvcxsrv-1ae1f3dee798a8468a415eaa8f1da78e9d3fbae8.tar.gz
vcxsrv-1ae1f3dee798a8468a415eaa8f1da78e9d3fbae8.tar.bz2
vcxsrv-1ae1f3dee798a8468a415eaa8f1da78e9d3fbae8.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr')
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.c131
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.h8
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr_draw.c7
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrinit.c15
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrvideo.c2
5 files changed, 87 insertions, 76 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c
index c3b3aeff5..6e61b8c5d 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.c
@@ -104,77 +104,77 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
}
if (EphyrWantGrayScale)
- screen->fb[0].depth = 8;
+ screen->fb.depth = 8;
- if (screen->fb[0].depth && screen->fb[0].depth != hostx_get_depth())
+ if (screen->fb.depth && screen->fb.depth != hostx_get_depth())
{
- if (screen->fb[0].depth < hostx_get_depth()
- && (screen->fb[0].depth == 24 || screen->fb[0].depth == 16
- || screen->fb[0].depth == 8))
+ if (screen->fb.depth < hostx_get_depth()
+ && (screen->fb.depth == 24 || screen->fb.depth == 16
+ || screen->fb.depth == 8))
{
- hostx_set_server_depth(screen, screen->fb[0].depth);
+ hostx_set_server_depth(screen, screen->fb.depth);
}
else
ErrorF("\nXephyr: requested screen depth not supported, setting to match hosts.\n");
}
- screen->fb[0].depth = hostx_get_server_depth(screen);
+ screen->fb.depth = hostx_get_server_depth(screen);
screen->rate = 72;
- if (screen->fb[0].depth <= 8)
+ if (screen->fb.depth <= 8)
{
if (EphyrWantGrayScale)
- screen->fb[0].visuals = ((1 << StaticGray) | (1 << GrayScale));
+ screen->fb.visuals = ((1 << StaticGray) | (1 << GrayScale));
else
- screen->fb[0].visuals = ((1 << StaticGray) |
- (1 << GrayScale) |
- (1 << StaticColor) |
- (1 << PseudoColor) |
- (1 << TrueColor) |
- (1 << DirectColor));
+ screen->fb.visuals = ((1 << StaticGray) |
+ (1 << GrayScale) |
+ (1 << StaticColor) |
+ (1 << PseudoColor) |
+ (1 << TrueColor) |
+ (1 << DirectColor));
- screen->fb[0].redMask = 0x00;
- screen->fb[0].greenMask = 0x00;
- screen->fb[0].blueMask = 0x00;
- screen->fb[0].depth = 8;
- screen->fb[0].bitsPerPixel = 8;
+ screen->fb.redMask = 0x00;
+ screen->fb.greenMask = 0x00;
+ screen->fb.blueMask = 0x00;
+ screen->fb.depth = 8;
+ screen->fb.bitsPerPixel = 8;
}
else
{
- screen->fb[0].visuals = (1 << TrueColor);
+ screen->fb.visuals = (1 << TrueColor);
- if (screen->fb[0].depth <= 15)
+ if (screen->fb.depth <= 15)
{
- screen->fb[0].depth = 15;
- screen->fb[0].bitsPerPixel = 16;
+ screen->fb.depth = 15;
+ screen->fb.bitsPerPixel = 16;
}
- else if (screen->fb[0].depth <= 16)
+ else if (screen->fb.depth <= 16)
{
- screen->fb[0].depth = 16;
- screen->fb[0].bitsPerPixel = 16;
+ screen->fb.depth = 16;
+ screen->fb.bitsPerPixel = 16;
}
- else if (screen->fb[0].depth <= 24)
+ else if (screen->fb.depth <= 24)
{
- screen->fb[0].depth = 24;
- screen->fb[0].bitsPerPixel = 32;
+ screen->fb.depth = 24;
+ screen->fb.bitsPerPixel = 32;
}
- else if (screen->fb[0].depth <= 30)
+ else if (screen->fb.depth <= 30)
{
- screen->fb[0].depth = 30;
- screen->fb[0].bitsPerPixel = 32;
+ screen->fb.depth = 30;
+ screen->fb.bitsPerPixel = 32;
}
else
{
ErrorF("\nXephyr: Unsupported screen depth %d\n",
- screen->fb[0].depth);
+ screen->fb.depth);
return FALSE;
}
hostx_get_visual_masks (screen, &redMask, &greenMask, &blueMask);
- screen->fb[0].redMask = (Pixel) redMask;
- screen->fb[0].greenMask = (Pixel) greenMask;
- screen->fb[0].blueMask = (Pixel) blueMask;
+ screen->fb.redMask = (Pixel) redMask;
+ screen->fb.greenMask = (Pixel) greenMask;
+ screen->fb.blueMask = (Pixel) blueMask;
}
@@ -223,6 +223,22 @@ ephyrWindowLinear (ScreenPtr pScreen,
return priv->base + row * priv->bytes_per_line + offset;
}
+/**
+ * Figure out display buffer size. If fakexa is enabled, allocate a larger
+ * buffer so that fakexa has space to put offscreen pixmaps.
+ */
+int
+ephyrBufferHeight(KdScreenInfo *screen)
+{
+ int buffer_height;
+ if (ephyrFuncs.initAccel == NULL)
+ buffer_height = screen->height;
+ else
+ buffer_height = 3 * screen->height;
+ return buffer_height;
+}
+
+
Bool
ephyrMapFramebuffer (KdScreenInfo *screen)
{
@@ -237,30 +253,19 @@ ephyrMapFramebuffer (KdScreenInfo *screen)
KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height);
KdSetPointerMatrix (&m);
- priv->bytes_per_line = ((screen->width * screen->fb[0].bitsPerPixel + 31) >> 5) << 2;
-
- /* point the framebuffer to the data in an XImage */
- /* If fakexa is enabled, allocate a larger buffer so that fakexa has space to
- * put offscreen pixmaps.
- */
- if (ephyrFuncs.initAccel == NULL)
- buffer_height = screen->height;
- else
- buffer_height = 3 * screen->height;
+ priv->bytes_per_line = ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
+
+ buffer_height = ephyrBufferHeight(screen);
priv->base = hostx_screen_init (screen, screen->width, screen->height, buffer_height);
- screen->memory_base = (CARD8 *) (priv->base);
- screen->memory_size = priv->bytes_per_line * buffer_height;
- screen->off_screen_base = priv->bytes_per_line * screen->height;
-
if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All))
{
scrpriv->shadow = FALSE;
- screen->fb[0].byteStride = priv->bytes_per_line;
- screen->fb[0].pixelStride = screen->width;
- screen->fb[0].frameBuffer = (CARD8 *) (priv->base);
+ screen->fb.byteStride = priv->bytes_per_line;
+ screen->fb.pixelStride = screen->width;
+ screen->fb.frameBuffer = (CARD8 *) (priv->base);
}
else
{
@@ -269,7 +274,7 @@ ephyrMapFramebuffer (KdScreenInfo *screen)
EPHYR_LOG("allocing shadow");
- KdShadowFbAlloc (screen, 0,
+ KdShadowFbAlloc (screen,
scrpriv->randr & (RR_Rotate_90|RR_Rotate_270));
}
@@ -305,7 +310,7 @@ ephyrUnmapFramebuffer (KdScreenInfo *screen)
EphyrScrPriv *scrpriv = screen->driver;
if (scrpriv->shadow)
- KdShadowFbFree (screen, 0);
+ KdShadowFbFree (screen);
/* Note, priv->base will get freed when XImage recreated */
@@ -569,10 +574,10 @@ ephyrRandRSetConfig (ScreenPtr pScreen,
(*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap (pScreen),
pScreen->width,
pScreen->height,
- screen->fb[0].depth,
- screen->fb[0].bitsPerPixel,
- screen->fb[0].byteStride,
- screen->fb[0].frameBuffer);
+ screen->fb.depth,
+ screen->fb.bitsPerPixel,
+ screen->fb.byteStride,
+ screen->fb.frameBuffer);
/* set the subpixel order */
@@ -733,7 +738,7 @@ ephyrScreenFini (KdScreenInfo *screen)
{
EphyrScrPriv *scrpriv = screen->driver;
if (scrpriv->shadow) {
- KdShadowFbFree (screen, 0);
+ KdShadowFbFree (screen);
}
xfree(screen->driver);
screen->driver = NULL;
@@ -1033,7 +1038,7 @@ ephyrCardFini (KdCardInfo *card)
}
void
-ephyrGetColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs)
+ephyrGetColors (ScreenPtr pScreen, int n, xColorItem *pdefs)
{
/* XXX Not sure if this is right */
@@ -1050,7 +1055,7 @@ ephyrGetColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs)
}
void
-ephyrPutColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs)
+ephyrPutColors (ScreenPtr pScreen, int n, xColorItem *pdefs)
{
int min, max, p;
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.h b/xorg-server/hw/kdrive/ephyr/ephyr.h
index 5479736e3..e4ce84dee 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.h
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.h
@@ -118,10 +118,10 @@ void
ephyrCardFini (KdCardInfo *card);
void
-ephyrGetColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs);
+ephyrGetColors (ScreenPtr pScreen, int n, xColorItem *pdefs);
void
-ephyrPutColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs);
+ephyrPutColors (ScreenPtr pScreen, int n, xColorItem *pdefs);
Bool
ephyrMapFramebuffer (KdScreenInfo *screen);
@@ -182,6 +182,10 @@ extern Bool ephyrCursorInit(ScreenPtr pScreen);
extern void ephyrCursorEnable(ScreenPtr pScreen);
+extern int ephyrBufferHeight(KdScreenInfo *screen);
+
+extern int ephyrBufferHeight(KdScreenInfo *screen);
+
/* ephyr_draw.c */
Bool
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr_draw.c b/xorg-server/hw/kdrive/ephyr/ephyr_draw.c
index 7b579c24b..f9fac8007 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr_draw.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr_draw.c
@@ -428,6 +428,7 @@ ephyrDrawInit(ScreenPtr pScreen)
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver;
+ EphyrPriv *priv = screen->card->driver;
EphyrFakexaPriv *fakexa;
Bool success;
@@ -441,9 +442,9 @@ ephyrDrawInit(ScreenPtr pScreen)
return FALSE;
}
- fakexa->exa->memoryBase = screen->memory_base;
- fakexa->exa->memorySize = screen->memory_size;
- fakexa->exa->offScreenBase = screen->off_screen_base;
+ 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.
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
index 0c638e98d..d0a4d8540 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
@@ -40,17 +40,18 @@ extern Bool noGlxVisualInit;
#endif
extern Bool ephyrNoXV;
+#ifdef KDRIVE_EVDEV
+extern KdPointerDriver LinuxEvdevMouseDriver;
+extern KdKeyboardDriver LinuxEvdevKeyboardDriver;
+#endif
+
void processScreenArg (char *screen_size, char *parent_id) ;
void
InitCard (char *name)
{
- KdCardAttr attr;
-
EPHYR_DBG("mark");
-
-
- KdCardInfoAdd (&ephyrFuncs, &attr, 0);
+ KdCardInfoAdd (&ephyrFuncs, 0);
}
#ifndef _MSC_VER
@@ -67,11 +68,11 @@ InitInput (int argc, char **argv)
KdPointerInfo *pi;
KdAddKeyboardDriver(&EphyrKeyboardDriver);
-#ifdef linux
+#ifdef KDRIVE_EVDEV
KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver);
#endif
KdAddPointerDriver(&EphyrMouseDriver);
-#ifdef linux
+#ifdef KDRIVE_EVDEV
KdAddPointerDriver(&LinuxEvdevMouseDriver);
#endif
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
index bb2ee1032..6624ab98a 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
@@ -302,7 +302,7 @@ ephyrInitVideo (ScreenPtr pScreen)
EPHYR_LOG ("enter\n") ;
- if (screen->fb[0].bitsPerPixel == 8) {
+ if (screen->fb.bitsPerPixel == 8) {
EPHYR_LOG_ERROR ("8 bits depth not supported\n") ;
return FALSE ;
}