/srv/irclogs.ubuntu.com/2014/12/18/#ubuntu-mir.txt

RAOFracarr: Hey, I'm about to do a whole lot of commenting on introduce-bufferstream.00:51
RAOFracarr: Would you prefer an IRC discussion? :)00:51
racarrRAOF: Yeah IRC sounds better :)00:53
RAOFOk.00:56
RAOFracarr: So, first off - why create_surfaceless_buffer_stream, rather than just create_buffer_stream?00:57
racarrRAOF: I guess because I'm thinking of BufferStream as analagous to an interafce implemented by00:58
racarrSurface and Screencast00:58
racarrso create_buffer_stream is00:58
racarrmildly incorrect?00:59
RAOFThat brings up point 2 - why does MirScreencast still exist? :)01:00
RAOFSo, my feeling is that mir_connection_create_surfaceless_buffer_stream is mildly incorrect; among other things, a screencast is *also* a surfaceless bufferstream.01:01
racarrhmm01:02
racarrI guess the Screencast C'Tor could just return BufferStream01:02
racarrexcept for ABI break01:02
RAOFYeah, that's what I was thinking.01:02
racarrwhich this otherwise avoids iirc01:02
RAOFYeah, this is true.01:03
racarrI guess, right so the other thing is01:03
racarrthen you would need mir_buffer_stream_release01:03
racarrand have to document the behavior when called on a buffer stream obtained01:03
racarrfrom a surface01:03
RAOFYeah. Which is my point 3 :)01:03
RAOFMy preference would be for *all* buffer streams to need to be released.01:04
racarroO?01:04
racarrWhat is the use case for releasing a surface but not the buffer stream?01:04
RAOFConsistency in API, mostly :)01:05
RAOFBut it's also vaguely sensible, if you just care about output.01:06
racarrHmm I dont know it seems to require a lot more error states, e.g. what happens if you use surface in when buffer stream is released, etc...01:06
racarr?01:06
RAOFNeither the surface nor the buffer stream are destroyed until both are.01:06
racarrWhat do you mean by its vaguely sensible01:07
racarrif you just care about output?01:07
RAOFWell, if you're doing something like a video output window you could happily release the surface and just swap the buffer stream.01:10
RAOFBut I agree that's not particularly compelling, which is why I said vaguely sensible :)01:10
racarrI guess I'd be more inclined to have mir_buffer_stream_release be an error01:10
racarrif the buffer stream is owned by a surface01:11
racarror something...not sure of the exact language01:11
RAOFWell, *that* could actually be a sensible usage.01:11
racarr?01:11
RAOFIf you're just doing say a static splash screen - create the surface, get the buffer stream, do your one and only swap, then release the buffer stream and now Mir can free some memory :)01:11
RAOFBut eh.01:12
RAOFMostly I want it for API consistency, and for when we want to associate multiple buffer streams with a single surface.01:12
racarrI am not sure I would quite see it01:13
racarranything that requires every currently existing call call to mir_surface_release01:13
racarrliterally without fail01:13
racarrto be prefixed with a call to mir_buffer_stream_release01:13
racarrhas to be incorrect right?01:13
racarranyone looking would say the surface should own the buffer stream and take care of releasing it....01:14
RAOFWell, I thought the same thing for MirSurfaceSpec; mir_surface_create() should eat the SurfaceSpec passed in.01:15
racarrugh01:15
racarrlol01:15
RAOFBut I don't think it's so unreasonable now :)01:15
racarrThis is a little different though because the surface creates the buffer stream...01:15
racarrand I do think its unreasonable lol01:16
racarrfloating references provide a better solution01:16
racarrbut yes I guess that landed01:16
dufluracarr: a buffer stream allocator for clients might be what we need to make nested clients bypass/overlayable too01:17
duflu... as the nested server can then allocate buffers from the system compositor for nested clients01:17
RAOFAlso, you still have the problem of error states multiplying - you still have to specify what happens when you use buffer stream you got from a released surface.01:17
racarrlol01:17
racarrnah, it becomes invalid01:17
racarrI guess there should be01:17
racarrmir_buffer_stream_is_valid01:17
RAOFYeah, that's necessary.01:18
RAOFduflu: Oooh, exactly right!01:18
RAOFduflu: That's ‘multiple buffer streams per surface’.01:18
dufluRAOF: Nah, just the nested server needs a way of allocating system-compositor buffers for nested clients01:18
RAOFAlso, hello from Perth.01:18
dufluRAOF: Oh good morning01:19
racarrHmm ok I am convinced mir screencast ctor should return MirBufferStream01:19
racarrI am convinced...surfaceless_buffer_stream could have a better name01:19
dufluracarr: minus "surfaceless" because that's kind of implied01:19
dufluBugger. We're too efficient and landed the branch I was about to fix01:20
racarrI mean not necessarily some buffer streams are associated with surfaces01:20
dufluAnother branch then01:20
racarrsome aren't01:20
racarrbut RAOF points out that screencast isnt associated with a surface01:20
racarrbut isnt what I call a SurfacelessBufferSTream01:20
dufluracarr: Yeah there's a reason why it's called a stream in video encoding/decoding01:21
racarrRAOF: The part that I can't wrap my head around is why you should have to release a buffer stream seperately from the surface....01:22
racarrduflu: ?01:22
dufluracarr: The reason is just that nobody has thought of a better abstraction/noun than "stream"01:22
racarroh lol01:22
dufluAnd maybe there isn't one01:22
RAOFracarr: You don't have to, but I feel it's a bit cleaner and consistent.01:22
racarrRAOF: Hmm01:23
racarrI guess I will mull over that one my thought is that01:23
racarrthe consistency is "all streams which you allocat ehave to be released" and in this case it01:23
racarrs said that the surface allocates the stream01:23
racarrlikewise I would say that in the case of attaching multiple buffer streams to surfaces, etc...01:23
racarrI guess I would expect the surface to take ownership of the stream01:23
RAOFI'm happy with that, but I'm not sure it's consistent with our current API.01:26
racarrim not sure either lol01:26
racarrwrt surface spec its different because you allocate the spec...01:26
racarrhmmm01:26
RAOFBut then with your multiple-buffer-streams case you *also* allocate the buffer stream :)01:27
racarrand are we sure there really is no MirScreencast01:27
racarrI can almost imagine things like01:27
racarrmir_screencast_set_capture_rate, or mir_screencast_set_scale01:27
RAOFMaybe?01:28
racarrWhat if we add MObject and then MirScreencast can MIR_IMPLEMENT_INTER....01:28
racarrerr....01:28
RAOF:)01:28
RAOFAll nontrivial C programs are guaranteed to implement a half-arsed object system? :)01:29
racarrmm01:29
racarrit does kind of seem like set_rate could be a thing...-.-01:33
RAOFThat would seem to be mir_buffer_stream_set_swap_interval?01:33
racarrhmm probably01:34
racarrSeems Screencast can probably go01:35
racarrRAOF: Ok so my plan is to change the surfaceless_buffer_stream names, drop MirScreencast, add buffer_stream_is_valid01:36
racarrdo something about buffer_stream_release01:36
racarr(took notes)01:36
RAOFHm.01:38
RAOFDoes MirCursorConfiguration want to own the buffer_stream?01:40
racarrhmm01:41
racarrI dont think so at least from the client perspective01:42
racarrand thats consistent with surface spec01:42
racarron the server side though, if the buffer stream was used as the01:42
racarractive cursor request from a surface01:42
racarreven if you release the buffer stream01:42
racarrthe surface will keep around shared_ptr buffer stream and the last buffer will persist until01:42
racarryou make a new cursor request for the surface01:42
racarrwhich I thought was good semantics01:43
racarrit would be more obvious with unref vs release01:43
RAOFMaybe we want unref?01:44
RAOFI agree that's good semantics.01:44
racarrI kind of think we want unref, because...well I dunno, that semantic might not be entirely obvious to me as I see _release01:46
racarrright. I mean I guess its explicitly non obvious01:46
racarrbecause release typically means release01:46
racarrhowever if I saw unref01:46
racarrI would assume01:46
racarrthe cursor configuration and or surface took references to the buffer stream01:47
RAOFRight.01:47
RAOF(Relatedly, Ryan is correct in saying that we need a destroy notify on our delegates)01:47
racarrindeed.01:48
racarrI'm making event ref counted in another mp...01:49
RAOFWhich would happily remove the need for all our _release_sync()s.01:49
racarrmaybe connection and surface should be ref counted too...01:49
racarrRAOF: ?01:49
racarrOh I see01:49
racarrwow this reminds me of an ancient problem that _create_sync is unsafe because oyu dont have time to set delegates before01:49
racarrevents can be received01:49
racarrand that delegates need to be in surface spec01:50
racarr<tangent>01:50
racarrwell its unsafe in that you could miss events01:50
racarrand will miss your first focus event01:50
racarrTotal tangent lol01:50
racarrok hopefully I should get to all this tomorrow assuming I dont wake up to some sort of perfect storm of merge conflicts01:52
racarrim kind of assuming I will wake up to a perfect storm of merge conflicts but who knows01:52
RAOFHeh.01:53
racarrOk. Off to go play some piano before dinnnnner01:58
racarrRAOF: Thanks :)01:58
duflu_RAOF: Can you check this out some time soon? ... https://code.launchpad.net/~vanvugt/mir/revert-r2165/+merge/24506302:34
RAOFSure. I'm doing a big review sweep anyway. :)02:36
=== duflu_ is now known as duflu
racarrwhee merging sha1sums causes cascading jenkins failures again!03:13
racarrduflu: I wonder how evil MirEvent* mir_event_ref(MirEvent const*) is :p04:13
racarrI think its ok if you believe in logical constness04:13
racarryou mark the ref count mutable the compiler is happy04:13
racarrall calls mir_event_foo* return the same value04:14
racarrafter mir_event_ref that they did before mir_event_ref04:14
dufluracarr: I think I abstained on that?04:14
racarrso its 'logically const' right04:14
* duflu checks04:14
RAOFUuuh, you mean MirEvent const* mir_event_ref(MirEvent const*), right?04:14
racarrduflu:  Mm :) I am just saying maybe there wont be an ABI break04:14
RAOFI'd be fine with that; you're not changing the contents of the MirEvent.04:14
racarrRAOF: Even better!04:14
racarrlol04:14
racarrhmm04:15
racarrno04:15
dufluracarr: Mutable or not, it would be poor C design to go changing things insider a const object04:15
racarrRAOF: But then mir_event_unref would have to accept a const04:15
racarrMirEvent04:15
racarrwhich...is less04:15
racarrmore questionable04:15
racarrI dont think youc an say its logically const04:16
racarrif you destroy the object04:16
racarrlol04:16
RAOFWhy does MirEvent want to be refcounted, by the way?04:16
dufluracarr: Non-const always, but just work to make the return value optional later?04:16
dufluThen no ABI break04:16
racarrduflu: Unfortunately clients only ever get MirEvent const*04:16
dufluAlthough this is mircommon, which we break regularly. Possibly a non-issue04:16
RAOFI don't know. I think it *is* logically const if mir_event_unref() only ever destroys an object that's no longer referenced anywhere.04:16
racarroh04:16
racarrthats true04:16
racarrhaha04:17
racarrwell04:17
racarrthats an argument at least!04:17
racarrhmm04:17
racarreffectively it wants to be refcounted because it wants to be copied04:17
RAOFBecause the client code wants to preserve it outside the event callback?04:17
dufluracarr: This is kind of why I was saying ABI breaks are inherited though. e.g. some changes in mircommon would break the client ABI04:18
racarrRAOF: Basically, and because04:18
racarrthe client library code isnt going to access it after that04:18
racarrI dont think you gain any sort of avoid synchronization benefit from a copy04:18
racarrand ref will be most efficient04:18
racarrRAOF: Then the double controversy is because I can't add ref_count to MirEvent yet mir_event_ref currently copies the event04:18
racarr:p04:18
RAOFWell, if you only ever use it inside the event callback then you can just pass the const*.04:19
RAOFWhat code wants to use the event outside the callback?04:19
dufluracarr: Surely while it's not opaque the user can just copy it? :) a = *b04:19
racarrRAOF: Qt queues it up as a task on the main loop04:19
racarrduflu: That's what qtubuntu does now04:19
racarrand im trying to04:19
racarrport it04:19
racarr:)04:19
RAOFAh, fair enough.04:19
RAOFThen I'm for mir_event_ref and mir_event_unref, both working on const*04:20
racarrmm I think so too04:21
racarrwill update in morning04:21
RAOFduflu: std::atomic_bool _still_ isn't equivalent to std::atomic<bool> :)05:20
anpokRAOF: hmm it cannot find the graphics-dummy platform05:34
* RAOF looks.05:36
RAOFOh, on the mako?05:37
anpokhm there we install the packages and do not run from build location05:38
anpokRAOF: oh you meant it should =log on the client and server by default?05:39
RAOFanpok: Yes.05:39
RAOFanpok: But more; I don't think that it should be a report at all. It was just - when all you have is a ReportPattern, everything seems to be a report.05:40
anpok:)05:40
RAOFBecause why would you _ever_ want to use SHARED_LIBRARY_PROBER_REPORT=lttng05:41
RAOF?05:41
anpokRAOF: if all your reports report to lttng.. all your reports report to lttng05:41
anpokto be honest I only made that change, because I needed it for the input side05:44
RAOFYeah.05:45
RAOFI think that short-term defaulting to log is fine.05:45
RAOFAnd then, longer term, we just need to drop the SharedLibraryProberReport interface entirely, move mir::logging into mircommon, and then have libraries_for_path log directly, rather than take a SharedLibraryProberReport.05:47
RAOFanpok: Oh, of course!05:51
RAOFanpok: You're missing a path separator in the as-installed probe.05:53
RAOFanpok: Would you like to fix it, or shall I?05:53
RAOFanpok: Specifically:05:54
RAOF+         {library_path() + "/server-modules/", library_path() + "/server-platform/", std::string(MIR_SERVER_PLATFORM_PATH)})05:54
RAOFshould be05:54
RAOF+         {library_path() + "/server-modules/", library_path() + "/server-platform/", std::string(MIR_SERVER_PLATFORM_PATH) + "/"})05:54
RAOFBecause MIR_SERVER_PLATFORM_PATH=/usr/lib/linux-armhf-gnueabi/server-platform05:55
dufluRAOF: Not equivalent, but more efficient and sufficient possibly05:58
dufluAlthough atomic anything is open to races. I think we're turning a blind eye to that most of the time05:59
dufluHmm, the sensible thing to do would be to find ways to tie up loose ends by tomorrow06:02
dufluNot sure how to achieve that more than we already are :P06:02
RAOFduflu: Actually, now that I've looked a bit more, I take that back.06:03
RAOFstd::atomic_bool is a typedef to std::atomic<bool>.06:03
RAOFSo we're both wrong :)06:03
dufluRAOF: Regardless if you know enough about the arch it could also be typedef bool :)06:03
duflusigactomic_t06:03
duflusigactomic_t06:04
dufluor sig_atomic_t06:04
dufluone of them06:04
RAOFI don't think sig_atomic_t is guaranteed to be thread-atomic.06:04
RAOFAnd it can't be typedef bool, because there's memory barriers involved.06:05
dufluRAOF: It's a pretty safe bet if the type is within the word size06:05
dufluRAOF: Barriers?!06:05
RAOFYes, barriers?06:06
dufluOh I see. std::atomic is quite featured.06:06
dufluToo many features for some uses06:06
dufluRAOF: I guess not if is_lock_free()06:08
RAOFBarriers != locks.06:08
RAOFBarriers are “dear CPU+compiler, please actually read this memory”06:08
dufluRAOF: ??06:08
racarre.g. cache invalidation06:09
RAOFCompilers are free to reorder or entirely elide reads; likewise CPUs (and, indeed, multiple levels of the memory heirarchy)06:09
dufluInteresting. I always use spinlock as my lowest level primitives but seems like barriers might also be useful06:11
RAOFduflu: Feel like a quick and easy top-approve?06:12
RAOFduflu: https://code.launchpad.net/~mir-team/mir/more-inconsistent-overrides/+merge/24506806:12
RAOFracarr: :P06:14
RAOFduflu: http://en.wikipedia.org/wiki/Memory_barrier if you're interested. In particular, memory barriers are required to correctly implement any synchronisation primitive. :)06:15
dufluRAOF: Right. Back on the original topic. If you can avoid a template instantiating type then it's obviously preferable. Some compilers at least will extern the std::atomic_foo methods06:18
dufluOr extern the instantiation06:18
RAOFThe instantiation is in libstdc++, though.06:18
dufluRAOF: Yes, in some implementations. What's important is that it might be typedef'd to something that's not an instantiation, hence more efficient06:19
RAOFI'm not entirely sure how that follows?06:24
dufluRAOF: Not mentioning '<>' in the code ensures you don't slow down the compiler to check for or create instantiations06:31
dufluUnfortunately not an advantage if the library typedefs to one06:31
dufluBut other C++ implementations would benefit06:32
dufluI don't remember the end of any year ever being this busy06:48
racarrThe year jenkins stole christmas06:48
dufluracarr: To be fair to Jenkins, it didn't slow us down. We had already landed everything we could. It just sucked up my time landing things06:49
racarrI dunno not to give anyone a hard time because I did the same thing to some branches but I assume introduce-buffer-stream etc wouldnt have gone a full week06:55
racarrwithout review06:55
racarrif they had a +1 from jenkins06:55
racarror maybe europe just doesnt like me anymore because I sleep through standup and there are only two of you guys06:56
racarrwho knows06:56
dufluracarr: I know how it feels. Safe to say everyone's waiting for things of theirs to lang07:00
dufluland07:00
racarr:)07:01
dufluAnd I'm now involved in more code reviews than I can feasibly keep up with. So staying out of others07:01
racarrThats how I felt towards EOD today toooo07:01
racarrOk daily show -> bed07:01
dufluracarr: As a matter of psychological trickery, developers tend toward reviewing smaller things first07:02
dufluNot that that's a "trick" but helpful to know07:02
anpokRAOF: uh!07:08
=== chihchun_afk is now known as chihchun
=== chihchun is now known as chihchun_afk
RAOFBoo.08:04
RAOFFewer random hard shutdowns please laptop.08:05
mlankhorstRAOF: hey did you take a look at standalone xmir yet? :P08:07
RAOFmlankhorst: What did you want me to look at again?08:07
RAOFI've been off for the last 3 days, so may have lost some state :)08:07
mlankhorstno just in general if you have looked at it or not08:08
RAOFmlankhorst: Oh, no, I've not.08:28
RAOFmlankhorst: Is there anything you'd like me to do about it?08:29
mlankhorstnot in particularly, just if you could look it over08:31
=== chihchun_afk is now known as chihchun
=== jono is now known as Guest60113
Mark__hello, anyone here?15:05
=== chihchun is now known as chihchun_afk
=== alan_g is now known as alan_g|EOD
racarrcan I TA add-more-event-getters?22:17
racarrHappy to lose the dependency on my branches...22:17
racarr*removes MirScreencast from public API*22:34
racarrChris pointed out last night MirBufferStream* mir_connection_create_screencast can be enough22:35

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