]> git.proxmox.com Git - pve-qemu-kvm.git/blob - debian/patches/extra/0001-cirrus-handle-negative-pitch-in-cirrus_invalidate_re.patch
fix #1237: include cirrus follow up fixes
[pve-qemu-kvm.git] / debian / patches / extra / 0001-cirrus-handle-negative-pitch-in-cirrus_invalidate_re.patch
1 From b3ce5aeaacdd0cec5bab1d83ee24bae73b0dd506 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Wed, 25 Jan 2017 14:48:57 +0100
4 Subject: [PATCH 1/4] cirrus: handle negative pitch in
5 cirrus_invalidate_region()
6
7 cirrus_invalidate_region() calls memory_region_set_dirty()
8 on a per-line basis, always ranging from off_begin to
9 off_begin+bytesperline. With a negative pitch off_begin
10 marks the top most used address and thus we need to do an
11 initial shift backwards by a line for negative pitches of
12 backward blits, otherwise the first iteration covers the
13 line going from the start offset forwards instead of
14 backwards.
15 Additionally since the start address is inclusive, if we
16 shift by a full `bytesperline` we move to the first address
17 *not* included in the blit, so we only shift by one less
18 than bytesperline.
19
20 Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
21 Message-id: 1485352137-29367-1-git-send-email-w.bumiller@proxmox.com
22
23 [ kraxel: codestyle fixes ]
24
25 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
26 ---
27 hw/display/cirrus_vga.c | 5 +++++
28 1 file changed, 5 insertions(+)
29
30 diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
31 index 379910d..0f05e45 100644
32 --- a/hw/display/cirrus_vga.c
33 +++ b/hw/display/cirrus_vga.c
34 @@ -661,9 +661,14 @@ static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
35 int off_cur;
36 int off_cur_end;
37
38 + if (off_pitch < 0) {
39 + off_begin -= bytesperline - 1;
40 + }
41 +
42 for (y = 0; y < lines; y++) {
43 off_cur = off_begin;
44 off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask;
45 + assert(off_cur_end >= off_cur);
46 memory_region_set_dirty(&s->vga.vram, off_cur, off_cur_end - off_cur);
47 off_begin += off_pitch;
48 }
49 --
50 2.1.4
51