[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 12/12] hw/display/artist: Fix invalidation of lines near screen
From: |
Helge Deller |
Subject: |
[PULL v2 12/12] hw/display/artist: Fix invalidation of lines near screen border |
Date: |
Mon, 10 Aug 2020 15:24:41 +0200 |
From: Sven Schnelle <svens@stackframe.org>
If parts of the invalidated screen lines are outside of the VRAM buffer,
the code skips the whole invalidate. This is incorrect when only parts
of the buffer are invisble - which is the case when the mouse cursor is
located near the screen border.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
---
hw/display/artist.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/display/artist.c b/hw/display/artist.c
index a959b2c158..71982559c6 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -206,7 +206,12 @@ static void artist_invalidate_lines(struct vram_buffer
*buf,
int starty, int height)
{
int start = starty * buf->width;
- int size = height * buf->width;
+ int size;
+
+ if (starty + height > buf->height)
+ height = buf->height - starty;
+
+ size = height * buf->width;
if (start + size <= buf->size) {
memory_region_set_dirty(&buf->mr, start, size);
--
2.21.3
- [PULL v2 00/12] target-hppa fixes pull request v2, Helge Deller, 2020/08/10
- [PULL v2 01/12] hw/hppa: Sync hppa_hardware.h file with SeaBIOS sources, Helge Deller, 2020/08/10
- [PULL v2 04/12] hw/display/artist.c: fix out of bounds check, Helge Deller, 2020/08/10
- [PULL v2 12/12] hw/display/artist: Fix invalidation of lines near screen border,
Helge Deller <=
- [PULL v2 11/12] hw/display/artist: Fix invalidation of lines in artist_draw_line(), Helge Deller, 2020/08/10
- [PULL v2 05/12] hw/hppa/lasi: Don't abort on invalid IMR value, Helge Deller, 2020/08/10
- [PULL v2 02/12] seabios-hppa: Update to SeaBIOS hppa version 1, Helge Deller, 2020/08/10
- [PULL v2 06/12] hw/display/artist: Check offset in draw_line to avoid buffer over-run, Helge Deller, 2020/08/10
- [PULL v2 10/12] hw/display/artist: Unbreak size mismatch memory accesses, Helge Deller, 2020/08/10
- [PULL v2 08/12] Revert "hw/display/artist: Avoid drawing line when nothing to display", Helge Deller, 2020/08/10
- [PULL v2 07/12] hw/display/artist: Refactor artist_rop8() to avoid buffer over-run, Helge Deller, 2020/08/10
- [PULL v2 09/12] hw/display/artist: Prevent out of VRAM buffer accesses, Helge Deller, 2020/08/10
- [PULL v2 03/12] hw/hppa: Implement proper SeaBIOS version check, Helge Deller, 2020/08/10
- Re: [PULL v2 00/12] target-hppa fixes pull request v2, Peter Maydell, 2020/08/10