qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Davydov <maxim.davydov@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: den@openvz.org, mst@redhat.com, stefanha@redhat.com,
	fam@euphon.net, amit@kernel.org, kraxel@redhat.com,
	berrange@redhat.com, Maxim Davydov <maxim.davydov@virtuozzo.com>
Subject: [PATCH v1 3/8] virtio-gpu: Add tracking of the virtio guest feature bits
Date: Wed,  1 Sep 2021 12:07:59 +0300	[thread overview]
Message-ID: <20210901090804.7139-4-maxim.davydov@virtuozzo.com> (raw)
In-Reply-To: <20210901090804.7139-1-maxim.davydov@virtuozzo.com>

Add tracking of the bits acknowledged by the guest

Signed-off-by: Maxim Davydov <maxim.davydov@virtuozzo.com>
---
 hw/display/vhost-user-gpu.c    |  3 ++-
 hw/display/virtio-gpu.c        |  8 +++++---
 include/hw/virtio/virtio-gpu.h | 10 +++++-----
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 49df56c..8248a70 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -566,7 +566,8 @@ vhost_user_gpu_device_realize(DeviceState *qdev, Error **errp)
 }
 
 static Property vhost_user_gpu_properties[] = {
-    VIRTIO_GPU_BASE_PROPERTIES(VhostUserGPU, parent_obj.conf),
+    VIRTIO_GPU_BASE_PROPERTIES(VhostUserGPU, parent_obj.conf,
+                               parent_obj.parent_obj.guest_features),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 990e71f..a1c52ac 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1387,11 +1387,13 @@ static const VMStateDescription vmstate_virtio_gpu = {
 };
 
 static Property virtio_gpu_properties[] = {
-    VIRTIO_GPU_BASE_PROPERTIES(VirtIOGPU, parent_obj.conf),
+    VIRTIO_GPU_BASE_PROPERTIES(VirtIOGPU, parent_obj.conf,
+                               parent_obj.parent_obj.guest_features),
     DEFINE_PROP_SIZE("max_hostmem", VirtIOGPU, conf_max_hostmem,
                      256 * MiB),
-    DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
-                    VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
+    DEFINE_VIRTIO_FEATURE_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
+                              parent_obj.parent_obj.guest_features,
+                              VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 24c6628..948ef69 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -143,11 +143,11 @@ struct VirtIOGPUBaseClass {
     void (*gl_flushed)(VirtIOGPUBase *g);
 };
 
-#define VIRTIO_GPU_BASE_PROPERTIES(_state, _conf)                       \
-    DEFINE_PROP_UINT32("max_outputs", _state, _conf.max_outputs, 1),    \
-    DEFINE_PROP_BIT("edid", _state, _conf.flags, \
-                    VIRTIO_GPU_FLAG_EDID_ENABLED, true), \
-    DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1024), \
+#define VIRTIO_GPU_BASE_PROPERTIES(_state, _conf, _guest_field)           \
+    DEFINE_PROP_UINT32("max_outputs", _state, _conf.max_outputs, 1),      \
+    DEFINE_VIRTIO_FEATURE_BIT("edid", _state, _conf.flags, _guest_field,  \
+                              VIRTIO_GPU_FLAG_EDID_ENABLED, true),        \
+    DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1024),                 \
     DEFINE_PROP_UINT32("yres", _state, _conf.yres, 768)
 
 typedef struct VGPUDMABuf {
-- 
1.8.3.1



  parent reply	other threads:[~2021-09-01 14:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  9:07 [PATCH v1 0/8] Virtio features acknowledged by guest Maxim Davydov
2021-09-01  9:07 ` [PATCH v1 1/8] qdev-properties: Add read-only 64 bit property Maxim Davydov
2021-09-01  9:07 ` [PATCH v1 2/8] virtio: Add tracking of the common virtio guest features Maxim Davydov
2021-09-01  9:07 ` Maxim Davydov [this message]
2021-09-01  9:08 ` [PATCH v1 4/8] virtio-serial: Add tracking of the virtio guest feature bits Maxim Davydov
2021-09-01  9:08 ` [PATCH v1 5/8] virtio-net: " Maxim Davydov
2021-09-01  9:08 ` [PATCH v1 6/8] scsi: Add tracking of the acknowledged " Maxim Davydov
2021-09-01  9:08 ` [PATCH v1 7/8] virtio-blk: Add tracking of the virtio guest " Maxim Davydov
2021-09-01  9:08 ` [PATCH v1 8/8] virtio-balloon: " Maxim Davydov
2021-09-02 12:34 ` [PATCH v1 0/8] Virtio features acknowledged by guest Stefan Hajnoczi

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=20210901090804.7139-4-maxim.davydov@virtuozzo.com \
    --to=maxim.davydov@virtuozzo.com \
    --cc=amit@kernel.org \
    --cc=berrange@redhat.com \
    --cc=den@openvz.org \
    --cc=fam@euphon.net \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).