[PATCH] hw/display: Fix mirrored output in dm163

Inès Varhol posted 1 patch 2 months, 1 week ago
hw/display/dm163.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] hw/display: Fix mirrored output in dm163
Posted by Inès Varhol 2 months, 1 week ago
DM163 is an emulated 8x8 LED matrix. This commit flips the image
horizontally so it's rendered the same way as on the hardware.

Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
---
 hw/display/dm163.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/dm163.c b/hw/display/dm163.c
index f92aee371d..75a91f62bd 100644
--- a/hw/display/dm163.c
+++ b/hw/display/dm163.c
@@ -271,7 +271,7 @@ static uint32_t *update_display_of_row(DM163State *s, uint32_t *dest,
                                        unsigned row)
 {
     for (unsigned _ = 0; _ < LED_SQUARE_SIZE; _++) {
-        for (int x = 0; x < RGB_MATRIX_NUM_COLS * LED_SQUARE_SIZE; x++) {
+        for (int x = RGB_MATRIX_NUM_COLS * LED_SQUARE_SIZE - 1; x >= 0; x--) {
             /* UI layer guarantees that there's 32 bits per pixel (Mar 2024) */
             *dest++ = s->buffer[s->buffer_idx_of_row[row]][x / LED_SQUARE_SIZE];
         }
-- 
2.45.2
Re: [PATCH] hw/display: Fix mirrored output in dm163
Posted by Michael Tokarev 2 months, 1 week ago
On 15.09.2024 15:57, Inès Varhol wrote:
> DM163 is an emulated 8x8 LED matrix. This commit flips the image
> horizontally so it's rendered the same way as on the hardware.

Picked this one up for trivial-patches, as it is, -
I've no idea if it is correct or not :)

This is an interesting device, I wonder if it is used by anyone?

Thanks,

/mjt

Re: [PATCH] hw/display: Fix mirrored output in dm163
Posted by Peter Maydell 2 months, 1 week ago
On Tue, 17 Sept 2024 at 10:11, Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> On 15.09.2024 15:57, Inès Varhol wrote:
> > DM163 is an emulated 8x8 LED matrix. This commit flips the image
> > horizontally so it's rendered the same way as on the hardware.
>
> Picked this one up for trivial-patches, as it is, -
> I've no idea if it is correct or not :)
>
> This is an interesting device, I wonder if it is used by anyone?

The device is used by the Arm b-l475e-iot01a board.

thanks
-- PMM
Re: [PATCH] hw/display: Fix mirrored output in dm163
Posted by Michael Tokarev 2 months, 1 week ago
On 17.09.2024 12:39, Peter Maydell wrote:

>> This is an interesting device, I wonder if it is used by anyone?
> 
> The device is used by the Arm b-l475e-iot01a board.

I mean if it is actually used in practice, - there's just 1 commit
for this file - it's addition in Apr this year, and that's all.
If the image is inverted, I wonder how it worked and no one
noticed :)

There's no problem with that, anyway.

Thanks,

/mjt
Re: [PATCH] hw/display: Fix mirrored output in dm163
Posted by Peter Maydell 2 months, 1 week ago
On Tue, 17 Sept 2024 at 10:54, Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> On 17.09.2024 12:39, Peter Maydell wrote:
>
> >> This is an interesting device, I wonder if it is used by anyone?
> >
> > The device is used by the Arm b-l475e-iot01a board.
>
> I mean if it is actually used in practice, - there's just 1 commit
> for this file - it's addition in Apr this year, and that's all.
> If the image is inverted, I wonder how it worked and no one
> noticed :)

This is a fairly new board, and the authors are gradually
adding its devices.

-- PMM