diff options
| author | Matthew Allum <mallum@openedhand.com> | 2005-10-27 15:13:29 +0000 |
|---|---|---|
| committer | Matthew Allum <mallum@openedhand.com> | 2005-10-27 15:13:29 +0000 |
| commit | c204a1dd763e530b10daf6327b18752a9d68fbdf (patch) | |
| tree | 2ffc05a6cd242ba1e76354b3a82b615126dec79b | |
| parent | 4efc6672d4bec5f18575f7b1ab0b9611d3e85de5 (diff) | |
| download | poky-c204a1dd763e530b10daf6327b18752a9d68fbdf.tar.gz | |
Add https://bugs.freedesktop.org/show_bug.cgi?id=4537 faster rotated blits patch
git-svn-id: https://svn.o-hand.com/repos/poky@145 311d38ba-8fff-0310-9ca6-ca027cbcb966
| -rw-r--r-- | openembedded/packages/xserver/xserver-kdrive/faster-rotated.patch | 241 | ||||
| -rw-r--r-- | openembedded/packages/xserver/xserver-kdrive_20050207.bb | 3 |
2 files changed, 243 insertions, 1 deletions
diff --git a/openembedded/packages/xserver/xserver-kdrive/faster-rotated.patch b/openembedded/packages/xserver/xserver-kdrive/faster-rotated.patch new file mode 100644 index 0000000000..eaf7ddec36 --- /dev/null +++ b/openembedded/packages/xserver/xserver-kdrive/faster-rotated.patch | |||
| @@ -0,0 +1,241 @@ | |||
| 1 | Index: xserver/miext/shadow/shrotate.c | ||
| 2 | =================================================================== | ||
| 3 | RCS file: /scratch/openbsd/cvs/XF4/xc/programs/Xserver/miext/shadow/shrotate.c,v | ||
| 4 | retrieving revision 1.2 | ||
| 5 | diff -u -r1.2 shrotate.c | ||
| 6 | --- xserver/miext/shadow/shrotate.c 3 Nov 2004 00:09:54 -0000 1.2 | ||
| 7 | +++ xserver/miext/shadow/shrotate.c 20 Sep 2005 23:07:58 -0000 | ||
| 8 | @@ -45,6 +45,106 @@ | ||
| 9 | #define TOP_TO_BOTTOM 2 | ||
| 10 | #define BOTTOM_TO_TOP -2 | ||
| 11 | |||
| 12 | + | ||
| 13 | +static void | ||
| 14 | +shadowUpdateRotatePackedSubRectangle(shadowBufPtr pBuf, | ||
| 15 | + FbBits *shaLine, int shaFirstShift, | ||
| 16 | + int shaStepOverX, int shaStepOverY, | ||
| 17 | + int shaStepDownX, int shaStepDownY, | ||
| 18 | + int shaBpp, FbBits shaMask, | ||
| 19 | + ScreenPtr pScreen, | ||
| 20 | + int scr_x1, int scr_y, | ||
| 21 | + int scr_h, int scr_w, | ||
| 22 | + int pixelsPerBits) | ||
| 23 | +{ | ||
| 24 | + FbBits *sha; | ||
| 25 | + int shaShift; | ||
| 26 | + int scr_x; | ||
| 27 | + int w; | ||
| 28 | + | ||
| 29 | + /* | ||
| 30 | + * Copy the bits, always write across the physical frame buffer | ||
| 31 | + * to take advantage of write combining. | ||
| 32 | + */ | ||
| 33 | + while (scr_h--) | ||
| 34 | + { | ||
| 35 | + int p; | ||
| 36 | + FbBits bits; | ||
| 37 | + FbBits *win; | ||
| 38 | + int i; | ||
| 39 | + CARD32 winSize; | ||
| 40 | + | ||
| 41 | + sha = shaLine; | ||
| 42 | + shaShift = shaFirstShift; | ||
| 43 | + w = scr_w; | ||
| 44 | + scr_x = scr_x1 * shaBpp >> FB_SHIFT; | ||
| 45 | + | ||
| 46 | + while (w) | ||
| 47 | + { | ||
| 48 | + /* | ||
| 49 | + * Map some of this line | ||
| 50 | + */ | ||
| 51 | + win = (FbBits *) (*pBuf->window) (pScreen, | ||
| 52 | + scr_y, | ||
| 53 | + scr_x << 2, | ||
| 54 | + SHADOW_WINDOW_WRITE, | ||
| 55 | + &winSize, | ||
| 56 | + pBuf->closure); | ||
| 57 | + i = (winSize >> 2); | ||
| 58 | + if (i > w) | ||
| 59 | + i = w; | ||
| 60 | + w -= i; | ||
| 61 | + scr_x += i; | ||
| 62 | + /* | ||
| 63 | + * Copy the portion of the line mapped | ||
| 64 | + */ | ||
| 65 | + while (i--) | ||
| 66 | + { | ||
| 67 | + bits = 0; | ||
| 68 | + p = pixelsPerBits; | ||
| 69 | + /* | ||
| 70 | + * Build one word of output from multiple inputs | ||
| 71 | + */ | ||
| 72 | + while (p--) | ||
| 73 | + { | ||
| 74 | + bits = FbScrLeft(bits, shaBpp); | ||
| 75 | + bits |= FbScrRight (*sha, shaShift) & shaMask; | ||
| 76 | + | ||
| 77 | + shaShift -= shaStepOverX; | ||
| 78 | + if (shaShift >= FB_UNIT) | ||
| 79 | + { | ||
| 80 | + shaShift -= FB_UNIT; | ||
| 81 | + sha--; | ||
| 82 | + } | ||
| 83 | + else if (shaShift < 0) | ||
| 84 | + { | ||
| 85 | + shaShift += FB_UNIT; | ||
| 86 | + sha++; | ||
| 87 | + } | ||
| 88 | + sha += shaStepOverY; | ||
| 89 | + } | ||
| 90 | + *win++ = bits; | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + scr_y++; | ||
| 94 | + shaFirstShift -= shaStepDownX; | ||
| 95 | + if (shaFirstShift >= FB_UNIT) | ||
| 96 | + { | ||
| 97 | + shaFirstShift -= FB_UNIT; | ||
| 98 | + shaLine--; | ||
| 99 | + } | ||
| 100 | + else if (shaFirstShift < 0) | ||
| 101 | + { | ||
| 102 | + shaFirstShift += FB_UNIT; | ||
| 103 | + shaLine++; | ||
| 104 | + } | ||
| 105 | + shaLine += shaStepDownY; | ||
| 106 | + } | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | +#define BLOCKSIZE_HEIGHT 32 | ||
| 110 | +#define BLOCKSIZE_WIDTH 32 | ||
| 111 | + | ||
| 112 | void | ||
| 113 | shadowUpdateRotatePacked (ScreenPtr pScreen, | ||
| 114 | shadowBufPtr pBuf) | ||
| 115 | @@ -61,7 +161,6 @@ | ||
| 116 | int sha_x1 = 0, sha_y1 = 0; | ||
| 117 | int scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h; | ||
| 118 | int scr_x, scr_y; | ||
| 119 | - int w; | ||
| 120 | int pixelsPerBits; | ||
| 121 | int pixelsMask; | ||
| 122 | FbStride shaStepOverY = 0, shaStepDownY = 0; | ||
| 123 | @@ -221,86 +320,46 @@ | ||
| 124 | ((sha_x1 * shaBpp) >> FB_SHIFT)); | ||
| 125 | |||
| 126 | /* | ||
| 127 | - * Copy the bits, always write across the physical frame buffer | ||
| 128 | - * to take advantage of write combining. | ||
| 129 | + * Copy in blocks of size BLOCKSIZE_WIDTH x BLOCKSIZE_HEIGHT | ||
| 130 | + * to reduce the number of cache misses when rotating 90 or | ||
| 131 | + * 270 degrees. | ||
| 132 | */ | ||
| 133 | - while (scr_h--) | ||
| 134 | + for (scr_y = scr_y1; scr_y < scr_y2; scr_y += BLOCKSIZE_HEIGHT) | ||
| 135 | { | ||
| 136 | - int p; | ||
| 137 | - FbBits bits; | ||
| 138 | - FbBits *win; | ||
| 139 | - int i; | ||
| 140 | - CARD32 winSize; | ||
| 141 | - | ||
| 142 | sha = shaLine; | ||
| 143 | shaShift = shaFirstShift; | ||
| 144 | - w = scr_w; | ||
| 145 | - scr_x = scr_x1 * shaBpp >> FB_SHIFT; | ||
| 146 | |||
| 147 | - while (w) | ||
| 148 | + for (scr_x = scr_x1; scr_x < scr_x2; scr_x += BLOCKSIZE_WIDTH) | ||
| 149 | { | ||
| 150 | - /* | ||
| 151 | - * Map some of this line | ||
| 152 | - */ | ||
| 153 | - win = (FbBits *) (*pBuf->window) (pScreen, | ||
| 154 | - scr_y, | ||
| 155 | - scr_x << 2, | ||
| 156 | - SHADOW_WINDOW_WRITE, | ||
| 157 | - &winSize, | ||
| 158 | - pBuf->closure); | ||
| 159 | - i = (winSize >> 2); | ||
| 160 | - if (i > w) | ||
| 161 | - i = w; | ||
| 162 | - w -= i; | ||
| 163 | - scr_x += i; | ||
| 164 | - /* | ||
| 165 | - * Copy the portion of the line mapped | ||
| 166 | - */ | ||
| 167 | - while (i--) | ||
| 168 | - { | ||
| 169 | - bits = 0; | ||
| 170 | - p = pixelsPerBits; | ||
| 171 | - /* | ||
| 172 | - * Build one word of output from multiple inputs | ||
| 173 | - * | ||
| 174 | - * Note that for 90/270 rotations, this will walk | ||
| 175 | - * down the shadow hitting each scanline once. | ||
| 176 | - * This is probably not very efficient. | ||
| 177 | - */ | ||
| 178 | - while (p--) | ||
| 179 | - { | ||
| 180 | - bits = FbScrLeft(bits, shaBpp); | ||
| 181 | - bits |= FbScrRight (*sha, shaShift) & shaMask; | ||
| 182 | + int h = BLOCKSIZE_HEIGHT; | ||
| 183 | + int w = BLOCKSIZE_WIDTH; | ||
| 184 | |||
| 185 | - shaShift -= shaStepOverX; | ||
| 186 | - if (shaShift >= FB_UNIT) | ||
| 187 | - { | ||
| 188 | - shaShift -= FB_UNIT; | ||
| 189 | - sha--; | ||
| 190 | - } | ||
| 191 | - else if (shaShift < 0) | ||
| 192 | - { | ||
| 193 | - shaShift += FB_UNIT; | ||
| 194 | - sha++; | ||
| 195 | - } | ||
| 196 | - sha += shaStepOverY; | ||
| 197 | - } | ||
| 198 | - *win++ = bits; | ||
| 199 | - } | ||
| 200 | - } | ||
| 201 | - scr_y++; | ||
| 202 | - shaFirstShift -= shaStepDownX; | ||
| 203 | - if (shaFirstShift >= FB_UNIT) | ||
| 204 | - { | ||
| 205 | - shaFirstShift -= FB_UNIT; | ||
| 206 | - shaLine--; | ||
| 207 | - } | ||
| 208 | - else if (shaFirstShift < 0) | ||
| 209 | - { | ||
| 210 | - shaFirstShift += FB_UNIT; | ||
| 211 | - shaLine++; | ||
| 212 | + if (scr_y + h > scr_y2) | ||
| 213 | + h = scr_y2 - scr_y; | ||
| 214 | + if (scr_x + w > scr_x2) | ||
| 215 | + w = scr_x2 - scr_x; | ||
| 216 | + w = (w * shaBpp) >> FB_SHIFT; | ||
| 217 | + | ||
| 218 | + shadowUpdateRotatePackedSubRectangle | ||
| 219 | + (pBuf, | ||
| 220 | + sha, shaShift, | ||
| 221 | + shaStepOverX, shaStepOverY, | ||
| 222 | + shaStepDownX, shaStepDownY, | ||
| 223 | + shaBpp, shaMask, | ||
| 224 | + pScreen, | ||
| 225 | + scr_x, scr_y, | ||
| 226 | + h, w, | ||
| 227 | + pixelsPerBits); | ||
| 228 | + | ||
| 229 | + shaShift -= BLOCKSIZE_WIDTH * shaStepOverX; | ||
| 230 | + sha += BLOCKSIZE_WIDTH * shaStepOverY; | ||
| 231 | + sha -= (shaShift >> FB_SHIFT); | ||
| 232 | + shaShift &= FB_MASK; | ||
| 233 | } | ||
| 234 | - shaLine += shaStepDownY; | ||
| 235 | + shaFirstShift -= BLOCKSIZE_HEIGHT * shaStepDownX; | ||
| 236 | + shaLine += BLOCKSIZE_HEIGHT * shaStepDownY; | ||
| 237 | + shaLine -= (shaFirstShift >> FB_SHIFT); | ||
| 238 | + shaFirstShift &= FB_MASK; | ||
| 239 | } | ||
| 240 | } | ||
| 241 | } | ||
diff --git a/openembedded/packages/xserver/xserver-kdrive_20050207.bb b/openembedded/packages/xserver/xserver-kdrive_20050207.bb index 65f1420096..48ae523c77 100644 --- a/openembedded/packages/xserver/xserver-kdrive_20050207.bb +++ b/openembedded/packages/xserver/xserver-kdrive_20050207.bb | |||
| @@ -20,7 +20,7 @@ DESCRIPTION_xserver-kdrive-epson = "X server from freedesktop.org, supporting Ep | |||
| 20 | DESCRIPTION_xserver-kdrive-fake = "Fake X server" | 20 | DESCRIPTION_xserver-kdrive-fake = "Fake X server" |
| 21 | DESCRIPTION_xserver-kdrive-xephyr = "X server in an X window" | 21 | DESCRIPTION_xserver-kdrive-xephyr = "X server in an X window" |
| 22 | 22 | ||
| 23 | PR = "r4" | 23 | PR = "r5" |
| 24 | 24 | ||
| 25 | FILES_xserver-kdrive-fbdev = "${bindir}/Xfbdev" | 25 | FILES_xserver-kdrive-fbdev = "${bindir}/Xfbdev" |
| 26 | FILES_xserver-kdrive-ati = "${bindir}/Xati" | 26 | FILES_xserver-kdrive-ati = "${bindir}/Xati" |
| @@ -35,6 +35,7 @@ FILES_xserver-kdrive-xephyr = "${bindir}/Xephyr" | |||
| 35 | 35 | ||
| 36 | SRC_URI = "cvs://anoncvs:anoncvs@pdx.freedesktop.org/cvs/xserver;module=xserver;date=${FIXEDCVSDATE} \ | 36 | SRC_URI = "cvs://anoncvs:anoncvs@pdx.freedesktop.org/cvs/xserver;module=xserver;date=${FIXEDCVSDATE} \ |
| 37 | file://kmode.patch;patch=1 \ | 37 | file://kmode.patch;patch=1 \ |
| 38 | file://faster-rotated.patch;patch=1 \ | ||
| 38 | file://fbdev-not-fix.patch;patch=1 " | 39 | file://fbdev-not-fix.patch;patch=1 " |
| 39 | 40 | ||
| 40 | SRC_URI_append_mnci = " file://onlyfb.patch;patch=1 \ | 41 | SRC_URI_append_mnci = " file://onlyfb.patch;patch=1 \ |
