Hi On Wed, Jun 21, 2023 at 11:53 PM Dongwon Kim <dongwon....@intel.com> wrote:
> x and y offsets and width and height of the scanout texture > is not correctly configured in case guest scanout frame is > dmabuf. > > Cc: Gerd Hoffmann <kra...@redhat.com> > Cc: Marc-André Lureau <marcandre.lur...@redhat.com> > Cc: Vivek Kasireddy <vivek.kasire...@intel.com> > Signed-off-by: Dongwon Kim <dongwon....@intel.com> > I find this a bit confusing, and I don't know how to actually test it. The only place where scanout_{width, height} are set is virtio_gpu_create_dmabuf() and there, they have the same values as width and height. it's too easy to get confused with the values imho. I find the terminology we use for ScanoutTexture much clearer. It uses backing_{width, height} instead, which indicates quite clearly that the usual x/y/w/h are for the sub-region to be shown. I think we should have a preliminary commit that renames scanout_{width, height}. Please give some help/hints on how to actually test this code too. Thanks! --- > ui/gtk-egl.c | 3 ++- > ui/gtk-gl-area.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c > index 19130041bc..e99e3b0d8c 100644 > --- a/ui/gtk-egl.c > +++ b/ui/gtk-egl.c > @@ -257,7 +257,8 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl, > > gd_egl_scanout_texture(dcl, dmabuf->texture, > dmabuf->y0_top, dmabuf->width, dmabuf->height, > - 0, 0, dmabuf->width, dmabuf->height); > + dmabuf->x, dmabuf->y, dmabuf->scanout_width, > + dmabuf->scanout_height); > > if (dmabuf->allow_fences) { > vc->gfx.guest_fb.dmabuf = dmabuf; > diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c > index c384a1516b..1605818bd1 100644 > --- a/ui/gtk-gl-area.c > +++ b/ui/gtk-gl-area.c > @@ -299,7 +299,8 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener > *dcl, > > gd_gl_area_scanout_texture(dcl, dmabuf->texture, > dmabuf->y0_top, dmabuf->width, > dmabuf->height, > - 0, 0, dmabuf->width, dmabuf->height); > + dmabuf->x, dmabuf->y, > dmabuf->scanout_width, > + dmabuf->scanout_height); > > if (dmabuf->allow_fences) { > vc->gfx.guest_fb.dmabuf = dmabuf; > -- > 2.34.1 > > > -- Marc-André Lureau