qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] sm501: Adjust endianness of pixel value in rect


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] sm501: Adjust endianness of pixel value in rectangle fill
Date: Wed, 19 Sep 2018 09:29:31 -0700

On 19 September 2018 at 07:46, BALATON Zoltan <address@hidden> wrote:
> On Wed, 19 Sep 2018, Marcus Comstedt wrote:
>>
>> The value from twoD_foreground (which is in host endian format) must
>> be converted to the endianness of the framebuffer (currently always
>> little endian) before it can be used to perform the fill operation.
>>
>> Signed-off-by: Marcus Comstedt <address@hidden>
>
>
> Reviewed-by: BALATON Zoltan <address@hidden>
>
> But also cc-ing Peter Maydell who reviewed endianness fixes before for this
> device model in case he has something to add.

There are probably other ways to fix that, but this looks OK to me.
We have a pixel value in a host-endianness register field, and we're
trying to write it into a little-endian framebuffer with a plain
host store of a 32/16/8 bit type. So cpu-to-le is the right thing.
(The other approach would be to use the stl_le_p()/stw_le_p()/stb_p()
functions to do the store directly in the correct endianness. But
I don't think that ends up with significantly cleaner code.)

Reviewed-by: Peter Maydell <address@hidden>

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]