From: Geert Uytterhoeven Date: Sun, 10 Mar 2013 20:04:19 +0000 (+0100) Subject: Xfbdev: Wire up Amiga afb4 and afb8 support X-Git-Tag: xorg-server-1.14.99.2~105^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ab260317ad3b2aafff31a97df21620db52eacd1;p=platform%2Fupstream%2Fxorg-server.git Xfbdev: Wire up Amiga afb4 and afb8 support Add support for Amiga-style bitplanes, with 4 or 8 bits per pixel. Signed-off-by: Geert Uytterhoeven Acked-by: Keith Packard --- diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c index 40747fe..95f64cb 100644 --- a/hw/kdrive/fbdev/fbdev.c +++ b/hw/kdrive/fbdev/fbdev.c @@ -319,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) { @@ -435,7 +450,20 @@ fbdevSetShadow(ScreenPtr pScreen) break; case FB_TYPE_PLANES: - FatalError("Bitplanes are not yet supported\n"); + 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: