hw/sparc: Set graphic display dimensions generically
If a dimension is not set, have the machine init code set the default values. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20260216213121.47122-7-philmd@linaro.org>
Philippe Mathieu-Daudé committed
Feb 11, 2026 at 15:33 UTC
37ad735f6b4ebdaaa952927ab9f96c9b857b7785
3 files changed
+20
-5
hw/sparc/sun4m.c
+9
@@ -892,6 +892,15 @@ static void sun4m_hw_init(MachineState *machine)
892
hwdef->esp_base, slavio_irq[18],
893
hwdef->le_base, slavio_irq[16], &hostid);
894
895
+ if (!graphic_width) {
896
+ graphic_width = 1024;
897
+ }
898
+ if (!graphic_height) {
899
+ graphic_height = 768;
900
+ }
901
+ if (!graphic_depth) {
902
+ graphic_depth = 8;
903
+ }
904
if (graphic_depth != 8 && graphic_depth != 24) {
905
error_report("Unsupported depth: %d", graphic_depth);
906
exit (1);
hw/sparc64/sun4u.c
+10
@@ -666,6 +666,16 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
666
sysbus_mmio_get_region(s, 0));
667
nvram = NVRAM(dev);
668
669
+ if (!graphic_width) {
670
+ graphic_width = 1024;
671
+ }
672
+ if (!graphic_height) {
673
+ graphic_height = 768;
674
+ }
675
+ if (!graphic_depth) {
676
+ graphic_depth = 8;
677
+ }
678
+
679
initrd_size = 0;
680
initrd_addr = 0;
681
kernel_size = sun4u_load_kernel(machine->kernel_filename,
system/globals-target.c
+1
-5
@@ -9,11 +9,7 @@
9
#include "qemu/osdep.h"
10
#include "system/system.h"
11
12
-#ifdef TARGET_SPARC
13
-int graphic_width = 1024;
14
-int graphic_height = 768;
15
-int graphic_depth = 8;
16
-#elif defined(TARGET_M68K)
12
+#if defined(TARGET_SPARC) || defined(TARGET_M68K)
13
int graphic_width;
14
int graphic_height;
15
int graphic_depth;