[PATCH 5/8] hw/m68k: Set graphic display dimensions generically

Philippe Mathieu-Daudé posted 8 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH 5/8] hw/m68k: Set graphic display dimensions generically
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
If a dimension is not set, have the machine init code
(q800_machine_init) set the default value.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/m68k/q800.c          | 6 +++---
 system/globals-target.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index ba32da2fa45..ded531394e6 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -560,9 +560,9 @@ static void q800_machine_init(MachineState *machine)
                             TYPE_NUBUS_MACFB);
     dev = DEVICE(&m->macfb);
     qdev_prop_set_uint32(dev, "slot", 9);
-    qdev_prop_set_uint32(dev, "width", graphic_width);
-    qdev_prop_set_uint32(dev, "height", graphic_height);
-    qdev_prop_set_uint8(dev, "depth", graphic_depth);
+    qdev_prop_set_uint32(dev, "width", graphic_width ?: 800);
+    qdev_prop_set_uint32(dev, "height", graphic_height ?: 600);
+    qdev_prop_set_uint8(dev, "depth", graphic_depth ?: 8);
     qdev_realize(dev, BUS(nubus), &error_fatal);
 
     macfb_mode = (NUBUS_MACFB(dev)->macfb).mode;
diff --git a/system/globals-target.c b/system/globals-target.c
index 989720591e7..e3f7d846ac0 100644
--- a/system/globals-target.c
+++ b/system/globals-target.c
@@ -14,9 +14,9 @@ int graphic_width = 1024;
 int graphic_height = 768;
 int graphic_depth = 8;
 #elif defined(TARGET_M68K)
-int graphic_width = 800;
-int graphic_height = 600;
-int graphic_depth = 8;
+int graphic_width;
+int graphic_height;
+int graphic_depth;
 #else
 int graphic_width = 800;
 int graphic_height = 600;
-- 
2.52.0


Re: [PATCH 5/8] hw/m68k: Set graphic display dimensions generically
Posted by Mark Cave-Ayland 1 month, 3 weeks ago
On 14/02/2026 02:12, Philippe Mathieu-Daudé wrote:

> If a dimension is not set, have the machine init code
> (q800_machine_init) set the default value.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/m68k/q800.c          | 6 +++---
>   system/globals-target.c | 6 +++---
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
> index ba32da2fa45..ded531394e6 100644
> --- a/hw/m68k/q800.c
> +++ b/hw/m68k/q800.c
> @@ -560,9 +560,9 @@ static void q800_machine_init(MachineState *machine)
>                               TYPE_NUBUS_MACFB);
>       dev = DEVICE(&m->macfb);
>       qdev_prop_set_uint32(dev, "slot", 9);
> -    qdev_prop_set_uint32(dev, "width", graphic_width);
> -    qdev_prop_set_uint32(dev, "height", graphic_height);
> -    qdev_prop_set_uint8(dev, "depth", graphic_depth);
> +    qdev_prop_set_uint32(dev, "width", graphic_width ?: 800);
> +    qdev_prop_set_uint32(dev, "height", graphic_height ?: 600);
> +    qdev_prop_set_uint8(dev, "depth", graphic_depth ?: 8);
>       qdev_realize(dev, BUS(nubus), &error_fatal);
>   
>       macfb_mode = (NUBUS_MACFB(dev)->macfb).mode;
> diff --git a/system/globals-target.c b/system/globals-target.c
> index 989720591e7..e3f7d846ac0 100644
> --- a/system/globals-target.c
> +++ b/system/globals-target.c
> @@ -14,9 +14,9 @@ int graphic_width = 1024;
>   int graphic_height = 768;
>   int graphic_depth = 8;
>   #elif defined(TARGET_M68K)
> -int graphic_width = 800;
> -int graphic_height = 600;
> -int graphic_depth = 8;
> +int graphic_width;
> +int graphic_height;
> +int graphic_depth;
>   #else
>   int graphic_width = 800;
>   int graphic_height = 600;

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.


Re: [PATCH 5/8] hw/m68k: Set graphic display dimensions generically
Posted by Pierrick Bouvier 1 month, 3 weeks ago
On 2/13/26 6:12 PM, Philippe Mathieu-Daudé wrote:
> If a dimension is not set, have the machine init code
> (q800_machine_init) set the default value.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/m68k/q800.c          | 6 +++---
>   system/globals-target.c | 6 +++---
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>