/srv/irclogs.ubuntu.com/2014/02/13/#ubuntu-mir.txt

RAOFmlankhorst: Oh, I think I know why Mir clients are failing on new mesa; I ran into it before.00:00
=== zoktar_ is now known as zoktar
=== cjohnston_ is now known as cjohnston
=== xnox_ is now known as xnox
=== duflu__ is now known as duflu
mlankhorstRAOF: go on08:15
mlankhorstis this thep oint where the killer makes another move and you die before you can tell what the important information is? ;-)08:16
alan_galf: I'm looking at some of the valgrind errors we see in my SwitchingBundle proposal and have found some very misleading reporting. What do you make of this: http://pastebin.ubuntu.com/6924718/10:05
anpoklacking support for c++1110:11
alan_gRats. valgrind can't detect std::atomic wrappers on types that don't need a lock. (Because the wrapper gets optimised away.)10:17
alan_gThat's a load of noise.10:17
alfalan_g: :/10:30
anpokthere is also no _GLIBCXX_SYNCHRONISATION_WHATEVER .. in atomic10:31
alan_gYeah. tvoss suggested threadsanitizer - which isn't quite as wrong with the example10:31
* alan_g wanders off to talk to folks that know this stuff in detail10:33
alfalan_g: anpok: I wonder if helgrind can understand hardware instructions with acquire/release semantics (e.g. probably used by atomic<> implementations)... probably not10:41
alan_galf: no. It is discussed on the valgrind lists - the opcodes are identical (for basic types anyway)10:42
mlankhorstRAOF: yeah the refresh fixed things.. I'm curious though since it seems to remove a bunch of free-s. Why were those removed?11:21
mlankhorst-+   free(dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]);11:21
mlankhorst-+   free(dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);11:21
greybackfolks, I've a little C++ issue I need advice on: http://pastebin.ubuntu.com/6925097/11:51
greybackI think I'm not fully understanding a reference to a pointer of an object and how to properly create one11:52
alan_ggreyback: C++ won't let you bind a non-const reference to a temporary11:55
alan_gs/QScopedPointer<MockBuffer> buffer(new MockBuffer);/mir::graphics::Buffer* buffer{nullptr};/11:58
greybackalan_g: interesting. Do I not need that MockBffer at all?11:58
alan_ggreyback: I doubt it: swap_buffers() is used to get a pointer to a buffer provided by the compositor and optionally return one12:00
alan_gBTW swap_buffers got some drastic changes last week and that code is using the old version12:02
greybackalan_g: ah really? Ok, well this is more an experiment than anything else.12:02
greybackalan_g: thanks for the help, you've pointed me in the right direction12:03
=== dandrader is now known as dandrader|afk
=== dandrader|afk is now known as dandrader
alffginther: Hi! Do we need to do something to deploy the change for the pbuildjenkins scripts?13:54
alfrsalveti: ogra_: How do you want to handle the package dependency of e.g. libmirclient to its platforms? libmirclient Depends: libmirclientplatform-mesa | libmirclientplatform-android ?13:59
ogra_alf, right, and then se seed libmirclientplatform-android in touch and libmirclientplatform-mesa everywhere else14:00
fgintheralf, It's all deployed now, you should be good to go14:12
alffginther: excellent, thanks14:13
alfogra_: rsalveti: Also, do you want mesa and android to have the same priority (in terms of dpkg alternatives), or different priorites, possibly depending on platform?14:24
ogra_alf, i assume they will never be installed together anyway14:25
ogra_so they can have the same14:25
alfogra_: if a package with the same priority as an already existing one gets installed, does the alternative change to the new one or stick to the current one?14:26
ogra_i thinkit gets changed14:27
alfogra_: hmm, let's see if I can find out for sure (to the sources!). The problem I am trying to avoid is someone using mir on the desktop, playing with packages, and installing the -android backend => broken system14:28
ogra_use Conflicts/Breaks in the control file14:29
ogra_then he needs to approve the removal ... (apt will ask Y/N )14:29
ogra_thats at least one stop gap14:29
alfogra_: Then what is the point of having alternatives in the first place? We could just Conflict/Break from the start... I thought the (future) goal was to be able to install in parallel and have runtime selection?14:31
ogra_but that would happen inside one package anyway, or not ?14:31
rsalvetialf: ogra_: I'd put the android with a lower priority14:37
rsalvetias our touch image is ro anyway14:37
ogra_indeed14:37
rsalvetithen we're still good for the desktop14:38
ogra_though my statement still stands, for the runtime selection we want both in one package14:38
alfrsalveti: ogra_: would it make sense to have mesa < android on armhf, mesa > android otherwise?14:40
alfrsalveti: ogra_: from the update-alternatives manpage: "If the group is in automatic mode, and the newly added alternatives' priority is higher than any other  installed  alterna‐ tives for this group, the symlinks will be updated to point to the newly added alternatives14:45
ogra_alf, right, well, do it like you described above14:46
rsalvetialf: we don't want to assume anything for armhf14:46
rsalvetias we now have the x86 emulator as well14:46
alfrsalveti: ogra_: ok, I will make them equal, hopefully what the manpage says is accurate, so just installing the package won't mess up a system with an existing equal alternative14:47
rsalvetiright :-)14:48
* alf didn't know what he was missing by not using ccache when developing/rebuilding packages14:55
kgunnmterry: didn't mean to abandon you....14:56
kgunnmterry: so what you wanted to know was where in the mir code does a client know his buffer is about to be "used" for composition consumption14:57
kgunnthat right ?14:57
mterrykgunn, yeah...  I want to know when a buffer with non-zero content is about to be used.  (i.e. not just transparent; I don't know if Mir optimizes such frames out anyway)15:00
mterrykgunn, oh and this is from compositor side15:00
mterrykgunn, I tried inspecting buffers but didn't know how to get actual pixel data15:01
kgunnalf: or anpok ^ can you help out mterry...15:02
mterryanpok and alan_g, you two were helping me yesterday with buffer stuff.  I have instrumented USC to insert itself into the surface/session creation process.  Now I have these buffers that the surface wants to swap15:03
mterryBut how do I inspect actual pixel data?  (I want to see if there's actual pixels to draw, it's not just all transparent -- does Mir optimize that away?)15:03
anpokmir would not optimize that away15:04
anpokalso if you look at current system behavior you regularly see white or black buffers show up.. so we seem to display things before actual content shows up - I dont know exactly where that happens though15:05
mterryanpok, hm.  But I have a mg::Buffer object.  I can't seem to do anything sensible with the native_buffer_handle, but how might I get the pixel data?15:06
alan_gmterry: I don't think that's an intended use. Maybe alf can suggest a way?15:08
greybackmterry: do you want to inspect the actual pixel data, or just be notified that a client has drawn its first frame?15:10
mterrygreyback, well you showed me you had something in the works for frame notification15:11
mterrygreyback, I suspect Qt is sending a dummy background before the Qml is fully loaded and drawn15:11
mterrygreyback, so I wanted to be able to inspect data to see if that is true and to detect the first non-empty frame15:11
greybackmterry: when mir creates a Surface, it may be some time until the buffer is actually drawn to by the client. So I wanted to be notified after the client has drawn to the buffer, as then it is non-empty15:16
greybackso I wasn't going to actually inspect the pixel data. I just wanted to know that the client swapped a buffer, which means it drew to it15:17
greybackmterry: are you using the SurfaceManager in unity-mir by any chance?15:18
mterrygreyback, no, I'm currently looking to do this in USC15:18
greybackmterry: ok15:18
mterrygreyback, so who does have access to the pixel data?  Seems hard to find in mir source  :)15:18
greybackmterry: so what I think Mir needs to export is some kind of event which says "Session has a Buffer ready" to be composited/drawn on screen (i.e. one which the client has actually drawn to)15:19
mterryThat would help, yeah15:20
alan_gmterry: the pixel data is platform dependent typically in a GL texture15:21
mterryalan_g, hmmm OK15:23
alan_gAs far as Mir is concerned if a client has sent a buffer via swap_buffers()  there is data. So I'm not sure what else this event you're discussing would be.15:25
=== alan_g is now known as alan_g|tea
mterryalan_g|tea, what about the idea of a client Mir session being able to indicate to the server that it is "ready" to be composited?  It seems not unreasonable that a compositor would want to keep some animation going or draw something to the screen while a client loads up15:46
=== alan_g|tea is now known as alan_g
alan_gmterry: why doesn't it do that by posting a buffer?15:48
mterryalan_g, yeah but when does it stop the buffer?15:49
alan_gI don't understand15:50
mterryalan_g, so here's the problem I'm working with15:51
mterryalan_g, USC starts, and lightdm kicks off a greeter session and a user session around the same time.  There's a race there, but USC knows to keep the greeter on top when it does show up15:51
mterryalan_g, but user session sometimes wins the race and appears for a second before the greeter15:52
alan_gack that's what we discussed yesterday15:52
mterryalan_g, I'd like to be able to hide the user session when it appears (easy with Session::hide())15:52
alan_gsure15:52
mterryalan_g, but I need to know when to unhide it (i.e. when the greeter is "done")15:52
mterryalan_g, and the greeter is posting frames before it is ready (presumably empty transparent frames)15:52
mterryQt is doing that I think for me15:53
mterryalan_g, the situation would be very similar once USC gets boot animation support.  We need to know when to transition from the animation to the greeter when it is ready to be shown15:54
alan_gSo the answer to "why doesn't it do that by posting a buffer?" is that Qt posts buffers before it is ready?15:54
mterryalan_g, well.  I mean, I could imagine a client like the unity8 shell not wanting to be "ready" before its scopes are loaded or whatever15:54
mterryalan_g, "readyness" doesn't necessarily translate into frames being posted15:55
mterryalan_g, but in this case, for the greeter, sure.  It's because Qt is posting before there is actual content to load15:55
=== dandrader is now known as dandrader|afk
mterryalan_g, I think the Qt window is drawn and its waiting for the Qml stuff to load and draw etc15:55
mterryat a guess, I haven't dived into it15:55
=== jono is now known as Guest53088
alan_gI don't like the sound of inspecting buffers to guess when they have "real" content. Too much can go wrong15:57
mterryalan_g, I get that.  What about some Mir signal that a client could post to its server?15:57
alan_gIt sounds like a weird client that posts buffers before it is ready.15:58
alan_gIs this really a general problem or something restricted to greeter <-> USC?15:59
mterryalan_g, I get that from a theoretical perspective.  But there are a lot of layers between a Qml file that knows "Component.onCompleted: isReady()" and Mir15:59
mterryalan_g, those abstractions tend to mean that Qt/Qml throws data at Mir willy nilly16:00
mterryalan_g, well, when an app launches...  We throw up a white screen right?   What if the shell wanted to show an animation while it loaded16:01
mterryalan_g, it would need to know when to stop the animation.  When the app is "ready"16:01
anpokfor those cases the first frame is good sign of readyness16:02
alan_gmterry: I've got a hangout - back in ~10min16:02
mterryanpok, that's fair.  I suppose click apps are tiny enough16:02
anpoki wonder whether other configuration changes will come up later16:03
anpokconfiguration changes the shell might request from a client..16:03
mterryanpok, alan_g: I'd be happy if Qt/Qml wouldn't post any frames until everything was loaded.  Is that a feasible change to make?  Ideally we could start "frozen" and unfreeze...  maybe Qt has internal support for doing that16:04
anpokseems like worthwhile to look into qt for that16:05
* mterry isn't super familiar with Mir and Qt integration, but digs into it16:05
mterryMaybe it's as easy as not doing show() until we're ready16:12
alan_gmterry: I don't know much Qt but that sounds like a logical approach16:21
greybackmterry: I'm not aware of any easy way to prevent Qt drawing until things are "ready"16:58
mterrygreyback, yeah I haven't been able to stop it yet.  Looks like QMirServerApplication even does it somewhere deep down?16:59
greybackmterry: nope, it doesn't touch render loop. Render loop will spin once the QML scene is ready. But it won't render if the "window" is marked hidden. So maybe http://qt-project.org/doc/qt-5.0/qtgui/qwindow.html#hide might do it17:01
mterrygreyback, I tried removing all the QQuickView code from unity8, but it still is seemingly posting non-null buffers to swap_buffers17:01
greybackmterry: thing is, Mir is doing the compositing. Is user session appears first, Mir shows it first. It just means Qt hasn't drawn its surface faster than the user session has17:02
mterrygreyback, maybe I don't understand how swap_buffers works, but it seems to be receiving valid buffers from the qml-less shell17:02
mterrygreyback, yeah that makes sense to me. I can have the compositor hide the user session until the greeter is ready17:03
greybackmterry: as soon as a client asks Mir for a surface to render on, Mir will be aware of that surface and start compositing it - even though nothing has been drawn to that surface yet. So you see black17:03
mterrygreyback, I just need a way to know when the greeter is ready so I can unhide it17:03
mterrygreyback, or in the greeter's alpha case, transparency17:03
greybackmterry: I don't know how to get Mir to create a Surface invisible by default. But maybe position it off-screen initially, or mark it fully transparent?17:04
mterrygreyback, well I've been using swap_buffers.  Did your approach you mentioned the other day to detect frames use a different mechanism?17:04
greybackmterry: well that's step 2, no? That once the user session buffer has been drawn to you can then show it?17:04
mterrygreyback, there is a way to get it to allow transparency:  https://code.launchpad.net/~mterry/unity-mir/alpha-greeter/+merge/20406917:04
greybackmterry: indeed. I need to review that...17:05
mterrygreyback, I actually don't care so much about when the user session is ready.  I just want to know when the greeter is ready so I can show the user session (ready or not) behind it17:06
mterryEventually I'll probably be interested in that information too, to add a little "waiting for session" animation17:06
greybackmterry: oh ok, I misread.In Qt, you can connect to this signal https://qt-project.org/doc/qt-5.1/qtquick/qquickwindow.html#frameSwapped17:07
greybackmterry: else you need to get that info out of Mir somehow17:07
mterrygreyback, I'm saying that even without the shell creating any windows, Mir compositor is seeing swap_buffer calls with non-null buffers.  So I'm having a hard time determining when a frame is posted if that's not the right way.  You said you had something similar.  Does it rely on swap_buffers or something else in Mir?17:08
greybackmterry: yep, I added something to ms::BasicSurface::swap_buffers so that I was notified when an actual buffer was swapped17:11
mterrygreyback, yeah I noticed you added a flag_for_render thing?17:12
mterryHaven't dived into your branch yet, but looks like that's my next step17:12
mterryBut first, lunch17:12
greybackmterry: yes that's it. That event was emitted when an actual client puffer was swapped17:12
greybackworked nicely for my purposes17:12
mterrygreyback, that's something you added, right?  I don't see it in trunk17:13
greybackmterry: yep17:14
=== FunnyLookinHat_ is now known as FunnyLookinHat
=== alan_g is now known as alan_g|EOD
mterrygreyback, oh, I see why flag_for_render isn't in trunk, it got removed...18:28
=== dandrader is now known as dandrader|lunch
=== dandrader|lunch is now known as dandrader
mterrySo I'm seeing swapped buffers from just mir::run_mir's use of DisplayServer...19:57
* mterry is wondering what could be posting buffers internally19:58
* anpok mumbles something unintelligible20:09
anpokmterry: when the display is on the compositor threads will start drawing the first frame20:20
anpokif you look in mir::compoistor::MultiThreadedCompositor::start I believe20:21
anpokschedules a composition for each active output20:21
anpokso with no surfaces you should get an initial glClear ... and swap buffers for20:22
mterryanpok, huh without data from the client?20:22
anpokI think this mainly about getting the display in the right state after turning it on again (or maybe the cause why we see old buffer contents - because we get the trigger before clients can send proper surface contents)20:24
anpokhavent played with that code yet.. so.. add a grain of guessing from my side20:24
mterryanpok, huh.  OK, I'll need to find a way to tell these apart from client-driven swap_buffer calls.  Maybe only start listening for them after client is set up20:24
anpokmterry: I wonder if that is proper behavior20:25
anpokmake waiting for the first round of new client buffers is better.. or just informing the shell and letting it decide what to do ..20:26
anpokyou could try without scheduling the first draw - just to be sure20:26
anpokbtw do you happen to know where the "Accept" decision is handled after an incoming call in unity820:27
anpoks/make waiting/maybe waiting/ o_O20:27
mterryanpok, the accept notification is from telephony-service20:40
anpokmterry: so they then launch the dialer app to take the call21:06
anpokthey==that service21:06
anpokor searches for a running dialer app21:07
mterryanpok, yeah21:07
mterryanpok, launches it via upstart yeah, which either opens or focuses it21:08

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!