Blame SOURCES/kvm-cirrus-stop-passing-around-src-pointers-in-the-blitt.patch

619821
From cc965429746aac94b7c37991f676dcd323ef212d Mon Sep 17 00:00:00 2001
976a86
From: Gerd Hoffmann <kraxel@redhat.com>
619821
Date: Mon, 27 Mar 2017 10:01:21 +0200
976a86
Subject: [PATCH 6/7] cirrus: stop passing around src pointers in the blitter
976a86
976a86
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
619821
Message-id: <1490608882-10242-7-git-send-email-kraxel@redhat.com>
619821
Patchwork-id: 74549
619821
O-Subject: [RHEL-7.4 qemu-kvm PATCH v2 6/7] cirrus: stop passing around src pointers in the blitter
619821
Bugzilla: 1430060
976a86
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
976a86
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
619821
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
976a86
976a86
Does basically the same as "cirrus: stop passing around dst pointers in
976a86
the blitter", just for the src pointer instead of the dst pointer.
976a86
976a86
For the src we have to care about cputovideo blits though and fetch the
976a86
data from s->cirrus_bltbuf instead of vga memory.  The cirrus_src*()
976a86
helper functions handle that.
976a86
976a86
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
976a86
Message-id: 1489584487-3489-1-git-send-email-kraxel@redhat.com
976a86
(cherry picked from commit ffaf857778286ca54e3804432a2369a279e73aa7)
976a86
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
976a86
---
976a86
 hw/display/cirrus_vga.c      | 61 +++++++++++++++++++++++++++++++++++---------
976a86
 hw/display/cirrus_vga_rop.h  | 48 +++++++++++++++++-----------------
976a86
 hw/display/cirrus_vga_rop2.h | 38 ++++++++++++++-------------
976a86
 3 files changed, 93 insertions(+), 54 deletions(-)
976a86
976a86
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
976a86
index 003cc4c..c1324ab 100644
976a86
--- a/hw/display/cirrus_vga.c
976a86
+++ b/hw/display/cirrus_vga.c
976a86
@@ -174,7 +174,7 @@
976a86
 
976a86
 struct CirrusVGAState;
976a86
 typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
976a86
-                                     uint32_t dstaddr, const uint8_t *src,
976a86
+                                     uint32_t dstaddr, uint32_t srcaddr,
976a86
 				     int dstpitch, int srcpitch,
976a86
 				     int bltwidth, int bltheight);
976a86
 typedef void (*cirrus_fill_t)(struct CirrusVGAState *s,
976a86
@@ -316,7 +316,7 @@ static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only)
976a86
 }
976a86
 
976a86
 static void cirrus_bitblt_rop_nop(CirrusVGAState *s,
976a86
-                                  uint32_t dstaddr, const uint8_t *src,
976a86
+                                  uint32_t dstaddr, uint32_t srcaddr,
976a86
                                   int dstpitch,int srcpitch,
976a86
                                   int bltwidth,int bltheight)
976a86
 {
976a86
@@ -328,6 +328,45 @@ static void cirrus_bitblt_fill_nop(CirrusVGAState *s,
976a86
 {
976a86
 }
976a86
 
976a86
+static inline uint8_t cirrus_src(CirrusVGAState *s, uint32_t srcaddr)
976a86
+{
976a86
+    if (s->cirrus_srccounter) {
976a86
+        /* cputovideo */
976a86
+        return s->cirrus_bltbuf[srcaddr & (CIRRUS_BLTBUFSIZE - 1)];
976a86
+    } else {
976a86
+        /* videotovideo */
976a86
+        return s->vga.vram_ptr[srcaddr & s->cirrus_addr_mask];
976a86
+    }
976a86
+}
976a86
+
976a86
+static inline uint16_t cirrus_src16(CirrusVGAState *s, uint32_t srcaddr)
976a86
+{
976a86
+    uint16_t *src;
976a86
+
976a86
+    if (s->cirrus_srccounter) {
976a86
+        /* cputovideo */
976a86
+        src = (void *)&s->cirrus_bltbuf[srcaddr & (CIRRUS_BLTBUFSIZE - 1) & ~1];
976a86
+    } else {
976a86
+        /* videotovideo */
976a86
+        src = (void *)&s->vga.vram_ptr[srcaddr & s->cirrus_addr_mask & ~1];
976a86
+    }
976a86
+    return *src;
976a86
+}
976a86
+
976a86
+static inline uint32_t cirrus_src32(CirrusVGAState *s, uint32_t srcaddr)
976a86
+{
976a86
+    uint32_t *src;
976a86
+
976a86
+    if (s->cirrus_srccounter) {
976a86
+        /* cputovideo */
976a86
+        src = (void *)&s->cirrus_bltbuf[srcaddr & (CIRRUS_BLTBUFSIZE - 1) & ~3];
976a86
+    } else {
976a86
+        /* videotovideo */
976a86
+        src = (void *)&s->vga.vram_ptr[srcaddr & s->cirrus_addr_mask & ~3];
976a86
+    }
976a86
+    return *src;
976a86
+}
976a86
+
976a86
 #define ROP_NAME 0
976a86
 #define ROP_FN(d, s) 0
976a86
 #include "cirrus_vga_rop.h"
976a86
@@ -670,10 +709,10 @@ static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
976a86
     }
976a86
 }
