qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] hw/arm/sbsa-ref: sort out graphics a bit
@ 2023-05-24 10:27 Marcin Juszkiewicz
  2023-05-24 10:27 ` [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine Marcin Juszkiewicz
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 10:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini, Marcin Juszkiewicz

Thomas Huth gave me some hints on how to improve sbsa-ref configuration
when it comes to graphics.

With this patchset we are able to start sbsa-ref if qemu is build with
"--without-default-devices" argument given to configure script.

Marcin Juszkiewicz (4):
  Add Bochs to list of vga_interfaces
  hw/arm/sbsa-ref: honor "-vga none" argument
  hw/arm/sbsa-ref: add gfx card only if we have pci
  hw/arm/sbsa-ref: use MachineClass->default_display

Thomas Huth (1):
  hw/arm: Use MachineClass->default_nic in the sbsa-ref machine

 hw/arm/sbsa-ref.c       | 11 ++++++++---
 include/sysemu/sysemu.h |  2 +-
 softmmu/vl.c            |  6 ++++++
 3 files changed, 15 insertions(+), 4 deletions(-)

-- 
2.40.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine
  2023-05-24 10:27 [PATCH v3 0/5] hw/arm/sbsa-ref: sort out graphics a bit Marcin Juszkiewicz
@ 2023-05-24 10:27 ` Marcin Juszkiewicz
  2023-05-24 14:59   ` Richard Henderson
  2023-05-24 10:27 ` [PATCH v3 2/5] Add Bochs to list of vga_interfaces Marcin Juszkiewicz
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 10:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini

From: Thomas Huth <thuth@redhat.com>

Mark the default NIC via the new MachineClass->default_nic setting
so that the machine-defaults code in vl.c can decide whether the
default NIC is usable or not (for example when compiling with the
"--without-default-devices" configure switch).

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/arm/sbsa-ref.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 792371fdce..9c3e670ec6 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -596,6 +596,7 @@ static void create_pcie(SBSAMachineState *sms)
     hwaddr size_mmio_high = sbsa_ref_memmap[SBSA_PCIE_MMIO_HIGH].size;
     hwaddr base_pio = sbsa_ref_memmap[SBSA_PCIE_PIO].base;
     int irq = sbsa_ref_irqmap[SBSA_PCIE];
+    MachineClass *mc = MACHINE_GET_CLASS(sms);
     MemoryRegion *mmio_alias, *mmio_alias_high, *mmio_reg;
     MemoryRegion *ecam_alias, *ecam_reg;
     DeviceState *dev;
@@ -641,7 +642,7 @@ static void create_pcie(SBSAMachineState *sms)
             NICInfo *nd = &nd_table[i];
 
             if (!nd->model) {
-                nd->model = g_strdup("e1000e");
+                nd->model = g_strdup(mc->default_nic);
             }
 
             pci_nic_init_nofail(nd, pci->bus, nd->model, NULL);
@@ -858,6 +859,7 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data)
     mc->minimum_page_bits = 12;
     mc->block_default_type = IF_IDE;
     mc->no_cdrom = 1;
