Re: [PATCH] ui/gtk: skip any extra draw of same guest scanout blob res

2021-09-23 Thread Dongwon Kim
On Fri, Sep 17, 2021 at 12:02:02PM +0200, Gerd Hoffmann wrote: > Hi, > > > +bool draw_submitted; > > +QemuMutex mutex; > > Why the mutex? I think all the code runs while holding the BQL so it > should be serialized. Gerd, I did more experiment and verified mutex is actually not r

Re: [PATCH] ui/gtk: skip any extra draw of same guest scanout blob res

2021-09-17 Thread Dongwon Kim
On Fri, Sep 17, 2021 at 12:02:02PM +0200, Gerd Hoffmann wrote: > Hi, > > > +bool draw_submitted; > > +QemuMutex mutex; > > Why the mutex? I think all the code runs while holding the BQL so it > should be serialized. Guest drawing process using blob is serialized (gd_egl_flush->sc

Re: [PATCH] ui/gtk: skip any extra draw of same guest scanout blob res

2021-09-17 Thread Gerd Hoffmann
Hi, > +bool draw_submitted; > +QemuMutex mutex; Why the mutex? I think all the code runs while holding the BQL so it should be serialized. > +#ifdef CONFIG_GBM > +if (dmabuf) { > +qemu_mutex_lock(&dmabuf->mutex); > +if (!dmabuf->draw_submitted) { >

[PATCH] ui/gtk: skip any extra draw of same guest scanout blob res

2021-09-16 Thread Dongwon Kim
Any extra draw call for the same blob resource representing guest scanout before the previous drawing is not finished can break synchronous draw sequence. To prevent this, drawing is now done only once for each draw submission (when draw_submitted == true). Mutex is added to protect this draw itera