qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-devel@nongnu.org, Alex Williamson <alex.williamson@redhat.com>
Cc: "Avihai Horon" <avihaih@nvidia.com>,
	"Eric Auger" <eric.auger@redhat.com>,
	"Zhenzhong Duan" <zhenzhong.duan@intel.com>,
	"Cédric Le Goater" <clg@redhat.com>
Subject: [PATCH for-10.1 07/32] vfio: Introduce a new header file for VFIOdisplay declarations
Date: Tue, 18 Mar 2025 10:53:50 +0100	[thread overview]
Message-ID: <20250318095415.670319-8-clg@redhat.com> (raw)
In-Reply-To: <20250318095415.670319-1-clg@redhat.com>

Gather all VFIOdisplay related declarations into "display.h" to
reduce exposure of VFIO internals in "hw/vfio/vfio-common.h".

Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/vfio/display.h             | 41 +++++++++++++++++++++++++++++++++++
 hw/vfio/pci.h                 |  1 +
 include/hw/vfio/vfio-common.h | 28 ------------------------
 hw/vfio/display.c             |  2 +-
 4 files changed, 43 insertions(+), 29 deletions(-)
 create mode 100644 hw/vfio/display.h

diff --git a/hw/vfio/display.h b/hw/vfio/display.h
new file mode 100644
index 0000000000000000000000000000000000000000..93a4df2dfa5b39946d700b3df76233f0d7b0343f
--- /dev/null
+++ b/hw/vfio/display.h
@@ -0,0 +1,41 @@
+/*
+ * VFIO display
+ *
+ * Copyright Red Hat, Inc. 2025
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_VFIO_DISPLAY_H
+#define HW_VFIO_DISPLAY_H
+
+#include "ui/console.h"
+#include "hw/display/ramfb.h"
+
+typedef struct VFIODMABuf {
+    QemuDmaBuf *buf;
+    uint32_t pos_x, pos_y, pos_updates;
+    uint32_t hot_x, hot_y, hot_updates;
+    int dmabuf_id;
+    QTAILQ_ENTRY(VFIODMABuf) next;
+} VFIODMABuf;
+
+typedef struct VFIODisplay {
+    QemuConsole *con;
+    RAMFBState *ramfb;
+    struct vfio_region_info *edid_info;
+    struct vfio_region_gfx_edid *edid_regs;
+    uint8_t *edid_blob;
+    QEMUTimer *edid_link_timer;
+    struct {
+        VFIORegion buffer;
+        DisplaySurface *surface;
+    } region;
+    struct {
+        QTAILQ_HEAD(, VFIODMABuf) bufs;
+        VFIODMABuf *primary;
+        VFIODMABuf *cursor;
+    } dmabuf;
+} VFIODisplay;
+
+#endif /* HW_VFIO_DISPLAY_H */
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index d94ecaba689c4681687c0a6796ffbcda522ae179..c84bba81487136d205ca30049c812d00e832c377 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -20,6 +20,7 @@
 #include "qemu/timer.h"
 #include "qom/object.h"
 #include "system/kvm.h"
+#include "display.h"
 
 #define PCI_ANY_ID (~0)
 
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 799e12d43747addbf444c15052f629b65978322f..288c2fb3d0e792427c0e7655002248829b4d189a 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -23,8 +23,6 @@
 
 #include "exec/memory.h"
 #include "qemu/queue.h"
-#include "ui/console.h"
-#include "hw/display/ramfb.h"
 #ifdef CONFIG_LINUX
 #include <linux/vfio.h>
 #endif