976a86
 
976a86
-static int cirrus_bitblt_common_patterncopy(CirrusVGAState *s, bool videosrc)
976a86
+static int cirrus_bitblt_common_patterncopy(CirrusVGAState *s)
976a86
 {
976a86
     uint32_t patternsize;
976a86
-    uint8_t *src;
976a86
+    bool videosrc = !s->cirrus_srccounter;
976a86
 
976a86
     if (videosrc) {
976a86
         switch (s->vga.get_bpp(&s->vga)) {
976a86
@@ -694,16 +733,14 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState *s, bool videosrc)
976a86
         if (s->cirrus_blt_srcaddr + patternsize > s->vga.vram_size) {
976a86
             return 0;
976a86
         }
976a86
-        src = s->vga.vram_ptr + s->cirrus_blt_srcaddr;
976a86
-    } else {
976a86
-        src = s->cirrus_bltbuf;
976a86
     }
976a86
 
976a86
     if (blit_is_unsafe(s, true)) {
976a86
         return 0;
976a86
     }
976a86
 
976a86
-    (*s->cirrus_rop) (s, s->cirrus_blt_dstaddr, src,
976a86
+    (*s->cirrus_rop) (s, s->cirrus_blt_dstaddr,
976a86
+                      videosrc ? s->cirrus_blt_srcaddr : 0,
976a86
                       s->cirrus_blt_dstpitch, 0,
976a86
                       s->cirrus_blt_width, s->cirrus_blt_height);
976a86
     cirrus_invalidate_region(s, s->cirrus_blt_dstaddr,
976a86
@@ -740,7 +777,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
976a86
 
976a86
 static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
976a86
 {
976a86
-    return cirrus_bitblt_common_patterncopy(s, true);
976a86
+    return cirrus_bitblt_common_patterncopy(s);
976a86
 }
976a86
 
976a86
 static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
976a86
@@ -790,7 +827,7 @@ static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
976a86
     }
976a86
 
976a86
     (*s->cirrus_rop) (s, s->cirrus_blt_dstaddr,
976a86
-                      s->vga.vram_ptr + s->cirrus_blt_srcaddr,
976a86
+                      s->cirrus_blt_srcaddr,
976a86
 		      s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
976a86
 		      s->cirrus_blt_width, s->cirrus_blt_height);
976a86
 
976a86
@@ -833,7 +870,7 @@ static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)
976a86
 
976a86
     if (s->cirrus_srccounter > 0) {
976a86
         if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
976a86
-            cirrus_bitblt_common_patterncopy(s, false);
976a86
+            cirrus_bitblt_common_patterncopy(s);
976a86
         the_end:
976a86
             s->cirrus_srccounter = 0;
976a86
             cirrus_bitblt_reset(s);
976a86
@@ -841,7 +878,7 @@ static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)
976a86
             /* at least one scan line */
976a86
             do {
976a86
                 (*s->cirrus_rop)(s, s->cirrus_blt_dstaddr,
976a86
-                                  s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);
976a86
+                                 0, 0, 0, s->cirrus_blt_width, 1);
976a86
                 cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,
976a86
                                          s->cirrus_blt_width, 1);
976a86
                 s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;
976a86
diff --git a/hw/display/cirrus_vga_rop.h b/hw/display/cirrus_vga_rop.h
976a86
index 3b16d70..16dffb8 100644
976a86
--- a/hw/display/cirrus_vga_rop.h
976a86
+++ b/hw/display/cirrus_vga_rop.h
976a86
@@ -78,7 +78,7 @@ static inline void glue(rop_32_, ROP_NAME)(CirrusVGAState *s,
976a86
 static void
976a86
 glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
976a86
                                        uint32_t dstaddr,
976a86
-                                       const uint8_t *src,
976a86
+                                       uint32_t srcaddr,
976a86
                                        int dstpitch, int srcpitch,
976a86
                                        int bltwidth, int bltheight)
