[00:00] mlankhorst: Oh, I think I know why Mir clients are failing on new mesa; I ran into it before. === zoktar_ is now known as zoktar === cjohnston_ is now known as cjohnston === xnox_ is now known as xnox === duflu__ is now known as duflu [08:15] RAOF: go on [08:16] is this thep oint where the killer makes another move and you die before you can tell what the important information is? ;-) [10:05] alf: 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:11] lacking support for c++11 [10:17] Rats. valgrind can't detect std::atomic wrappers on types that don't need a lock. (Because the wrapper gets optimised away.) [10:17] That's a load of noise. [10:30] alan_g: :/ [10:31] there is also no _GLIBCXX_SYNCHRONISATION_WHATEVER .. in atomic [10:31] Yeah. tvoss suggested threadsanitizer - which isn't quite as wrong with the example [10:33] * alan_g wanders off to talk to folks that know this stuff in detail [10:41] alan_g: anpok: I wonder if helgrind can understand hardware instructions with acquire/release semantics (e.g. probably used by atomic<> implementations)... probably not [10:42] alf: no. It is discussed on the valgrind lists - the opcodes are identical (for basic types anyway) [11:21] RAOF: 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] -+ free(dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]); [11:21] -+ free(dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]); [11:51] folks, I've a little C++ issue I need advice on: http://pastebin.ubuntu.com/6925097/ [11:52] I think I'm not fully understanding a reference to a pointer of an object and how to properly create one [11:55] greyback: C++ won't let you bind a non-const reference to a temporary [11:58] s/QScopedPointer buffer(new MockBuffer);/mir::graphics::Buffer* buffer{nullptr};/ [11:58] alan_g: interesting. Do I not need that MockBffer at all? [12:00] greyback: I doubt it: swap_buffers() is used to get a pointer to a buffer provided by the compositor and optionally return one [12:02] BTW swap_buffers got some drastic changes last week and that code is using the old version [12:02] alan_g: ah really? Ok, well this is more an experiment than anything else. [12:03] alan_g: thanks for the help, you've pointed me in the right direction === dandrader is now known as dandrader|afk === dandrader|afk is now known as dandrader [13:54] fginther: Hi! Do we need to do something to deploy the change for the pbuildjenkins scripts? [13:59] rsalveti: ogra_: How do you want to handle the package dependency of e.g. libmirclient to its platforms? libmirclient Depends: libmirclientplatform-mesa | libmirclientplatform-android ? [14:00] alf, right, and then se seed libmirclientplatform-android in touch and libmirclientplatform-mesa everywhere else [14:12] alf, It's all deployed now, you should be good to go [14:13] fginther: excellent, thanks [14:24] ogra_: 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:25] alf, i assume they will never be installed together anyway [14:25] so they can have the same [14:26] ogra_: 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:27] i thinkit gets changed [14:28] ogra_: 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 system [14:29] use Conflicts/Breaks in the control file [14:29] then he needs to approve the removal ... (apt will ask Y/N ) [14:29] thats at least one stop gap [14:31] ogra_: 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] but that would happen inside one package anyway, or not ? [14:37] alf: ogra_: I'd put the android with a lower priority [14:37] as our touch image is ro anyway [14:37] indeed [14:38] then we're still good for the desktop [14:38] though my statement still stands, for the runtime selection we want both in one package [14:40] rsalveti: ogra_: would it make sense to have mesa < android on armhf, mesa > android otherwise? [14:45] rsalveti: 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 alternatives [14:46] alf, right, well, do it like you described above [14:46] alf: we don't want to assume anything for armhf [14:46] as we now have the x86 emulator as well [14:47] rsalveti: 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 alternative [14:48] right :-) [14:55] * alf didn't know what he was missing by not using ccache when developing/rebuilding packages [14:56] mterry: didn't mean to abandon you.... [14:57] mterry: 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 consumption [14:57] that right ? [15:00] kgunn, 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] kgunn, oh and this is from compositor side [15:01] kgunn, I tried inspecting buffers but didn't know how to get actual pixel data [15:02] alf: or anpok ^ can you help out mterry... [15:03] anpok 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 swap [15:03] But 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:04] mir would not optimize that away [15:05] also 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 though [15:06] anpok, 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:08] mterry: I don't think that's an intended use. Maybe alf can suggest a way? [15:10] mterry: do you want to inspect the actual pixel data, or just be notified that a client has drawn its first frame? [15:11] greyback, well you showed me you had something in the works for frame notification [15:11] greyback, I suspect Qt is sending a dummy background before the Qml is fully loaded and drawn [15:11] greyback, so I wanted to be able to inspect data to see if that is true and to detect the first non-empty frame [15:16] mterry: 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-empty [15:17] so 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 it [15:18] mterry: are you using the SurfaceManager in unity-mir by any chance? [15:18] greyback, no, I'm currently looking to do this in USC [15:18] mterry: ok [15:18] greyback, so who does have access to the pixel data? Seems hard to find in mir source :) [15:19] mterry: 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:20] That would help, yeah [15:21] mterry: the pixel data is platform dependent typically in a GL texture [15:23] alan_g, hmmm OK [15:25] As 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. === alan_g is now known as alan_g|tea [15:46] alan_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 up === alan_g|tea is now known as alan_g [15:48] mterry: why doesn't it do that by posting a buffer? [15:49] alan_g, yeah but when does it stop the buffer? [15:50] I don't understand [15:51] alan_g, so here's the problem I'm working with [15:51] alan_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 up [15:52] alan_g, but user session sometimes wins the race and appears for a second before the greeter [15:52] ack that's what we discussed yesterday [15:52] alan_g, I'd like to be able to hide the user session when it appears (easy with Session::hide()) [15:52] sure [15:52] alan_g, but I need to know when to unhide it (i.e. when the greeter is "done") [15:52] alan_g, and the greeter is posting frames before it is ready (presumably empty transparent frames) [15:53] Qt is doing that I think for me [15:54] alan_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 shown [15:54] So the answer to "why doesn't it do that by posting a buffer?" is that Qt posts buffers before it is ready? [15:54] alan_g, well. I mean, I could imagine a client like the unity8 shell not wanting to be "ready" before its scopes are loaded or whatever [15:55] alan_g, "readyness" doesn't necessarily translate into frames being posted [15:55] alan_g, but in this case, for the greeter, sure. It's because Qt is posting before there is actual content to load === dandrader is now known as dandrader|afk [15:55] alan_g, I think the Qt window is drawn and its waiting for the Qml stuff to load and draw etc [15:55] at a guess, I haven't dived into it === jono is now known as Guest53088 [15:57] I don't like the sound of inspecting buffers to guess when they have "real" content. Too much can go wrong [15:57] alan_g, I get that. What about some Mir signal that a client could post to its server? [15:58] It sounds like a weird client that posts buffers before it is ready. [15:59] Is this really a general problem or something restricted to greeter <-> USC? [15:59] alan_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 Mir [16:00] alan_g, those abstractions tend to mean that Qt/Qml throws data at Mir willy nilly [16:01] alan_g, well, when an app launches... We throw up a white screen right? What if the shell wanted to show an animation while it loaded [16:01] alan_g, it would need to know when to stop the animation. When the app is "ready" [16:02] for those cases the first frame is good sign of readyness [16:02] mterry: I've got a hangout - back in ~10min [16:02] anpok, that's fair. I suppose click apps are tiny enough [16:03] i wonder whether other configuration changes will come up later [16:03] configuration changes the shell might request from a client.. [16:04] anpok, 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 that [16:05] seems like worthwhile to look into qt for that [16:05] * mterry isn't super familiar with Mir and Qt integration, but digs into it [16:12] Maybe it's as easy as not doing show() until we're ready [16:21] mterry: I don't know much Qt but that sounds like a logical approach [16:58] mterry: I'm not aware of any easy way to prevent Qt drawing until things are "ready" [16:59] greyback, yeah I haven't been able to stop it yet. Looks like QMirServerApplication even does it somewhere deep down? [17:01] mterry: 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 it [17:01] greyback, I tried removing all the QQuickView code from unity8, but it still is seemingly posting non-null buffers to swap_buffers [17:02] mterry: 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 has [17:02] greyback, maybe I don't understand how swap_buffers works, but it seems to be receiving valid buffers from the qml-less shell [17:03] greyback, yeah that makes sense to me. I can have the compositor hide the user session until the greeter is ready [17:03] mterry: 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 black [17:03] greyback, I just need a way to know when the greeter is ready so I can unhide it [17:03] greyback, or in the greeter's alpha case, transparency [17:04] mterry: 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] greyback, well I've been using swap_buffers. Did your approach you mentioned the other day to detect frames use a different mechanism? [17:04] mterry: well that's step 2, no? That once the user session buffer has been drawn to you can then show it? [17:04] greyback, there is a way to get it to allow transparency: https://code.launchpad.net/~mterry/unity-mir/alpha-greeter/+merge/204069 [17:05] mterry: indeed. I need to review that... [17:06] greyback, 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 it [17:06] Eventually I'll probably be interested in that information too, to add a little "waiting for session" animation [17:07] mterry: oh ok, I misread.In Qt, you can connect to this signal https://qt-project.org/doc/qt-5.1/qtquick/qquickwindow.html#frameSwapped [17:07] mterry: else you need to get that info out of Mir somehow [17:08] greyback, 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:11] mterry: yep, I added something to ms::BasicSurface::swap_buffers so that I was notified when an actual buffer was swapped [17:12] greyback, yeah I noticed you added a flag_for_render thing? [17:12] Haven't dived into your branch yet, but looks like that's my next step [17:12] But first, lunch [17:12] mterry: yes that's it. That event was emitted when an actual client puffer was swapped [17:12] worked nicely for my purposes [17:13] greyback, that's something you added, right? I don't see it in trunk [17:14] mterry: yep === FunnyLookinHat_ is now known as FunnyLookinHat === alan_g is now known as alan_g|EOD [18:28] greyback, oh, I see why flag_for_render isn't in trunk, it got removed... === dandrader is now known as dandrader|lunch === dandrader|lunch is now known as dandrader [19:57] So I'm seeing swapped buffers from just mir::run_mir's use of DisplayServer... [19:58] * mterry is wondering what could be posting buffers internally [20:09] * anpok mumbles something unintelligible [20:20] mterry: when the display is on the compositor threads will start drawing the first frame [20:21] if you look in mir::compoistor::MultiThreadedCompositor::start I believe [20:21] schedules a composition for each active output [20:22] so with no surfaces you should get an initial glClear ... and swap buffers for [20:22] anpok, huh without data from the client? [20:24] I 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] havent played with that code yet.. so.. add a grain of guessing from my side [20:24] anpok, 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 up [20:25] mterry: I wonder if that is proper behavior [20:26] make 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] you could try without scheduling the first draw - just to be sure [20:27] btw do you happen to know where the "Accept" decision is handled after an incoming call in unity8 [20:27] s/make waiting/maybe waiting/ o_O [20:40] anpok, the accept notification is from telephony-service [21:06] mterry: so they then launch the dialer app to take the call [21:06] they==that service [21:07] or searches for a running dialer app [21:07] anpok, yeah [21:08] anpok, launches it via upstart yeah, which either opens or focuses it