* [PATCH] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read()
@ 2021-05-24 20:23 Helge Deller
2021-05-25 3:53 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 3+ messages in thread
From: Helge Deller @ 2021-05-24 20:23 UTC (permalink / raw)
To: qemu-devel
Cc: Sven Schnelle, Richard Henderson, Philippe Mathieu-Daudé,
qemu-stable
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() 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@gmx.de>
Fixes: c7050f3f167b ("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>
Cc: qemu-stable@nongnu.org
diff --git a/hw/display/artist.c b/hw/display/artist.c
index ed0e637f25..34efd3a565 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -1233,8 +1233,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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read()
2021-05-24 20:23 [PATCH] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read() Helge Deller
@ 2021-05-25 3:53 ` Philippe Mathieu-Daudé
2021-05-25 20:08 ` Helge Deller
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-25 3:53 UTC (permalink / raw)
To: Helge Deller, qemu-devel; +Cc: Richard Henderson, Sven Schnelle, qemu-stable
Hi Helge,
On 5/24/21 10:23 PM, Helge Deller wrote:
> 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() 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.
OK, but there is a similar issue in artist_vram_write(), right?
>
> Signed-off-by: Helge Deller <deller@gmx.de>
> Fixes: c7050f3f167b ("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>
> Cc: qemu-stable@nongnu.org
>
> diff --git a/hw/display/artist.c b/hw/display/artist.c
> index ed0e637f25..34efd3a565 100644
> --- a/hw/display/artist.c
> +++ b/hw/display/artist.c
> @@ -1233,8 +1233,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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read()
2021-05-25 3:53 ` Philippe Mathieu-Daudé
@ 2021-05-25 20:08 ` Helge Deller
0 siblings, 0 replies; 3+ messages in thread
From: Helge Deller @ 2021-05-25 20:08 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Richard Henderson, Sven Schnelle, qemu-stable
On 5/25/21 5:53 AM, Philippe Mathieu-Daudé wrote:
> Hi Helge,
Hi Plilippe,
> On 5/24/21 10:23 PM, Helge Deller wrote:
>> 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() 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.
>
> OK, but there is a similar issue in artist_vram_write(), right?
Similar code: Yes.
Issue: Maybe.
I applied the same patch in artist_vram_write() and it didn't showed any
negative (or positive) effects.
So, I'll resend my patch with artist_vram_write() adjusted as well.
Thanks!
Helge
>> Signed-off-by: Helge Deller <deller@gmx.de>
>> Fixes: c7050f3f167b ("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>
>> Cc: qemu-stable@nongnu.org
>>
>> diff --git a/hw/display/artist.c b/hw/display/artist.c
>> index ed0e637f25..34efd3a565 100644
>> --- a/hw/display/artist.c
>> +++ b/hw/display/artist.c
>> @@ -1233,8 +1233,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;
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-25 20:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 20:23 [PATCH] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read() Helge Deller
2021-05-25 3:53 ` Philippe Mathieu-Daudé
2021-05-25 20:08 ` Helge Deller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.