From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
marcandre.lureau@redhat.com, "Thomas Huth" <thuth@redhat.com>,
"Peter Xu" <peterx@redhat.com>, "Fabiano Rosas" <farosas@suse.de>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [RFC PATCH] cirrus-vga: Add property to set frame buffer endianness and make it default to little endian
Date: Mon, 30 Mar 2026 16:06:55 +0200 (CEST) [thread overview]
Message-ID: <20260330140655.31EC55968DE@zero.eik.bme.hu> (raw)
I've tried this but it does not seem to work and leaves default to
auto. Could somebody tell how this should work?
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/core/machine.c | 2 ++
hw/display/cirrus_vga.c | 6 ++++++
hw/display/cirrus_vga_internal.h | 2 ++
hw/display/cirrus_vga_isa.c | 2 ++
4 files changed, 12 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 0aa77a57e9..e573ef46bc 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -41,6 +41,8 @@
GlobalProperty hw_compat_10_2[] = {
{ "scsi-block", "migrate-pr", "off" },
{ "isa-cirrus-vga", "global-vmstate", "true" },
+ { "isa-cirrus-vga", "x-big-endian-fb", "off" },
+ { "cirrus-vga", "x-big-endian-fb", "off" },
};
const size_t hw_compat_10_2_len = G_N_ELEMENTS(hw_compat_10_2);
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 629b34fc68..e379f125ae 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -2930,6 +2930,10 @@ void cirrus_init_common(CirrusVGAState *s, Object *owner,
s->vga.cursor_invalidate = cirrus_cursor_invalidate;
s->vga.cursor_draw_line = cirrus_cursor_draw_line;
+ if (s->big_endian_fb != ON_OFF_AUTO_AUTO) {
+ s->vga.big_endian_fb = (s->big_endian_fb == ON_OFF_AUTO_ON);
+ }
+
qemu_register_reset(cirrus_reset, s);
}
@@ -2987,6 +2991,8 @@ static const Property pci_vga_cirrus_properties[] = {
cirrus_vga.vga.vram_size_mb, 4),
DEFINE_PROP_BOOL("blitter", struct PCICirrusVGAState,
cirrus_vga.enable_blitter, true),
+ DEFINE_PROP_ON_OFF_AUTO("x-big-endian-fb", struct PCICirrusVGAState,
+ cirrus_vga.big_endian_fb, ON_OFF_AUTO_AUTO),
};
static void cirrus_vga_class_init(ObjectClass *klass, const void *data)
diff --git a/hw/display/cirrus_vga_internal.h b/hw/display/cirrus_vga_internal.h
index a78ebbd920..7c07201f18 100644
--- a/hw/display/cirrus_vga_internal.h
+++ b/hw/display/cirrus_vga_internal.h
@@ -26,6 +26,7 @@
#ifndef CIRRUS_VGA_INTERNAL_H
#define CIRRUS_VGA_INTERNAL_H
+#include "hw/core/qdev-properties.h"
#include "vga_int.h"
/* IDs */
@@ -94,6 +95,7 @@ typedef struct CirrusVGAState {
int real_vram_size; /* XXX: suppress that */
int device_id;
int bustype;
+ OnOffAuto big_endian_fb;
} CirrusVGAState;
void cirrus_init_common(CirrusVGAState *s, Object *owner,
diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c
index 76034a8860..c2b0b61476 100644
--- a/hw/display/cirrus_vga_isa.c
+++ b/hw/display/cirrus_vga_isa.c
@@ -75,6 +75,8 @@ static const Property isa_cirrus_vga_properties[] = {
cirrus_vga.enable_blitter, true),
DEFINE_PROP_BOOL("global-vmstate", struct ISACirrusVGAState,
cirrus_vga.vga.global_vmstate, false),
+ DEFINE_PROP_ON_OFF_AUTO("x-big-endian-fb", struct PCICirrusVGAState,
+ cirrus_vga.big_endian_fb, ON_OFF_AUTO_AUTO),
};
static void isa_cirrus_vga_class_init(ObjectClass *klass, const void *data)
--
2.41.3
next reply other threads:[~2026-03-30 14:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 14:06 BALATON Zoltan [this message]
2026-03-30 15:05 ` [RFC PATCH] cirrus-vga: Add property to set frame buffer endianness and make it default to little endian Gerd Hoffmann
2026-03-31 10:04 ` BALATON Zoltan
2026-03-30 16:22 ` Fabiano Rosas
2026-03-30 18:07 ` Philippe Mathieu-Daudé
2026-03-30 20:36 ` BALATON Zoltan
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=20260330140655.31EC55968DE@zero.eik.bme.hu \
--to=balaton@eik.bme.hu \
--cc=farosas@suse.de \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.