Skip to contentSkip to conversation

display: include dependencies explicitly

PATCH In review Michael S. Tsirkin 3 participants 3 messages Nov 9, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 display: include dependencies explicitly

acpi-vga-stub.c pulls in vga_int.h
However that currently pulls in ui/console.h which breaks e.g. on systems without pixman. It's better to remove ui/console.h from vga_int.h and directly include it where it's used.

---
 hw/display/vga_int.h        | 1 -
 include/qemu/typedefs.h     | 2 ++
 hw/display/ati_2d.c         | 1 +
 hw/display/cirrus_vga.c     | 1 +
 hw/display/cirrus_vga_isa.c | 1 +
 hw/display/vga-isa.c        | 1 +
 hw/display/vga-mmio.c       | 1 +
 hw/display/vga-pci.c        | 1 +
 hw/display/vga.c            | 1 +
 hw/display/vmware_vga.c     | 1 +
 10 files changed, 10 insertions(+), 1 deletion(-)
hw/display/vga_int.h +0 -1
index 330406ad9c..7cf0d11201 100644
@@ -27,7 +27,6 @@
 
 #include "exec/ioport.h"
 #include "exec/memory.h"
-#include "ui/console.h"
 
 #include "hw/display/bochs-vbe.h"
 #include "hw/acpi/acpi_aml_interface.h"
include/qemu/typedefs.h +2 -0
index 6d4e6d9708..688408e048 100644
@@ -132,6 +132,8 @@ typedef struct Visitor Visitor;
 typedef struct VMChangeStateEntry VMChangeStateEntry;
 typedef struct VMStateDescription VMStateDescription;
 typedef struct DumpState DumpState;
