First import
[xorg_rtime.git] / xorg-server-1.4 / fb / fbblt.c
blob837c3a239a8cb7ba3bfab99f192ef6888c1df165
1 /*
2 * Copyright © 1998 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Keith Packard not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission. Keith Packard makes no
11 * representations about the suitability of this software for any purpose. It
12 * is provided "as is" without express or implied warranty.
14 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
23 #ifdef HAVE_DIX_CONFIG_H
24 #include <dix-config.h>
25 #endif
27 #include <string.h>
28 #include "fb.h"
30 #define InitializeShifts(sx,dx,ls,rs) { \
31 if (sx != dx) { \
32 if (sx > dx) { \
33 ls = sx - dx; \
34 rs = FB_UNIT - ls; \
35 } else { \
36 rs = dx - sx; \
37 ls = FB_UNIT - rs; \
38 } \
39 } \
42 void
43 fbBlt (FbBits *srcLine,
44 FbStride srcStride,
45 int srcX,
47 FbBits *dstLine,
48 FbStride dstStride,
49 int dstX,
51 int width,
52 int height,
54 int alu,
55 FbBits pm,
56 int bpp,
58 Bool reverse,
59 Bool upsidedown)
61 FbBits *src, *dst;
62 int leftShift, rightShift;
63 FbBits startmask, endmask;
64 FbBits bits, bits1;
65 int n, nmiddle;
66 Bool destInvarient;
67 int startbyte, endbyte;
68 FbDeclareMergeRop ();
70 #ifdef FB_24BIT
71 if (bpp == 24 && !FbCheck24Pix (pm))
73 fbBlt24 (srcLine, srcStride, srcX, dstLine, dstStride, dstX,
74 width, height, alu, pm, reverse, upsidedown);
75 return;
77 #endif
79 if (alu == GXcopy && pm == FB_ALLONES && !reverse &&
80 !(srcX & 7) && !(dstX & 7) && !(width & 7)) {
81 int i;
82 CARD8 *src = (CARD8 *) srcLine;
83 CARD8 *dst = (CARD8 *) dstLine;
85 srcStride *= sizeof(FbBits);
86 dstStride *= sizeof(FbBits);
87 width >>= 3;
88 src += (srcX >> 3);
89 dst += (dstX >> 3);
91 if (!upsidedown)
92 for (i = 0; i < height; i++)
93 MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
94 else
95 for (i = height - 1; i >= 0; i--)
96 MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
98 return;
101 FbInitializeMergeRop(alu, pm);
102 destInvarient = FbDestInvarientMergeRop();
103 if (upsidedown)
105 srcLine += (height - 1) * (srcStride);
106 dstLine += (height - 1) * (dstStride);
107 srcStride = -srcStride;
108 dstStride = -dstStride;
110 FbMaskBitsBytes (dstX, width, destInvarient, startmask, startbyte,
111 nmiddle, endmask, endbyte);
112 if (reverse)
114 srcLine += ((srcX + width - 1) >> FB_SHIFT) + 1;
115 dstLine += ((dstX + width - 1) >> FB_SHIFT) + 1;
116 srcX = (srcX + width - 1) & FB_MASK;
117 dstX = (dstX + width - 1) & FB_MASK;
119 else
121 srcLine += srcX >> FB_SHIFT;
122 dstLine += dstX >> FB_SHIFT;
123 srcX &= FB_MASK;
124 dstX &= FB_MASK;
126 if (srcX == dstX)
128 while (height--)
130 src = srcLine;
131 srcLine += srcStride;
132 dst = dstLine;
133 dstLine += dstStride;
134 if (reverse)
136 if (endmask)
138 bits = READ(--src);
139 --dst;
140 FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
142 n = nmiddle;
143 if (destInvarient)
145 while (n--)
146 WRITE(--dst, FbDoDestInvarientMergeRop(READ(--src)));
148 else
150 while (n--)
152 bits = READ(--src);
153 --dst;
154 WRITE(dst, FbDoMergeRop (bits, READ(dst)));
157 if (startmask)
159 bits = READ(--src);
160 --dst;
161 FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
164 else
166 if (startmask)
168 bits = READ(src++);
169 FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
170 dst++;
172 n = nmiddle;
173 if (destInvarient)
175 #if 0
177 * This provides some speedup on screen->screen blts
178 * over the PCI bus, usually about 10%. But fb
179 * isn't usually used for this operation...
181 if (_ca2 + 1 == 0 && _cx2 == 0)
183 FbBits t1, t2, t3, t4;
184 while (n >= 4)
186 t1 = *src++;
187 t2 = *src++;
188 t3 = *src++;
189 t4 = *src++;
190 *dst++ = t1;
191 *dst++ = t2;
192 *dst++ = t3;
193 *dst++ = t4;
194 n -= 4;
197 #endif
198 while (n--)
199 WRITE(dst++, FbDoDestInvarientMergeRop(READ(src++)));
201 else
203 while (n--)
205 bits = READ(src++);
206 WRITE(dst, FbDoMergeRop (bits, READ(dst)));
207 dst++;
210 if (endmask)
212 bits = READ(src);
213 FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
218 else
220 if (srcX > dstX)
222 leftShift = srcX - dstX;
223 rightShift = FB_UNIT - leftShift;
225 else
227 rightShift = dstX - srcX;
228 leftShift = FB_UNIT - rightShift;
230 while (height--)
232 src = srcLine;
233 srcLine += srcStride;
234 dst = dstLine;
235 dstLine += dstStride;
237 bits1 = 0;
238 if (reverse)
240 if (srcX < dstX)
241 bits1 = READ(--src);
242 if (endmask)
244 bits = FbScrRight(bits1, rightShift);
245 if (FbScrRight(endmask, leftShift))
247 bits1 = READ(--src);
248 bits |= FbScrLeft(bits1, leftShift);
250 --dst;
251 FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
253 n = nmiddle;
254 if (destInvarient)
256 while (n--)
258 bits = FbScrRight(bits1, rightShift);
259 bits1 = READ(--src);
260 bits |= FbScrLeft(bits1, leftShift);
261 --dst;
262 WRITE(dst, FbDoDestInvarientMergeRop(bits));
265 else
267 while (n--)
269 bits = FbScrRight(bits1, rightShift);
270 bits1 = READ(--src);
271 bits |= FbScrLeft(bits1, leftShift);
272 --dst;
273 WRITE(dst, FbDoMergeRop(bits, READ(dst)));
276 if (startmask)
278 bits = FbScrRight(bits1, rightShift);
279 if (FbScrRight(startmask, leftShift))
281 bits1 = READ(--src);
282 bits |= FbScrLeft(bits1, leftShift);
284 --dst;
285 FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
288 else
290 if (srcX > dstX)
291 bits1 = READ(src++);
292 if (startmask)
294 bits = FbScrLeft(bits1, leftShift);
295 if (FbScrLeft(startmask, rightShift))
297 bits1 = READ(src++);
298 bits |= FbScrRight(bits1, rightShift);
300 FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
301 dst++;
303 n = nmiddle;
304 if (destInvarient)
306 while (n--)
308 bits = FbScrLeft(bits1, leftShift);
309 bits1 = READ(src++);
310 bits |= FbScrRight(bits1, rightShift);
311 WRITE(dst, FbDoDestInvarientMergeRop(bits));
312 dst++;
315 else
317 while (n--)
319 bits = FbScrLeft(bits1, leftShift);
320 bits1 = READ(src++);
321 bits |= FbScrRight(bits1, rightShift);
322 WRITE(dst, FbDoMergeRop(bits, READ(dst)));
323 dst++;
326 if (endmask)
328 bits = FbScrLeft(bits1, leftShift);
329 if (FbScrLeft(endmask, rightShift))
331 bits1 = READ(src);
332 bits |= FbScrRight(bits1, rightShift);
334 FbDoRightMaskByteMergeRop (dst, bits, endbyte, endmask);
341 #ifdef FB_24BIT
343 #undef DEBUG_BLT24
344 #ifdef DEBUG_BLT24
346 static unsigned long
347 getPixel (char *src, int x)
349 unsigned long l;
351 l = 0;
352 memcpy (&l, src + x * 3, 3);
353 return l;
355 #endif
357 static void
358 fbBlt24Line (FbBits *src,
359 int srcX,
361 FbBits *dst,
362 int dstX,
364 int width,
366 int alu,
367 FbBits pm,
369 Bool reverse)
371 #ifdef DEBUG_BLT24
372 char *origDst = (char *) dst;
373 FbBits *origLine = dst + ((dstX >> FB_SHIFT) - 1);
374 int origNlw = ((width + FB_MASK) >> FB_SHIFT) + 3;
375 int origX = dstX / 24;
376 #endif
378 int leftShift, rightShift;
379 FbBits startmask, endmask;
380 int n;
382 FbBits bits, bits1;
383 FbBits mask;
385 int rot;
386 FbDeclareMergeRop ();
388 FbInitializeMergeRop (alu, FB_ALLONES);
389 FbMaskBits(dstX, width, startmask, n, endmask);
390 #ifdef DEBUG_BLT24
391 ErrorF ("dstX %d width %d reverse %d\n", dstX, width, reverse);
392 #endif
393 if (reverse)
395 src += ((srcX + width - 1) >> FB_SHIFT) + 1;
396 dst += ((dstX + width - 1) >> FB_SHIFT) + 1;
397 rot = FbFirst24Rot (((dstX + width - 8) & FB_MASK));
398 rot = FbPrev24Rot(rot);
399 #ifdef DEBUG_BLT24
400 ErrorF ("dstX + width - 8: %d rot: %d\n", (dstX + width - 8) & FB_MASK, rot);
401 #endif
402 srcX = (srcX + width - 1) & FB_MASK;
403 dstX = (dstX + width - 1) & FB_MASK;
405 else
407 src += srcX >> FB_SHIFT;
408 dst += dstX >> FB_SHIFT;
409 srcX &= FB_MASK;
410 dstX &= FB_MASK;
411 rot = FbFirst24Rot (dstX);
412 #ifdef DEBUG_BLT24
413 ErrorF ("dstX: %d rot: %d\n", dstX, rot);
414 #endif
416 mask = FbRot24(pm,rot);
417 #ifdef DEBUG_BLT24
418 ErrorF ("pm 0x%x mask 0x%x\n", pm, mask);
419 #endif
420 if (srcX == dstX)
422 if (reverse)
424 if (endmask)
426 bits = READ(--src);
427 --dst;
428 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
429 mask = FbPrev24Pix (mask);
431 while (n--)
433 bits = READ(--src);
434 --dst;
435 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
436 mask = FbPrev24Pix (mask);
438 if (startmask)
440 bits = READ(--src);
441 --dst;
442 WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
445 else
447 if (startmask)
449 bits = READ(src++);
450 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
451 dst++;
452 mask = FbNext24Pix(mask);
454 while (n--)
456 bits = READ(src++);
457 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
458 dst++;
459 mask = FbNext24Pix(mask);
461 if (endmask)
463 bits = READ(src);
464 WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
468 else
470 if (srcX > dstX)
472 leftShift = srcX - dstX;
473 rightShift = FB_UNIT - leftShift;
475 else
477 rightShift = dstX - srcX;
478 leftShift = FB_UNIT - rightShift;
481 bits1 = 0;
482 if (reverse)
484 if (srcX < dstX)
485 bits1 = READ(--src);
486 if (endmask)
488 bits = FbScrRight(bits1, rightShift);
489 if (FbScrRight(endmask, leftShift))
491 bits1 = READ(--src);
492 bits |= FbScrLeft(bits1, leftShift);
494 --dst;
495 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
496 mask = FbPrev24Pix(mask);
498 while (n--)
500 bits = FbScrRight(bits1, rightShift);
501 bits1 = READ(--src);
502 bits |= FbScrLeft(bits1, leftShift);
503 --dst;
504 WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
505 mask = FbPrev24Pix(mask);
507 if (startmask)
509 bits = FbScrRight(bits1, rightShift);
510 if (FbScrRight(startmask, leftShift))
512 bits1 = READ(--src);
513 bits |= FbScrLeft(bits1, leftShift);
515 --dst;
516 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
519 else
521 if (srcX > dstX)
522 bits1 = READ(src++);
523 if (startmask)
525 bits = FbScrLeft(bits1, leftShift);
526 bits1 = READ(src++);
527 bits |= FbScrRight(bits1, rightShift);
528 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
529 dst++;
530 mask = FbNext24Pix(mask);
532 while (n--)
534 bits = FbScrLeft(bits1, leftShift);
535 bits1 = READ(src++);
536 bits |= FbScrRight(bits1, rightShift);
537 WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
538 dst++;
539 mask = FbNext24Pix(mask);
541 if (endmask)
543 bits = FbScrLeft(bits1, leftShift);
544 if (FbScrLeft(endmask, rightShift))
546 bits1 = READ(src);
547 bits |= FbScrRight(bits1, rightShift);
549 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
553 #ifdef DEBUG_BLT24
555 int firstx, lastx, x;
557 firstx = origX;
558 if (firstx)
559 firstx--;
560 lastx = origX + width/24 + 1;
561 for (x = firstx; x <= lastx; x++)
562 ErrorF ("%06x ", getPixel (origDst, x));
563 ErrorF ("\n");
564 while (origNlw--)
565 ErrorF ("%08x ", *origLine++);
566 ErrorF ("\n");
568 #endif
571 void
572 fbBlt24 (FbBits *srcLine,
573 FbStride srcStride,
574 int srcX,
576 FbBits *dstLine,
577 FbStride dstStride,
578 int dstX,
580 int width,
581 int height,
583 int alu,
584 FbBits pm,
586 Bool reverse,
587 Bool upsidedown)
589 if (upsidedown)
591 srcLine += (height-1) * srcStride;
592 dstLine += (height-1) * dstStride;
593 srcStride = -srcStride;
594 dstStride = -dstStride;
596 while (height--)
598 fbBlt24Line (srcLine, srcX, dstLine, dstX, width, alu, pm, reverse);
599 srcLine += srcStride;
600 dstLine += dstStride;
602 #ifdef DEBUG_BLT24
603 ErrorF ("\n");
604 #endif
606 #endif /* FB_24BIT */
608 #if FB_SHIFT == FB_STIP_SHIFT + 1
611 * Could be generalized to FB_SHIFT > FB_STIP_SHIFT + 1 by
612 * creating an ring of values stepped through for each line
615 void
616 fbBltOdd (FbBits *srcLine,
617 FbStride srcStrideEven,
618 FbStride srcStrideOdd,
619 int srcXEven,
620 int srcXOdd,
622 FbBits *dstLine,
623 FbStride dstStrideEven,
624 FbStride dstStrideOdd,
625 int dstXEven,
626 int dstXOdd,
628 int width,
629 int height,
631 int alu,
632 FbBits pm,
633 int bpp)
635 FbBits *src;
636 int leftShiftEven, rightShiftEven;
637 FbBits startmaskEven, endmaskEven;
638 int nmiddleEven;
640 FbBits *dst;
641 int leftShiftOdd, rightShiftOdd;
642 FbBits startmaskOdd, endmaskOdd;
643 int nmiddleOdd;
645 int leftShift, rightShift;
646 FbBits startmask, endmask;
647 int nmiddle;
649 int srcX, dstX;
651 FbBits bits, bits1;
652 int n;
654 Bool destInvarient;
655 Bool even;
656 FbDeclareMergeRop ();
658 FbInitializeMergeRop (alu, pm);
659 destInvarient = FbDestInvarientMergeRop();
661 srcLine += srcXEven >> FB_SHIFT;
662 dstLine += dstXEven >> FB_SHIFT;
663 srcXEven &= FB_MASK;
664 dstXEven &= FB_MASK;
665 srcXOdd &= FB_MASK;
666 dstXOdd &= FB_MASK;
668 FbMaskBits(dstXEven, width, startmaskEven, nmiddleEven, endmaskEven);
669 FbMaskBits(dstXOdd, width, startmaskOdd, nmiddleOdd, endmaskOdd);
671 even = TRUE;
672 InitializeShifts(srcXEven, dstXEven, leftShiftEven, rightShiftEven);
673 InitializeShifts(srcXOdd, dstXOdd, leftShiftOdd, rightShiftOdd);
674 while (height--)
676 src = srcLine;
677 dst = dstLine;
678 if (even)
680 srcX = srcXEven;
681 dstX = dstXEven;
682 startmask = startmaskEven;
683 endmask = endmaskEven;
684 nmiddle = nmiddleEven;
685 leftShift = leftShiftEven;
686 rightShift = rightShiftEven;
687 srcLine += srcStrideEven;
688 dstLine += dstStrideEven;
689 even = FALSE;
691 else
693 srcX = srcXOdd;
694 dstX = dstXOdd;
695 startmask = startmaskOdd;
696 endmask = endmaskOdd;
697 nmiddle = nmiddleOdd;
698 leftShift = leftShiftOdd;
699 rightShift = rightShiftOdd;
700 srcLine += srcStrideOdd;
701 dstLine += dstStrideOdd;
702 even = TRUE;
704 if (srcX == dstX)
706 if (startmask)
708 bits = READ(src++);
709 WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), startmask));
710 dst++;
712 n = nmiddle;
713 if (destInvarient)
715 while (n--)
717 bits = READ(src++);
718 WRITE(dst, FbDoDestInvarientMergeRop(bits));
719 dst++;
722 else
724 while (n--)
726 bits = READ(src++);
727 WRITE(dst, FbDoMergeRop (bits, READ(dst)));
728 dst++;
731 if (endmask)
733 bits = READ(src);
734 WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), endmask));
737 else
739 bits = 0;
740 if (srcX > dstX)
741 bits = READ(src++);
742 if (startmask)
744 bits1 = FbScrLeft(bits, leftShift);
745 bits = READ(src++);
746 bits1 |= FbScrRight(bits, rightShift);
747 WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), startmask));
748 dst++;
750 n = nmiddle;
751 if (destInvarient)
753 while (n--)
755 bits1 = FbScrLeft(bits, leftShift);
756 bits = READ(src++);
757 bits1 |= FbScrRight(bits, rightShift);
758 WRITE(dst, FbDoDestInvarientMergeRop(bits1));
759 dst++;
762 else
764 while (n--)
766 bits1 = FbScrLeft(bits, leftShift);
767 bits = READ(src++);
768 bits1 |= FbScrRight(bits, rightShift);
769 WRITE(dst, FbDoMergeRop(bits1, READ(dst)));
770 dst++;
773 if (endmask)
775 bits1 = FbScrLeft(bits, leftShift);
776 if (FbScrLeft(endmask, rightShift))
778 bits = READ(src);
779 bits1 |= FbScrRight(bits, rightShift);
781 WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), endmask));
787 #ifdef FB_24BIT
788 void
789 fbBltOdd24 (FbBits *srcLine,
790 FbStride srcStrideEven,
791 FbStride srcStrideOdd,
792 int srcXEven,
793 int srcXOdd,
795 FbBits *dstLine,
796 FbStride dstStrideEven,
797 FbStride dstStrideOdd,
798 int dstXEven,
799 int dstXOdd,
801 int width,
802 int height,
804 int alu,
805 FbBits pm)
807 Bool even = TRUE;
809 while (height--)
811 if (even)
813 fbBlt24Line (srcLine, srcXEven, dstLine, dstXEven,
814 width, alu, pm, FALSE);
815 srcLine += srcStrideEven;
816 dstLine += dstStrideEven;
817 even = FALSE;
819 else
821 fbBlt24Line (srcLine, srcXOdd, dstLine, dstXOdd,
822 width, alu, pm, FALSE);
823 srcLine += srcStrideOdd;
824 dstLine += dstStrideOdd;
825 even = TRUE;
828 #if 0
829 fprintf (stderr, "\n");
830 #endif
832 #endif
834 #endif
836 #if FB_STIP_SHIFT != FB_SHIFT
837 void
838 fbSetBltOdd (FbStip *stip,
839 FbStride stipStride,
840 int srcX,
841 FbBits **bits,
842 FbStride *strideEven,
843 FbStride *strideOdd,
844 int *srcXEven,
845 int *srcXOdd)
847 int srcAdjust;
848 int strideAdjust;
851 * bytes needed to align source
853 srcAdjust = (((int) stip) & (FB_MASK >> 3));
855 * FbStip units needed to align stride
857 strideAdjust = stipStride & (FB_MASK >> FB_STIP_SHIFT);
859 *bits = (FbBits *) ((char *) stip - srcAdjust);
860 if (srcAdjust)
862 *strideEven = FbStipStrideToBitsStride (stipStride + 1);
863 *strideOdd = FbStipStrideToBitsStride (stipStride);
865 *srcXEven = srcX + (srcAdjust << 3);
866 *srcXOdd = srcX + (srcAdjust << 3) - (strideAdjust << FB_STIP_SHIFT);
868 else
870 *strideEven = FbStipStrideToBitsStride (stipStride);
871 *strideOdd = FbStipStrideToBitsStride (stipStride + 1);
873 *srcXEven = srcX;
874 *srcXOdd = srcX + (strideAdjust << FB_STIP_SHIFT);
877 #endif
879 void
880 fbBltStip (FbStip *src,
881 FbStride srcStride, /* in FbStip units, not FbBits units */
882 int srcX,
884 FbStip *dst,
885 FbStride dstStride, /* in FbStip units, not FbBits units */
886 int dstX,
888 int width,
889 int height,
891 int alu,
892 FbBits pm,
893 int bpp)
895 #if FB_STIP_SHIFT != FB_SHIFT
896 if (FB_STIP_ODDSTRIDE(srcStride) || FB_STIP_ODDPTR(src) ||
897 FB_STIP_ODDSTRIDE(dstStride) || FB_STIP_ODDPTR(dst))
899 FbStride srcStrideEven, srcStrideOdd;
900 FbStride dstStrideEven, dstStrideOdd;
901 int srcXEven, srcXOdd;
902 int dstXEven, dstXOdd;
903 FbBits *s, *d;
904 int sx, dx;
906 src += srcX >> FB_STIP_SHIFT;
907 srcX &= FB_STIP_MASK;
908 dst += dstX >> FB_STIP_SHIFT;
909 dstX &= FB_STIP_MASK;
911 fbSetBltOdd (src, srcStride, srcX,
913 &srcStrideEven, &srcStrideOdd,
914 &srcXEven, &srcXOdd);
916 fbSetBltOdd (dst, dstStride, dstX,
918 &dstStrideEven, &dstStrideOdd,
919 &dstXEven, &dstXOdd);
921 #ifdef FB_24BIT
922 if (bpp == 24 && !FbCheck24Pix (pm))
924 fbBltOdd24 (s, srcStrideEven, srcStrideOdd,
925 srcXEven, srcXOdd,
927 d, dstStrideEven, dstStrideOdd,
928 dstXEven, dstXOdd,
930 width, height, alu, pm);
932 else
933 #endif
935 fbBltOdd (s, srcStrideEven, srcStrideOdd,
936 srcXEven, srcXOdd,
938 d, dstStrideEven, dstStrideOdd,
939 dstXEven, dstXOdd,
941 width, height, alu, pm, bpp);
944 else
945 #endif
947 fbBlt ((FbBits *) src, FbStipStrideToBitsStride (srcStride),
948 srcX,
949 (FbBits *) dst, FbStipStrideToBitsStride (dstStride),
950 dstX,
951 width, height,
952 alu, pm, bpp, FALSE, FALSE);