[PATCH 3/8] hw/m68k/q800: Use MacFbMode fields in q800_machine_init()

Philippe Mathieu-Daudé posted 8 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH 3/8] hw/m68k/q800: Use MacFbMode fields in q800_machine_init()
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
Once the Mac Frame Buffer device is realized on the NuBus,
its MacFbMode might be different of the global graphic_depth
and graphic_width globals. Prefer the device MacFbMode fields
to initialize the BootInfo structure.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/m68k/q800.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 4767eb4298f..b55c03a90bf 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -605,9 +605,9 @@ static void q800_machine_init(MachineState *machine)
         BOOTINFO2(param_ptr, BI_MEMCHUNK, 0, ram_size);
         BOOTINFO1(param_ptr, BI_MAC_VADDR,
                   VIDEO_BASE + macfb_mode->offset);
-        BOOTINFO1(param_ptr, BI_MAC_VDEPTH, graphic_depth);
+        BOOTINFO1(param_ptr, BI_MAC_VDEPTH, macfb_mode->depth);
         BOOTINFO1(param_ptr, BI_MAC_VDIM,
-                  (graphic_height << 16) | graphic_width);
+                  (graphic_height << 16) | macfb_mode->width);
         BOOTINFO1(param_ptr, BI_MAC_VROW, macfb_mode->stride);
         BOOTINFO1(param_ptr, BI_MAC_SCCBASE, SCC_BASE);
 
-- 
2.52.0


Re: [PATCH 3/8] hw/m68k/q800: Use MacFbMode fields in q800_machine_init()
Posted by Mark Cave-Ayland 1 month, 3 weeks ago
On 14/02/2026 02:12, Philippe Mathieu-Daudé wrote:

> Once the Mac Frame Buffer device is realized on the NuBus,
> its MacFbMode might be different of the global graphic_depth
> and graphic_width globals. Prefer the device MacFbMode fields
> to initialize the BootInfo structure.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/m68k/q800.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
> index 4767eb4298f..b55c03a90bf 100644
> --- a/hw/m68k/q800.c
> +++ b/hw/m68k/q800.c
> @@ -605,9 +605,9 @@ static void q800_machine_init(MachineState *machine)
>           BOOTINFO2(param_ptr, BI_MEMCHUNK, 0, ram_size);
>           BOOTINFO1(param_ptr, BI_MAC_VADDR,
>                     VIDEO_BASE + macfb_mode->offset);
> -        BOOTINFO1(param_ptr, BI_MAC_VDEPTH, graphic_depth);
> +        BOOTINFO1(param_ptr, BI_MAC_VDEPTH, macfb_mode->depth);
>           BOOTINFO1(param_ptr, BI_MAC_VDIM,
> -                  (graphic_height << 16) | graphic_width);
> +                  (graphic_height << 16) | macfb_mode->width);
>           BOOTINFO1(param_ptr, BI_MAC_VROW, macfb_mode->stride);
>           BOOTINFO1(param_ptr, BI_MAC_SCCBASE, SCC_BASE);

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


ATB,

Mark.


Re: [PATCH 3/8] hw/m68k/q800: Use MacFbMode fields in q800_machine_init()
Posted by BALATON Zoltan 1 month, 3 weeks ago
On Sat, 14 Feb 2026, Philippe Mathieu-Daudé wrote:
> Once the Mac Frame Buffer device is realized on the NuBus,
> its MacFbMode might be different of the global graphic_depth
> and graphic_width globals. Prefer the device MacFbMode fields
> to initialize the BootInfo structure.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/m68k/q800.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
> index 4767eb4298f..b55c03a90bf 100644
> --- a/hw/m68k/q800.c
> +++ b/hw/m68k/q800.c
> @@ -605,9 +605,9 @@ static void q800_machine_init(MachineState *machine)
>         BOOTINFO2(param_ptr, BI_MEMCHUNK, 0, ram_size);
>         BOOTINFO1(param_ptr, BI_MAC_VADDR,
>                   VIDEO_BASE + macfb_mode->offset);
> -        BOOTINFO1(param_ptr, BI_MAC_VDEPTH, graphic_depth);
> +        BOOTINFO1(param_ptr, BI_MAC_VDEPTH, macfb_mode->depth);
>         BOOTINFO1(param_ptr, BI_MAC_VDIM,
> -                  (graphic_height << 16) | graphic_width);
> +                  (graphic_height << 16) | macfb_mode->width);
>         BOOTINFO1(param_ptr, BI_MAC_VROW, macfb_mode->stride);
>         BOOTINFO1(param_ptr, BI_MAC_SCCBASE, SCC_BASE);

I know nothing about this but the idea is to let the user override 
graphics resolution via the command line. Would this break that?

Regards,
BALATON Zoltan
Re: [PATCH 3/8] hw/m68k/q800: Use MacFbMode fields in q800_machine_init()
Posted by Pierrick Bouvier 1 month, 3 weeks ago
On 2/13/26 6:12 PM, Philippe Mathieu-Daudé wrote:
> Once the Mac Frame Buffer device is realized on the NuBus,
> its MacFbMode might be different of the global graphic_depth
> and graphic_width globals. Prefer the device MacFbMode fields
> to initialize the BootInfo structure.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/m68k/q800.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

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