Review Request 126381: kwayland backend for libkscreen

Sebastian Kügler sebas at kde.org
Fri Dec 18 13:53:01 UTC 2015



> On Dec. 18, 2015, 9:20 a.m., Martin Gräßlin wrote:
> > backends/kwayland/waylandconfig.cpp, line 154
> > <https://git.reviewboard.kde.org/r/126381/diff/4/?file=424314#file424314line154>
> >
> >     maybe a counter for block signals? Whenever it gets blocked increment by 1, and decrement on unblok. With a bool there's always the danger of two things happening at the same time srew over your internal blocking.
> >     
> >     Also from KWin code experience I suggest to use dedicated methods blockSignals(), unblockSignals() instead of manually changing the values. And add assert to ensure that e.g. unblock is only called if it's blocked.

I think just keeping it internal to WaylandConfig is enough to warrant that it's not going to race. This is *only* done in applySettings, which would mean the user is applying two configs right after each other. That's going to cause unexpected behaviour anyway, a configChanged() too much is then the least of the problems.

Even then, if signals are unblocked, the worst thing that happens is a signal triggered more than once and the client updating more often than necessary. No big deal, IMO, the added complexity of counting is not worth it, here. (If blocking were more involved, perhaps, but it's all very local here, so easy enough to keep in check.)

I've added setters with asserts, though.


> On Dec. 18, 2015, 9:20 a.m., Martin Gräßlin wrote:
> > backends/kwayland/waylandconfig.cpp, line 184
> > <https://git.reviewboard.kde.org/r/126381/diff/4/?file=424314#file424314line184>
> >
> >     just checking: you want the semantic that an existing value is edited and if it's not existing a new pair is added?

No, I want insert(). :-)

(Fixed.)


> On Dec. 18, 2015, 9:20 a.m., Martin Gräßlin wrote:
> > backends/kwayland/waylandoutput.cpp, lines 51-52
> > <https://git.reviewboard.kde.org/r/126381/diff/4/?file=424316#file424316line51>
> >
> >     no check for not found. That is potentially crashy

As long as the rotationMap is complete (and it is), it can't crash since this function doesn't take random values as input. Checking and falling back to "Normal" won't make it any more correct.


> On Dec. 18, 2015, 9:20 a.m., Martin Gräßlin wrote:
> > backends/kwayland/waylandoutput.cpp, line 37
> > <https://git.reviewboard.kde.org/r/126381/diff/4/?file=424316#file424316line37>
> >
> >     you could move it into the Ctor's init list

I'd rather leave it here, putting the whole initializer into the init list makes it harder to read, IMO.


- Sebastian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126381/#review89688
-----------------------------------------------------------


On Dec. 17, 2015, 6:53 p.m., Sebastian Kügler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126381/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2015, 6:53 p.m.)
> 
> 
> Review request for Plasma, Solid, Daniel Vrátil, and Martin Gräßlin.
> 
> 
> Repository: libkscreen
> 
> 
> Description
> -------
> 
> This adds a kwayland backend to libkscreen.
> 
> This backend uses KWayland's OutputManagement protocol for enlisting and
> configuring devices.
> 
> Enlisting outputs
> 
> KScreen's outputs are created from KWayland::Client::OutputDevice objects,
> they copy the data into kscreen's Outputs, and update these objects. A list
> of outputs is requested from the client Registry object.
> 
> Configuring outputs
> 
> The backend asks the global OutputManagement interface for an OutputConfiguration
> object, then sets the changes per outputdevice on this object, and asks the
> compositor to apply() this configuration.
> 
> For this to work, the compositor should support the Wayland org_kde_kwin_outputdevice
> and org_kde_kwin_outputmanagement protocols, for example through
> KWayland::Server classes OutputDevice, OutputManagmenent and OuputConfiguration.
> 
> General working
> 
> WaylandBackend creates a global static internal config, available through
> WaylandBackend::internalConfig(). WaylandConfig binds to the wl_registry
> callbacks and catches org_kde_kwin_outputdevice creation and destruction.
> It passes org_kde_kwin_outputdevice creation and removal on to
> WB::internalConfig() to handle its internal data representation as WaylandOutput.
> WaylandOutput binds to org_kde_kwin_outputdevice's callback, and gets notified
> of geometry and modes, including changes. WaylandOutput administrates the
> internal representation of these objects, and invokes the global notifier,
> which then runs the pointers it holds through the updateK* methods in
> Wayland{Screen,Output,...}.
> 
> KScreen:{Screen,Output,Edid,Mode} objects are created from the internal
> representation as requested (usually triggered by the creation of a
> KScreen::Config object through KScreen::Config::current()). As with other
> backends, the objects which are handed out to the lib's user are expected
> to be deleted by the user, the backend only takes ownership of its internal
> data representation objects.
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt efac5ce 
>   autotests/CMakeLists.txt 07b7bbc 
>   autotests/configs/default.json 3ac3e19 
>   autotests/testconfigserializer.cpp 1af3069 
>   autotests/testkwaylandbackend.cpp PRE-CREATION 
>   autotests/testkwaylandconfig.cpp PRE-CREATION 
>   backends/CMakeLists.txt ff5d751 
>   backends/kwayland/CMakeLists.txt PRE-CREATION 
>   backends/kwayland/README.md PRE-CREATION 
>   backends/kwayland/waylandbackend.h PRE-CREATION 
>   backends/kwayland/waylandbackend.cpp PRE-CREATION 
>   backends/kwayland/waylandconfig.h PRE-CREATION 
>   backends/kwayland/waylandconfig.cpp PRE-CREATION 
>   backends/kwayland/waylandoutput.h PRE-CREATION 
>   backends/kwayland/waylandoutput.cpp PRE-CREATION 
>   backends/kwayland/waylandscreen.h PRE-CREATION 
>   backends/kwayland/waylandscreen.cpp PRE-CREATION 
>   src/backendmanager.cpp 89ae31e 
>   src/config.cpp e8b8a8f 
>   src/screen.h 4cd1e82 
>   tests/CMakeLists.txt d5e41d5 
>   tests/kwayland/CMakeLists.txt PRE-CREATION 
>   tests/kwayland/main.cpp PRE-CREATION 
>   tests/kwayland/waylandconfigreader.h PRE-CREATION 
>   tests/kwayland/waylandconfigreader.cpp PRE-CREATION 
>   tests/kwayland/waylandtestserver.h PRE-CREATION 
>   tests/kwayland/waylandtestserver.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/126381/diff/
> 
> 
> Testing
> -------
> 
> The patch contains a test server, which is used for the autotests.
> 
> The test server uses KWayland's server classes and is set up from the json config data we use for the other tests. That means that the backends runs against a real server to test everything.
> 
> I also tested the kscreen UI, which also works as expected.
> 
> 
> Thanks,
> 
> Sebastian Kügler
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20151218/dec8a7d0/attachment-0001.html>


More information about the Plasma-devel mailing list