Skip to content
Snippets Groups Projects
Commit 62a012b0 authored by Helge Deller's avatar Helge Deller Committed by Michael Roth
Browse files

hw/display/artist: Fix bug in coordinate extraction in artist_vram_read() and artist_vram_write()


The CDE desktop on HP-UX 10 shows wrongly rendered pixels when the local screen
menu is closed. This bug was introduced by commit c7050f3f
("hw/display/artist: Refactor x/y coordination extraction") which converted the
coordinate extraction in artist_vram_read() and artist_vram_write() to use the
ADDR_TO_X and ADDR_TO_Y macros, but forgot to right-shift the address by 2 as
it was done before.

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Fixes: c7050f3f ("hw/display/artist: Refactor x/y coordination extraction")
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Sven Schnelle <svens@stackframe.org>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <YK1aPb8keur9W7h2@ls3530>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 01f750f5)
Signed-off-by: default avatarMichael Roth <michael.roth@amd.com>
parent 487a0956
No related branches found
No related tags found
No related merge requests found
...@@ -1170,8 +1170,8 @@ static void artist_vram_write(void *opaque, hwaddr addr, uint64_t val, ...@@ -1170,8 +1170,8 @@ static void artist_vram_write(void *opaque, hwaddr addr, uint64_t val,
} }
buf = vram_write_buffer(s); buf = vram_write_buffer(s);
posy = ADDR_TO_Y(addr); posy = ADDR_TO_Y(addr >> 2);
posx = ADDR_TO_X(addr); posx = ADDR_TO_X(addr >> 2);
if (!buf->size) { if (!buf->size) {
return; return;
...@@ -1232,8 +1232,8 @@ static uint64_t artist_vram_read(void *opaque, hwaddr addr, unsigned size) ...@@ -1232,8 +1232,8 @@ static uint64_t artist_vram_read(void *opaque, hwaddr addr, unsigned size)
return 0; return 0;
} }
posy = ADDR_TO_Y(addr); posy = ADDR_TO_Y(addr >> 2);
posx = ADDR_TO_X(addr); posx = ADDR_TO_X(addr >> 2);
if (posy > buf->height || posx > buf->width) { if (posy > buf->height || posx > buf->width) {
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment