From 6ca31b0522873da6ae8bcdc49cbcca1b04c4016c Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Tue, 29 Jun 2010 14:31:43 +0100 Subject: xorg-xserver: move older xserver's to meta-extras Move xservers which are only used by retired machines to meta-extras Signed-off-by: Joshua Lock --- .../xserver-kdrive-glamo/fbdev-not-fix.patch | 14 + .../fix-picturestr-include-order.patch | 15 + .../xserver-kdrive-glamo/fix_default_mode.patch | 26 + .../xserver-kdrive-glamo/gumstix-kmode.patch | 23 + .../xserver-kdrive-glamo/kdrive-1.3-18bpp.patch | 419 ++ .../xserver-kdrive-glamo/kmode-palm.patch | 34 + .../xorg-xserver/xserver-kdrive-glamo/kmode.patch | 28 + .../xserver-kdrive-glamo/w100-autofoo.patch | 54 + .../w100-fix-offscreen-bmp.patch | 15 + .../w100-new-input-world-order.patch | 28 + .../xorg-xserver/xserver-kdrive-glamo/w100.patch | 6335 ++++++++++++++++++++ .../xserver-kdrive-glamo_1.3.0.0+git.bb | 64 + .../xserver-kdrive-xomap/button_only.patch | 20 + .../xserver-kdrive-xomap/calibrateext.patch | 124 + .../xserver-kdrive-xomap/configfix.patch | 15 + .../xserver-kdrive-xomap/disable-apm.patch | 20 + .../disable-xf86-dga-xorgcfg.patch | 37 + .../xserver-kdrive-xomap/disable-xkb.patch | 82 + .../enable-builtin-fonts.patch | 12 + .../xserver-kdrive-xomap/enable-tslib.patch | 23 + .../xserver-kdrive-xomap/fbdev-not-fix.patch | 14 + .../xorg-xserver/xserver-kdrive-xomap/fixups.patch | 446 ++ .../xserver-kdrive-xomap/kdrive-evdev.patch | 503 ++ .../xserver-kdrive-xomap/kdrive-use-evdev.patch | 53 + .../xorg-xserver/xserver-kdrive-xomap/kmode.patch | 43 + .../xserver-kdrive-xomap/no-serial-probing.patch | 13 + .../xserver-kdrive-xomap/xcalibrate.patch | 73 + .../xserver-kdrive-xomap/xcalibrate_coords.patch | 122 + .../xserver-kdrive-xomap/xfbdev-fb-opt.patch | 82 + .../xorg-xserver/xserver-kdrive-xomap_1.1.99.3.bb | 52 + .../xserver-kdrive-glamo/fbdev-not-fix.patch | 14 - .../fix-picturestr-include-order.patch | 15 - .../xserver-kdrive-glamo/fix_default_mode.patch | 26 - .../xserver-kdrive-glamo/gumstix-kmode.patch | 23 - .../xserver-kdrive-glamo/kdrive-1.3-18bpp.patch | 419 -- .../xserver-kdrive-glamo/kmode-palm.patch | 34 - .../xorg-xserver/xserver-kdrive-glamo/kmode.patch | 28 - .../xserver-kdrive-glamo/w100-autofoo.patch | 54 - .../w100-fix-offscreen-bmp.patch | 15 - .../w100-new-input-world-order.patch | 28 - .../xorg-xserver/xserver-kdrive-glamo/w100.patch | 6335 -------------------- .../xserver-kdrive-glamo_1.3.0.0+git.bb | 64 - .../xserver-kdrive-xomap/button_only.patch | 20 - .../xserver-kdrive-xomap/calibrateext.patch | 124 - .../xserver-kdrive-xomap/configfix.patch | 15 - .../xserver-kdrive-xomap/disable-apm.patch | 20 - .../disable-xf86-dga-xorgcfg.patch | 37 - .../xserver-kdrive-xomap/disable-xkb.patch | 82 - .../enable-builtin-fonts.patch | 12 - .../xserver-kdrive-xomap/enable-tslib.patch | 23 - .../xserver-kdrive-xomap/fbdev-not-fix.patch | 14 - .../xorg-xserver/xserver-kdrive-xomap/fixups.patch | 446 -- .../xserver-kdrive-xomap/kdrive-evdev.patch | 503 -- .../xserver-kdrive-xomap/kdrive-use-evdev.patch | 53 - .../xorg-xserver/xserver-kdrive-xomap/kmode.patch | 43 - .../xserver-kdrive-xomap/no-serial-probing.patch | 13 - .../xserver-kdrive-xomap/xcalibrate.patch | 73 - .../xserver-kdrive-xomap/xcalibrate_coords.patch | 122 - .../xserver-kdrive-xomap/xfbdev-fb-opt.patch | 82 - .../xorg-xserver/xserver-kdrive-xomap_1.1.99.3.bb | 52 - 60 files changed, 8789 insertions(+), 8789 deletions(-) create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fbdev-not-fix.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix-picturestr-include-order.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix_default_mode.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/gumstix-kmode.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kdrive-1.3-18bpp.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode-palm.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-autofoo.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-fix-offscreen-bmp.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-new-input-world-order.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-glamo_1.3.0.0+git.bb create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/button_only.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/configfix.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/disable-apm.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/disable-xf86-dga-xorgcfg.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/disable-xkb.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/enable-builtin-fonts.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/enable-tslib.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/fbdev-not-fix.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/fixups.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/kdrive-evdev.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/kdrive-use-evdev.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/kmode.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/no-serial-probing.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate_coords.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch create mode 100644 meta-extras/packages/xorg-xserver/xserver-kdrive-xomap_1.1.99.3.bb delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/fbdev-not-fix.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/fix-picturestr-include-order.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/fix_default_mode.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/gumstix-kmode.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/kdrive-1.3-18bpp.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/kmode-palm.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/kmode.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/w100-autofoo.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/w100-fix-offscreen-bmp.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/w100-new-input-world-order.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo/w100.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-glamo_1.3.0.0+git.bb delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/button_only.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/configfix.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/disable-apm.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/disable-xf86-dga-xorgcfg.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/disable-xkb.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/enable-builtin-fonts.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/enable-tslib.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/fbdev-not-fix.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/fixups.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/kdrive-evdev.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/kdrive-use-evdev.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/kmode.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/no-serial-probing.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate_coords.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive-xomap_1.1.99.3.bb diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fbdev-not-fix.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fbdev-not-fix.patch new file mode 100644 index 0000000000..f87e7cc2cd --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fbdev-not-fix.patch @@ -0,0 +1,14 @@ +--- xserver/hw/kdrive/fbdev/fbdev.c~ 2004-09-15 00:08:10.000000000 +0100 ++++ xserver/hw/kdrive/fbdev/fbdev.c 2004-11-13 17:47:02.000000000 +0000 +@@ -198,6 +198,11 @@ + return FALSE; + } + ++ /* Re-get the "fixed" parameters since they might have changed */ ++ k = ioctl (priv->fd, FBIOGET_FSCREENINFO, &priv->fix); ++ if (k < 0) ++ perror ("FBIOGET_FSCREENINFO"); ++ + /* Now get the new screeninfo */ + ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var); + depth = priv->var.bits_per_pixel; diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix-picturestr-include-order.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix-picturestr-include-order.patch new file mode 100644 index 0000000000..3da235e1e1 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix-picturestr-include-order.patch @@ -0,0 +1,15 @@ +# Reverse include order in render/picturestr.h to be able to compile against renderproto >= 0.9.3 +Index: xorg-server-1.2.0/render/picturestr.h +=================================================================== +--- xorg-server-1.2.0.orig/render/picturestr.h 2008-02-09 22:54:46.000000000 +0100 ++++ xorg-server-1.2.0/render/picturestr.h 2008-02-09 22:54:50.000000000 +0100 +@@ -26,8 +26,8 @@ + #ifndef _PICTURESTR_H_ + #define _PICTURESTR_H_ + +-#include "glyphstr.h" + #include "scrnintstr.h" ++#include "glyphstr.h" + #include "resource.h" + + typedef struct _DirectFormat { diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix_default_mode.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix_default_mode.patch new file mode 100644 index 0000000000..edc5146302 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/fix_default_mode.patch @@ -0,0 +1,26 @@ +--- + hw/kdrive/src/kmode.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: xorg-server-1.3.0.0/hw/kdrive/src/kmode.c +=================================================================== +--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kmode.c 2007-05-16 10:30:29.000000000 +0100 ++++ xorg-server-1.3.0.0/hw/kdrive/src/kmode.c 2007-05-16 10:31:08.000000000 +0100 +@@ -106,6 +106,8 @@ const KdMonitorTiming kdMonitorTimings[ + 16, 120, 176, KdSyncNegative, /* 37.861 */ + 1, 20, 24, KdSyncNegative, /* 72.809 */ + }, ++ /* DEFAULT */ ++#define MONITOR_TIMING_DEFAULT 13 + { 640, 480, 60, 25175, /* VESA */ + 16, 48, 160, KdSyncNegative, /* 31.469 */ + 10, 33, 45, KdSyncNegative, /* 59.940 */ +@@ -127,8 +129,6 @@ const KdMonitorTiming kdMonitorTimings[ + 16, 160, 256, KdSyncPositive, /* 46.875 */ + 1, 21, 25, KdSyncPositive, /* 75.000 */ + }, +- /* DEFAULT */ +-#define MONITOR_TIMING_DEFAULT 9 + { 800, 600, 72, 50000, /* VESA */ + 56, 64, 240, KdSyncPositive, /* 48.077 */ + 37, 23, 66, KdSyncPositive, /* 72.188 */ diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/gumstix-kmode.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/gumstix-kmode.patch new file mode 100644 index 0000000000..56817a7001 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/gumstix-kmode.patch @@ -0,0 +1,23 @@ +--- /tmp/kmode.c 2007-10-07 11:49:52.000000000 +0200 ++++ xorg-server-1.3.0.0/hw/kdrive/src/kmode.c 2007-10-07 11:51:57.962045000 +0200 +@@ -119,7 +119,19 @@ + 0, 0, 0, KdSyncNegative, /* 59.940 */ + }, + +- ++ ++/* gumstix console-vx */ ++ { 480, 272, 60, 0, /* VESA */ ++ 0, 0, 0, KdSyncNegative, /* 31.469 */ ++ 0, 0, 0, KdSyncNegative, /* 59.940 */ ++ }, ++ ++ { 272, 480, 60, 0, /* VESA */ ++ 0, 0, 0, KdSyncNegative, /* 31.469 */ ++ 0, 0, 0, KdSyncNegative, /* 59.940 */ ++ }, ++ ++ + /* 800x600 modes */ + { 800, 600, 85, 56250, /* VESA */ + 32, 152, 248, KdSyncPositive, /* 53.674 */ diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kdrive-1.3-18bpp.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kdrive-1.3-18bpp.patch new file mode 100644 index 0000000000..714536934c --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kdrive-1.3-18bpp.patch @@ -0,0 +1,419 @@ +diff -Nurd xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.c +--- xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c 2006-11-16 19:01:23.000000000 +0100 ++++ xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.c 2007-09-15 16:53:20.152045000 +0200 +@@ -213,6 +213,24 @@ + + /* Now get the new screeninfo */ + ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var); ++ /* Special treatment of 18bpp */ ++ if ((priv->var.red.length == 6) && (priv->var.green.length == 6) && ++ (priv->var.blue.length == 6)) ++ { ++ priv->var.red.length = 8; ++ if (priv->var.red.offset != 0) ++ priv->var.red.offset = 16; ++ priv->var.green.length = 8; ++ priv->var.green.offset = 8; ++ priv->var.blue.length = 8; ++ if (priv->var.blue.offset != 0) ++ priv->var.blue.offset = 16; ++ priv->var.bits_per_pixel = 32; ++ priv->Have18Bpp = TRUE; ++ } ++ else ++ priv->Have18Bpp = FALSE; ++ + depth = priv->var.bits_per_pixel; + gray = priv->var.grayscale; + +@@ -334,7 +352,7 @@ + KdMouseMatrix m; + FbdevPriv *priv = screen->card->driver; + +- if (scrpriv->randr != RR_Rotate_0) ++ if (scrpriv->randr != RR_Rotate_0 || priv->Have18Bpp) + scrpriv->shadow = TRUE; + else + scrpriv->shadow = FALSE; +@@ -398,6 +416,354 @@ + return TRUE; + } + ++void ++shadowUpdatePacked18 (ScreenPtr pScreen, ++ shadowBufPtr pBuf) ++{ ++ RegionPtr damage = shadowDamage (pBuf); ++ PixmapPtr pShadow = pBuf->pPixmap; ++ int nbox = REGION_NUM_RECTS (damage); ++ BoxPtr pbox = REGION_RECTS (damage); ++ FbBits *shaBase, *shaLine, *sha; ++ FbStride shaStride; ++ int scrBase, scrLine, scr; ++ int shaBpp; ++ int shaXoff, shaYoff; /* XXX assumed to be zero */ ++ int x, y, w, h, width; ++ int i; ++ char *winBase = NULL, *win; ++ CARD32 winSize; ++ ++ fbGetDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); ++ while (nbox--) ++ { ++ x = pbox->x1 * shaBpp; ++ y = pbox->y1; ++ w = (pbox->x2 - pbox->x1) * shaBpp; ++ h = pbox->y2 - pbox->y1; ++ ++ scrLine = (x >> FB_SHIFT); ++ shaLine = shaBase + y * shaStride + (x >> FB_SHIFT); ++ ++ x &= FB_MASK; ++ w = (w + x + FB_MASK) >> FB_SHIFT; ++ ++ while (h--) ++ { ++ winSize = 0; ++ scrBase = 0; ++ width = w; ++ scr = scrLine; ++ sha = shaLine; ++ while (width) { ++ /* how much remains in this window */ ++ i = scrBase + winSize - scr; ++ if (i <= 0 || scr < scrBase) ++ { ++ winBase = (char *) (*pBuf->window) (pScreen, ++ y, ++ scr * 3, ++ SHADOW_WINDOW_WRITE, ++ &winSize, ++ pBuf->closure); ++ if(!winBase) ++ return; ++ scrBase = scr; ++ winSize /= 3; ++ i = winSize; ++ } ++ win = winBase + (scr - scrBase); ++ if (i > width) ++ i = width; ++ width -= i; ++ scr += i; ++#define PickBit(a,i) (((a) >> (i)) & 1) ++ while (i--) ++ { ++ FbBits bits = *sha++; ++ *win++ = ((bits & 0xFC) >> 2) | ++ ((bits & 0xC00) >> 4); ++ *win++ = ((bits & 0xF000) >> 12) | ++ ((bits & 0x3C0000) >> 14); ++ *win++ = (bits & 0xC00000) >> 22; ++ } ++ } ++ shaLine += shaStride; ++ y++; ++ } ++ pbox++; ++ } ++} ++ ++#define LEFT_TO_RIGHT 1 ++#define RIGHT_TO_LEFT -1 ++#define TOP_TO_BOTTOM 2 ++#define BOTTOM_TO_TOP -2 ++ ++void ++shadowUpdateRotatePacked18 (ScreenPtr pScreen, ++ shadowBufPtr pBuf) ++{ ++ RegionPtr damage = shadowDamage (pBuf); ++ PixmapPtr pShadow = pBuf->pPixmap; ++ int nbox = REGION_NUM_RECTS (damage); ++ BoxPtr pbox = REGION_RECTS (damage); ++ FbBits *shaBits; ++ FbStride shaStride; ++ int shaBpp; ++ int shaXoff, shaYoff; ++ int box_x1, box_x2, box_y1, box_y2; ++ int sha_x1 = 0, sha_y1 = 0; ++ int scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h; ++ int scr_x, scr_y; ++ int w; ++ int pixelsPerBits; ++ int pixelsMask; ++ FbStride shaStepOverY = 0, shaStepDownY = 0; ++ FbStride shaStepOverX = 0, shaStepDownX = 0; ++ FbBits *shaLine, *sha; ++ int shaHeight = pShadow->drawable.height; ++ int shaWidth = pShadow->drawable.width; ++ FbBits shaMask; ++ int shaFirstShift, shaShift; ++ int o_x_dir; ++ int o_y_dir; ++ int x_dir; ++ int y_dir; ++ ++ fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); ++ pixelsPerBits = (sizeof (FbBits) * 8) / shaBpp; ++ pixelsMask = ~(pixelsPerBits - 1); ++ shaMask = FbBitsMask (FB_UNIT-shaBpp, shaBpp); ++ /* ++ * Compute rotation related constants to walk the shadow ++ */ ++ o_x_dir = LEFT_TO_RIGHT; ++ o_y_dir = TOP_TO_BOTTOM; ++ if (pBuf->randr & SHADOW_REFLECT_X) ++ o_x_dir = -o_x_dir; ++ if (pBuf->randr & SHADOW_REFLECT_Y) ++ o_y_dir = -o_y_dir; ++ switch (pBuf->randr & (SHADOW_ROTATE_ALL)) { ++ case SHADOW_ROTATE_0: /* upper left shadow -> upper left screen */ ++ default: ++ x_dir = o_x_dir; ++ y_dir = o_y_dir; ++ break; ++ case SHADOW_ROTATE_90: /* upper right shadow -> upper left screen */ ++ x_dir = o_y_dir; ++ y_dir = -o_x_dir; ++ break; ++ case SHADOW_ROTATE_180: /* lower right shadow -> upper left screen */ ++ x_dir = -o_x_dir; ++ y_dir = -o_y_dir; ++ break; ++ case SHADOW_ROTATE_270: /* lower left shadow -> upper left screen */ ++ x_dir = -o_y_dir; ++ y_dir = o_x_dir; ++ break; ++ } ++ switch (x_dir) { ++ case LEFT_TO_RIGHT: ++ shaStepOverX = shaBpp; ++ shaStepOverY = 0; ++ break; ++ case TOP_TO_BOTTOM: ++ shaStepOverX = 0; ++ shaStepOverY = shaStride; ++ break; ++ case RIGHT_TO_LEFT: ++ shaStepOverX = -shaBpp; ++ shaStepOverY = 0; ++ break; ++ case BOTTOM_TO_TOP: ++ shaStepOverX = 0; ++ shaStepOverY = -shaStride; ++ break; ++ } ++ switch (y_dir) { ++ case TOP_TO_BOTTOM: ++ shaStepDownX = 0; ++ shaStepDownY = shaStride; ++ break; ++ case RIGHT_TO_LEFT: ++ shaStepDownX = -shaBpp; ++ shaStepDownY = 0; ++ break; ++ case BOTTOM_TO_TOP: ++ shaStepDownX = 0; ++ shaStepDownY = -shaStride; ++ break; ++ case LEFT_TO_RIGHT: ++ shaStepDownX = shaBpp; ++ shaStepDownY = 0; ++ break; ++ } ++ ++ while (nbox--) ++ { ++ box_x1 = pbox->x1; ++ box_y1 = pbox->y1; ++ box_x2 = pbox->x2; ++ box_y2 = pbox->y2; ++ pbox++; ++ ++ /* ++ * Compute screen and shadow locations for this box ++ */ ++ switch (x_dir) { ++ case LEFT_TO_RIGHT: ++ scr_x1 = box_x1 & pixelsMask; ++ scr_x2 = (box_x2 + pixelsPerBits - 1) & pixelsMask; ++ ++ sha_x1 = scr_x1; ++ break; ++ case TOP_TO_BOTTOM: ++ scr_x1 = box_y1 & pixelsMask; ++ scr_x2 = (box_y2 + pixelsPerBits - 1) & pixelsMask; ++ ++ sha_y1 = scr_x1; ++ break; ++ case RIGHT_TO_LEFT: ++ scr_x1 = (shaWidth - box_x2) & pixelsMask; ++ scr_x2 = (shaWidth - box_x1 + pixelsPerBits - 1) & pixelsMask; ++ ++ sha_x1 = (shaWidth - scr_x1 - 1); ++ break; ++ case BOTTOM_TO_TOP: ++ scr_x1 = (shaHeight - box_y2) & pixelsMask; ++ scr_x2 = (shaHeight - box_y1 + pixelsPerBits - 1) & pixelsMask; ++ ++ sha_y1 = (shaHeight - scr_x1 - 1); ++ break; ++ } ++ switch (y_dir) { ++ case TOP_TO_BOTTOM: ++ scr_y1 = box_y1; ++ scr_y2 = box_y2; ++ ++ sha_y1 = scr_y1; ++ break; ++ case RIGHT_TO_LEFT: ++ scr_y1 = (shaWidth - box_x2); ++ scr_y2 = (shaWidth - box_x1); ++ ++ sha_x1 = box_x2 - 1; ++ break; ++ case BOTTOM_TO_TOP: ++ scr_y1 = shaHeight - box_y2; ++ scr_y2 = shaHeight - box_y1; ++ ++ sha_y1 = box_y2 - 1; ++ break; ++ case LEFT_TO_RIGHT: ++ scr_y1 = box_x1; ++ scr_y2 = box_x2; ++ ++ sha_x1 = box_x1; ++ break; ++ } ++ scr_w = ((scr_x2 - scr_x1) * shaBpp) >> FB_SHIFT; ++ scr_h = scr_y2 - scr_y1; ++ scr_y = scr_y1; ++ ++ /* shift amount for first pixel on screen */ ++ shaFirstShift = FB_UNIT - ((sha_x1 * shaBpp) & FB_MASK) - shaBpp; ++ ++ /* pointer to shadow data first placed on screen */ ++ shaLine = (shaBits + ++ sha_y1 * shaStride + ++ ((sha_x1 * shaBpp) >> FB_SHIFT)); ++ ++ /* ++ * Copy the bits, always write across the physical frame buffer ++ * to take advantage of write combining. ++ */ ++ while (scr_h--) ++ { ++ int p; ++ FbBits bits; ++ char *win; ++ int i; ++ CARD32 winSize; ++ ++ sha = shaLine; ++ shaShift = shaFirstShift; ++ w = scr_w; ++ scr_x = scr_x1 * shaBpp >> FB_SHIFT; ++ ++ while (w) ++ { ++ /* ++ * Map some of this line ++ */ ++ win = (char *) (*pBuf->window) (pScreen, ++ scr_y, ++ scr_x * 3, ++ SHADOW_WINDOW_WRITE, ++ &winSize, ++ pBuf->closure); ++ i = winSize / 3; ++ if (i > w) ++ i = w; ++ w -= i; ++ scr_x += i; ++ /* ++ * Copy the portion of the line mapped ++ */ ++ while (i--) ++ { ++ bits = 0; ++ p = pixelsPerBits; ++ /* ++ * Build one word of output from multiple inputs ++ * ++ * Note that for 90/270 rotations, this will walk ++ * down the shadow hitting each scanline once. ++ * This is probably not very efficient. ++ */ ++ while (p--) ++ { ++ bits = FbScrLeft(bits, shaBpp); ++ bits |= FbScrRight (*sha, shaShift) & shaMask; ++ ++ shaShift -= shaStepOverX; ++ if (shaShift >= FB_UNIT) ++ { ++ shaShift -= FB_UNIT; ++ sha--; ++ } ++ else if (shaShift < 0) ++ { ++ shaShift += FB_UNIT; ++ sha++; ++ } ++ sha += shaStepOverY; ++ } ++ *win++ = ((bits & 0xFC) >> 2) | ++ ((bits & 0xC00) >> 4); ++ *win++ = ((bits & 0xF000) >> 12) | ++ ((bits & 0x3C0000) >> 14); ++ *win++ = (bits & 0xC00000) >> 22; ++ } ++ } ++ scr_y++; ++ shaFirstShift -= shaStepDownX; ++ if (shaFirstShift >= FB_UNIT) ++ { ++ shaFirstShift -= FB_UNIT; ++ shaLine--; ++ } ++ else if (shaFirstShift < 0) ++ { ++ shaFirstShift += FB_UNIT; ++ shaLine++; ++ } ++ shaLine += shaStepDownY; ++ } ++ } ++} ++ + Bool + fbdevSetShadow (ScreenPtr pScreen) + { +@@ -418,7 +784,14 @@ + + window = fbdevWindowLinear; + update = 0; +- if (scrpriv->randr) ++ if (priv->Have18Bpp) ++ { ++ if (scrpriv->randr != RR_Rotate_0) ++ update = shadowUpdateRotatePacked18; ++ else ++ update = shadowUpdatePacked18; ++ } ++ else if (scrpriv->randr) + if (priv->var.bits_per_pixel == 16) { + switch (scrpriv->randr) { + case RR_Rotate_90: +diff -Nurd xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.h xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.h +--- xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.h 2006-09-18 08:04:17.000000000 +0200 ++++ xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.h 2007-09-15 16:45:07.362045000 +0200 +@@ -44,6 +44,7 @@ + int fd; + char *fb; + char *fb_base; ++ Bool Have18Bpp; + } FbdevPriv; + + typedef struct _fbdevScrPriv { diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode-palm.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode-palm.patch new file mode 100644 index 0000000000..255e707b55 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode-palm.patch @@ -0,0 +1,34 @@ +--- kmode.c 2006-05-03 19:48:42.000000000 +0200 ++++ xserver/hw/kdrive/src/kmode.c 2006-05-03 19:50:43.000000000 +0200 +@@ -32,6 +32,31 @@ + /* H V Hz KHz */ + /* FP BP BLANK POLARITY */ + ++ /* Treo 650 */ ++ ++ { 320, 320, 64, 16256, ++ 17, 12, 32, KdSyncNegative, ++ 1, 11, 14, KdSyncNegative, ++ }, ++ ++ { 320, 320, 64, 0, ++ 0, 0, 0, KdSyncNegative, ++ 0, 0, 0, KdSyncNegative, ++ }, ++ ++ /* LifeDrive/T3/TX modes */ ++ ++ { 320, 480, 64, 16256, ++ 17, 12, 32, KdSyncNegative, ++ 1, 11, 14, KdSyncNegative, ++ }, ++ ++ { 480, 320, 64, 0, ++ 0, 0, 0, KdSyncNegative, ++ 0, 0, 0, KdSyncNegative, ++ }, ++ ++ + /* IPAQ modeline: + * + * Modeline "320x240" 5.7222 320 337 340 352 240 241 244 254" diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode.patch new file mode 100644 index 0000000000..5ad3e4e277 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/kmode.patch @@ -0,0 +1,28 @@ +--- /tmp/kmode.c 2005-06-27 14:46:19.716843288 +0200 ++++ xserver/hw/kdrive/src/kmode.c 2005-06-27 14:46:30.070269328 +0200 +@@ -41,6 +41,11 @@ + 1, 11, 14, KdSyncNegative, + }, + ++ { 240, 320, 64, 0, ++ 0, 0, 0, KdSyncNegative, ++ 0, 0, 0, KdSyncNegative, ++ }, ++ + /* Other VESA modes */ + { 640, 350, 85, 31500, /* VESA */ + 32, 96, 192, KdSyncPositive, /* 26.413 */ +@@ -80,6 +85,13 @@ + 16, 48, 160, KdSyncNegative, /* 31.469 */ + 10, 33, 45, KdSyncNegative, /* 59.940 */ + }, ++ ++ ++ { 480, 640, 60, 0, /* VESA */ ++ 0, 0, 0, KdSyncNegative, /* 31.469 */ ++ 0, 0, 0, KdSyncNegative, /* 59.940 */ ++ }, ++ + + /* 800x600 modes */ + { 800, 600, 85, 56250, /* VESA */ diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-autofoo.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-autofoo.patch new file mode 100644 index 0000000000..b53e327dae --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-autofoo.patch @@ -0,0 +1,54 @@ +Index: git/hw/kdrive/Makefile.am +=================================================================== +--- git.orig/hw/kdrive/Makefile.am 2006-09-02 12:12:13.000000000 +0200 ++++ git/hw/kdrive/Makefile.am 2006-09-02 12:12:14.000000000 +0200 +@@ -7,6 +7,10 @@ + FBDEV_SUBDIRS = fbdev epson + endif + ++if KDRIVEW100 ++W100_SUBDIRS = w100 ++endif ++ + if XSDLSERVER + XSDL_SUBDIRS = sdl + endif +@@ -20,6 +24,7 @@ + linux \ + $(XSDL_SUBDIRS) \ + $(FBDEV_SUBDIRS) \ ++ $(W100_SUBDIRS) \ + $(VESA_SUBDIRS) \ + $(XEPHYR_SUBDIRS) \ + fake +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2006-09-02 12:12:14.000000000 +0200 ++++ git/configure.ac 2006-09-02 12:12:14.000000000 +0200 +@@ -442,6 +442,7 @@ + AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) + AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) + AC_ARG_ENABLE(xsdl, AS_HELP_STRING([--enable-xsdl], [Build the kdrive Xsdl server (default: auto)]), [XSDL=$enableval], [XSDL=auto]) ++AC_ARG_ENABLE(w100, AS_HELP_STRING([--enable-w100], [Build the kdrive Xw100 server (default: no)]), [KDRIVEW100=$enableval], [KDRIVEW100=no]) + dnl xprint + AC_ARG_ENABLE(freetype, AS_HELP_STRING([ --enable-freetype], [Build Xprint FreeType backend (default: yes)]), [XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=no]) + AC_ARG_WITH(freetype-config, AS_HELP_STRING([ --with-freetype-config=PROG], [Use FreeType configuration program PROG (default: auto)]), freetype_config=$withval, freetype_config=auto) +@@ -1519,6 +1520,10 @@ + AC_SUBST([XSDL_LIBS]) + AC_SUBST([XSDL_INCS]) + ++AM_CONDITIONAL(KDRIVEW100, [test "x$KDRIVEW100" = xyes]) ++if test "x$KDRIVEW100" = xyes; then ++ AC_DEFINE(KDRIVEW100, 1, [Build Xw100 server]) ++fi + + dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers) + AC_DEFINE(__XKBDEFRULES__, "xorg", [Default XKB rules]) +@@ -1753,6 +1758,7 @@ + hw/kdrive/epson/Makefile + hw/kdrive/fake/Makefile + hw/kdrive/fbdev/Makefile ++hw/kdrive/w100/Makefile + hw/kdrive/i810/Makefile + hw/kdrive/linux/Makefile + hw/kdrive/mach64/Makefile diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-fix-offscreen-bmp.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-fix-offscreen-bmp.patch new file mode 100644 index 0000000000..39bc22c6b3 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-fix-offscreen-bmp.patch @@ -0,0 +1,15 @@ +Patch suggested by Manuel Teira to actually enable offscreen pixmap +acceleration in Xw100. Value 16 is empirical, works well on hx4700, +but in case of issues, consider double it (other accelerated drivers +use bigger values than 16). + +--- xorg-server-1.2.0/hw/kdrive/w100/ati_draw.c.org 2007-04-04 10:28:57.000000000 +0000 ++++ xorg-server-1.2.0/hw/kdrive/w100/ati_draw.c 2007-04-06 14:43:40.000000000 +0000 +@@ -433,6 +433,7 @@ + * or kaaPixmapUseScreen. But this is probably caused by some bug in this + * driver... */ + atis->kaa.flags |= KAA_OFFSCREEN_PIXMAPS; ++ atis->kaa.pitchAlign = 16; + if (!kaaDrawInit(pScreen, &atis->kaa)) + return FALSE; + diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-new-input-world-order.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-new-input-world-order.patch new file mode 100644 index 0000000000..239ae0bb67 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100-new-input-world-order.patch @@ -0,0 +1,28 @@ +Index: xorg-server-1.4/hw/kdrive/w100/ati_stub.c +=================================================================== +--- xorg-server-1.4.orig/hw/kdrive/w100/ati_stub.c 2007-09-08 21:40:26.000000000 +0200 ++++ xorg-server-1.4/hw/kdrive/w100/ati_stub.c 2007-09-08 22:04:27.000000000 +0200 +@@ -74,10 +74,20 @@ + void + InitInput(int argc, char **argv) + { +- KdInitInput(&LinuxMouseFuncs, &LinuxKeyboardFuncs); +-#ifdef TOUCHSCREEN +- KdAddMouseDriver(&TsFuncs); ++ KdKeyboardInfo *ki; ++ ++ KdAddKeyboardDriver (&LinuxKeyboardDriver); ++ KdAddPointerDriver (&LinuxMouseDriver); ++ KdAddKeyboardDriver (&LinuxEvdevKeyboardDriver); ++ KdAddPointerDriver (&LinuxEvdevMouseDriver); ++#ifdef TSLIB ++ KdAddPointerDriver (&TsDriver); + #endif ++ ++ ki = KdParseKeyboard ("keyboard"); ++ KdAddKeyboard(ki); ++ ++ KdInitInput (); + } + + void diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100.patch new file mode 100644 index 0000000000..1bb6f357c6 --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-glamo/w100.patch @@ -0,0 +1,6335 @@ +Index: git/hw/kdrive/w100/ati.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/hw/kdrive/w100/ati.c 2006-09-02 12:12:14.000000000 +0200 +@@ -0,0 +1,434 @@ ++/* ++ * Copyright © 2006 Alberto Mardegan ++ * ++ * 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 Alberto Mardegan not be used in ++ * advertising or publicity pertaining to distribution of the software without ++ * specific, written prior permission. Alberto Mardegan makes no ++ * representations about the suitability of this software for any purpose. It ++ * is provided "as is" without express or implied warranty. ++ * ++ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL ALBERTO MARDEGAN 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_CONFIG_H ++#include ++#endif ++#include "ati.h" ++#include "w100_regs.h" ++ ++ ++struct pci_id_entry ati_pci_ids[] = { ++ {0x1002, 0x5644, 0, "ATI Imageon 3200"}, ++ {0x1002, 0x5741, 0, "ATI Imageon 100"}, ++ {0x1002, 0x5744, 0, "ATI Imageon 3220"}, ++ {0, 0, 0, NULL} ++}; ++ ++ ++static Bool ++ATICardInit(KdCardInfo * card) ++{ ++ ATICardInfo *atic; ++ int i; ++ Bool initialized = FALSE; ++ ++ atic = xcalloc(sizeof(ATICardInfo), 1); ++ if (atic == NULL) ++ return FALSE; ++ ++#ifdef KDRIVEFBDEV ++ if (!initialized && fbdevInitialize(card, &atic->backend_priv.fbdev)) { ++ atic->use_fbdev = TRUE; ++ initialized = TRUE; ++ atic->backend_funcs.cardfini = fbdevCardFini; ++ atic->backend_funcs.scrfini = fbdevScreenFini; ++ atic->backend_funcs.initScreen = fbdevInitScreen; ++ atic->backend_funcs.finishInitScreen = fbdevFinishInitScreen; ++ atic->backend_funcs.createRes = fbdevCreateResources; ++ atic->backend_funcs.preserve = fbdevPreserve; ++ atic->backend_funcs.restore = fbdevRestore; ++ atic->backend_funcs.dpms = fbdevDPMS; ++ atic->backend_funcs.enable = fbdevEnable; ++ atic->backend_funcs.disable = fbdevDisable; ++ atic->backend_funcs.getColors = fbdevGetColors; ++ atic->backend_funcs.putColors = fbdevPutColors; ++#ifdef RANDR ++ atic->backend_funcs.randrSetConfig = fbdevRandRSetConfig; ++#endif ++ } ++#endif ++#ifdef KDRIVEVESA ++ if (!initialized && vesaInitialize(card, &atic->backend_priv.vesa)) { ++ atic->use_vesa = TRUE; ++ initialized = TRUE; ++ atic->backend_funcs.cardfini = vesaCardFini; ++ atic->backend_funcs.scrfini = vesaScreenFini; ++ atic->backend_funcs.initScreen = vesaInitScreen; ++ atic->backend_funcs.finishInitScreen = vesaFinishInitScreen; ++ atic->backend_funcs.createRes = vesaCreateResources; ++ atic->backend_funcs.preserve = vesaPreserve; ++ atic->backend_funcs.restore = vesaRestore; ++ atic->backend_funcs.dpms = vesaDPMS; ++ atic->backend_funcs.enable = vesaEnable; ++ atic->backend_funcs.disable = vesaDisable; ++ atic->backend_funcs.getColors = vesaGetColors; ++ atic->backend_funcs.putColors = vesaPutColors; ++#ifdef RANDR ++ atic->backend_funcs.randrSetConfig = vesaRandRSetConfig; ++#endif ++ } ++#endif ++ ++ if (!initialized || !ATIMap(card, atic)) { ++ xfree(atic); ++ return FALSE; ++ } ++ ++ card->driver = atic; ++ ++ for (i = 0; ati_pci_ids[i].name != NULL; i++) { ++ if (ati_pci_ids[i].device == card->attr.deviceID) { ++ atic->pci_id = &ati_pci_ids[i]; ++ break; ++ } ++ } ++ ++ ErrorF("Using ATI card: %s\n", atic->pci_id->name); ++ ++ return TRUE; ++} ++ ++static void ++ATICardFini(KdCardInfo * card) ++{ ++ ATICardInfo *atic = (ATICardInfo *) card->driver; ++ ++ ATIUnmap(card, atic); ++ atic->backend_funcs.cardfini(card); ++} ++ ++/* ++ * Once screen->off_screen_base is set, this function ++ * allocates the remaining memory appropriately ++ */ ++ ++static void ++ATISetOffscreen(KdScreenInfo * screen) ++{ ++ ATICardInfo(screen); ++ int screen_size; ++ char *mmio = atic->reg_base; ++ ++ /* check (and adjust) pitch */ ++ if (mmio) { ++ int byteStride = screen->fb[0].byteStride; ++ int bitStride; ++ int pixelStride; ++ int bpp = screen->fb[0].bitsPerPixel; ++ ++ /* ++ * Ensure frame buffer is correctly aligned ++ */ ++ if (byteStride & 0x3f) { ++ byteStride = (byteStride + 0x3f) & ~0x3f; ++ bitStride = byteStride * 8; ++ pixelStride = bitStride / bpp; ++ ++ screen->fb[0].byteStride = byteStride; ++ screen->fb[0].pixelStride = pixelStride; ++ } ++ } ++ ++ screen_size = screen->fb[0].byteStride * screen->height; ++ ++ screen->off_screen_base = screen_size; ++ ++} ++ ++static Bool ++ATIScreenInit(KdScreenInfo * screen) ++{ ++ ATIScreenInfo *atis; ++ ATICardInfo(screen); ++ Bool success = FALSE; ++ ++ atis = xcalloc(sizeof(ATIScreenInfo), 1); ++ if (atis == NULL) ++ return FALSE; ++ ++ atis->atic = atic; ++ atis->screen = screen; ++ screen->driver = atis; ++ ++ if (screen->fb[0].depth == 0) ++ screen->fb[0].depth = 16; ++#ifdef KDRIVEFBDEV ++ if (atic->use_fbdev) { ++ success = fbdevScreenInitialize(screen, &atis->backend_priv.fbdev); ++ } ++#endif ++#ifdef KDRIVEVESA ++ if (atic->use_vesa) { ++ success = vesaScreenInitialize(screen, &atis->backend_priv.vesa); ++ } ++#endif ++ ++ if (!success) { ++ screen->driver = NULL; ++ xfree(atis); ++ return FALSE; ++ } ++ ++ ErrorF ++ ("Offscreen memory at offset %08x, memory base %08x, size %08x\n", ++ screen->off_screen_base, screen->memory_base, ++ screen->memory_size); ++ ATISetOffscreen(screen); ++ ++ return TRUE; ++} ++ ++#ifdef RANDR ++static Bool ++ATIRandRSetConfig(ScreenPtr pScreen, ++ Rotation randr, int rate, RRScreenSizePtr pSize) ++{ ++ KdScreenPriv(pScreen); ++ KdScreenInfo *screen = pScreenPriv->screen; ++ ATICardInfo *atic = screen->card->driver; ++ Bool ret; ++ ++ ATIDrawDisable(pScreen); ++ ret = atic->backend_funcs.randrSetConfig(pScreen, randr, rate, pSize); ++ ATISetOffscreen(screen); ++ /* ++ * Set frame buffer mapping ++ */ ++ (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen), ++ pScreen->width, ++ pScreen->height, ++ screen->fb[0].depth, ++ screen->fb[0].bitsPerPixel, ++ screen->fb[0].byteStride, ++ screen->fb[0].frameBuffer); ++ ++ ATIDrawEnable(pScreen); ++ return ret; ++} ++ ++static Bool ++ATIRandRInit(ScreenPtr pScreen) ++{ ++ rrScrPrivPtr pScrPriv; ++ ++ pScrPriv = rrGetScrPriv(pScreen); ++ pScrPriv->rrSetConfig = ATIRandRSetConfig; ++ return TRUE; ++} ++#endif ++ ++static void ++ATIScreenFini(KdScreenInfo * screen) ++{ ++ ATIScreenInfo *atis = (ATIScreenInfo *) screen->driver; ++ ATICardInfo *atic = screen->card->driver; ++ ++ atic->backend_funcs.scrfini(screen); ++ xfree(atis); ++ screen->driver = 0; ++} ++ ++Bool ++ATIMap(KdCardInfo * card, ATICardInfo * atic) ++{ ++ atic->mem_base = (CARD8 *) KdMapDevice(ATI_MEM_BASE(card), ++ ATI_MEM_SIZE(card)); ++ ++ if (atic->mem_base == NULL) ++ return FALSE; ++ atic->reg_base = atic->mem_base + 0x10000; /* XXX */ ++ ++ KdSetMappedMode(ATI_MEM_BASE(card), ATI_MEM_SIZE(card), ++ KD_MAPPED_MODE_REGISTERS); ++ ++ return TRUE; ++} ++ ++void ++ATIUnmap(KdCardInfo * card, ATICardInfo * atic) ++{ ++ if (atic->reg_base) { ++ KdResetMappedMode(ATI_REG_BASE(card), ATI_REG_SIZE(card), ++ KD_MAPPED_MODE_REGISTERS); ++ KdUnmapDevice((void *) atic->reg_base, ATI_REG_SIZE(card)); ++ atic->reg_base = 0; ++ } ++} ++ ++static Bool ++ATIInitScreen(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ ++ return atic->backend_funcs.initScreen(pScreen); ++} ++ ++static Bool ++ATIFinishInitScreen(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ ++ if (!atic->backend_funcs.finishInitScreen(pScreen)) ++ return FALSE; ++#ifdef RANDR ++ if (!ATIRandRInit(pScreen)) ++ return FALSE; ++#endif ++ return TRUE; ++} ++ ++static Bool ++ATICreateResources(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ ++ return atic->backend_funcs.createRes(pScreen); ++} ++ ++static void ++ATIPreserve(KdCardInfo * card) ++{ ++ ATICardInfo *atic = card->driver; ++ ++ atic->backend_funcs.preserve(card); ++} ++ ++static void ++ATIRestore(KdCardInfo * card) ++{ ++ ATICardInfo *atic = card->driver; ++ ++ ATIUnmap(card, atic); ++ ++ atic->backend_funcs.restore(card); ++} ++ ++static Bool ++ATIDPMS(ScreenPtr pScreen, int mode) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ ++ return atic->backend_funcs.dpms(pScreen, mode); ++} ++ ++static Bool ++ATIEnable(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ mc_ext_mem_location_u eml; ++ char *mmio; ++ ++ if (!atic->backend_funcs.enable(pScreen)) ++ return FALSE; ++ ++ if ((atic->reg_base == NULL) ++ && !ATIMap(pScreenPriv->screen->card, atic)) ++ return FALSE; ++ ++ mmio = atic->reg_base; ++ eml.val = MMIO_IN32(mmio, mmMC_EXT_MEM_LOCATION); ++ atic->ext_mem_location = eml.f.mc_ext_mem_start << 8; ++ ATISetOffscreen(pScreenPriv->screen); ++ ++ return TRUE; ++} ++ ++static void ++ATIDisable(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ ++ ATIUnmap(pScreenPriv->card, atic); ++ ++ atic->backend_funcs.disable(pScreen); ++} ++ ++static void ++ATIGetColors(ScreenPtr pScreen, int fb, int n, xColorItem * pdefs) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ ++ atic->backend_funcs.getColors(pScreen, fb, n, pdefs); ++} ++ ++static void ++ATIPutColors(ScreenPtr pScreen, int fb, int n, xColorItem * pdefs) ++{ ++ KdScreenPriv(pScreen); ++ ATICardInfo(pScreenPriv); ++ ++ atic->backend_funcs.putColors(pScreen, fb, n, pdefs); ++} ++ ++/* Compute log base 2 of val. */ ++int ++ATILog2(int val) ++{ ++ int bits; ++ ++ for (bits = 0; val != 0; val >>= 1, ++bits); ++ return bits - 1; ++} ++ ++ ++ ++KdCardFuncs ATIFuncs = { ++ ATICardInit, /* cardinit */ ++ ATIScreenInit, /* scrinit */ ++ ATIInitScreen, /* initScreen */ ++ ATIFinishInitScreen, /* finishInitScreen */ ++ ATICreateResources, /* createRes */ ++ ATIPreserve, /* preserve */ ++ ATIEnable, /* enable */ ++ ATIDPMS, /* dpms */ ++ ATIDisable, /* disable */ ++ ATIRestore, /* restore */ ++ ATIScreenFini, /* scrfini */ ++ ATICardFini, /* cardfini */ ++ ++#define ATICursorInit 0 ++#define ATICursorEnable 0 ++#define ATICursorDisable 0 ++#define ATICursorFini 0 ++#define ATIRecolorCursor 0 ++ ATICursorInit, /* initCursor */ ++ ATICursorEnable, /* enableCursor */ ++ ATICursorDisable, /* disableCursor */ ++ ATICursorFini, /* finiCursor */ ++ ATIRecolorCursor, /* recolorCursor */ ++ ++ ATIDrawInit, /* initAccel */ ++ ATIDrawEnable, /* enableAccel */ ++ ATIDrawDisable, /* disableAccel */ ++ ATIDrawFini, /* finiAccel */ ++ ++ ATIGetColors, /* getColors */ ++ ATIPutColors, /* putColors */ ++}; +Index: git/hw/kdrive/w100/ati_cursor.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/hw/kdrive/w100/ati_cursor.c 2006-09-02 12:12:14.000000000 +0200 +@@ -0,0 +1,93 @@ ++/* ++ * Copyright © 2006 Alberto Mardegan ++ * ++ * 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 Alberto Mardegan not be used in ++ * advertising or publicity pertaining to distribution of the software without ++ * specific, written prior permission. Alberto Mardegan makes no ++ * representations about the suitability of this software for any purpose. It ++ * is provided "as is" without express or implied warranty. ++ * ++ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL ALBERTO MARDEGAN 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_CONFIG_H ++#include ++#endif ++#include "ati.h" ++#include "cursorstr.h" ++#include "ati_draw.h" ++ ++static void ++ATIMoveCursor(ScreenPtr pScreen, int x, int y) ++{ ++} ++ ++ ++static Bool ++ATIRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ++{ ++ return FALSE; ++} ++ ++ ++static Bool ++ATIUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ++{ ++ return TRUE; ++} ++ ++ ++static void ++ATISetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) ++{ ++} ++ ++ ++miPointerSpriteFuncRec ATIPointerSpriteFuncs = { ++ ATIRealizeCursor, ++ ATIUnrealizeCursor, ++ ATISetCursor, ++ ATIMoveCursor, ++}; ++ ++ ++void ++ATICursorEnable(ScreenPtr pScreen) ++{ ++} ++ ++ ++void ++ATICursorDisable(ScreenPtr pScreen) ++{ ++} ++ ++ ++Bool ++ATICursorInit(ScreenPtr pScreen) ++{ ++ return FALSE; ++} ++ ++ ++void ++ATIRecolorCursor(ScreenPtr pScreen, int ndef, xColorItem * pdef) ++{ ++ return; ++} ++ ++ ++void ++ATICursorFini(ScreenPtr pScreen) ++{ ++} +Index: git/hw/kdrive/w100/ati_dma.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/hw/kdrive/w100/ati_dma.c 2006-09-02 12:12:14.000000000 +0200 +@@ -0,0 +1,333 @@ ++/* ++ * Copyright © 2006 Alberto Mardegan ++ * ++ * 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 Alberto Mardegan not be used in ++ * advertising or publicity pertaining to distribution of the software without ++ * specific, written prior permission. Alberto Mardegan makes no ++ * representations about the suitability of this software for any purpose. It ++ * is provided "as is" without express or implied warranty. ++ * ++ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL ALBERTO MARDEGAN 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. ++ */ ++ ++#include ++ ++#include "ati.h" ++#include "w100_regs.h" ++#include "w100_const.h" ++#include "ati_dma.h" ++#include "ati_draw.h" ++ ++ ++#define DEBUG_FIFO 0 ++ ++extern CARD32 w100_microcode[][2]; ++ ++#if DEBUG_FIFO ++static void ++ATIDebugFifo(ATIScreenInfo * atis) ++{ ++ ATICardInfo *atic = atis->atic; ++ char *mmio = atic->reg_base; ++ ++ ErrorF("mmCP_CSQ_CNTL: 0x%08x\n", MMIO_IN32(mmio, mmCP_CSQ_CNTL)); ++ ErrorF("mmCP_CSQ_STAT: 0x%08x\n", MMIO_IN32(mmio, mmCP_CSQ_STAT)); ++ ErrorF("mmRBBM_STATUS: 0x%08x\n", MMIO_IN32(mmio, mmRBBM_STATUS)); ++} ++#endif ++ ++static void ++ATIUploadMicrocode(ATIScreenInfo * atis) ++{ ++ ATICardInfo *atic = atis->atic; ++ char *mmio = atic->reg_base; ++ int i; ++ ++ MMIO_OUT32(mmio, mmCP_ME_RAM_ADDR, 0); ++ for (i = 0; i < 256; i++) { ++ MMIO_OUT32(mmio, mmCP_ME_RAM_DATAH, w100_microcode[i][1]); ++ MMIO_OUT32(mmio, mmCP_ME_RAM_DATAL, w100_microcode[i][0]); ++ } ++} ++ ++/* Required when reading from video memory after acceleration to make sure all ++ * data has been flushed to video memory from the pixel cache. ++ */ ++static void ++ATIFlushPixelCache(ATIScreenInfo * atis) ++{ ++ ATICardInfo *atic = atis->atic; ++ char *mmio = atic->reg_base; ++ rbbm_status_u rs; ++ TIMEOUT_LOCALS; ++ ++ WHILE_NOT_TIMEOUT(.2) { ++ rs.val = MMIO_IN32(mmio, mmRBBM_STATUS); ++ if (!rs.f.gui_active) ++ break; ++ } ++ if (TIMEDOUT()) ++ ErrorF("Timeout flushing pixel cache.\n"); ++} ++ ++static void ++ATIEngineReset(ATIScreenInfo * atis) ++{ ++ ATICardInfo *atic = atis->atic; ++ char *mmio = atic->reg_base; ++ CARD32 sclk_cntl; ++ sclk_cntl_u sc; ++ rbbm_soft_reset_u rsr; ++ ++#if DEBUG_FIFO ++ ErrorF("Engine Reset!\n"); ++ ATIDebugFifo(atis); ++#endif ++ ++ ATIFlushPixelCache(atis); ++ ++ sc.val = sclk_cntl = MMIO_IN32(mmio, mmSCLK_CNTL); ++ sc.f.sclk_force_e2 = sc.f.sclk_force_e3 = sc.f.sclk_force_idct = 1; ++ MMIO_OUT32(mmio, mmSCLK_CNTL, sc.val); ++ ++ rsr.val = 0; ++ rsr.f.soft_reset_e2 = 1; ++ MMIO_OUT32(mmio, mmRBBM_SOFT_RESET, rsr.val); ++ MMIO_OUT32(mmio, mmRBBM_SOFT_RESET, 0); ++ ++ MMIO_OUT32(mmio, mmSCLK_CNTL, sclk_cntl); ++} ++ ++inline void ++ATIWaitAvailMMIO(ATIScreenInfo * atis, int n) ++{ ++ ATICardInfo *atic = atis->atic; ++ char *mmio = atic->reg_base; ++ rbbm_status_u rs; ++ TIMEOUT_LOCALS; ++ ++ if (atis->mmio_avail >= n) { ++ atis->mmio_avail -= n; ++ return; ++ } ++ WHILE_NOT_TIMEOUT(.2) { ++ rs.val = MMIO_IN32(mmio, mmRBBM_STATUS); ++ atis->mmio_avail = rs.f.cmdfifo_avail; ++ if (atis->mmio_avail >= n) ++ break; ++ ErrorF("Available %d slots.\n", atis->mmio_avail); ++ } ++ if (TIMEDOUT()) { ++ ErrorF("Timeout waiting for %d MMIO slots.\n", n); ++ ATIEngineReset(atis); ++ ATIDrawSetup(atis->screen->pScreen); ++ } ++ atis->mmio_avail -= n; ++} ++ ++ ++void ++ATIWaitIdle(ATIScreenInfo * atis) ++{ ++ ATICardInfo *atic = atis->atic; ++ char *mmio = atic->reg_base; ++ rbbm_status_u rs; ++ TIMEOUT_LOCALS; ++ ++ /* Empty the fifo */ ++ ATIWaitAvailMMIO(atis, 16); ++ ++ WHILE_NOT_TIMEOUT(.2) { ++ rs.val = MMIO_IN32(mmio, mmRBBM_STATUS); ++ if (!rs.f.gui_active) ++ break; ++#if DEBUG_FIFO ++ ATIDebugFifo(atis); ++#endif ++ /* don't know if this is needed, but it's in aticore */ ++ MMIO_IN32(mmio, mmCP_RB_RPTR); ++ } ++ if (TIMEDOUT()) { ++ ErrorF("Timeout idling accelerator, resetting...\n"); ++ ATIEngineReset(atis); ++ ATIDrawSetup(atis->screen->pScreen); ++ } ++ ++ ATIFlushPixelCache(atis); ++ ++#if DEBUG_FIFO ++ ErrorF("Idle?\n"); ++ ATIDebugFifo(atis); ++#endif ++} ++ ++ ++static Bool ++ATIDMAInit(ScreenPtr pScreen, Bool use_agp) ++{ ++ KdScreenPriv(pScreen); ++ ATIScreenInfo(pScreenPriv); ++ ATICardInfo(pScreenPriv); ++ char *mmio = atic->reg_base; ++ int dma_offset, rbsize = 10; ++ wrap_start_dir_u wsd; ++ wrap_buf_a_u wba; ++ cp_rb_cntl_u rc; ++ cp_csq_cntl_u cc; ++ CARD32 mem_offset; ++ ++ /* with rbsize = 10, DMA buffer will be of 0x2000 (8192) bytes */ ++ atis->ring_count = 1 << (rbsize + 1); ++ atis->ring_mask = atis->ring_count - 1; ++ atis->ring_len = atis->ring_count * 4; ++ atis->dma_space = KdOffscreenAlloc(pScreen, atis->ring_len, ++ 16, TRUE, NULL, NULL); ++ if (atis->dma_space == NULL) ++ return FALSE; ++ ++ wsd.val = MMIO_IN32(mmio, mmWRAP_START_DIR); ++ atis->ring_addr = ++ (CARD32 *) (atic->mem_base + (wsd.f.start_addr << 1)); ++ dma_offset = atis->dma_space->offset; ++ ++ ATIUploadMicrocode(atis); ++ ATIEngineReset(atis); ++ ++ atis->ring_read = 0; ++ atis->ring_write = 0; ++ atis->ring_free = atis->ring_count; ++ ++ mem_offset = atic->ext_mem_location + atis->dma_space->offset; ++ MMIO_OUT32(mmio, mmCP_RB_BASE, mem_offset); ++ MMIO_OUT32(mmio, mmCP_RB_WPTR, atis->ring_write); ++ MMIO_OUT32(mmio, mmCP_RB_RPTR, atis->ring_read); ++ MMIO_OUT32(mmio, mmCP_RB_RPTR_ADDR, 0); ++ ++ wba.val = 0; ++ wba.f.offset_addr_a = mem_offset; ++ switch (rbsize) { ++ case 9: ++ wba.f.block_size_a = WB_BLOCK_SIZE_A_0; ++ break; ++ case 10: ++ wba.f.block_size_a = WB_BLOCK_SIZE_A_1; ++ break; ++ case 11: ++ wba.f.block_size_a = WB_BLOCK_SIZE_A_2; ++ break; ++ case 12: ++ wba.f.block_size_a = WB_BLOCK_SIZE_A_3; ++ break; ++ case 13: ++ wba.f.block_size_a = WB_BLOCK_SIZE_A_4; ++ break; ++ } ++ MMIO_OUT32(mmio, mmWRAP_BUF_A, wba.val); ++ ++ rc.val = 0; ++ rc.f.rb_no_update = 1; ++ rc.f.rb_bufsz = rbsize; ++ MMIO_OUT32(mmio, mmCP_RB_CNTL, rc.val); ++ ++ cc.val = 0; ++ cc.f.csq_mode = CSQ_CNTL_MODE_FREERUN; ++ MMIO_OUT32(mmio, mmCP_CSQ_CNTL, cc.val); ++ ++ return TRUE; ++} ++ ++static Bool ++ATIDMAFini(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATIScreenInfo(pScreenPriv); ++ ATICardInfo(pScreenPriv); ++ char *mmio = atic->reg_base; ++ ++ MMIO_OUT32(mmio, mmCP_CSQ_CNTL, 0); ++ ++ ATIEngineReset(atis); ++ ++ //KdOffscreenFree(pScreen, atis->dma_space); ++ ++ return TRUE; ++} ++ ++void ++ATIDMASetup(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATIScreenInfo(pScreenPriv); ++ ++ atis->using_dma = FALSE; ++ atis->using_pio = FALSE; ++ if (ATIDMAInit(pScreen, FALSE)) ++ atis->using_dma = TRUE; ++ ++ if (atis->using_dma) ++ ErrorF("Initialized DMA\n"); ++} ++ ++void ++ATIDMATeardown(ScreenPtr pScreen) ++{ ++ KdScreenPriv(pScreen); ++ ATIScreenInfo(pScreenPriv); ++ ++ ATIWaitIdle(atis); ++ ++ if (atis->using_dma) ++ ATIDMAFini(pScreen); ++ ++ atis->using_pio = FALSE; ++ atis->using_dma = FALSE; ++} ++ ++ ++CARD32 * ++ATIRequestEntries(ATIScreenInfo * atis, int n) ++{ ++ char *mmio = atis->atic->reg_base; ++ CARD32 *ptr; ++ TIMEOUT_LOCALS; ++ ++ WHILE_NOT_TIMEOUT(1) { ++ if (atis->ring_free > n) { ++ ptr = atis->ring_addr + atis->ring_write; ++ return ptr; ++ } ++ atis->ring_read = MMIO_IN32(mmio, mmCP_RB_RPTR); ++ atis->ring_write = MMIO_IN32(mmio, mmCP_RB_WPTR); ++ ++ if (atis->ring_read == atis->ring_write) { ++ atis->ring_free = atis->ring_count; ++ } else { ++ atis->ring_free = ++ (atis->ring_count + ++ atis->ring_read - atis->ring_write) & atis->ring_mask; ++ } ++ } ++ if (TIMEDOUT()) ++ ErrorF("Timeout waiting for %d entries.\n", n); ++ return NULL; ++} ++ ++void ++ATISubmitEntries(ATIScreenInfo * atis, int n) ++{ ++ char *mmio = atis->atic->reg_base; ++ atis->ring_free -= n; ++ atis->ring_write += n; ++ atis->ring_write &= atis->ring_mask; ++ MMIO_OUT32(mmio, mmCP_RB_WPTR, atis->ring_write); ++} +Index: git/hw/kdrive/w100/ati_dma.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/hw/kdrive/w100/ati_dma.h 2006-09-02 12:12:14.000000000 +0200 +@@ -0,0 +1,176 @@ ++/* ++ * Copyright © 2004 Eric Anholt ++ * ++ * 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 Eric Anholt not be used in ++ * advertising or publicity pertaining to distribution of the software without ++ * specific, written prior permission. Eric Anholt makes no ++ * representations about the suitability of this software for any purpose. It ++ * is provided "as is" without express or implied warranty. ++ * ++ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL ERIC ANHOLT 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. ++ */ ++/* $Header: /cvs/xserver/xserver/hw/kdrive/ati/ati_dma.h,v 1.5 2005-01-27 05:25:57 anholt Exp $ */ ++ ++#ifndef _ATI_DMA_H_ ++#define _ATI_DMA_H_ ++ ++#define CCE_DEBUG 1 ++ ++/* CCE packet defines */ ++ ++#define ATI_CCE_PACKETTYPE_MASK 0xc0000000 ++#define ATI_CCE_PACKET0 0x00000000 ++#define ATI_CCE_PACKET0_COUNT_MASK 0x3fff0000 ++#define ATI_CCE_PACKET0_ONE_REG_WR 0x00008000 ++#define ATI_CCE_PACKET0_REG_MASK 0x000007ff ++#define ATI_CCE_PACKET1 0x40000000 ++#define ATI_CCE_PACKET1_REG_1 0x000007ff ++#define ATI_CCE_PACKET1_REG_2 0x003ff800 ++#define ATI_CCE_PACKET1_REG_2_SHIFT 10 ++#define ATI_CCE_PACKET2 0x80000000 ++#define ATI_CCE_PACKET3 0xc0000000 ++#define ATI_CCE_PACKET3_COUNT_MASK 0x3fff0000 ++#define ATI_CCE_PACKET3_IT_OPCODE_MASK 0x0000ff00 ++ ++ ++#if !CCE_DEBUG ++#define DMA_PACKET0(reg, count) \ ++ (ATI_CCE_PACKET0 | (((count) - 1) << 16) | ((reg) >> 2)) ++#else ++#define DMA_PACKET0(reg, count) \ ++ (__packet0count = (count), __reg = (reg), \ ++ ATI_CCE_PACKET0 | (((count) - 1) << 16) | ((reg) >> 2)) ++#endif ++#define DMA_PACKET1(reg1, reg2) \ ++ (ATI_CCE_PACKET1 | \ ++ (((reg2) >> 2) << ATI_CCE_PACKET1_REG_2_SHIFT) | ((reg1) >> 2)) ++#define DMA_PACKET3(type, count) \ ++ ((type) | (((count) - 1) << 16)) ++ ++ ++ ++#ifdef USE_DMA ++ ++#if !CCE_DEBUG ++ ++#define RING_LOCALS \ ++ CARD32 *__head; int __count ++#define BEGIN_DMA(n) \ ++do { \ ++ __head = ATIRequestEntries(atis, n); \ ++ __count = 0; \ ++} while (0) ++#define END_DMA() do { \ ++ ATISubmitEntries(atis, __count); \ ++} while (0) ++ ++#else /* CCE_DEBUG */ ++#define RING_LOCALS \ ++ CARD32 *__head; int __count, __total, __reg, __packet0count ++#define BEGIN_DMA(n) \ ++do { \ ++ __head = ATIRequestEntries(atis, n); \ ++ __count = 0; \ ++ __total = n; \ ++ __reg = 0; \ ++ __packet0count = 0; \ ++} while (0) ++#define END_DMA() do { \ ++ if (__count != __total) \ ++ FatalError("count != total (%d vs %d) at %s:%d\n", \ ++ __count, __total, __FILE__, __LINE__); \ ++ ATISubmitEntries(atis, __count); \ ++} while (0) ++ ++#endif /* CCE_DEBUG */ ++ ++#define BEGIN_DMA_REG(n) BEGIN_DMA(n * 2) ++#define END_DMA_REG() END_DMA() ++ ++#define OUT_REG(reg, val) \ ++do { \ ++ OUT_RING(DMA_PACKET0(reg, 1)); \ ++ OUT_RING(val); \ ++} while (0) ++ ++ ++#else /* USE_DMA */ ++ ++ ++#define RING_LOCALS char *__mmio = atis->atic->reg_base ++#define BEGIN_DMA_REG(n) \ ++do { \ ++ ATIWaitAvailMMIO(atis, n); \ ++} while (0) ++#define END_DMA_REG() do {} while (0) ++#define OUT_REG(reg, val) MMIO_OUT32(__mmio, reg, val) ++#endif /* USE_DMA */ ++ ++ ++#define OUT_RING(val) do { \ ++ __head[__count++] = (val); \ ++} while (0) ++ ++#define OUT_RING_REG(reg, val) do { \ ++ if (__reg != reg) \ ++ FatalError("unexpected reg (0x%x vs 0x%x) at %s:%d\n", \ ++ reg, __reg, __FILE__, __LINE__); \ ++ if (__packet0count-- <= 0) \ ++ FatalError("overrun of packet0 at %s:%d\n", \ ++ __FILE__, __LINE__); \ ++ __head[__count++] = (val); \ ++ __reg += 4; \ ++} while (0) ++ ++#define OUT_RING_F(x) OUT_RING(GET_FLOAT_BITS(x)) ++ ++#define TIMEOUT_LOCALS struct timeval _target, _curtime ++ ++static inline Bool ++tv_le(struct timeval *tv1, struct timeval *tv2) ++{ ++ if (tv1->tv_sec < tv2->tv_sec || ++ (tv1->tv_sec == tv2->tv_sec && tv1->tv_usec < tv2->tv_usec)) ++ return TRUE; ++ else ++ return FALSE; ++} ++ ++#define WHILE_NOT_TIMEOUT(_timeout) \ ++ gettimeofday(&_target, NULL); \ ++ _target.tv_usec += ((_timeout) * 1000000); \ ++ _target.tv_sec += _target.tv_usec / 1000000; \ ++ _target.tv_usec = _target.tv_usec % 1000000; \ ++ while (gettimeofday(&_curtime, NULL), tv_le(&_curtime, &_target)) ++ ++#define TIMEDOUT() (!tv_le(&_curtime, &_target)) ++ ++ ++void ++ATIFlushIndirect(ATIScreenInfo *atis, Bool discard); ++ ++void ++ATIDMASetup(ScreenPtr pScreen); ++ ++void ++ATIDMATeardown(ScreenPtr pScreen); ++ ++CARD32 * ++ATIRequestEntries(ATIScreenInfo *atis, int n); ++ ++void ++ATISubmitEntries(ATIScreenInfo *atis, int n); ++ ++inline void ++ATIWaitAvailMMIO(ATIScreenInfo *atis, int n); ++#endif /* _ATI_DMA_H_ */ +Index: git/hw/kdrive/w100/ati_draw.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/hw/kdrive/w100/ati_draw.c 2006-09-02 12:12:14.000000000 +0200 +@@ -0,0 +1,477 @@ ++/* ++ * Copyright © 2006 Alberto Mardegan ++ * ++ * 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 Alberto Mardegan not be used in ++ * advertising or publicity pertaining to distribution of the software without ++ * specific, written prior permission. Alberto Mardegan makes no ++ * representations about the suitability of this software for any purpose. It ++ * is provided "as is" without express or implied warranty. ++ * ++ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL ALBERTO MARDEGAN 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