[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ui/gtk: skip any extra draw of same guest scanout blob res
From: |
Dongwon Kim |
Subject: |
Re: [PATCH] ui/gtk: skip any extra draw of same guest scanout blob res |
Date: |
Thu, 23 Sep 2021 16:41:17 -0700 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
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 required.
I think I had some wrong belief after seeing some of sync problem
resolved after adding mutex but the code sequence was different at that
time.. I will remove mutex.
>
> > +#ifdef CONFIG_GBM
> > + if (dmabuf) {
> > + qemu_mutex_lock(&dmabuf->mutex);
> > + if (!dmabuf->draw_submitted) {
> > + qemu_mutex_unlock(&dmabuf->mutex);
> > + return;
> > + } else {
> > + dmabuf->draw_submitted = false;
> > + }
> > + }
> > +#endif
>
> Factoring out that into helper functions is probably a good idea. Then
> have stub functions for the CONFIG_GBM=no case and *alot* less #ifdefs
> in the code ...
>
There are oter places controlled by #ifdef CONFIG_GBM.
What about taking care of CONFIG_GBM altogher after v2 (same but no
mutex) of this patch?
> thanks,
> Gerd
>