aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/fbdev
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-04 09:07:26 +0200
committermarha <marha@users.sourceforge.net>2013-06-04 09:07:26 +0200
commit150771e7aabf4c864b0b970c5b8d773634793abe (patch)
tree3d544cc0d8d06dd70e843d6ca7e4b0ef421d2758 /xorg-server/hw/kdrive/fbdev
parentfbe681216618af573ce29ca03b382b39b5919a52 (diff)
downloadvcxsrv-150771e7aabf4c864b0b970c5b8d773634793abe.tar.gz
vcxsrv-150771e7aabf4c864b0b970c5b8d773634793abe.tar.bz2
vcxsrv-150771e7aabf4c864b0b970c5b8d773634793abe.zip
xwininfo fontconfig libX11 libXau libXdmcp libXext mesa libXinerama libxcb libxcb/xcb-proto libfontenc pixman xkbcomp mkfontscale xkeyboard-config git update 4 Jun 2013
xserver commit c21344add2fc589df83b29be5831c36a372201bd libxcb commit 9ae84ad187e2ba440c40f44b8eb21c82c2fdbf12 libxcb/xcb-proto commit bdfedfa57a13ff805580cfacafc70f9cc55df363 xkeyboard-config commit dad9ade4e83d1ef5a517fcc4cc9ad3a79b47acce libX11 commit 8496122eb00ce6cd5d2308ee54f64b68c378e455 libXdmcp commit 0b443c1b769b9c9a3b45b4252afe07e18b709ff4 libXext commit d8366afbb0d2e4fbb1e419b1187f490522270bea libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff libXau commit 899790011304c4029e15abf410e49ce7cec17e0a xkbcomp commit ed582f4fccd4e23abcfba8b3b03649fea6414f44 pixman commit 2acfac5f8e097ee2ae225d986f981b55d65dd152 mkfontscale commit 19e2cb7c6a3ec2c5b1bc0d24866fa685eef0ee13 xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13 fontconfig commit cd9b1033a68816a7acfbba1718ba0aa5888f6ec7 mesa commit 7bafd88c153e395274b632e7eae4bc9fc3aec1d2
Diffstat (limited to 'xorg-server/hw/kdrive/fbdev')
-rw-r--r--xorg-server/hw/kdrive/fbdev/fbdev.c157
-rw-r--r--xorg-server/hw/kdrive/fbdev/fbdev.h2
2 files changed, 130 insertions, 29 deletions
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);