On Sat, 23 Apr 2016 11:18:57 +0200 Benoit Gschwind <[email protected]> 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 <[email protected]> > >> > >> 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
pgpZkP_Ty5PBF.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
