qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: "Dongwon Kim" <dongwon.kim@intel.com>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Beraldo Leal" <bleal@redhat.com>,
	richard.henderson@linaro.org,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Vivek Kasireddy" <vivek.kasireddy@intel.com>
Subject: Re: [8.1 regression] Re: [PULL 05/19] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties
Date: Mon, 21 Aug 2023 10:04:43 -0600	[thread overview]
Message-ID: <20230821100443.6034d0a4.alex.williamson@redhat.com> (raw)
In-Reply-To: <CAMxuvaxjHq=3oB74McSdHSMthtv0XLwk0k6tW92FjY1yyeoA_w@mail.gmail.com>

On Mon, 21 Aug 2023 14:20:38 +0400
Marc-André Lureau <marcandre.lureau@redhat.com> wrote:

> Hi Alex
> 
> On Thu, Aug 17, 2023 at 1:25 AM Alex Williamson
> <alex.williamson@redhat.com> wrote:
> >
> > On Wed, 16 Aug 2023 15:08:10 -0600
> > Alex Williamson <alex.williamson@redhat.com> wrote:  
> > > > diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
> > > > index 8f9fbf583e..3d19dbe382 100644
> > > > --- a/ui/egl-helpers.c
> > > > +++ b/ui/egl-helpers.c
> > > > @@ -314,9 +314,9 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
> > > >      }
> > > >
> > > >      attrs[i++] = EGL_WIDTH;
> > > > -    attrs[i++] = dmabuf->width;
> > > > +    attrs[i++] = dmabuf->backing_width;
> > > >      attrs[i++] = EGL_HEIGHT;
> > > > -    attrs[i++] = dmabuf->height;
> > > > +    attrs[i++] = dmabuf->backing_height;
> > > >      attrs[i++] = EGL_LINUX_DRM_FOURCC_EXT;
> > > >      attrs[i++] = dmabuf->fourcc;
> > > >
> > > > diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
> > > > index 42db1bb6cf..eee821d73a 100644
> > > > --- a/ui/gtk-egl.c
> > > > +++ b/ui/gtk-egl.c
> > > > @@ -262,9 +262,10 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl,
> > > >      }
> > > >
> > > >      gd_egl_scanout_texture(dcl, dmabuf->texture,
> > > > -                           dmabuf->y0_top, dmabuf->width, dmabuf->height,
> > > > -                           dmabuf->x, dmabuf->y, dmabuf->scanout_width,
> > > > -                           dmabuf->scanout_height, NULL);
> > > > +                           dmabuf->y0_top,
> > > > +                           dmabuf->backing_width, dmabuf->backing_height,
> > > > +                           dmabuf->x, dmabuf->y, dmabuf->width,
> > > > +                           dmabuf->height, NULL);
> > > >
> > > >      if (dmabuf->allow_fences) {
> > > >          vc->gfx.guest_fb.dmabuf = dmabuf;
> > > > @@ -284,7 +285,8 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl,
> > > >          if (!dmabuf->texture) {
> > > >              return;
> > > >          }
> > > > -        egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->width, dmabuf->height,
> > > > +        egl_fb_setup_for_tex(&vc->gfx.cursor_fb,
> > > > +                             dmabuf->backing_width, dmabuf->backing_height,
> > > >                               dmabuf->texture, false);
> > > >      } else {
> > > >          egl_fb_destroy(&vc->gfx.cursor_fb);
> > > > diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
> > > > index a9a7fdf50c..4513d3d059 100644
> > > > --- a/ui/gtk-gl-area.c
> > > > +++ b/ui/gtk-gl-area.c
> > > > @@ -301,9 +301,10 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener *dcl,
> > > >      }
> > > >
> > > >      gd_gl_area_scanout_texture(dcl, dmabuf->texture,
> > > > -                               dmabuf->y0_top, dmabuf->width, dmabuf->height,
> > > > -                               dmabuf->x, dmabuf->y, dmabuf->scanout_width,
> > > > -                               dmabuf->scanout_height, NULL);
> > > > +                               dmabuf->y0_top,
> > > > +                               dmabuf->backing_width, dmabuf->backing_height,
> > > > +                               dmabuf->x, dmabuf->y, dmabuf->width,
> > > > +                               dmabuf->height, NULL);
> > > >
> > > >      if (dmabuf->allow_fences) {
> > > >          vc->gfx.guest_fb.dmabuf = dmabuf;  
> > >  
> >
> > I suspect the issues is in these last few chunks where width and height
> > are replaced with backing_width and backing height, but
> > hw/vfio/display.c never sets backing_*.  It appears that the following
> > resolves the issue:
> >
> > diff --git a/hw/vfio/display.c b/hw/vfio/display.c
> > index bec864f482f4..837d9e6a309e 100644
> > --- a/hw/vfio/display.c
> > +++ b/hw/vfio/display.c
> > @@ -243,6 +243,8 @@ static VFIODMABuf *vfio_display_get_dmabuf(VFIOPCIDevice *vdev,
> >      dmabuf->dmabuf_id  = plane.dmabuf_id;
> >      dmabuf->buf.width  = plane.width;
> >      dmabuf->buf.height = plane.height;
> > +    dmabuf->buf.backing_width = plane.width;
> > +    dmabuf->buf.backing_height = plane.height;
> >      dmabuf->buf.stride = plane.stride;
> >      dmabuf->buf.fourcc = plane.drm_format;
> >      dmabuf->buf.modifier = plane.drm_format_mod;
> >
> > I'll post that formally, but I really have no idea how dmabuf display
> > works, so confirmation would be appreciated.  Thanks,  
> 
> Looks correct to me. I wish Kim would chime in.
> 
> I am not familiar with vfio/display. Looking at the kernel side, it
> seems it doesn't have a concept for scanout geometry that is different
> from the backing dmabuf/texture dimension.
> 
> Should we make this a blocker for release? Are you sending the patch?

I did send a patch, Kim commented there:

https://lore.kernel.org/all/20230816215550.1723696-1-alex.williamson@redhat.com/

Follow-up suggest vhost-user-gpu is also affected.  Empirically the
patch I sent works, I think it's correct, but Gerd is probably most
qualified to respond to the comments.  I don't know how a "scanout"
relates to what we provide in vfio_device_gfx_plane_info.  Thanks,

Alex



  reply	other threads:[~2023-08-21 16:05 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 12:45 [PULL 00/19] UI & audio patches marcandre.lureau
2023-07-17 12:45 ` [PULL 01/19] virtio-gpu: fix potential divide-by-zero regression marcandre.lureau
2023-07-17 12:45 ` [PULL 02/19] ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255) marcandre.lureau
2023-07-17 12:45 ` [PULL 03/19] ui/gtk: Make sure the right EGL context is currently bound marcandre.lureau
2023-07-17 12:45 ` [PULL 04/19] virtio-gpu: replace the surface with null surface when resetting marcandre.lureau
2023-07-26 14:19   ` Marc-André Lureau
2023-07-17 12:45 ` [PULL 05/19] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties marcandre.lureau
2023-08-16 21:08   ` [8.1 regression] " Alex Williamson
2023-08-16 21:25     ` Alex Williamson
2023-08-21 10:20       ` Marc-André Lureau
2023-08-21 16:04         ` Alex Williamson [this message]
2023-07-17 12:45 ` [PULL 06/19] ui/gtk: set scanout-mode right before scheduling draw marcandre.lureau
2023-07-21  6:53   ` Volker Rümelin
2023-07-24  4:47     ` Kim, Dongwon
2023-07-24 17:23       ` Volker Rümelin
2023-07-17 12:45 ` [PULL 07/19] ui/gtk: skip refresh if new dmabuf has been submitted marcandre.lureau
2023-07-17 12:45 ` [PULL 08/19] libvirt-ci: update submodule to cover pipewire marcandre.lureau
2023-07-17 12:45 ` [PULL 09/19] tests/lcitool: add pipewire marcandre.lureau
2023-07-17 12:45 ` [PULL 10/19] audio/pw: Pipewire->PipeWire case fix for user-visible text marcandre.lureau
2023-07-17 12:45 ` [PULL 11/19] audio/pw: drop needless case statement marcandre.lureau
2023-07-17 12:45 ` [PULL 12/19] audio/pw: needless check for NULL marcandre.lureau
2023-07-17 12:45 ` [PULL 13/19] audio/pw: trace during init before calling pipewire API marcandre.lureau
2023-07-17 12:45 ` [PULL 14/19] audio/pw: add more details on error marcandre.lureau
2023-07-17 12:45 ` [PULL 15/19] audio/pw: factorize some common code marcandre.lureau
2023-07-17 12:45 ` [PULL 16/19] audio/pw: add more error reporting marcandre.lureau
2023-07-17 12:45 ` [PULL 17/19] audio/pw: simplify error reporting in stream creation marcandre.lureau
2023-07-17 12:45 ` [PULL 18/19] audio/pw: remove wrong comment marcandre.lureau
2023-07-17 12:45 ` [PULL 19/19] audio/pw: improve channel position code marcandre.lureau
2023-07-17 19:12 ` [PULL 00/19] UI & audio patches Richard Henderson

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=20230821100443.6034d0a4.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=dongwon.kim@intel.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=vivek.kasireddy@intel.com \
    --cc=wainersm@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).