@@ -182,32 +180,6 @@ typedef struct VFIOGroup {
 #define TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO \
             TYPE_HOST_IOMMU_DEVICE_IOMMUFD "-vfio"
 
-typedef struct VFIODMABuf {
-    QemuDmaBuf *buf;
-    uint32_t pos_x, pos_y, pos_updates;
-    uint32_t hot_x, hot_y, hot_updates;
-    int dmabuf_id;
-    QTAILQ_ENTRY(VFIODMABuf) next;
-} VFIODMABuf;
-
-typedef struct VFIODisplay {
-    QemuConsole *con;
-    RAMFBState *ramfb;
-    struct vfio_region_info *edid_info;
-    struct vfio_region_gfx_edid *edid_regs;
-    uint8_t *edid_blob;
-    QEMUTimer *edid_link_timer;
-    struct {
-        VFIORegion buffer;
-        DisplaySurface *surface;
-    } region;
-    struct {
-        QTAILQ_HEAD(, VFIODMABuf) bufs;
-        VFIODMABuf *primary;
-        VFIODMABuf *cursor;
-    } dmabuf;
-} VFIODisplay;
-
 VFIOAddressSpace *vfio_get_address_space(AddressSpace *as);
 void vfio_put_address_space(VFIOAddressSpace *space);
 void vfio_address_space_insert(VFIOAddressSpace *space,
diff --git a/hw/vfio/display.c b/hw/vfio/display.c
index ea87830fe0d5fc66f3f27a16bde5d75b7b6280c0..2c06361c67cb074b88f2649b3b9fd21b7bacf07c 100644
--- a/hw/vfio/display.c
+++ b/hw/vfio/display.c
@@ -16,9 +16,9 @@
 
 #include "qemu/error-report.h"
 #include "hw/display/edid.h"
-#include "ui/console.h"
 #include "qapi/error.h"
 #include "pci.h"
+#include "display.h"
 #include "trace.h"
 
 #ifndef DRM_PLANE_TYPE_PRIMARY
-- 
2.48.1



  parent reply	other threads:[~2025-03-18  9:59 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  9:53 [PATCH for-10.1 00/32] vfio: Spring cleanup Cédric Le Goater
2025-03-18  9:53 ` [PATCH for-10.1 01/32] vfio: Move vfio_mig_active() into migration.c Cédric Le Goater
2025-03-19  9:10   ` John Levon
2025-03-19 11:54   ` Avihai Horon
2025-03-19 16:38     ` Cédric Le Goater
2025-03-18  9:53 ` [PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred() Cédric Le Goater
2025-03-19  7:33   ` Philippe Mathieu-Daudé
2025-03-19  9:10   ` John Levon
2025-03-19 12:07   ` Avihai Horon
2025-03-18  9:53 ` [PATCH for-10.1 03/32] vfio: Introduce a new header file for external migration services Cédric Le Goater
2025-03-19 11:48   ` Prasad Pandit
2025-03-19 12:37   ` Avihai Horon
2025-03-19 16:49     ` Cédric Le Goater
2025-03-18  9:53 ` [PATCH for-10.1 04/32] vfio: Make vfio_un/block_multiple_devices_migration() static Cédric Le Goater
2025-03-19 12:38   ` Joao Martins
2025-03-18  9:53 ` [PATCH for-10.1 05/32] vfio: Make vfio_viommu_preset() static Cédric Le Goater
2025-03-19 12:26   ` Joao Martins
2025-03-19 16:50   ` John Levon
2025-03-18  9:53 ` [PATCH for-10.1 06/32] vfio: Introduce a new header file for internal migration services Cédric Le Goater
2025-03-19 12:29   ` Prasad Pandit
2025-03-19 17:26     ` Cédric Le Goater
2025-03-20  6:19       ` Prasad Pandit
2025-03-19 14:05   ` Avihai Horon
2025-03-19 17:33     ` Cédric Le Goater
2025-03-19 16:55   ` John Levon
2025-03-18  9:53 ` Cédric Le Goater [this message]
2025-03-20  9:50   ` [PATCH for-10.1 07/32] vfio: Introduce a new header file for VFIOdisplay declarations John Levon
2025-03-18  9:53 ` [PATCH for-10.1 08/32] vfio: Move VFIOHostDMAWindow definition into spapr.c Cédric Le Goater
2025-03-20  9:43   ` John Levon
2025-03-18  9:53 ` [PATCH for-10.1 09/32] vfio: Introduce a new header file for VFIOIOMMUFD declarations Cédric Le Goater
2025-03-19  9:09   ` John Levon
2025-03-20  9:18   ` Duan, Zhenzhong
2025-03-20 13:37     ` Cédric Le Goater
2025-03-18  9:53 ` [PATCH for-10.1 10/32] vfio: Introduce new files for VFIORegion definitions and declarations Cédric Le Goater
2025-03-19 16:54   ` John Levon
2025-03-18  9:53 ` [PATCH for-10.1 11/32] vfio: Introduce a new header file for VFIOcontainer declarations Cédric Le Goater
2025-03-19 17:00   ` John Levon
2025-03-20  9:24   ` Duan, Zhenzhong
2025-03-18  9:53 ` [PATCH for-10.1 12/32] vfio: Make vfio_group_list static Cédric Le Goater
2025-03-20  9:28   ` Duan, Zhenzhong
2025-03-20  9:38   ` John Levon
2025-03-18  9:53 ` [PATCH for-10.1 13/32] vfio: Move VFIOAddressSpace helpers into container-base.c Cédric Le Goater
2025-03-19 16:45   ` John Levon
2025-03-20  9:36   ` Duan, Zhenzhong
2025-03-20 19:26     ` Cédric Le Goater
2025-03-21  7:18       ` Duan, Zhenzhong
2025-03-18  9:53 ` [PATCH for-10.1 14/32] vfio: Move Host IOMMU type declarations into their respective files Cédric Le Goater
2025-03-19  9:10   ` John Levon
2025-03-20  9:36   ` Duan, Zhenzhong
2025-03-18  9:53 ` [PATCH for-10.1 15/32] vfio: Introduce a new header file for helper services Cédric Le Goater
2025-03-20  9:40   ` John Levon
2025-03-21  9:25     ` Cédric Le Goater
2025-03-21 11:17       ` John Levon
2025-03-18  9:53 ` [PATCH for-10.1 16/32] vfio: Move vfio_get_info_dma_avail() into helpers.c Cédric Le Goater
2025-03-19 16:50   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 17/32] vfio: Move vfio_kvm_device_add/del_fd() to helpers.c Cédric Le Goater
2025-03-19 16:46   ` John Levon
2025-03-20  9:40   ` Duan, Zhenzhong
2025-03-18  9:54 ` [PATCH for-10.1 18/32] vfio: Move vfio_get_device_info() " Cédric Le Goater
2025-03-20  9:41   ` John Levon
2025-03-20  9:42   ` Duan, Zhenzhong
2025-03-18  9:54 ` [PATCH for-10.1 19/32] vfio: Introduce a new file for VFIODevice definitions Cédric Le Goater
2025-03-19 16:42   ` John Levon
2025-03-20  9:01     ` Cédric Le Goater
2025-03-18  9:54 ` [PATCH for-10.1 20/32] vfio: Introduce new files for CPR definitions and declarations Cédric Le Goater
2025-03-19 17:01   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 21/32] vfio: Move vfio_kvm_device_fd() into helpers.c Cédric Le Goater
2025-03-20  9:44   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 22/32] vfio: Move vfio_device_list into device.c Cédric Le Goater
2025-03-20  9:29   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 23/32] vfio: Move vfio_de/attach_device() " Cédric Le Goater
2025-03-19 16:58   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 24/32] vfio: Introduce new files for dirty tracking definitions and declarations Cédric Le Goater
2025-03-19 13:23   ` Joao Martins
2025-03-20  9:46   ` John Levon
2025-03-21  9:29     ` Cédric Le Goater
2025-03-20  9:52   ` Duan, Zhenzhong
2025-03-20 11:00     ` Joao Martins
2025-03-21  6:24       ` Duan, Zhenzhong
2025-03-21  9:31     ` Cédric Le Goater
2025-03-21  9:44       ` Duan, Zhenzhong
2025-03-18  9:54 ` [PATCH for-10.1 25/32] vfio: Move vfio_set_migration_error() into migration.c Cédric Le Goater
2025-03-19 12:12   ` Prasad Pandit
2025-03-21 10:19     ` Cédric Le Goater
2025-03-24  4:40       ` Prasad Pandit
2025-03-19 17:00   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 26/32] vfio: Rename vfio-common.h to vfio-device.h Cédric Le Goater
2025-03-19 14:27   ` Avihai Horon
2025-03-21 11:03     ` Cédric Le Goater
2025-03-19 16:56   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 27/32] vfio: Rename VFIODevice related services Cédric Le Goater
2025-03-20  9:35   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 28/32] vfio: Make vfio_devices_query_dirty_bitmap() static Cédric Le Goater
2025-03-19 12:14   ` Joao Martins
2025-03-19 16:54   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 29/32] vfio: Rename VFIOContainer related services Cédric Le Goater
2025-03-20  9:38   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 30/32] vfio: Rename VFIO dirty tracking services Cédric Le Goater
2025-03-19 12:21   ` Joao Martins
2025-03-20 11:13     ` Avihai Horon
2025-03-20 11:18       ` Joao Martins
2025-03-20 11:45         ` Avihai Horon
2025-03-20 11:56           ` Joao Martins
2025-03-20 12:24             ` Avihai Horon
2025-03-21 11:22     ` Cédric Le Goater
2025-03-31 12:49       ` Joao Martins
2025-03-31 13:14         ` Cédric Le Goater
2025-03-20  9:42   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 31/32] vfio: Introduce vfio_dirty_tracking_un/register() routines Cédric Le Goater
2025-03-19 13:24   ` Joao Martins
2025-03-20 12:28     ` Joao Martins
2025-03-20  9:49   ` John Levon
2025-03-18  9:54 ` [PATCH for-10.1 32/32] vfio: Rename RAM discard related services Cédric Le Goater
2025-03-19 16:57   ` John Levon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250318095415.670319-8-clg@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=avihaih@nvidia.com \
    --cc=eric.auger@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhenzhong.duan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).