[PATCH v1] refactor configuration API of rdp-backend
Pekka Paalanen
ppaalanen at gmail.com
Mon Apr 25 13:18:12 UTC 2016
On Sat, 23 Apr 2016 11:18:57 +0200
Benoit Gschwind <gschwind at gnu-log.net> wrote:
> Hello,
>
> Le 22/04/2016 23:57, Hardening a écrit :
> > Le 22/04/2016 17:05, Benoit Gschwind a écrit :
> >> Implement a "well" defined API to configure the rdp backend.
> >> Following according to discution about libweston API.
> >> ---
> >> v1:
> >> - Fix the patch log
> >> v0:
> >> - Nothing particular.
> >>
> >> Signed-off-by: Benoit Gschwind <gschwind at gnu-log.net>
> >>
> >> Makefile.am | 1 +
> >> src/compositor-rdp.c | 71 +++++++++++++++++++++-------------------------------
> >> src/compositor-rdp.h | 54 +++++++++++++++++++++++++++++++++++++++
> >> src/main.c | 56 +++++++++++++++++++++++++++++++++++++++--
> >> 4 files changed, 137 insertions(+), 45 deletions(-)
> >> create mode 100644 src/compositor-rdp.h
> >> static int
> >> load_backend(struct weston_compositor *compositor, const char *backend,
> >> int *argc, char **argv, struct weston_config *config)
> >> {
> >> if (strstr(backend, "headless-backend.so"))
> >> return load_headless_backend(compositor, backend, argc, argv, config);
> >> + else if (strstr(backend, "rdp-backend.so"))
> >> + return load_rdp_backend(compositor, backend, argc, argv, config);
> >> #if 0
> >> else if (strstr(backend, "drm-backend.so"))
> >> return load_drm_backend(compositor, backend, argc, argv, config);
> >> @@ -734,8 +788,6 @@ load_backend(struct weston_compositor *compositor, const char *backend,
> >> return load_fbdev_backend(compositor, backend, argc, argv, config);
> >> else if (strstr(backend, "rpi-backend.so"))
> >> return load_rpi_backend(compositor, backend, argc, argv, config);
> >> - else if (strstr(backend, "rdp-backend.so"))
> >> - return load_rdp_backend(compositor, backend, argc, argv, config);
> >> #endif
> >>
> >> return load_backend_old(compositor, backend, argc, argv, config);
> >>
> >
> > It looks good to me.
> > I'm just wondering if there should be some ifdefery if the RDP
> > compositor is not built (in src/main.c)?
> >
>
> I'm not sure, if the module is not build weston will fail with error
> because he can't load rdp-backend.so. Currently it's look like there is
> not extract error message to advertise that Weston was not built with
> rdp back-end.
>
> Anyway, if needed I can update the code :)
Hi,
that is certainly not a topic for this patch.
It is an issue that touches all backends. We could #ifdef out all
backend-specific things in main.c per each backend, but that would only
bring minor space savings, yet it clutters the code and makes parts of
the code miss compile-testing for no other reason. So I would not add
that kind of #ifdefs here.
If we want better error messages when a backend is not found, then we
should do just that. It would be even possible to manufacture a weston
build id and even if a backend .so is found, one could verify against
the build id whether it was really built for this version or a
left-over from past installations.
Those are topics for other patches.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160425/6c1fd70c/attachment.sig>
More information about the wayland-devel
mailing list