976a86
 {
976a86
@@ -93,19 +93,19 @@ glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
976a86
 
976a86
     for (y = 0; y < bltheight; y++) {
976a86
         for (x = 0; x < bltwidth; x++) {
976a86
-            ROP_OP(s, dstaddr, *src);
976a86
+            ROP_OP(s, dstaddr, cirrus_src(s, srcaddr));
976a86
             dstaddr++;
976a86
-            src++;
976a86
+            srcaddr++;
976a86
         }
976a86
         dstaddr += dstpitch;
976a86
-        src += srcpitch;
976a86
+        srcaddr += srcpitch;
976a86
     }
976a86
 }
976a86
 
976a86
 static void
976a86
 glue(cirrus_bitblt_rop_bkwd_, ROP_NAME)(CirrusVGAState *s,
976a86
                                         uint32_t dstaddr,
976a86
-                                        const uint8_t *src,
976a86
+                                        uint32_t srcaddr,
976a86
                                         int dstpitch, int srcpitch,
976a86
                                         int bltwidth, int bltheight)
976a86
 {
976a86
@@ -114,19 +114,19 @@ glue(cirrus_bitblt_rop_bkwd_, ROP_NAME)(CirrusVGAState *s,
976a86
     srcpitch += bltwidth;
976a86
     for (y = 0; y < bltheight; y++) {
976a86
         for (x = 0; x < bltwidth; x++) {
976a86
-            ROP_OP(s, dstaddr, *src);
976a86
+            ROP_OP(s, dstaddr, cirrus_src(s, srcaddr));
976a86
             dstaddr--;
976a86
-            src--;
976a86
+            srcaddr--;
976a86
         }
976a86
         dstaddr += dstpitch;
976a86
-        src += srcpitch;
976a86
+        srcaddr += srcpitch;
976a86
     }
976a86
 }
976a86
 
976a86
 static void
976a86
 glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_8)(CirrusVGAState *s,
976a86
                                                        uint32_t dstaddr,
976a86
-                                                       const uint8_t *src,
976a86
+                                                       uint32_t srcaddr,
976a86
                                                        int dstpitch,
976a86
                                                        int srcpitch,
976a86
                                                        int bltwidth,
976a86
@@ -143,19 +143,19 @@ glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_8)(CirrusVGAState *s,
976a86
 
976a86
     for (y = 0; y < bltheight; y++) {
976a86
         for (x = 0; x < bltwidth; x++) {
976a86
-            ROP_OP_TR(s, dstaddr, *src, transp);
976a86
+            ROP_OP_TR(s, dstaddr, cirrus_src(s, srcaddr), transp);
976a86
             dstaddr++;
976a86
-            src++;
976a86
+            srcaddr++;
976a86
         }
976a86
         dstaddr += dstpitch;
976a86
-        src += srcpitch;
976a86
+        srcaddr += srcpitch;
976a86
     }
976a86
 }
976a86
 
976a86
 static void
976a86
 glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_8)(CirrusVGAState *s,
976a86
                                                         uint32_t dstaddr,
976a86
-                                                        const uint8_t *src,
976a86
+                                                        uint32_t srcaddr,
976a86
                                                         int dstpitch,
976a86
                                                         int srcpitch,
976a86
                                                         int bltwidth,
976a86
@@ -167,19 +167,19 @@ glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_8)(CirrusVGAState *s,
976a86
     srcpitch += bltwidth;
976a86
     for (y = 0; y < bltheight; y++) {
976a86
         for (x = 0; x < bltwidth; x++) {
976a86
-            ROP_OP_TR(s, dstaddr, *src, transp);
976a86
+            ROP_OP_TR(s, dstaddr, cirrus_src(s, srcaddr), transp);
976a86
             dstaddr--;
976a86
-            src--;
976a86
+            srcaddr--;
976a86
         }
976a86
         dstaddr += dstpitch;
976a86
-        src += srcpitch;
976a86
+        srcaddr += srcpitch;
976a86
     }
976a86
 }
976a86
 
976a86
 static void
976a86
 glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
976a86
                                                         uint32_t dstaddr,
976a86
-                                                        const uint8_t *src,
976a86
+                                                        uint32_t srcaddr,
976a86
                                                         int dstpitch,
976a86
                                                         int srcpitch,
976a86
                                                         int bltwidth,