+    mc->default_nic = "e1000e";
     mc->default_ram_size = 1 * GiB;
     mc->default_ram_id = "sbsa-ref.ram";
     mc->default_cpus = 4;
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 2/5] Add Bochs to list of vga_interfaces
  2023-05-24 10:27 [PATCH v3 0/5] hw/arm/sbsa-ref: sort out graphics a bit Marcin Juszkiewicz
  2023-05-24 10:27 ` [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine Marcin Juszkiewicz
@ 2023-05-24 10:27 ` Marcin Juszkiewicz
  2023-05-24 10:48   ` Thomas Huth
  2023-05-24 14:59   ` Richard Henderson
  2023-05-24 10:27 ` [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument Marcin Juszkiewicz
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 10:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini, Marcin Juszkiewicz

arm/sbsa-ref uses Bochs-display graphics card and without it being
present in vga_interfaces "-vga none" argument handling cannot be added.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 include/sysemu/sysemu.h | 2 +-
 softmmu/vl.c            | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 25be2a692e..9713a1b470 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -29,7 +29,7 @@ extern int autostart;
 
 typedef enum {
     VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
-    VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO,
+    VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO, VGA_BOCHS,
     VGA_TYPE_MAX,
 } VGAInterfaceType;
 
diff --git a/softmmu/vl.c b/softmmu/vl.c
index b0b96f67fa..07e6030875 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -216,6 +216,7 @@ static struct {
     { .driver = "ati-vga",              .flag = &default_vga       },
     { .driver = "vhost-user-vga",       .flag = &default_vga       },
     { .driver = "virtio-vga-gl",        .flag = &default_vga       },
+    { .driver = "bochs-display",        .flag = &default_vga       },
 };
 
 static QemuOptsList qemu_rtc_opts = {
@@ -935,6 +936,11 @@ static const VGAInterfaceInfo vga_interfaces[VGA_TYPE_MAX] = {
         .name = "CG3 framebuffer",
         .class_names = { "cgthree" },
     },
+    [VGA_BOCHS] = {
+        .opt_name = "bochs-display",
+        .name = "Bochs framebuffer",
+        .class_names = { "bochs-display" },
+    },
 #ifdef CONFIG_XEN_BACKEND
     [VGA_XENFB] = {
         .opt_name = "xenfb",
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument
  2023-05-24 10:27 [PATCH v3 0/5] hw/arm/sbsa-ref: sort out graphics a bit Marcin Juszkiewicz
  2023-05-24 10:27 ` [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine Marcin Juszkiewicz
  2023-05-24 10:27 ` [PATCH v3 2/5] Add Bochs to list of vga_interfaces Marcin Juszkiewicz
@ 2023-05-24 10:27 ` Marcin Juszkiewicz
  2023-05-24 10:50   ` Thomas Huth
  2023-05-24 14:59   ` Richard Henderson
  2023-05-24 10:27 ` [PATCH v3 4/5] hw/arm/sbsa-ref: add gfx card only if we have pci Marcin Juszkiewicz
  2023-05-24 10:27 ` [PATCH v3 5/5] hw/arm/sbsa-ref: use MachineClass->default_display Marcin Juszkiewicz
  4 siblings, 2 replies; 11+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 10:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini, Marcin Juszkiewicz

In case someone wants to run without graphics card.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 hw/arm/sbsa-ref.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 9c3e670ec6..c540b2f1ba 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -649,7 +649,9 @@ static void create_pcie(SBSAMachineState *sms)
         }
     }
 
-    pci_create_simple(pci->bus, -1, "bochs-display");
+    if (vga_interface_type != VGA_NONE) {
+        pci_create_simple(pci->bus, -1, "bochs-display");
+    }
 
     create_smmu(sms, pci->bus);
 }
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 4/5] hw/arm/sbsa-ref: add gfx card only if we have pci
  2023-05-24 10:27 [PATCH v3 0/5] hw/arm/sbsa-ref: sort out graphics a bit Marcin Juszkiewicz
                   ` (2 preceding siblings ...)
  2023-05-24 10:27 ` [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument Marcin Juszkiewicz
@ 2023-05-24 10:27 ` Marcin Juszkiewicz
  2023-05-24 10:27 ` [PATCH v3 5/5] hw/arm/sbsa-ref: use MachineClass->default_display Marcin Juszkiewicz
  4 siblings, 0 replies; 11+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 10:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini, Marcin Juszkiewicz

Creation of network card is guarded with check do we
have pci bus. Do the same with graphics card.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 hw/arm/sbsa-ref.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index c540b2f1ba..9a3d77d6b6 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -647,10 +647,10 @@ static void create_pcie(SBSAMachineState *sms)
 
             pci_nic_init_nofail(nd, pci->bus, nd->model, NULL);
         }
