more cirrus fixes
[pve-qemu-kvm.git] / debian / patches / extra / 0002-Revert-cirrus-allow-zero-source-pitch-in-pattern-fil.patch
blob0b8e6edde2beaf0ec1c0beee06df371f5787bb7b
1 From cba280fe94eaed53952e2997cac1ee2bed6cfdee Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Fri, 10 Feb 2017 08:34:03 +0100
4 Subject: [PATCH 2/2] Revert "cirrus: allow zero source pitch in pattern fill
5 rops"
7 This reverts commit cf9c099a7694eb47ded529e1ed40ee8789f32d31.
9 Conflicts:
10 hw/display/cirrus_vga.c
11 ---
12 hw/display/cirrus_vga.c | 29 +++++++++--------------------
13 1 file changed, 9 insertions(+), 20 deletions(-)
15 diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
16 index 6bd13fc..92e7951 100644
17 --- a/hw/display/cirrus_vga.c
18 +++ b/hw/display/cirrus_vga.c
19 @@ -272,6 +272,9 @@ static void cirrus_update_memory_access(CirrusVGAState *s);
20 static bool blit_region_is_unsafe(struct CirrusVGAState *s,
21 int32_t pitch, int32_t addr)
23 + if (!pitch) {
24 + return true;
25 + }
26 if (pitch < 0) {
27 int64_t min = addr
28 + ((int64_t)s->cirrus_blt_height - 1) * pitch
29 @@ -290,11 +293,8 @@ static bool blit_region_is_unsafe(struct CirrusVGAState *s,
30 return false;
33 -static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only,
34 - bool zero_src_pitch_ok)
35 +static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only)
37 - int32_t check_pitch;
39 /* should be the case, see cirrus_bitblt_start */
40 assert(s->cirrus_blt_width > 0);
41 assert(s->cirrus_blt_height > 0);
42 @@ -303,10 +303,6 @@ static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only,
43 return true;
46 - if (!s->cirrus_blt_dstpitch) {
47 - return true;
48 - }
50 if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
51 s->cirrus_blt_dstaddr)) {
52 return true;
53 @@ -314,14 +310,8 @@ static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only,
54 if (dst_only) {
55 return false;
58 - check_pitch = s->cirrus_blt_srcpitch;
59 - if (!zero_src_pitch_ok && !check_pitch) {
60 - check_pitch = s->cirrus_blt_width;
61 - }
63 - if (blit_region_is_unsafe(s, check_pitch,
64 - s->cirrus_blt_srcaddr)) {
65 + if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,
66 + s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
67 return true;
70 @@ -715,9 +705,8 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState *s, bool videosrc)
71 src = s->cirrus_bltbuf;
74 - if (blit_is_unsafe(s, true, true)) {
75 + if (blit_is_unsafe(s, true))
76 return 0;
77 - }
79 (*s->cirrus_rop) (s, dst, src,
80 s->cirrus_blt_dstpitch, 0,
81 @@ -734,7 +723,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
83 cirrus_fill_t rop_func;
85 - if (blit_is_unsafe(s, true, true)) {
86 + if (blit_is_unsafe(s, true)) {
87 return 0;
89 rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
90 @@ -834,7 +823,7 @@ static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
92 static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
94 - if (blit_is_unsafe(s, false, false))
95 + if (blit_is_unsafe(s, false))
96 return 0;
98 return cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->vga.start_addr,
99 --
100 2.1.4