diff mbox series

[v4,2/3] Add Bochs to list of vga_interfaces

Message ID 20230524111413.833912-3-marcin.juszkiewicz@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw/arm/sbsa-ref: sort out graphics a bit | expand

Commit Message

Marcin Juszkiewicz May 24, 2023, 11:14 a.m. UTC
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>
---
 hw/pci/pci.c            | 2 ++
 include/sysemu/sysemu.h | 2 +-
 softmmu/vl.c            | 6 ++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

Comments

Thomas Huth May 24, 2023, 11:47 a.m. UTC | #1
On 24/05/2023 13.14, 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>
> ---
>   hw/pci/pci.c            | 2 ++
>   include/sysemu/sysemu.h | 2 +-
>   softmmu/vl.c            | 6 ++++++
>   3 files changed, 9 insertions(+), 1 deletion(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>
Peter Maydell May 25, 2023, 10:15 a.m. UTC | #2
On Wed, 24 May 2023 at 12:14, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> 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>
> ---
>  hw/pci/pci.c            | 2 ++
>  include/sysemu/sysemu.h | 2 +-
>  softmmu/vl.c            | 6 ++++++
>  3 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 1cc7c89036..edac76ea15 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -1937,6 +1937,8 @@ PCIDevice *pci_vga_init(PCIBus *bus)
>          return pci_create_simple(bus, -1, "vmware-svga");
>      case VGA_VIRTIO:
>          return pci_create_simple(bus, -1, "virtio-vga");
> +    case VGA_BOCHS:
> +        return pci_create_simple(bus, -1, "bochs-display");
>      case VGA_NONE:
>      default: /* Other non-PCI types. Checking for unsupported types is already
>                  done in vl.c. */
> 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;

Is it really right that we want to add more support to this
legacy-command-line-option interface? We don't list every
graphics device we support here...

-- PMM
diff mbox series

Patch

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 1cc7c89036..edac76ea15 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1937,6 +1937,8 @@  PCIDevice *pci_vga_init(PCIBus *bus)
         return pci_create_simple(bus, -1, "vmware-svga");
     case VGA_VIRTIO:
         return pci_create_simple(bus, -1, "virtio-vga");
+    case VGA_BOCHS:
+        return pci_create_simple(bus, -1, "bochs-display");
     case VGA_NONE:
     default: /* Other non-PCI types. Checking for unsupported types is already
                 done in vl.c. */
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",