-    }
 
-    if (vga_interface_type != VGA_NONE) {
-        pci_create_simple(pci->bus, -1, "bochs-display");
+        if (vga_interface_type != VGA_NONE) {
+            pci_create_simple(pci->bus, -1, "bochs-display");
+        }
     }
 
     create_smmu(sms, pci->bus);
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 5/5] hw/arm/sbsa-ref: use MachineClass->default_display
  2023-05-24 10:27 [PATCH v3 0/5] hw/arm/sbsa-ref: sort out graphics a bit Marcin Juszkiewicz
                   ` (3 preceding siblings ...)
  2023-05-24 10:27 ` [PATCH v3 4/5] hw/arm/sbsa-ref: add gfx card only if we have pci Marcin Juszkiewicz
@ 2023-05-24 10:27 ` Marcin Juszkiewicz
  4 siblings, 0 replies; 11+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 10:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini, Marcin Juszkiewicz

Mark the default graphica via the new MachineClass->default_display
setting so that the machine-defaults code in vl.c can decide whether the
default graphics is usable or not (for example when compiling with the
"--without-default-devices" configure switch).

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 hw/arm/sbsa-ref.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 9a3d77d6b6..30ce7f7db4 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -649,7 +649,7 @@ static void create_pcie(SBSAMachineState *sms)
         }
 
         if (vga_interface_type != VGA_NONE) {
-            pci_create_simple(pci->bus, -1, "bochs-display");
+            pci_create_simple(pci->bus, -1, mc->default_display);
         }
     }
 
@@ -865,6 +865,7 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data)
     mc->default_ram_size = 1 * GiB;
     mc->default_ram_id = "sbsa-ref.ram";
     mc->default_cpus = 4;
+    mc->default_display = "bochs-display";
     mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids;
     mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props;
     mc->get_default_cpu_node_id = sbsa_ref_get_default_cpu_node_id;
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 2/5] Add Bochs to list of vga_interfaces
  2023-05-24 10:27 ` [PATCH v3 2/5] Add Bochs to list of vga_interfaces Marcin Juszkiewicz
@ 2023-05-24 10:48   ` Thomas Huth
  2023-05-24 14:59   ` Richard Henderson
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2023-05-24 10:48 UTC (permalink / raw)
  To: Marcin Juszkiewicz, qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Paolo Bonzini

On 24/05/2023 12.27, Marcin Juszkiewicz wrote:
> arm/sbsa-ref uses Bochs-display graphics card and without it being
> present in vga_interfaces "-vga none" argument handling cannot be added.
> 
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
>   include/sysemu/sysemu.h | 2 +-
>   softmmu/vl.c            | 6 ++++++
>   2 files changed, 7 insertions(+), 1 deletion(-)

