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
7 This reverts commit cf9c099a7694eb47ded529e1ed40ee8789f32d31.
10 hw/display/cirrus_vga.c
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)
28 + ((int64_t)s->cirrus_blt_height - 1) * pitch
29 @@ -290,11 +293,8 @@ static bool blit_region_is_unsafe(struct CirrusVGAState *s,
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,
46 - if (!s->cirrus_blt_dstpitch) {
50 if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
51 s->cirrus_blt_dstaddr)) {
53 @@ -314,14 +310,8 @@ static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only,
58 - check_pitch = s->cirrus_blt_srcpitch;
59 - if (!zero_src_pitch_ok && !check_pitch) {
60 - check_pitch = s->cirrus_blt_width;
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)) {
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))
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)) {
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))
98 return cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->vga.start_addr,