]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/extra/0003-cirrus-fix-blit-address-mask-handling.patch
import stable-4 build files
[pve-qemu.git] / debian / patches / extra / 0003-cirrus-fix-blit-address-mask-handling.patch
1 From a173829e6ebd8b2d7f29028f106173ba067c8b8c Mon Sep 17 00:00:00 2001
2 From: Gerd Hoffmann <kraxel@redhat.com>
3 Date: Wed, 25 Jan 2017 11:09:56 +0100
4 Subject: [PATCH 3/4] cirrus: fix blit address mask handling
5
6 Apply the cirrus_addr_mask to cirrus_blt_dstaddr and cirrus_blt_srcaddr
7 right after assigning them, in cirrus_bitblt_start(), instead of having
8 this all over the place in the cirrus code, and missing a few places.
9
10 Reported-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
11 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 Message-id: 1485338996-17095-1-git-send-email-kraxel@redhat.com
13 ---
14 hw/display/cirrus_vga.c | 25 ++++++++++++-------------
15 1 file changed, 12 insertions(+), 13 deletions(-)
16
17 diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
18 index 98f089e..7db6409 100644
19 --- a/hw/display/cirrus_vga.c
20 +++ b/hw/display/cirrus_vga.c
21 @@ -309,7 +309,7 @@ static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only,
22 }
23
24 if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
25 - s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
26 + s->cirrus_blt_dstaddr)) {
27 return true;
28 }
29 if (dst_only) {
30 @@ -322,7 +322,7 @@ static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only,
31 }
32
33 if (blit_region_is_unsafe(s, check_pitch,
34 - s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
35 + s->cirrus_blt_srcaddr)) {
36 return true;
37 }
38
39 @@ -689,7 +689,7 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
40 {
41 uint8_t *dst;
42
43 - dst = s->vga.vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
44 + dst = s->vga.vram_ptr + s->cirrus_blt_dstaddr;
45
46 if (blit_is_unsafe(s, false, true)) {
47 return 0;
48 @@ -714,7 +714,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
49 return 0;
50 }
51 rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
52 - rop_func(s, s->vga.vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
53 + rop_func(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,
54 s->cirrus_blt_dstpitch,
55 s->cirrus_blt_width, s->cirrus_blt_height);
56 cirrus_invalidate_region(s, s->cirrus_blt_dstaddr,
57 @@ -732,9 +732,8 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
58
59 static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
60 {
61 - return cirrus_bitblt_common_patterncopy(s,
62 - s->vga.vram_ptr + ((s->cirrus_blt_srcaddr & ~7) &
63 - s->cirrus_addr_mask));
64 + return cirrus_bitblt_common_patterncopy(s, s->vga.vram_ptr +
65 + (s->cirrus_blt_srcaddr & ~7));
66 }
67
68 static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
69 @@ -788,10 +787,8 @@ static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
70 if (notify)
71 graphic_hw_update(s->vga.con);
72
73 - (*s->cirrus_rop) (s, s->vga.vram_ptr +
74 - (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
75 - s->vga.vram_ptr +
76 - (s->cirrus_blt_srcaddr & s->cirrus_addr_mask),
77 + (*s->cirrus_rop) (s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,
78 + s->vga.vram_ptr + s->cirrus_blt_srcaddr,
79 s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
80 s->cirrus_blt_width, s->cirrus_blt_height);
81
82 @@ -842,8 +839,7 @@ static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)
83 } else {
84 /* at least one scan line */
85 do {
86 - (*s->cirrus_rop)(s, s->vga.vram_ptr +
87 - (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
88 + (*s->cirrus_rop)(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,
89 s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);
90 cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,
91 s->cirrus_blt_width, 1);
92 @@ -962,6 +958,9 @@ static void cirrus_bitblt_start(CirrusVGAState * s)
93 s->cirrus_blt_modeext = s->vga.gr[0x33];
94 blt_rop = s->vga.gr[0x32];
95
96 + s->cirrus_blt_dstaddr &= s->cirrus_addr_mask;
97 + s->cirrus_blt_srcaddr &= s->cirrus_addr_mask;
98 +
99 #ifdef DEBUG_BITBLT
100 printf("rop=0x%02x mode=0x%02x modeext=0x%02x w=%d h=%d dpitch=%d spitch=%d daddr=0x%08x saddr=0x%08x writemask=0x%02x\n",
101 blt_rop,
102 --
103 2.1.4
104