Sorry for not noticing it earlier ... but while you're at it, please also 
add an entry for VGA_BOCHS to pci_vga_init(), so that other machines could 
benefit from this automatically, too.

  Thomas




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument
  2023-05-24 10:27 ` [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument Marcin Juszkiewicz
@ 2023-05-24 10:50   ` Thomas Huth
  2023-05-24 14:59   ` Richard Henderson
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2023-05-24 10:50 UTC (permalink / raw)
  To: Marcin Juszkiewicz, qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Paolo Bonzini

On 24/05/2023 12.27, Marcin Juszkiewicz wrote:
> In case someone wants to run without graphics card.
> 
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
>   hw/arm/sbsa-ref.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
> index 9c3e670ec6..c540b2f1ba 100644
> --- a/hw/arm/sbsa-ref.c
> +++ b/hw/arm/sbsa-ref.c
> @@ -649,7 +649,9 @@ static void create_pcie(SBSAMachineState *sms)
>           }
>       }
>   
> -    pci_create_simple(pci->bus, -1, "bochs-display");
> +    if (vga_interface_type != VGA_NONE) {
> +        pci_create_simple(pci->bus, -1, "bochs-display");
> +    }

Once you extended pci_vga_init(), I think you should simply replace this 
line with pci_vga_init(pci->bus) - then you get the handling for VGA_NONE 
and other graphic adapters automatically (especially one could use "-vga 
std" to switch back to the normal VGA card that was used in former times).

  Thomas




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine
  2023-05-24 10:27 ` [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine Marcin Juszkiewicz
@ 2023-05-24 14:59   ` Richard Henderson
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2023-05-24 14:59 UTC (permalink / raw)
  To: Marcin Juszkiewicz, qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini

On 5/24/23 03:27, Marcin Juszkiewicz wrote:
> From: Thomas Huth<thuth@redhat.com>
> 
> Mark the default NIC via the new MachineClass->default_nic setting
> so that the machine-defaults code in vl.c can decide whether the
> default NIC is usable or not (for example when compiling with the
> "--without-default-devices" configure switch).
> 
> Signed-off-by: Thomas Huth<thuth@redhat.com>
> ---
>   hw/arm/sbsa-ref.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 2/5] Add Bochs to list of vga_interfaces
  2023-05-24 10:27 ` [PATCH v3 2/5] Add Bochs to list of vga_interfaces Marcin Juszkiewicz
  2023-05-24 10:48   ` Thomas Huth
@ 2023-05-24 14:59   ` Richard Henderson
  1 sibling, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2023-05-24 14:59 UTC (permalink / raw)
  To: Marcin Juszkiewicz, qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini

On 5/24/23 03:27, Marcin Juszkiewicz wrote:
> arm/sbsa-ref uses Bochs-display graphics card and without it being
> present in vga_interfaces "-vga none" argument handling cannot be added.
> 
> Signed-off-by: Marcin Juszkiewicz<marcin.juszkiewicz@linaro.org>
> ---
>   include/sysemu/sysemu.h | 2 +-
>   softmmu/vl.c            | 6 ++++++
>   2 files changed, 7 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument
  2023-05-24 10:27 ` [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument Marcin Juszkiewicz
  2023-05-24 10:50   ` Thomas Huth
@ 2023-05-24 14:59   ` Richard Henderson
  1 sibling, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2023-05-24 14:59 UTC (permalink / raw)
  To: Marcin Juszkiewicz, qemu-devel
  Cc: qemu-arm, Leif Lindholm, Peter Maydell, Thomas Huth,
	Paolo Bonzini

On 5/24/23 03:27, Marcin Juszkiewicz wrote:
> In case someone wants to run without graphics card.
> 
> Signed-off-by: Marcin Juszkiewicz<marcin.juszkiewicz@linaro.org>
> ---
>   hw/arm/sbsa-ref.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-24 15:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24 10:27 [PATCH v3 0/5] hw/arm/sbsa-ref: sort out graphics a bit Marcin Juszkiewicz
2023-05-24 10:27 ` [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine Marcin Juszkiewicz
2023-05-24 14:59   ` Richard Henderson
2023-05-24 10:27 ` [PATCH v3 2/5] Add Bochs to list of vga_interfaces Marcin Juszkiewicz
2023-05-24 10:48   ` Thomas Huth
2023-05-24 14:59   ` Richard Henderson
2023-05-24 10:27 ` [PATCH v3 3/5] hw/arm/sbsa-ref: honor "-vga none" argument Marcin Juszkiewicz
2023-05-24 10:50   ` Thomas Huth
2023-05-24 14:59   ` Richard Henderson
2023-05-24 10:27 ` [PATCH v3 4/5] hw/arm/sbsa-ref: add gfx card only if we have pci Marcin Juszkiewicz
2023-05-24 10:27 ` [PATCH v3 5/5] hw/arm/sbsa-ref: use MachineClass->default_display Marcin Juszkiewicz

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).