[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/13] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 09/13] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset() |
Date: |
Tue, 3 Dec 2024 12:31:36 +0100 |
The 'pci-vga' device allow setting a 'big-endian-framebuffer'
property since commit 3c2784fc864 ("vga: Expose framebuffer
byteorder as a QOM property"). Similarly, the 'virtio-vga'
device since commit 8be61ce2ce3 ("virtio-vga: implement
big-endian-framebuffer property").
Both call vga_common_reset() in their reset handler, respectively
pci_secondary_vga_reset() and virtio_vga_base_reset_hold(), which
reset 'big_endian_fb', overwritting the property. This is not
correct: the hardware is expected to keep its configured
endianness during resets.
Move 'big_endian_fb' assignment from vga_common_reset() to
vga_common_init() which is called once when the common VGA state
is initialized.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Message-Id: <20241129101721.17836-2-philmd@linaro.org>
---
hw/display/vga.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 892fedc8dce..b074b58c90d 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1873,7 +1873,6 @@ void vga_common_reset(VGACommonState *s)
s->cursor_start = 0;
s->cursor_end = 0;
s->cursor_offset = 0;
- s->big_endian_fb = s->default_endian_fb;
memset(s->invalidated_y_table, '\0', sizeof(s->invalidated_y_table));
memset(s->last_palette, '\0', sizeof(s->last_palette));
memset(s->last_ch_attr, '\0', sizeof(s->last_ch_attr));
@@ -2266,6 +2265,7 @@ bool vga_common_init(VGACommonState *s, Object *obj,
Error **errp)
* all target endian dependencies from this file.
*/
s->default_endian_fb = target_words_bigendian();
+ s->big_endian_fb = s->default_endian_fb;
vga_dirty_log_start(s);
--
2.45.2
- [PULL 00/13] Misc fixes for 2024-12-03, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 01/13] hw/openrisc: Fixed undercounting of TTCR in continuous mode, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 02/13] hw/openrisc/openrisc_sim: keep serial@90000000 as default, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 03/13] ui/cocoa: Temporarily ignore annoying deprecated declaration warnings, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 04/13] MAINTAINERS: add myself as the maintainer for LoongArch VirtMachine, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 05/13] meson: Add missing SDL dependency to system/main.c, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 06/13] MAINTAINERS: update email addr for Brian Cain, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 07/13] hw/core/machine: diagnose wrapping of maxmem, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 08/13] target/riscv: Avoid bad shift in riscv_cpu_do_interrupt(), Philippe Mathieu-Daudé, 2024/12/03
- [PULL 09/13] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset(),
Philippe Mathieu-Daudé <=
- [PULL 10/13] hw/virtio: fix crash in processing balloon stats, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 11/13] tests/qtest: drop 'fuzz-' prefix from virtio-balloon test, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 12/13] tests/qtest: add test for querying balloon guest stats, Philippe Mathieu-Daudé, 2024/12/03
- [PULL 13/13] system: Select HVF by default when no other accelerator is available, Philippe Mathieu-Daudé, 2024/12/03
- Re: [PULL 00/13] Misc fixes for 2024-12-03, Peter Maydell, 2024/12/03