From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: RE: [PATCH v3 12/20] virtio-gpu: Add virtio_gpu_set_scanout_blob
Date: Tue, 11 May 2021 22:42:37 +0000 [thread overview]
Message-ID: <85ccf06ce13549b397bb30364d4fbe74@intel.com> (raw)
In-Reply-To: <20210511113957.7xxjcvpavimhgb73@sirius.home.kraxel.org>
Hi Gerd,
> > - pixman_image_unref(res->image);
> > + if (res->image) {
> > + pixman_image_unref(res->image);
> > + }
>
> There is qemu_pixman_image_unref().
>
> Like pixman_image_unref except that it also accepts (and ignores) NULL
> pointers.
[Kasireddy, Vivek] Made the change in v4.
>
> > virtio_gpu_cleanup_mapping(g, res);
> > QTAILQ_REMOVE(&g->reslist, res, next);
> > g->hostmem -= res->hostmem;
> > @@ -494,6 +496,7 @@ static void virtio_gpu_resource_flush(VirtIOGPU *g,
> > {
> > struct virtio_gpu_simple_resource *res;
> > struct virtio_gpu_resource_flush rf;
> > + struct virtio_gpu_scanout *scanout;
> > pixman_region16_t flush_region;
> > int i;
> >
> > @@ -504,16 +507,28 @@ static void virtio_gpu_resource_flush(VirtIOGPU *g,
> >
> > res = virtio_gpu_find_check_resource(g, rf.resource_id, false,
> > __func__, &cmd->error);
> > - if (!res || res->blob) {
> > + if (!res) {
> > return;
> > }
> >
> > - if (rf.r.x > res->width ||
> > + if (res->blob && display_opengl) {
>
> console_has_gl(scanout->con)
[Kasireddy, Vivek] Made this change here and in other places in v4.
>
> > + if (!res->blob &&
> > + (rf.r.x > res->width ||
> > rf.r.y > res->height ||
> > rf.r.width > res->width ||
> > rf.r.height > res->height ||
> > rf.r.x + rf.r.width > res->width ||
> > - rf.r.y + rf.r.height > res->height) {
> > + rf.r.y + rf.r.height > res->height)) {
> > qemu_log_mask(LOG_GUEST_ERROR, "%s: flush bounds outside resource"
> > " bounds for resource %d: %d %d %d %d vs %d %d\n",
> > __func__, rf.resource_id, rf.r.x, rf.r.y,
>
> Indent needs fixing.
> Do we need sanity checks for the res->blob == true case? I think so ...
[Kasireddy, Vivek] If a resource is a blob, it would not have valid width and height and
instead only have valid blob_size; hence, the sanity checks would not be applicable.
Thanks,
Vivek
>
> > g->parent_obj.enable = 1;
> > - data = (uint8_t *)pixman_image_get_data(res->image);
> > +
> > + if (res->blob) {
> > + if (display_opengl) {
>
> Again console_has_gl(scanout->con)
>
> > + if (!virtio_gpu_update_dmabuf(g, scanout_id, res, fb)) {
> > + virtio_gpu_update_scanout(g, scanout_id, res, r);
> > + return;
> > + }
> > + }
> > +
> > + data = res->blob;
> > + } else {
> > + data = (uint8_t *)pixman_image_get_data(res->image);
> > + }
> >
> > /* create a surface for this scanout */
> > - if (!scanout->ds ||
> > + if ((res->blob && !display_opengl) ||
>
> And again.
>
> take care,
> Gerd
next prev parent reply other threads:[~2021-05-11 22:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 8:07 [PATCH v3 00/20] virtio-gpu: Add support for Blob resources Vivek Kasireddy
2021-05-11 8:07 ` [PATCH v3 01/20] ui: Get the fd associated with udmabuf driver Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 02/20] headers: Add udmabuf.h Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 03/20] virtio-gpu: Add udmabuf helpers Vivek Kasireddy
2021-05-11 11:22 ` Gerd Hoffmann
2021-05-11 8:08 ` [PATCH v3 04/20] virtio-gpu: Add virtio_gpu_find_check_resource Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 05/20] virtio-gpu: Refactor virtio_gpu_set_scanout Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 06/20] virtio-gpu: Refactor virtio_gpu_create_mapping_iov Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 07/20] virtio-gpu: Add initial definitions for blob resources Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 08/20] virtio-gpu: Add virtio_gpu_resource_create_blob Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 09/20] ui/pixman: Add qemu_pixman_to_drm_format() Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 10/20] virtio-gpu: Add helpers to create and destroy dmabuf objects Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 11/20] virtio-gpu: Factor out update scanout Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 12/20] virtio-gpu: Add virtio_gpu_set_scanout_blob Vivek Kasireddy
2021-05-11 11:39 ` Gerd Hoffmann
2021-05-11 22:42 ` Kasireddy, Vivek [this message]
2021-05-11 8:08 ` [PATCH v3 13/20] virtio-gpu: Update cursor data using blob Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 14/20] virtio-gpu: Add initial definitions for explict flush feature Vivek Kasireddy
2021-05-11 11:42 ` Gerd Hoffmann
2021-05-11 8:08 ` [PATCH v3 15/20] virtio-gpu: Add dmabuf helpers for synchronization Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 16/20] virtio-gpu: Add virtio_gpu_wait_flush API Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 17/20] ui: Add egl helpers for synchronization Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 18/20] ui/gtk-egl: Wait for the draw signal for dmabuf blobs Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 19/20] ui/gtk: Create a common release_dmabuf helper Vivek Kasireddy
2021-05-11 8:08 ` [PATCH v3 20/20] virtio-gpu: Add gl_flushed callback Vivek Kasireddy
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=85ccf06ce13549b397bb30364d4fbe74@intel.com \
--to=vivek.kasireddy@intel.com \
--cc=kraxel@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 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).