[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen staging-4.16] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read() and artist_vram_write()



commit b19de1137bc158cc2782750f1a94be153a5fd54d
Author:     Helge Deller <deller@xxxxxx>
AuthorDate: Tue May 25 22:12:45 2021 +0200
Commit:     Michael Roth <michael.roth@xxxxxxx>
CommitDate: Tue Dec 14 08:57:12 2021 -0600

    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 c7050f3f167b
    ("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: Helge Deller <deller@xxxxxx>
    Fixes: c7050f3f167b ("hw/display/artist: Refactor x/y coordination 
extraction")
    Cc: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
    Cc: Richard Henderson <richard.henderson@xxxxxxxxxx>
    Cc: Sven Schnelle <svens@xxxxxxxxxxxxxx>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
    Message-Id: <YK1aPb8keur9W7h2@ls3530>
    Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
    (cherry picked from commit 01f750f5fef1afd8f6abc0548910f87d473e26d5)
    Signed-off-by: Michael Roth <michael.roth@xxxxxxx>
---
 hw/display/artist.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/display/artist.c b/hw/display/artist.c
index aa7bd594aa..21b7fd1b44 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -1170,8 +1170,8 @@ static void artist_vram_write(void *opaque, hwaddr addr, 
uint64_t val,
     }
 
     buf = vram_write_buffer(s);
-    posy = ADDR_TO_Y(addr);
-    posx = ADDR_TO_X(addr);
+    posy = ADDR_TO_Y(addr >> 2);
+    posx = ADDR_TO_X(addr >> 2);
 
     if (!buf->size) {
         return;
@@ -1232,8 +1232,8 @@ static uint64_t artist_vram_read(void *opaque, hwaddr 
addr, unsigned size)
         return 0;
     }
 
-    posy = ADDR_TO_Y(addr);
-    posx = ADDR_TO_X(addr);
+    posy = ADDR_TO_Y(addr >> 2);
+    posx = ADDR_TO_X(addr >> 2);
 
     if (posy > buf->height || posx > buf->width) {
         return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.16



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.