976a86
@@ -196,19 +196,19 @@ glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
976a86
 
976a86
     for (y = 0; y < bltheight; y++) {
976a86
         for (x = 0; x < bltwidth; x+=2) {
976a86
-            ROP_OP_TR_16(s, dstaddr, *(uint16_t *)src, transp);
976a86
+            ROP_OP_TR_16(s, dstaddr, cirrus_src16(s, srcaddr), transp);
976a86
             dstaddr += 2;
976a86
-            src += 2;
976a86
+            srcaddr += 2;
976a86
         }
976a86
         dstaddr += dstpitch;
976a86
-        src += srcpitch;
976a86
+        srcaddr += srcpitch;
976a86
     }
976a86
 }
976a86
 
976a86
 static void
976a86
 glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
976a86
                                                          uint32_t dstaddr,
976a86
-                                                         const uint8_t *src,
976a86
+                                                         uint32_t srcaddr,
976a86
                                                          int dstpitch,
976a86
                                                          int srcpitch,
976a86
                                                          int bltwidth,
976a86
@@ -220,12 +220,12 @@ glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
976a86
     srcpitch += bltwidth;
976a86
     for (y = 0; y < bltheight; y++) {
976a86
         for (x = 0; x < bltwidth; x+=2) {
976a86
-            ROP_OP_TR_16(s, dstaddr, *(uint16_t *)src, transp);
976a86
+            ROP_OP_TR_16(s, dstaddr, cirrus_src16(s, srcaddr), transp);
976a86
             dstaddr -= 2;
976a86
-            src -= 2;
976a86
+            srcaddr -= 2;
976a86
         }
976a86
         dstaddr += dstpitch;
976a86
-        src += srcpitch;
976a86
+        srcaddr += srcpitch;
976a86
     }
976a86
 }
976a86
 
976a86
diff --git a/hw/display/cirrus_vga_rop2.h b/hw/display/cirrus_vga_rop2.h
976a86
index bc92f0e..b86bcd6 100644
976a86
--- a/hw/display/cirrus_vga_rop2.h
976a86
+++ b/hw/display/cirrus_vga_rop2.h
976a86
@@ -41,14 +41,14 @@
976a86
 static void
976a86
 glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH)
976a86
      (CirrusVGAState *s, uint32_t dstaddr,
976a86
-      const uint8_t *src,
976a86
+      uint32_t srcaddr,
976a86
       int dstpitch, int srcpitch,
976a86
       int bltwidth, int bltheight)
976a86
 {
976a86
     uint32_t addr;
976a86
     int x, y, pattern_y, pattern_pitch, pattern_x;
976a86
     unsigned int col;
976a86
-    const uint8_t *src1;
976a86
+    uint32_t src1addr;
976a86
 #if DEPTH == 24
976a86
     int skipleft = s->vga.gr[0x2f] & 0x1f;
976a86
 #else
976a86
@@ -66,22 +66,24 @@ glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH)
976a86
     for(y = 0; y < bltheight; y++) {
976a86
         pattern_x = skipleft;
976a86
         addr = dstaddr + skipleft;
976a86
-        src1 = src + pattern_y * pattern_pitch;
976a86
+        src1addr = srcaddr + pattern_y * pattern_pitch;
976a86
         for (x = skipleft; x < bltwidth; x += (DEPTH / 8)) {
976a86
 #if DEPTH == 8
976a86
-            col = src1[pattern_x];
976a86
+            col = cirrus_src(s, src1addr + pattern_x);
976a86
             pattern_x = (pattern_x + 1) & 7;
976a86
 #elif DEPTH == 16
976a86
-            col = ((uint16_t *)(src1 + pattern_x))[0];
976a86
+            col = cirrus_src16(s, src1addr + pattern_x);
976a86
             pattern_x = (pattern_x + 2) & 15;
976a86
 #elif DEPTH == 24
976a86
             {
976a86
-                const uint8_t *src2 = src1 + pattern_x * 3;
976a86
-                col = src2[0] | (src2[1] << 8) | (src2[2] << 16);
976a86
+                uint32_t src2addr = src1addr + pattern_x * 3;
976a86
+                col = cirrus_src(s, src2addr) |
976a86
+                    (cirrus_src(s, src2addr + 1) << 8) |
976a86
+                    (cirrus_src(s, src2addr + 2) << 16);
976a86
                 pattern_x = (pattern_x + 1) & 7;
976a86
             }
976a86
 #else
976a86
-            col = ((uint32_t *)(src1 + pattern_x))[0];
976a86
+            col = cirrus_src32(s, src1addr + pattern_x);
976a86
             pattern_x = (pattern_x + 4) & 31;
976a86
 #endif
976a86
             PUTPIXEL(s, addr, col);
976a86
@@ -96,7 +98,7 @@ glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH)
976a86
 static void
976a86
 glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
976a86
      (CirrusVGAState *s, uint32_t dstaddr,
976a86
-      const uint8_t *src,
976a86
+      uint32_t srcaddr,
976a86
       int dstpitch, int srcpitch,
976a86
       int bltwidth, int bltheight)
976a86
 {
976a86
@@ -124,12 +126,12 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
976a86
 
976a86
     for(y = 0; y < bltheight; y++) {
976a86
         bitmask = 0x80 >> srcskipleft;
976a86
-        bits = *src++ ^ bits_xor;
976a86
+        bits = cirrus_src(s, srcaddr++) ^ bits_xor;
976a86
         addr = dstaddr + dstskipleft;
976a86
         for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
976a86
             if ((bitmask & 0xff) == 0) {
976a86
                 bitmask = 0x80;
976a86
-                bits = *src++ ^ bits_xor;
976a86
+                bits = cirrus_src(s, srcaddr++) ^ bits_xor;
976a86
             }
976a86
             index = (bits & bitmask);
976a86
             if (index) {
976a86
@@ -145,7 +147,7 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
976a86
 static void
976a86
 glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH)
976a86
      (CirrusVGAState *s, uint32_t dstaddr,
976a86
-      const uint8_t *src,
976a86
+      uint32_t srcaddr,
976a86
       int dstpitch, int srcpitch,
976a86
       int bltwidth, int bltheight)
976a86
 {
976a86
@@ -162,12 +164,12 @@ glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH)
976a86
     colors[1] = s->cirrus_blt_fgcol;
976a86
     for(y = 0; y < bltheight; y++) {
976a86
         bitmask = 0x80 >> srcskipleft;
976a86
-        bits = *src++;
976a86
+        bits = cirrus_src(s, srcaddr++);
976a86
         addr = dstaddr + dstskipleft;
976a86
         for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
976a86
             if ((bitmask & 0xff) == 0) {
976a86
                 bitmask = 0x80;
976a86
-                bits = *src++;
976a86
+                bits = cirrus_src(s, srcaddr++);
976a86
             }
976a86
             col = colors[!!(bits & bitmask)];
976a86
             PUTPIXEL(s, addr, col);
976a86
@@ -181,7 +183,7 @@ glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH)
976a86
 static void
976a86
 glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH)
976a86
      (CirrusVGAState *s, uint32_t dstaddr,
976a86
-      const uint8_t *src,
976a86
+      uint32_t srcaddr,
976a86
       int dstpitch, int srcpitch,
976a86
       int bltwidth, int bltheight)
976a86
 {
976a86
@@ -207,7 +209,7 @@ glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH)
976a86
     pattern_y = s->cirrus_blt_srcaddr & 7;
976a86
 
976a86
     for(y = 0; y < bltheight; y++) {
976a86
-        bits = src[pattern_y] ^ bits_xor;
976a86
+        bits = cirrus_src(s, srcaddr + pattern_y) ^ bits_xor;
976a86
         bitpos = 7 - srcskipleft;
976a86
         addr = dstaddr + dstskipleft;
976a86
         for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
976a86
@@ -225,7 +227,7 @@ glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH)
976a86
 static void
976a86
 glue(glue(glue(cirrus_colorexpand_pattern_, ROP_NAME), _),DEPTH)
976a86
      (CirrusVGAState *s, uint32_t dstaddr,
976a86
-      const uint8_t *src,
976a86
+      uint32_t srcaddr,
976a86
       int dstpitch, int srcpitch,
976a86
       int bltwidth, int bltheight)
976a86
 {
976a86
@@ -242,7 +244,7 @@ glue(glue(glue(cirrus_colorexpand_pattern_, ROP_NAME), _),DEPTH)
976a86
     pattern_y = s->cirrus_blt_srcaddr & 7;
976a86
 
976a86
     for(y = 0; y < bltheight; y++) {
976a86
-        bits = src[pattern_y];
976a86
+        bits = cirrus_src(s, srcaddr + pattern_y);
976a86
         bitpos = 7 - srcskipleft;
976a86
         addr = dstaddr + dstskipleft;
976a86
         for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
976a86
-- 
976a86
1.8.3.1
976a86