[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] hw/mips/malta: Split FPGA LEDs/ASCII display updates
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 2/6] hw/mips/malta: Split FPGA LEDs/ASCII display updates |
Date: |
Wed, 4 Jan 2023 14:39:31 +0100 |
No need to refresh the ASCII bar when a LED is toggled
(and vice versa).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/malta.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index c0a2e0ab04..e9424150aa 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -106,11 +106,10 @@ static struct _loaderparams {
} loaderparams;
/* Malta FPGA */
-static void malta_fpga_update_display(void *opaque)
+static void malta_fpga_update_display_leds(MaltaFPGAState *s)
{
char leds_text[9];
int i;
- MaltaFPGAState *s = opaque;
for (i = 7 ; i >= 0 ; i--) {
if (s->leds & (1 << i)) {
@@ -123,6 +122,10 @@ static void malta_fpga_update_display(void *opaque)
qemu_chr_fe_printf(&s->display, "\e[H\n\n|\e[32m%-8.8s\e[00m|\r\n",
leds_text);
+}
+
+static void malta_fpga_update_display_ascii(MaltaFPGAState *s)
+{
qemu_chr_fe_printf(&s->display, "\n\n\n\n|\e[31m%-8.8s\e[00m|",
s->display_text);
}
@@ -457,13 +460,13 @@ static void malta_fpga_write(void *opaque, hwaddr addr,
/* LEDBAR Register */
case 0x00408:
s->leds = val & 0xff;
- malta_fpga_update_display(s);
+ malta_fpga_update_display_leds(s);
break;
/* ASCIIWORD Register */
case 0x00410:
snprintf(s->display_text, 9, "%08X", (uint32_t)val);
- malta_fpga_update_display(s);
+ malta_fpga_update_display_ascii(s);
break;
/* ASCIIPOS0 to ASCIIPOS7 Registers */
@@ -476,7 +479,7 @@ static void malta_fpga_write(void *opaque, hwaddr addr,
case 0x00448:
case 0x00450:
s->display_text[(saddr - 0x00418) >> 3] = (char) val;
- malta_fpga_update_display(s);
+ malta_fpga_update_display_ascii(s);
break;
/* SOFTRES Register */
--
2.38.1
- [PATCH 0/6] hw/mips/gt64xxx_pci: Fix endianness swap on big-endian hosts, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 1/6] hw/pci/pci_host: Trace config accesses on unexisting functions, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 2/6] hw/mips/malta: Split FPGA LEDs/ASCII display updates,
Philippe Mathieu-Daudé <=
- [PATCH 3/6] hw/mips/malta: Trace FPGA LEDs/ASCII display updates, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 4/6] hw/mips/gt64xxx_pci: Accumulate address space changes, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 5/6] hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 6/6] tests/avocado: Add tests booting YAMON ROM on MIPS Malta machines, Philippe Mathieu-Daudé, 2023/01/04
- Re: [PATCH 0/6] hw/mips/gt64xxx_pci: Fix endianness swap on big-endian hosts, Richard Henderson, 2023/01/04
- Re: [PATCH 0/6] hw/mips/gt64xxx_pci: Fix endianness swap on big-endian hosts, Philippe Mathieu-Daudé, 2023/01/13