[PATCH weston] compositor: Separate hardcoded backend related code from compositor

Bill Spitzak spitzak at gmail.com
Tue Jun 23 11:22:18 PDT 2015


On Tue, Jun 23, 2015 at 10:49 AM, Giulio Camuffo <giuliocamuffo at gmail.com>
wrote:

> Well, but you are adding weston specific stuff into the backends code,
> that is the options handling. In libweston the backends do not parse
> the command line or the config file, so all the backend options are
> weston specific.
>

This just seems wrong to me. Why are these backends .so files at all, then?
The compositor cannot load any it does not know about since it requires
passing this option structure that it had to know about at compile time. It
would be far more efficient to just link all of them into the compositor
then and it would start up faster.

It's true that this is not going to really kill anything, but it does
suffer from code smell. Adding an option to a backend will require
modifying a header file that compositors have to include (the one defining
the option structure for that backend) and changing all compositors to set
that option in the structure, as well as modifying the backend itself.

Passing a weston_options structure and letting the backend remove options
it understands I think will work fine. That does not mean the compositor
has to use the weston option parser to create the structure. And it
certainly does not mean the backends are parsing the command line. The
current ones are not being passed argv so this is obviously false.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150623/72d43314/attachment.html>


More information about the wayland-devel mailing list