From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-9.2? v2 1/2] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset()
Date: Fri, 29 Nov 2024 11:17:20 +0100 [thread overview]
Message-ID: <20241129101721.17836-2-philmd@linaro.org> (raw)
In-Reply-To: <20241129101721.17836-1-philmd@linaro.org>
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>
---
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
next prev parent reply other threads:[~2024-11-29 10:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-29 10:17 [PATCH v2 0/2] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset() Philippe Mathieu-Daudé
2024-11-29 10:17 ` Philippe Mathieu-Daudé [this message]
2024-12-02 19:48 ` [PATCH-for-9.2? v2 1/2] " Philippe Mathieu-Daudé
2024-12-03 1:30 ` Benjamin Herrenschmidt
2024-12-03 10:51 ` Gerd Hoffmann
2024-12-03 12:21 ` BALATON Zoltan
2024-12-05 23:00 ` Benjamin Herrenschmidt
2024-12-06 9:28 ` Gerd Hoffmann
2024-12-09 1:12 ` Benjamin Herrenschmidt
2024-11-29 10:17 ` [PATCH v2 2/2] hw/display/vga: Remove pointless VGACommonState::default_endian_fb Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241129101721.17836-2-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=benh@kernel.crashing.org \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).