Re: mutter: reduce server grabs for window creation



On Wed, 2013-12-18 at 13:36 -0600, Daniel Drake wrote:
On Wed, Dec 18, 2013 at 11:58 AM, Owen Taylor <otaylor redhat com> wrote:
From the partial backtrace posted on the bug, it looks like the code
called in response to ::add-window is not drawing (which would be fairly
surprising) but doing other GL operations - in the backtrace deleting a
texture.

Going deeper into the trace, actually the call to delete the texture
is some code in our custom shell, running in a StWidget style_changed
handler. Maybe that is questionable. We've seen the hang in other
contexts too (e.g. window minimizing where mutter's idle_calc_showing
takes a server grab and then emits some signals to the shell), maybe
in less questionable cases. Either way I'm going to attempt to reduce
the server grabbing according to your comments - moreso than the
initial patch does.

It sounds like server grabs and your driver just aren't going to get
along very well. Chasing every place where you are using GL behind the
scenes could be tricky. If we can stop leaking server grabs out to
Javascript without compromising robustness, that would definitely be
better.

One thing that definitely should be noted is that we still have a server
grab over everything when this code is called from
meta_screen_manage_all_windows(). From a brief look, it appears to me
that this happens *after* we initialize Javascript, set up signal
connections, etc - so probably the only reason that your patch works for
you is that the driver's internal swap-buffers thread isn't doing
anything during initialization.

My patch does remove the meta_display_grab() call made by
meta_screen_manage_all_windows(). I'm not sure if it was necessary or
not, I just noticed that it calls meta_window_new_with_attrs() too and
decided to update it for the new semantics.

Ah, missed that. I would have probably commented negatively on it if I
had noticed it, but on analysis (see my other mail), I don't think it
actually has much point :-)

- Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]