+typedef struct GraphicHwOps GraphicHwOps;
+typedef struct QEMUCursor QEMUCursor;
 
 /*
  * Pointer types
hw/display/ati_2d.c +1 -0
index 692bec91de..7d786653e8 100644
@@ -12,6 +12,7 @@
 #include "ati_regs.h"
 #include "qemu/log.h"
 #include "ui/pixel_ops.h"
+#include "ui/console.h"
 
 /*
  * NOTE:
hw/display/cirrus_vga.c +1 -0
index 2577005d03..4cc3567c69 100644
@@ -45,6 +45,7 @@
 #include "ui/pixel_ops.h"
 #include "cirrus_vga_internal.h"
 #include "qom/object.h"
+#include "ui/console.h"
 
 /*
  * TODO:
hw/display/cirrus_vga_isa.c +1 -0
index 96144bd690..84be51670e 100644
@@ -31,6 +31,7 @@
 #include "hw/isa/isa.h"
 #include "cirrus_vga_internal.h"
 #include "qom/object.h"
+#include "ui/console.h"
 
 #define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
 OBJECT_DECLARE_SIMPLE_TYPE(ISACirrusVGAState, ISA_CIRRUS_VGA)
hw/display/vga-isa.c +1 -0
index 46abbc5653..2a5437d803 100644
@@ -32,6 +32,7 @@
 #include "qemu/timer.h"
 #include "hw/loader.h"
 #include "hw/qdev-properties.h"
+#include "ui/console.h"
 #include "qom/object.h"
 
 #define TYPE_ISA_VGA "isa-vga"
hw/display/vga-mmio.c +1 -0
index 75dfcedea5..cd2c46776d 100644
@@ -27,6 +27,7 @@
 #include "hw/sysbus.h"
 #include "hw/display/vga.h"
 #include "hw/qdev-properties.h"
+#include "ui/console.h"
 #include "vga_int.h"
 
 /*
hw/display/vga-pci.c +1 -0
index 9a91de7ed1..df23dbf3a0 100644
@@ -30,6 +30,7 @@
 #include "migration/vmstate.h"
 #include "vga_int.h"
 #include "ui/pixel_ops.h"
+#include "ui/console.h"
 #include "qemu/module.h"
 #include "qemu/timer.h"
 #include "hw/loader.h"
hw/display/vga.c +1 -0
index 50ecb1ad02..0cb26a791b 100644
@@ -31,6 +31,7 @@
 #include "vga_int.h"
 #include "vga_regs.h"
 #include "ui/pixel_ops.h"
+#include "ui/console.h"
 #include "qemu/timer.h"
 #include "hw/xen/xen.h"
 #include "migration/vmstate.h"
hw/display/vmware_vga.c +1 -0
index cedbbde522..53949d2539 100644
@@ -33,6 +33,7 @@
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 #include "qom/object.h"
+#include "ui/console.h"
 
 #undef VERBOSE
 #define HW_RECT_ACCEL
Signature · 1 line
MST
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Michael S. Tsirkin

acpi-vga-stub.c pulls in vga_int.h
However that currently pulls in ui/console.h which breaks e.g. on systems without pixman. It's better to remove ui/console.h from vga_int.h and directly include it where it's used.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1308

Fixes cfead31326 ("AcpiDevAmlIf interface to build VGA device descs")
Quoted 31 lines
---
  hw/display/vga_int.h        | 1 -
  include/qemu/typedefs.h     | 2 ++
  hw/display/ati_2d.c         | 1 +
  hw/display/cirrus_vga.c     | 1 +
  hw/display/cirrus_vga_isa.c | 1 +
  hw/display/vga-isa.c        | 1 +
  hw/display/vga-mmio.c       | 1 +
  hw/display/vga-pci.c        | 1 +
  hw/display/vga.c            | 1 +
  hw/display/vmware_vga.c     | 1 +
  10 files changed, 10 insertions(+), 1 deletion(-)
hw/display/vga_int.h +0 -1
index 330406ad9c..7cf0d11201 100644
@@ -27,7 +27,6 @@
 
  #include "exec/ioport.h"
  #include "exec/memory.h"
-#include "ui/console.h"
 
  #include "hw/display/bochs-vbe.h"
  #include "hw/acpi/acpi_aml_interface.h"
include/qemu/typedefs.h +0 -0
index 6d4e6d9708..688408e048 100644

include/qemu/typedefs.h typedef struct Visitor Visitor; · line 136

Quoted 5 lines
include/qemu/typedefs.h +2 -0
@@ -132,6 +132,8 @@ typedef struct Visitor Visitor;
  typedef struct VMChangeStateEntry VMChangeStateEntry;
  typedef struct VMStateDescription VMStateDescription;
  typedef struct DumpState DumpState;
+typedef struct GraphicHwOps GraphicHwOps;
+typedef struct QEMUCursor QEMUCursor;

Besides the "Please keep this list in case-insensitive alphabetical order." in this file header,

Quoted 98 lines
include/qemu/typedefs.h +0 -0
  /*
   * Pointer types
hw/display/ati_2d.c +1 -0
index 692bec91de..7d786653e8 100644
@@ -12,6 +12,7 @@
  #include "ati_regs.h"
  #include "qemu/log.h"
  #include "ui/pixel_ops.h"
+#include "ui/console.h"
 
  /*
   * NOTE:
hw/display/cirrus_vga.c +1 -0
index 2577005d03..4cc3567c69 100644
@@ -45,6 +45,7 @@
  #include "ui/pixel_ops.h"
  #include "cirrus_vga_internal.h"
  #include "qom/object.h"
+#include "ui/console.h"
 
  /*
   * TODO:
hw/display/cirrus_vga_isa.c +1 -0
index 96144bd690..84be51670e 100644
@@ -31,6 +31,7 @@
  #include "hw/isa/isa.h"
  #include "cirrus_vga_internal.h"
  #include "qom/object.h"
+#include "ui/console.h"
 
  #define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
  OBJECT_DECLARE_SIMPLE_TYPE(ISACirrusVGAState, ISA_CIRRUS_VGA)
hw/display/vga-isa.c +1 -0
index 46abbc5653..2a5437d803 100644
@@ -32,6 +32,7 @@
  #include "qemu/timer.h"
  #include "hw/loader.h"
  #include "hw/qdev-properties.h"
+#include "ui/console.h"
  #include "qom/object.h"
 
  #define TYPE_ISA_VGA "isa-vga"
hw/display/vga-mmio.c +1 -0
index 75dfcedea5..cd2c46776d 100644
@@ -27,6 +27,7 @@
  #include "hw/sysbus.h"
  #include "hw/display/vga.h"
  #include "hw/qdev-properties.h"
+#include "ui/console.h"
  #include "vga_int.h"
 
  /*
hw/display/vga-pci.c +1 -0
index 9a91de7ed1..df23dbf3a0 100644
@@ -30,6 +30,7 @@
  #include "migration/vmstate.h"
  #include "vga_int.h"
  #include "ui/pixel_ops.h"
+#include "ui/console.h"
  #include "qemu/module.h"
  #include "qemu/timer.h"
  #include "hw/loader.h"
hw/display/vga.c +1 -0
index 50ecb1ad02..0cb26a791b 100644
@@ -31,6 +31,7 @@
  #include "vga_int.h"
  #include "vga_regs.h"
  #include "ui/pixel_ops.h"
+#include "ui/console.h"
  #include "qemu/timer.h"
  #include "hw/xen/xen.h"
  #include "migration/vmstate.h"
hw/display/vmware_vga.c +1 -0
index cedbbde522..53949d2539 100644
@@ -33,6 +33,7 @@
  #include "hw/qdev-properties.h"
  #include "migration/vmstate.h"
  #include "qom/object.h"
+#include "ui/console.h"
 
  #undef VERBOSE
  #define HW_RECT_ACCEL
Tested-by on v1 1/1
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 7 lines · Michael S. Tsirkin

acpi-vga-stub.c pulls in vga_int.h
However that currently pulls in ui/console.h which breaks e.g. on systems without pixman. It's better to remove ui/console.h from vga_int.h and directly include it where it's used.

Quoted 134 lines
---
  hw/display/vga_int.h        | 1 -
  include/qemu/typedefs.h     | 2 ++
  hw/display/ati_2d.c         | 1 +
  hw/display/cirrus_vga.c     | 1 +
  hw/display/cirrus_vga_isa.c | 1 +
  hw/display/vga-isa.c        | 1 +
  hw/display/vga-mmio.c       | 1 +
  hw/display/vga-pci.c        | 1 +
  hw/display/vga.c            | 1 +
  hw/display/vmware_vga.c     | 1 +
  10 files changed, 10 insertions(+), 1 deletion(-)
hw/display/vga_int.h +0 -1
index 330406ad9c..7cf0d11201 100644
@@ -27,7 +27,6 @@
 
  #include "exec/ioport.h"
  #include "exec/memory.h"
-#include "ui/console.h"
 
  #include "hw/display/bochs-vbe.h"
  #include "hw/acpi/acpi_aml_interface.h"
include/qemu/typedefs.h +2 -0
index 6d4e6d9708..688408e048 100644
@@ -132,6 +132,8 @@ typedef struct Visitor Visitor;
  typedef struct VMChangeStateEntry VMChangeStateEntry;
  typedef struct VMStateDescription VMStateDescription;
  typedef struct DumpState DumpState;
+typedef struct GraphicHwOps GraphicHwOps;
+typedef struct QEMUCursor QEMUCursor;
 
  /*
   * Pointer types
hw/display/ati_2d.c +1 -0
index 692bec91de..7d786653e8 100644
@@ -12,6 +12,7 @@
  #include "ati_regs.h"
  #include "qemu/log.h"
  #include "ui/pixel_ops.h"
+#include "ui/console.h"
 
  /*
   * NOTE:
hw/display/cirrus_vga.c +1 -0
index 2577005d03..4cc3567c69 100644
@@ -45,6 +45,7 @@
  #include "ui/pixel_ops.h"
  #include "cirrus_vga_internal.h"
  #include "qom/object.h"
+#include "ui/console.h"
 
  /*
   * TODO:
hw/display/cirrus_vga_isa.c +1 -0
index 96144bd690..84be51670e 100644
@@ -31,6 +31,7 @@
  #include "hw/isa/isa.h"
  #include "cirrus_vga_internal.h"
  #include "qom/object.h"
+#include "ui/console.h"
 
  #define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
  OBJECT_DECLARE_SIMPLE_TYPE(ISACirrusVGAState, ISA_CIRRUS_VGA)
hw/display/vga-isa.c +1 -0
index 46abbc5653..2a5437d803 100644
@@ -32,6 +32,7 @@
  #include "qemu/timer.h"
  #include "hw/loader.h"
  #include "hw/qdev-properties.h"
+#include "ui/console.h"
  #include "qom/object.h"
 
  #define TYPE_ISA_VGA "isa-vga"
hw/display/vga-mmio.c +1 -0
index 75dfcedea5..cd2c46776d 100644
@@ -27,6 +27,7 @@
  #include "hw/sysbus.h"
  #include "hw/display/vga.h"
  #include "hw/qdev-properties.h"
+#include "ui/console.h"
  #include "vga_int.h"
 
  /*
hw/display/vga-pci.c +1 -0
index 9a91de7ed1..df23dbf3a0 100644
@@ -30,6 +30,7 @@
  #include "migration/vmstate.h"
  #include "vga_int.h"
  #include "ui/pixel_ops.h"
+#include "ui/console.h"
  #include "qemu/module.h"
  #include "qemu/timer.h"
  #include "hw/loader.h"
hw/display/vga.c +1 -0
index 50ecb1ad02..0cb26a791b 100644
@@ -31,6 +31,7 @@
  #include "vga_int.h"
  #include "vga_regs.h"
  #include "ui/pixel_ops.h"
+#include "ui/console.h"
  #include "qemu/timer.h"
  #include "hw/xen/xen.h"
  #include "migration/vmstate.h"
hw/display/vmware_vga.c +1 -0
index cedbbde522..53949d2539 100644
@@ -33,6 +33,7 @@
  #include "hw/qdev-properties.h"
  #include "migration/vmstate.h"
  #include "qom/object.h"
+#include "ui/console.h"
 
  #undef VERBOSE
  #define HW_RECT_ACCEL