Skip to contentSkip to conversation

hw/display: Trivial include cleanups

PATCH In review Philippe Mathieu-Daudé 4 participants 9 messages May 4, 2020 – May 18, 2020

lore
Share & tools
lore
#0 lore raw

cover hw/display: Trivial include cleanups

Some 'display' patches worth salvaging while doing housekeeping.

Philippe Mathieu-Daudé (2):
hw/display: Include local 'framebuffer.h' hw/display/edid: Add missing 'qdev-properties.h' header

 include/hw/display/edid.h | 1 +
 hw/display/artist.c       | 2 +-
 hw/display/next-fb.c      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.21.3
#1 lore raw

PATCH 1/2 hw/display: Include local 'framebuffer.h'

The "framebuffer.h" header is not an exported include.

---
 hw/display/artist.c  | 2 +-
 hw/display/next-fb.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/display/artist.c +1 -1
index 753dbb9a77..e1d5885fed 100644
@@ -21,7 +21,7 @@
 #include "migration/vmstate.h"
 #include "ui/console.h"
 #include "trace.h"
-#include "hw/display/framebuffer.h"
+#include "framebuffer.h"
 
 #define TYPE_ARTIST "artist"
 #define ARTIST(obj) OBJECT_CHECK(ARTISTState, (obj), TYPE_ARTIST)
hw/display/next-fb.c +1 -1
index 2b726a10f8..b0513a8fba 100644
@@ -27,7 +27,7 @@
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
-#include "hw/display/framebuffer.h"
+#include "framebuffer.h"
 #include "ui/pixel_ops.h"
 #include "hw/m68k/next-cube.h"
 
Signature · 1 line
2.21.3
#4 lore raw

Re: [PATCH 1/2] hw/display: Include local 'framebuffer.h'

In reply to Philippe Mathieu-Daudé
Quoted 1 line · Philippe Mathieu-Daudé

The "framebuffer.h" header is not an exported include.

Patch added to ui queue.
(patch 2/2 skipped, has unanswered quesions).

thanks,
Gerd

Quoted 36 lines
---
 hw/display/artist.c  | 2 +-
 hw/display/next-fb.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/display/artist.c +1 -1
index 753dbb9a77..e1d5885fed 100644
@@ -21,7 +21,7 @@
 #include "migration/vmstate.h"
 #include "ui/console.h"
 #include "trace.h"
-#include "hw/display/framebuffer.h"
+#include "framebuffer.h"
 
 #define TYPE_ARTIST "artist"
 #define ARTIST(obj) OBJECT_CHECK(ARTISTState, (obj), TYPE_ARTIST)
hw/display/next-fb.c +1 -1
index 2b726a10f8..b0513a8fba 100644
@@ -27,7 +27,7 @@
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
-#include "hw/display/framebuffer.h"
+#include "framebuffer.h"
 #include "ui/pixel_ops.h"
 #include "hw/m68k/next-cube.h"
 
Signature · 1 line
2.21.3
#5 lore raw

PATCH 2/2 hw/display/edid: Add missing 'qdev-properties.h' header

In reply to Philippe Mathieu-Daudé

To use the DEFINE_EDID_PROPERTIES() macro we need the definitions from "hw/qdev-properties.h".

---
 include/hw/display/edid.h | 1 +
 1 file changed, 1 insertion(+)
include/hw/display/edid.h +1 -0
index ff99dc0a05..23371ee82c 100644
@@ -2,6 +2,7 @@
 #define EDID_H
 
 #include "qom/object.h"
+#include "hw/qdev-properties.h"
 
 typedef struct qemu_edid_info {
     const char *vendor; /* http://www.uefi.org/pnp_id_list */
Signature · 1 line
2.21.3
#6 lore raw

Re: [PATCH 2/2] hw/display/edid: Add missing 'qdev-properties.h' header

include/hw/display/edid.h line 5

Quoted 6 lines · Philippe Mathieu-Daudé

+++ b/include/hw/display/edid.h

include/hw/display/edid.h +1 -0
@@ -2,6 +2,7 @@
 #define EDID_H
 
 #include "qom/object.h"
+#include "hw/qdev-properties.h"

So, are you intending to remove this include from other c files?

r~

#8 lore raw

Re: [PATCH 2/2] hw/display/edid: Add missing 'qdev-properties.h' header

Quoted 11 lines · Richard Henderson
Quoted 7 lines · Philippe Mathieu-Daudé

To use the DEFINE_EDID_PROPERTIES() macro we need the definitions from "hw/qdev-properties.h".

---
 include/hw/display/edid.h | 1 +
 1 file changed, 1 insertion(+)

Does this not currently build? I'm not sure what you're fixing.

Because when trying to use this header once included, I get when building:

include/hw/display/edid.h:24:5: error: implicit declaration of function ‘DEFINE_PROP_UINT32’ [-Werror=implicit-function-declaration]

   24 |     DEFINE_PROP_UINT32("xres", _state, _edid_info.prefx, 0),    \
      |     ^~~~~~~~~~~~~~~~~~

Then I've to grep for this macro and figure out I need to include "hw/qdev-properties.h".
I am expecting a header providing a macro to also include the pre-requisites, so I fixed in case someone else run into the same problem.
Does it make sense? I can reword the patch description to better explain.

Quoted 3 lines

r~