hw/display: Refresh UI depending on vGPU page flip events
cover hw/display: Refresh UI depending on vGPU page flip events
This series shows the idea to refresh UI console depending on vGPU page flip events.
Tina Zhang (3):
vfio: Add a funtion to return a specific irq capabilities ui/console: Introduce two new APIs
vfio/display: Refresh display depending on vGPU page flip events
hw/vfio/common.c | 78 +++++++++++ hw/vfio/display.c | 249 +++++++++++++++++++++++++++++----- include/hw/vfio/vfio-common.h | 11 ++ include/ui/console.h | 2 + ui/console.c | 35 +++++ 5 files changed, 343 insertions(+), 32 deletions(-)
Signature · 1 line
2.17.1
RFC PATCH 1/3 vfio: Add a funtion to return a specific irq capabilities
vfio_get_dev_irq_info is introduced to return a specific irq capabilities.
--- hw/vfio/common.c | 78 +++++++++++++++++++++++++++++++++++ include/hw/vfio/vfio-common.h | 3 ++ 2 files changed, 81 insertions(+)
hw/vfio/common.c +78 -0
@@ -748,6 +748,25 @@ vfio_get_region_info_cap(struct vfio_region_info *info, uint16_t id)return NULL ; } +static struct vfio_info_cap_header * +vfio_get_irq_info_cap (struct vfio_irq_info *info,uint16_t id) +{ +struct vfio_info_cap_header *hdr; +void *ptr = info; + +if (!(info->flags &VFIO_IRQ_INFO_FLAG_CAPS )) { +return NULL ; + } + +for (hdr = ptr + info->cap_offset; hdr != ptr; hdr = ptr + hdr->next) { +if (hdr->id == id) { +return hdr; + } + } + +return NULL ; +} +static int vfio_setup_region_sparse_mmaps (VFIORegion *region,struct vfio_region_info *info) {
@@ -1539,6 +1558,33 @@ retry:return 0 ; } +static int vfio_get_irq_info (VFIODevice *vbasedev,int index, +struct vfio_irq_info **info) +{ +size_t argsz =sizeof (struct vfio_irq_info ); + + *info =g_malloc0 (argsz); + + (*info)->index = index; +retry: + (*info)->argsz = argsz; + +if (ioctl (vbasedev->fd,VFIO_DEVICE_GET_IRQ_INFO , *info)) { +g_free (*info); + *info =NULL ; +return -errno; + } + +if ((*info)->argsz > argsz) { + argsz = (*info)->argsz; + *info =g_realloc (*info, argsz); + + goto retry; + } + +return 0 ; +} +int vfio_get_dev_region_info (VFIODevice *vbasedev,uint32_t type,uint32_t subtype,struct vfio_region_info **info) {
@@ -1574,6 +1620,38 @@ int vfio_get_dev_region_info(VFIODevice *vbasedev, uint32_t type,return -ENODEV ; } +int vfio_get_dev_irq_info (VFIODevice *vbasedev,uint32_t type, +uint32_t subtype,struct vfio_irq_info **info) +{ +int i; + +for (i =0 ; i < vbasedev->num_irqs; i++) { +struct vfio_info_cap_header *hdr; +struct vfio_irq_info_cap_type *cap_type; + +if (vfio_get_irq_info (vbasedev, i, info)) { +continue ; + } + + hdr =vfio_get_irq_info_cap (*info,VFIO_IRQ_INFO_CAP_TYPE ); +if (!hdr) { +g_free (*info); +continue ; + } + + cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header); + +if (cap_type->type == type && cap_type->subtype == subtype) { +return 0 ; + } + +g_free (*info); + } + + *info =NULL ; +return -ENODEV ; +} +bool vfio_has_region_cap (VFIODevice *vbasedev,int region,uint16_t cap_type) {struct vfio_region_info *info =NULL ;
include/hw/vfio/vfio-common.h +3 -0
@@ -195,6 +195,9 @@ int vfio_get_dev_region_info(VFIODevice *vbasedev, uint32_t type,bool vfio_has_region_cap (VFIODevice *vbasedev,int region,uint16_t cap_type);struct vfio_info_cap_header *vfio_get_region_info_cap (struct vfio_region_info *info,uint16_t id); + +int vfio_get_dev_irq_info (VFIODevice *vbasedev,uint32_t type, +uint32_t subtype,struct vfio_irq_info **info);#endif extern const MemoryListener vfio_prereg_listener;
Signature · 1 line
2.17.1
RFC PATCH 2/3 ui/console: Introduce two new APIs
In reply to Tina Zhanggraphic_hw_refresh is used by display to invoke console refresh. dpy_update_interval is used by display to update gui timer interval.
--- include/ui/console.h | 2 ++ ui/console.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+)
include/ui/console.h +2 -0
@@ -275,6 +275,7 @@ void register_displaychangelistener(DisplayChangeListener *dcl);void update_displaychangelistener (DisplayChangeListener *dcl,uint64_t interval);void unregister_displaychangelistener (DisplayChangeListener *dcl); +void dpy_update_interval (QemuConsole *con,uint64_t interval);bool dpy_ui_info_supported (QemuConsole *con);int dpy_set_ui_info (QemuConsole *con,QemuUIInfo *info);
@@ -379,6 +380,7 @@ void graphic_console_set_hwops(QemuConsole *con,void graphic_console_close (QemuConsole *con);void graphic_hw_update (QemuConsole *con); +void graphic_hw_refresh (QemuConsole *con);void graphic_hw_invalidate (QemuConsole *con);void graphic_hw_text_update (QemuConsole *con,console_ch_t *chardata);void graphic_hw_gl_block (QemuConsole *con,bool block);
ui/console.c +35 -0
@@ -268,6 +268,24 @@ void graphic_hw_update(QemuConsole *con) } } +void graphic_hw_refresh (QemuConsole *con) +{ +DisplayState *ds; +DisplayChangeListener *dcl; + +if (!con) { + con = active_console; + } + + ds = con->ds; + + QLIST_FOREACH(dcl, &ds->listeners, next) { +if (dcl->ops->dpy_refresh) { + dcl->ops->dpy_refresh (dcl); + } + } +} +void graphic_hw_gl_block (QemuConsole *con,bool block) {assert (con !=NULL );
@@ -1480,6 +1498,23 @@ void update_displaychangelistener(DisplayChangeListener *dcl, } } +void dpy_update_interval (QemuConsole *con,uint64_t interval) +{ +DisplayChangeListener *dcl; +DisplayState *ds; + +if (!con) { +return ; + } + + ds = con->ds; + + QLIST_FOREACH(dcl, &ds->listeners, next) { +update_displaychangelistener (dcl, interval); + } +} + +void unregister_displaychangelistener (DisplayChangeListener *dcl) {DisplayState *ds = dcl->ds;
Signature · 1 line
2.17.1
RFC PATCH 3/3 vfio/display: Refresh display depending on vGPU page flip events
In reply to Tina ZhangUse vGPU plane page flip events to refresh display.
--- hw/vfio/display.c | 249 +++++++++++++++++++++++++++++----- include/hw/vfio/vfio-common.h | 8 ++ 2 files changed, 225 insertions(+), 32 deletions(-)
hw/vfio/display.c +217 -32
@@ -288,44 +288,54 @@ static void vfio_display_dmabuf_update(void *opaque)VFIODMABuf *primary, *cursor;bool free_bufs = false, new_cursor = false;; - primary =vfio_display_get_dmabuf (vdev,DRM_PLANE_TYPE_PRIMARY ); -if (primary ==NULL ) { -if (dpy->ramfb) { -ramfb_display_update (dpy->con, dpy->ramfb); - } -return ; +if (dpy->event_flags &VFIO_IRQ_EVENT_ENABLE ) { +dpy_update_interval (dpy->con,GUI_REFRESH_INTERVAL_IDLE ); } -if (dpy->dmabuf.primary != primary) { - dpy->dmabuf.primary = primary; -qemu_console_resize (dpy->con, - primary->buf.width, primary->buf.height); -dpy_gl_scanout_dmabuf (dpy->con, &primary->buf); - free_bufs = true; - } +if (!dpy->event_flags || + (dpy->event_flags &VFIO_IRQ_EVENT_PRIMRAY_PLANE_FLIP )) { + primary =vfio_display_get_dmabuf (vdev,DRM_PLANE_TYPE_PRIMARY ); +if (primary ==NULL ) { +if (dpy->ramfb) { +ramfb_display_update (dpy->con, dpy->ramfb); + } +return ; + } - cursor =vfio_display_get_dmabuf (vdev,DRM_PLANE_TYPE_CURSOR ); -if (dpy->dmabuf.cursor != cursor) { - dpy->dmabuf.cursor = cursor; - new_cursor = true; - free_bufs = true; +if (dpy->dmabuf.primary != primary) { + dpy->dmabuf.primary = primary; +qemu_console_resize (dpy->con, + primary->buf.width, primary->buf.height); +dpy_gl_scanout_dmabuf (dpy->con, &primary->buf); + free_bufs = true; + } } -if (cursor && (new_cursor || cursor->hot_updates)) { -bool have_hot = (cursor->hot_x !=0xffffffff && - cursor->hot_y !=0xffffffff ); -dpy_gl_cursor_dmabuf (dpy->con, &cursor->buf, have_hot, - cursor->hot_x, cursor->hot_y); - cursor->hot_updates =0 ; - }else if (!cursor && new_cursor) { -dpy_gl_cursor_dmabuf (dpy->con,NULL , false,0 ,0 ); - } +if (!dpy->event_flags || + (dpy->event_flags &VFIO_IRQ_EVENT_CURSOR_PLANE_FLIP )) { + cursor =vfio_display_get_dmabuf (vdev,DRM_PLANE_TYPE_CURSOR ); +if (dpy->dmabuf.cursor != cursor) { + dpy->dmabuf.cursor = cursor; + new_cursor = true; + free_bufs = true; + } + +if (cursor && (new_cursor || cursor->hot_updates)) { +bool have_hot = (cursor->hot_x !=0xffffffff && + cursor->hot_y !=0xffffffff ); +dpy_gl_cursor_dmabuf (dpy->con, &cursor->buf, have_hot, + cursor->hot_x, cursor->hot_y); + cursor->hot_updates =0 ; + }else if (!cursor && new_cursor) { +dpy_gl_cursor_dmabuf (dpy->con,NULL , false,0 ,0 ); + } -if (cursor && cursor->pos_updates) { -dpy_gl_cursor_position (dpy->con, - cursor->pos_x, - cursor->pos_y); - cursor->pos_updates =0 ; +if (cursor && cursor->pos_updates) { +dpy_gl_cursor_position (dpy->con, + cursor->pos_x, + cursor->pos_y); + cursor->pos_updates =0 ; + } }dpy_gl_update (dpy->con,0 ,0 , primary->buf.width, primary->buf.height);
@@ -340,6 +350,7 @@ static const GraphicHwOps vfio_display_dmabuf_ops = { .ui_info = vfio_display_edid_ui_info, }; +static int vfio_register_display_notifier (VFIOPCIDevice *vdev);static int vfio_display_dmabuf_init (VFIOPCIDevice *vdev,Error **errp) {if (!display_opengl) {
@@ -355,6 +366,8 @@ static int vfio_display_dmabuf_init(VFIOPCIDevice *vdev, Error **errp) vdev->dpy->ramfb =ramfb_setup (DEVICE (vdev), errp); }vfio_display_edid_init (vdev); +vfio_register_display_notifier (vdev); +return 0 ; }
@@ -495,6 +508,177 @@ static void vfio_display_region_exit(VFIODisplay *dpy)/* ---------------------------------------------------------------------- */ +static void primary_plane_update (void *opaque) +{ +VFIOPCIDevice *vdev = opaque; +VFIODisplay *dpy = vdev->dpy; + +if (!event_notifier_test_and_clear (&dpy->pri_event_notifier)) { +return ; + } + + dpy->event_flags |=VFIO_IRQ_EVENT_PRIMRAY_PLANE_FLIP ; +graphic_hw_refresh (dpy->con); + dpy->event_flags &= ~VFIO_IRQ_EVENT_PRIMRAY_PLANE_FLIP ; +} + +static void cursor_plane_update (void *opaque) +{ +VFIOPCIDevice *vdev = opaque; +VFIODisplay *dpy = vdev->dpy; +static int times; + +if (!event_notifier_test_and_clear (&dpy->cur_event_notifier)) { +return ; + } + +/* Have to skip some cursor events due to performance impact */ +if (times++ /2 ) { + times =0 ; + dpy->event_flags |=VFIO_IRQ_EVENT_CURSOR_PLANE_FLIP ; +graphic_hw_refresh (dpy->con); + dpy->event_flags &= ~VFIO_IRQ_EVENT_CURSOR_PLANE_FLIP ; + } +} + +static int register_display_notifier (VFIOPCIDevice *vdev, +uint32_t type,uint32_t subtype, +EventNotifier *notifier, +void (*handler)(void *opaque)) +{ +struct vfio_irq_info *irq; +struct vfio_irq_set *irq_set; +int argsz; +int32_t *pfd; +int ret; + + ret =vfio_get_dev_irq_info (&vdev->vbasedev, + type, + subtype, + &irq); +if (ret) { + goto out; + } + + ret =event_notifier_init (notifier,0 ); +if (ret) { +error_report ("vfio: Unable to init event notifier for device request" ); + goto out; + } + + argsz =sizeof (*irq_set) +sizeof (*pfd); + + irq_set =g_malloc0 (argsz); + irq_set->argsz = argsz; + irq_set->flags =VFIO_IRQ_SET_DATA_EVENTFD | +VFIO_IRQ_SET_ACTION_TRIGGER ; + irq_set->index = irq->index; + irq_set->start =0 ; + irq_set->count =1 ; + pfd = (int32_t *)&irq_set->data; + + *pfd =event_notifier_get_fd (notifier); +qemu_set_fd_handler (*pfd, handler,NULL , vdev); + + ret =ioctl (vdev->vbasedev.fd,VFIO_DEVICE_SET_IRQS , irq_set); +if (ret) { +error_report ("vfio: Failed to set up device request notification" ); +qemu_set_fd_handler (*pfd,NULL ,NULL , vdev); +event_notifier_cleanup (notifier); + } + +g_free (irq_set); + +out: +return ret; +} + +static int vfio_register_display_notifier (VFIOPCIDevice *vdev) +{ +VFIODisplay *dpy = vdev->dpy; +int ret; + + ret =register_display_notifier (vdev,VFIO_IRQ_TYPE_GFX , +VFIO_IRQ_SUBTYPE_GFX_PRI_PLANE_FLIP , + &dpy->pri_event_notifier, + primary_plane_update); + +if (ret) { + goto out; + } + + ret =register_display_notifier (vdev,VFIO_IRQ_TYPE_GFX , +VFIO_IRQ_SUBTYPE_GFX_CUR_PLANE_FLIP , + &dpy->cur_event_notifier, + cursor_plane_update); +out: +if (ret) { + dpy->event_flags =0 ; + }else { + dpy->event_flags =VFIO_IRQ_EVENT_ENABLE ; + } + +return ret; +} + +static void unregister_display_notifier (VFIOPCIDevice *vdev, +uint32_t type,uint32_t subtype, +EventNotifier *notifier) +{ +VFIODisplay *dpy = vdev->dpy; +int argsz; +struct vfio_irq_info *irq; +struct vfio_irq_set *irq_set; +int32_t *pfd; +int ret; + +if (!dpy->event_flags) { +return ; + } + + ret =vfio_get_dev_irq_info (&vdev->vbasedev, + type, + subtype, + &irq); +if (ret) { +return ; + } + + argsz =sizeof (*irq_set) +sizeof (*pfd); + + irq_set =g_malloc0 (argsz); + irq_set->argsz = argsz; + irq_set->flags =VFIO_IRQ_SET_DATA_EVENTFD | +VFIO_IRQ_SET_ACTION_TRIGGER ; + irq_set->index = irq->index; + irq_set->start =0 ; + irq_set->count =1 ; + pfd = (int32_t *)&irq_set->data; + *pfd =-1 ; + +if (ioctl (vdev->vbasedev.fd,VFIO_DEVICE_SET_IRQS , irq_set)) { +error_report ("vfio: Failed to de-assign device request fd: %m" ); + } +g_free (irq_set); +qemu_set_fd_handler (event_notifier_get_fd (notifier), +NULL ,NULL , vdev); +event_notifier_cleanup (notifier); +} + +static void vfio_unregister_display_notifier (VFIOPCIDevice *vdev) +{ +VFIODisplay *dpy = vdev->dpy; + +unregister_display_notifier (vdev,VFIO_IRQ_TYPE_GFX , +VFIO_IRQ_SUBTYPE_GFX_PRI_PLANE_FLIP , + &dpy->pri_event_notifier); + +unregister_display_notifier (vdev,VFIO_IRQ_TYPE_GFX , +VFIO_IRQ_SUBTYPE_GFX_CUR_PLANE_FLIP , + &dpy->cur_event_notifier); + dpy->event_flags = false; +} +int vfio_display_probe (VFIOPCIDevice *vdev,Error **errp) {struct vfio_device_gfx_plane_info probe;
@@ -531,6 +715,7 @@ void vfio_display_finalize(VFIOPCIDevice *vdev)return ; } +vfio_unregister_display_notifier (vdev);graphic_console_close (vdev->dpy->con);vfio_display_dmabuf_exit (vdev->dpy);vfio_display_region_exit (vdev->dpy);
include/hw/vfio/vfio-common.h +8 -0
@@ -27,6 +27,7 @@#include "qemu/notify.h" #include "ui/console.h" #include "hw/display/ramfb.h" +#include "qemu/event_notifier.h" #ifdef CONFIG_LINUX #include <linux/vfio.h> #endif
@@ -145,6 +146,10 @@ typedef struct VFIODMABuf {QTAILQ_ENTRY (VFIODMABuf) next; } VFIODMABuf; +#define VFIO_IRQ_EVENT_ENABLE (1 << 0) +#define VFIO_IRQ_EVENT_PRIMRAY_PLANE_FLIP (1 << 1) +#define VFIO_IRQ_EVENT_CURSOR_PLANE_FLIP (1 << 2) + typedef struct VFIODisplay { QemuConsole *con; RAMFBState *ramfb;
@@ -152,6 +157,9 @@ typedef struct VFIODisplay {struct vfio_region_gfx_edid *edid_regs;uint8_t *edid_blob;QEMUTimer *edid_link_timer; +EventNotifier pri_event_notifier; +EventNotifier cur_event_notifier; +uint32_t event_flags;struct {VFIORegion buffer;DisplaySurface *surface;
Signature · 1 line
2.17.1
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed build test on s390x host. Please find the details below.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with # HEAD pointing to a commit that has the patches applied on top of "base"
# branch set -e CC=$HOME/bin/cc INSTALL=$PWD/install BUILD=$PWD/build mkdir -p $BUILD $INSTALL SRC=$PWD cd $BUILD $SRC/configure --cc=$CC --prefix=$INSTALL make -j4 # XXX: we need reliable clean up # make check -j4 V=1 make install
echo
echo "=== ENV ==="
env
echo
echo "=== PACKAGES ==="
rpm -qa
=== TEST SCRIPT END ===
CC aarch64-softmmu/hw/display/virtio-gpu.o
CC arm-softmmu/hw/display/virtio-gpu-pci.o/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_irq_info_cap’:/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: error: ‘VFIO_IRQ_INFO_FLAG_CAPS’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_FLAG_CAPS’?
757 | if (!(info->flags & VFIO_IRQ_INFO_FLAG_CAPS)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_FLAG_CAPS/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: note: each undeclared identifier is reported only once for each function it appears in /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:761:26: error: ‘struct vfio_irq_info’ has no member named ‘cap_offset’
761 | for (hdr = ptr + info->cap_offset; hdr != ptr; hdr = ptr + hdr->next) {
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_dev_irq_info’:/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1636:44: error: ‘VFIO_IRQ_INFO_CAP_TYPE’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_CAP_TYPE’?
1636 | hdr = vfio_get_irq_info_cap(*info, VFIO_IRQ_INFO_CAP_TYPE);
| ^~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_CAP_TYPE
In file included from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:51,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:34: error: dereferencing pointer to incomplete type ‘struct vfio_irq_info_cap_type’
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
1642 | cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header);
| ^~~~~~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:54: error: initialization of ‘const int *’ from incompatible pointer type ‘struct vfio_info_cap_header *’ [-Werror=incompatible-pointer-types]
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
---
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/glib-compat.h:32,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:140,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:58:37: error: invalid use of undefined type ‘struct vfio_irq_info_cap_type’
58 | (type *) ((char *) __mptr - offsetof(type, member));})
| ^~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
---
CC aarch64-softmmu/hw/timer/digic-timer.o
CC aarch64-softmmu/hw/timer/allwinner-a10-pit.o/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_irq_info_cap’:/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: error: ‘VFIO_IRQ_INFO_FLAG_CAPS’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_FLAG_CAPS’?
757 | if (!(info->flags & VFIO_IRQ_INFO_FLAG_CAPS)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_FLAG_CAPS/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: note: each undeclared identifier is reported only once for each function it appears in /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:761:26: error: ‘struct vfio_irq_info’ has no member named ‘cap_offset’
761 | for (hdr = ptr + info->cap_offset; hdr != ptr; hdr = ptr + hdr->next) {
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_dev_irq_info’:/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1636:44: error: ‘VFIO_IRQ_INFO_CAP_TYPE’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_CAP_TYPE’?
1636 | hdr = vfio_get_irq_info_cap(*info, VFIO_IRQ_INFO_CAP_TYPE);
| ^~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_CAP_TYPE
In file included from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:51,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:34: error: dereferencing pointer to incomplete type ‘struct vfio_irq_info_cap_type’
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
1642 | cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header);
| ^~~~~~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:54: error: initialization of ‘const int *’ from incompatible pointer type ‘struct vfio_info_cap_header *’ [-Werror=incompatible-pointer-types]
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
---
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/glib-compat.h:32,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:140,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:58:37: error: invalid use of undefined type ‘struct vfio_irq_info_cap_type’
58 | (type *) ((char *) __mptr - offsetof(type, member));})
| ^~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
---
CC aarch64-softmmu/hw/vfio/common.o
CC aarch64-softmmu/hw/vfio/spapr.o/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_irq_info_cap’:/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: error: ‘VFIO_IRQ_INFO_FLAG_CAPS’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_FLAG_CAPS’?
757 | if (!(info->flags & VFIO_IRQ_INFO_FLAG_CAPS)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_FLAG_CAPS/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: note: each undeclared identifier is reported only once for each function it appears in /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:761:26: error: ‘struct vfio_irq_info’ has no member named ‘cap_offset’
761 | for (hdr = ptr + info->cap_offset; hdr != ptr; hdr = ptr + hdr->next) {
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_dev_irq_info’:/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1636:44: error: ‘VFIO_IRQ_INFO_CAP_TYPE’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_CAP_TYPE’?
1636 | hdr = vfio_get_irq_info_cap(*info, VFIO_IRQ_INFO_CAP_TYPE);
| ^~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_CAP_TYPE
In file included from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:51,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:34: error: dereferencing pointer to incomplete type ‘struct vfio_irq_info_cap_type’
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
1642 | cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header);
| ^~~~~~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:54: error: initialization of ‘const int *’ from incompatible pointer type ‘struct vfio_info_cap_header *’ [-Werror=incompatible-pointer-types]
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
---
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/glib-compat.h:32,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:140,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:58:37: error: invalid use of undefined type ‘struct vfio_irq_info_cap_type’
58 | (type *) ((char *) __mptr - offsetof(type, member));})
| ^~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
---
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_irq_info_cap’:
/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: error: ‘VFIO_IRQ_INFO_FLAG_CAPS’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_FLAG_CAPS’?
757 | if (!(info->flags & VFIO_IRQ_INFO_FLAG_CAPS)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_FLAG_CAPS/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:757:25: note: each undeclared identifier is reported only once for each function it appears in /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:761:26: error: ‘struct vfio_irq_info’ has no member named ‘cap_offset’
761 | for (hdr = ptr + info->cap_offset; hdr != ptr; hdr = ptr + hdr->next) {
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c: In function ‘vfio_get_dev_irq_info’:/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1636:44: error: ‘VFIO_IRQ_INFO_CAP_TYPE’ undeclared (first use in this function); did you mean ‘VFIO_REGION_INFO_CAP_TYPE’?
1636 | hdr = vfio_get_irq_info_cap(*info, VFIO_IRQ_INFO_CAP_TYPE);
| ^~~~~~~~~~~~~~~~~~~~~~
| VFIO_REGION_INFO_CAP_TYPE
In file included from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:51,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:34: error: dereferencing pointer to incomplete type ‘struct vfio_irq_info_cap_type’
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
1642 | cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header);
| ^~~~~~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:57:54: error: initialization of ‘const int *’ from incompatible pointer type ‘struct vfio_info_cap_header *’ [-Werror=incompatible-pointer-types]
57 | const typeof(((type *) 0)->member) *__mptr = (ptr); \
| ^/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
---
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/glib-compat.h:32,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/osdep.h:140,
from /var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:21:/var/tmp/patchew-tester-tmp-ymcno5d3/src/include/qemu/compiler.h:58:37: error: invalid use of undefined type ‘struct vfio_irq_info_cap_type’
58 | (type *) ((char *) __mptr - offsetof(type, member));})
| ^~~~~~~~/var/tmp/patchew-tester-tmp-ymcno5d3/src/hw/vfio/common.c:1642:20: note: in expansion of macro ‘container_of’
The full log is available at
http://patchew.org/logs/[email protected]/testing.s390x/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1 === TEST SCRIPT END ===
CC x86_64-softmmu/qapi/qapi-visit-target.o
CC x86_64-softmmu/qapi/qapi-visit.o
CC x86_64-softmmu/qapi/qapi-events-target.o
/tmp/qemu-test/src/hw/vfio/display.c:295:9: error: variable 'primary' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (!dpy->event_flags ||
^~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/hw/vfio/display.c:341:35: note: uninitialized use occurs here
---
VFIODMABuf *primary, *cursor;
^
= NULL/tmp/qemu-test/src/hw/vfio/display.c:601:43: error: use of undeclared identifier 'VFIO_IRQ_TYPE_GFX'
ret = register_display_notifier(vdev, VFIO_IRQ_TYPE_GFX,
^/tmp/qemu-test/src/hw/vfio/display.c:602:37: error: use of undeclared identifier 'VFIO_IRQ_SUBTYPE_GFX_PRI_PLANE_FLIP'
VFIO_IRQ_SUBTYPE_GFX_PRI_PLANE_FLIP,
^/tmp/qemu-test/src/hw/vfio/display.c:610:43: error: use of undeclared identifier 'VFIO_IRQ_TYPE_GFX'
ret = register_display_notifier(vdev, VFIO_IRQ_TYPE_GFX,
^/tmp/qemu-test/src/hw/vfio/display.c:611:36: error: use of undeclared identifier 'VFIO_IRQ_SUBTYPE_GFX_CUR_PLANE_FLIP'
VFIO_IRQ_SUBTYPE_GFX_CUR_PLANE_FLIP,
^
/tmp/qemu-test/src/hw/vfio/display.c:672:39: error: use of undeclared identifier 'VFIO_IRQ_TYPE_GFX'
unregister_display_notifier(vdev, VFIO_IRQ_TYPE_GFX,
^
/tmp/qemu-test/src/hw/vfio/display.c:673:33: error: use of undeclared identifier 'VFIO_IRQ_SUBTYPE_GFX_PRI_PLANE_FLIP'
VFIO_IRQ_SUBTYPE_GFX_PRI_PLANE_FLIP,
^
/tmp/qemu-test/src/hw/vfio/display.c:676:39: error: use of undeclared identifier 'VFIO_IRQ_TYPE_GFX'
unregister_display_notifier(vdev, VFIO_IRQ_TYPE_GFX,
^
/tmp/qemu-test/src/hw/vfio/display.c:677:33: error: use of undeclared identifier 'VFIO_IRQ_SUBTYPE_GFX_CUR_PLANE_FLIP'
VFIO_IRQ_SUBTYPE_GFX_CUR_PLANE_FLIP,
^
9 errors generated.
/tmp/qemu-test/src/hw/vfio/common.c:757:25: error: use of undeclared identifier 'VFIO_IRQ_INFO_FLAG_CAPS'
if (!(info->flags & VFIO_IRQ_INFO_FLAG_CAPS)) {
^
/tmp/qemu-test/src/hw/vfio/common.c:761:28: error: no member named 'cap_offset' in 'struct vfio_irq_info'
for (hdr = ptr + info->cap_offset; hdr != ptr; hdr = ptr + hdr->next) {
~~~~ ^
/tmp/qemu-test/src/hw/vfio/common.c:1636:44: error: use of undeclared identifier 'VFIO_IRQ_INFO_CAP_TYPE'
hdr = vfio_get_irq_info_cap(*info, VFIO_IRQ_INFO_CAP_TYPE);
^
/tmp/qemu-test/src/hw/vfio/common.c:1642:20: error: incomplete definition of type 'struct vfio_irq_info_cap_type'
cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/include/qemu/compiler.h:57:34: note: expanded from macro 'container_of'
---
/tmp/qemu-test/src/hw/vfio/common.c:1630:16: note: forward declaration of 'struct vfio_irq_info_cap_type'
struct vfio_irq_info_cap_type *cap_type;
^
/tmp/qemu-test/src/hw/vfio/common.c:1642:20: error: offsetof of incomplete type 'struct vfio_irq_info_cap_type'
cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header);
^ ~~~~~~
/tmp/qemu-test/src/include/qemu/compiler.h:58:37: note: expanded from macro 'container_of'
---
/tmp/qemu-test/src/hw/vfio/common.c:1630:16: note: forward declaration of 'struct vfio_irq_info_cap_type'
struct vfio_irq_info_cap_type *cap_type;
^
/tmp/qemu-test/src/hw/vfio/common.c:1642:18: error: assigning to 'struct vfio_irq_info_cap_type *' from incompatible type 'void'
cap_type = container_of(hdr, struct vfio_irq_info_cap_type, header);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/hw/vfio/common.c:1644:21: error: incomplete definition of type 'struct vfio_irq_info_cap_type'
if (cap_type->type == type && cap_type->subtype == subtype) {
~~~~~~~~^
/tmp/qemu-test/src/hw/vfio/common.c:1630:16: note: forward declaration of 'struct vfio_irq_info_cap_type'
struct vfio_irq_info_cap_type *cap_type;
^
/tmp/qemu-test/src/hw/vfio/common.c:1644:47: error: incomplete definition of type 'struct vfio_irq_info_cap_type'
if (cap_type->type == type && cap_type->subtype == subtype) {
~~~~~~~~^/tmp/qemu-test/src/hw/vfio/common.c:1630:16: note: forward declaration of 'struct vfio_irq_info_cap_type'
The full log is available at
http://patchew.org/logs/[email protected]/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]