aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive')
-rw-r--r--xorg-server/hw/kdrive/ephyr/man/Xephyr.man6
-rw-r--r--xorg-server/hw/kdrive/fbdev/fbdev.c157
-rw-r--r--xorg-server/hw/kdrive/fbdev/fbdev.h2
-rw-r--r--xorg-server/hw/kdrive/src/kdrive.c3
4 files changed, 137 insertions, 31 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/man/Xephyr.man b/xorg-server/hw/kdrive/ephyr/man/Xephyr.man
index ca88ab240..f14f6c864 100644
--- a/xorg-server/hw/kdrive/ephyr/man/Xephyr.man
+++ b/xorg-server/hw/kdrive/ephyr/man/Xephyr.man
@@ -46,7 +46,7 @@ and the following additional options:
sets the screen size.
.TP 8
.BI -parent " id"
-uses exiting window
+uses existing window
.I id .
If a
.BI -screen
@@ -59,6 +59,10 @@ 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.
.SH "SIGNALS"
Send a SIGUSR1 to the server (e.g. pkill -USR1 Xephyr) to
toggle the debugging mode.
diff --git a/xorg-server/hw/kdrive/fbdev/fbdev.c b/xorg-server/hw/kdrive/fbdev/fbdev.c
index d6fcf1a5f..95f64cbef 100644
--- a/xorg-server/hw/kdrive/fbdev/fbdev.c
+++ b/xorg-server/hw/kdrive/fbdev/fbdev.c
@@ -30,7 +30,7 @@
extern int KdTsPhyScreen;
-char *fbdevDevicePath = NULL;
+const char *fbdevDevicePath = NULL;
static Bool
fbdevInitialize(KdCardInfo * card, FbdevPriv * priv)
@@ -206,13 +206,23 @@ fbdevScreenInitialize(KdScreenInfo * screen, FbdevScrPriv * scrpriv)
depth = priv->var.bits_per_pixel;
gray = priv->var.grayscale;
+ /* Calculate fix.line_length if it's zero */
+ if (!priv->fix.line_length)
+ priv->fix.line_length = (priv->var.xres_virtual * depth + 7) / 8;
+
switch (priv->fix.visual) {
+ case FB_VISUAL_MONO01:
+ case FB_VISUAL_MONO10:
+ screen->fb.visuals = (1 << StaticGray);
+ break;
case FB_VISUAL_PSEUDOCOLOR:
- if (gray) {
- screen->fb.visuals = (1 << StaticGray);
+ screen->fb.visuals = (1 << StaticGray);
+ if (priv->var.bits_per_pixel == 1) {
+ /* Override to monochrome, to have preallocated black/white */
+ priv->fix.visual = FB_VISUAL_MONO01;
+ } else if (gray) {
/* could also support GrayScale, but what's the point? */
- }
- else {
+ } else {
screen->fb.visuals = ((1 << StaticGray) |
(1 << GrayScale) |
(1 << StaticColor) |
@@ -309,6 +319,21 @@ fbdevWindowLinear(ScreenPtr pScreen,
return (CARD8 *) priv->fb + row * priv->fix.line_length + offset;
}
+static void *
+fbdevWindowAfb(ScreenPtr pScreen,
+ CARD32 row,
+ CARD32 offset, int mode, CARD32 *size, void *closure)
+{
+ KdScreenPriv(pScreen);
+ FbdevPriv *priv = pScreenPriv->card->driver;
+
+ if (!pScreenPriv->enabled)
+ return 0;
+ /* offset to next plane */
+ *size = priv->var.yres_virtual * priv->fix.line_length;
+ return (CARD8 *) priv->fb + row * priv->fix.line_length + offset;
+}
+
Bool
fbdevMapFramebuffer(KdScreenInfo * screen)
{
@@ -316,7 +341,8 @@ fbdevMapFramebuffer(KdScreenInfo * screen)
KdPointerMatrix m;
FbdevPriv *priv = screen->card->driver;
- if (scrpriv->randr != RR_Rotate_0)
+ if (scrpriv->randr != RR_Rotate_0 ||
+ priv->fix.type != FB_TYPE_PACKED_PIXELS)
scrpriv->shadow = TRUE;
else
scrpriv->shadow = FALSE;
@@ -392,33 +418,88 @@ fbdevSetShadow(ScreenPtr pScreen)
window = fbdevWindowLinear;
update = 0;
- if (scrpriv->randr)
- if (priv->var.bits_per_pixel == 16) {
- switch (scrpriv->randr) {
- case RR_Rotate_90:
- if (useYX)
- update = shadowUpdateRotate16_90YX;
- else
- update = shadowUpdateRotate16_90;
- break;
- case RR_Rotate_180:
- update = shadowUpdateRotate16_180;
+ switch (priv->fix.type) {
+ case FB_TYPE_PACKED_PIXELS:
+ if (scrpriv->randr)
+ if (priv->var.bits_per_pixel == 16) {
+ switch (scrpriv->randr) {
+ case RR_Rotate_90:
+ if (useYX)
+ update = shadowUpdateRotate16_90YX;
+ else
+ update = shadowUpdateRotate16_90;
+ break;
+ case RR_Rotate_180:
+ update = shadowUpdateRotate16_180;
+ break;
+ case RR_Rotate_270:
+ if (useYX)
+ update = shadowUpdateRotate16_270YX;
+ else
+ update = shadowUpdateRotate16_270;
+ break;
+ default:
+ update = shadowUpdateRotate16;
+ break;
+ }
+ }
+ else
+ update = shadowUpdateRotatePacked;
+ else
+ update = shadowUpdatePacked;
+ break;
+
+ case FB_TYPE_PLANES:
+ window = fbdevWindowAfb;
+ switch (priv->var.bits_per_pixel) {
+ case 4:
+ update = shadowUpdateAfb4;
+ break;
+
+ case 8:
+ update = shadowUpdateAfb8;
+ break;
+
+ default:
+ FatalError("Bitplanes with bpp %u are not yet supported\n",
+ priv->var.bits_per_pixel);
+ }
+ break;
+
+ case FB_TYPE_INTERLEAVED_PLANES:
+ if (priv->fix.type_aux == 2) {
+ switch (priv->var.bits_per_pixel) {
+ case 4:
+ update = shadowUpdateIplan2p4;
break;
- case RR_Rotate_270:
- if (useYX)
- update = shadowUpdateRotate16_270YX;
- else
- update = shadowUpdateRotate16_270;
+
+ case 8:
+ update = shadowUpdateIplan2p8;
break;
+
default:
- update = shadowUpdateRotate16;
- break;
+ FatalError("Atari interleaved bitplanes with bpp %u are not yet supported\n",
+ priv->var.bits_per_pixel);
}
+ } else {
+ FatalError("Interleaved bitplanes with interleave %u are not yet supported\n",
+ priv->fix.type_aux);
}
- else
- update = shadowUpdateRotatePacked;
- else
- update = shadowUpdatePacked;
+ break;
+
+ case FB_TYPE_TEXT:
+ FatalError("Text frame buffers are not yet supported\n");
+ break;
+
+ case FB_TYPE_VGA_PLANES:
+ FatalError("VGA planes are not yet supported\n");
+ break;
+
+ default:
+ FatalError("Unsupported frame buffer type %u\n", priv->fix.type);
+ break;
+ }
+
return KdShadowSet(pScreen, scrpriv->randr, update, window);
}
@@ -573,6 +654,26 @@ fbdevCreateColormap(ColormapPtr pmap)
xColorItem *pdefs;
switch (priv->fix.visual) {
+ case FB_VISUAL_MONO01:
+ pScreen->whitePixel = 0;
+ pScreen->blackPixel = 1;
+ pmap->red[0].co.local.red = 65535;
+ pmap->red[0].co.local.green = 65535;
+ pmap->red[0].co.local.blue = 65535;
+ pmap->red[1].co.local.red = 0;
+ pmap->red[1].co.local.green = 0;
+ pmap->red[1].co.local.blue = 0;
+ return TRUE;
+ case FB_VISUAL_MONO10:
+ pScreen->blackPixel = 0;
+ pScreen->whitePixel = 1;
+ pmap->red[0].co.local.red = 0;
+ pmap->red[0].co.local.green = 0;
+ pmap->red[0].co.local.blue = 0;
+ pmap->red[1].co.local.red = 65535;
+ pmap->red[1].co.local.green = 65535;
+ pmap->red[1].co.local.blue = 65535;
+ return TRUE;
case FB_VISUAL_STATIC_PSEUDOCOLOR:
pVisual = pmap->pVisual;
nent = pVisual->ColormapEntries;
diff --git a/xorg-server/hw/kdrive/fbdev/fbdev.h b/xorg-server/hw/kdrive/fbdev/fbdev.h
index 0706f4e11..f3f7aeceb 100644
--- a/xorg-server/hw/kdrive/fbdev/fbdev.h
+++ b/xorg-server/hw/kdrive/fbdev/fbdev.h
@@ -49,7 +49,7 @@ typedef struct _fbdevScrPriv {
} FbdevScrPriv;
extern KdCardFuncs fbdevFuncs;
-extern char *fbdevDevicePath;
+extern const char *fbdevDevicePath;
Bool
fbdevCardInit(KdCardInfo * card);
diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c
index 7d9bf9ddd..1899a27a9 100644
--- a/xorg-server/hw/kdrive/src/kdrive.c
+++ b/xorg-server/hw/kdrive/src/kdrive.c
@@ -943,7 +943,8 @@ KdInitScreen(ScreenInfo * pScreenInfo,
{
KdCardInfo *card = screen->card;
- (*card->cfuncs->scrinit) (screen);
+ if (!(*card->cfuncs->scrinit) (screen))
+ FatalError("Screen initialization failed!\n");
if (!card->cfuncs->initAccel)
screen->dumb = TRUE;