From: "Daniel P. Berrangé" <berrange@redhat.com>
To: dongwon.kim@intel.com
Cc: qemu-devel@nongnu.org, marcandre.lureau@redhat.com
Subject: Re: [PATCH v6 1/3] ui/console: Introduce dpy_gl_qemu_dmabuf_get_..() helpers
Date: Wed, 17 Apr 2024 12:04:55 +0100 [thread overview]
Message-ID: <Zh-s1wqWU8c0GHS8@redhat.com> (raw)
In-Reply-To: <20240417040954.55641-2-dongwon.kim@intel.com>
On Tue, Apr 16, 2024 at 09:09:52PM -0700, dongwon.kim@intel.com wrote:
> From: Dongwon Kim <dongwon.kim@intel.com>
>
> This commit introduces dpy_gl_qemu_dmabuf_get_... helpers to extract
> specific fields from the QemuDmaBuf struct. It also updates all instances
> where fields within the QemuDmaBuf struct are directly accessed, replacing
> them with calls to these new helper functions.
>
> v6: fix typos in helper names in ui/spice-display.c
>
> Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
> ---
> include/ui/console.h | 17 +++++
> hw/display/vhost-user-gpu.c | 6 +-
> hw/display/virtio-gpu-udmabuf.c | 7 +-
> hw/vfio/display.c | 15 +++--
> ui/console.c | 116 +++++++++++++++++++++++++++++++-
> ui/dbus-console.c | 9 ++-
> ui/dbus-listener.c | 43 +++++++-----
> ui/egl-headless.c | 23 +++++--
> ui/egl-helpers.c | 47 +++++++------
> ui/gtk-egl.c | 48 ++++++++-----
> ui/gtk-gl-area.c | 37 ++++++----
> ui/gtk.c | 6 +-
> ui/spice-display.c | 50 ++++++++------
> 13 files changed, 316 insertions(+), 108 deletions(-)
>
> diff --git a/include/ui/console.h b/include/ui/console.h
> index 0bc7a00ac0..6292943a82 100644
> --- a/include/ui/console.h
> +++ b/include/ui/console.h
> @@ -358,6 +358,23 @@ void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf,
> bool have_hot, uint32_t hot_x, uint32_t hot_y);
> void dpy_gl_cursor_position(QemuConsole *con,
> uint32_t pos_x, uint32_t pos_y);
> +
> +int32_t dpy_gl_qemu_dmabuf_get_fd(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_width(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_height(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_stride(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_fourcc(QemuDmaBuf *dmabuf);
> +uint64_t dpy_gl_qemu_dmabuf_get_modifier(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_texture(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_x(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_y(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_backing_width(QemuDmaBuf *dmabuf);
> +uint32_t dpy_gl_qemu_dmabuf_get_backing_height(QemuDmaBuf *dmabuf);
> +bool dpy_gl_qemu_dmabuf_get_y0_top(QemuDmaBuf *dmabuf);
> +void *dpy_gl_qemu_dmabuf_get_sync(QemuDmaBuf *dmabuf);
> +int32_t dpy_gl_qemu_dmabuf_get_fence_fd(QemuDmaBuf *dmabuf);
> +bool dpy_gl_qemu_dmabuf_get_allow_fences(QemuDmaBuf *dmabuf);
> +bool dpy_gl_qemu_dmabuf_get_draw_submitted(QemuDmaBuf *dmabuf);
IMHO these method names don't need a "dpy_gl_" prefix on
them. Since they're accessors for the "QemuDmaBuf" struct,
I think its sufficient to just have "qemu_dmabuf_" as the
name prefix, making names more compact.
The console.{h,c} files are a bit of a dumping ground for
UI code. While QemuDmaBuf was just a struct with direct
field access that's OK.
With turning this into a more of an object with accessors,
I think it would also be desirable to move the struct
definition and all its methods into separate ui/dmabuf.{c,h}
files, so its fully self-contained.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-04-17 11:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 4:09 [PATCH v6 0/3] ui/console: Private QemuDmaBuf struct dongwon.kim
2024-04-17 4:09 ` [PATCH v6 1/3] ui/console: Introduce dpy_gl_qemu_dmabuf_get_..() helpers dongwon.kim
2024-04-17 10:55 ` Marc-André Lureau
2024-04-17 11:04 ` Daniel P. Berrangé [this message]
2024-04-17 17:06 ` Kim, Dongwon
2024-04-17 18:16 ` Marc-André Lureau
2024-04-17 4:09 ` [PATCH v6 2/3] ui/console: Introduce dpy_gl_qemu_dmabuf_set_..() helpers dongwon.kim
2024-04-17 4:09 ` [PATCH v6 3/3] ui/console: Introduce dpy_gl_qemu_dmabuf_new() and free() helpers dongwon.kim
2024-04-17 11:09 ` Daniel P. Berrangé
2024-04-17 11:15 ` Marc-André Lureau
2024-04-17 11:15 ` [PATCH v6 0/3] ui/console: Private QemuDmaBuf struct Daniel P. Berrangé
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=Zh-s1wqWU8c0GHS8@redhat.com \
--to=berrange@redhat.com \
--cc=dongwon.kim@intel.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.