Re: [PATCH weston] rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGL
On Sat, Nov 23, 2013 at 11:30:25AM +0200, Pekka Paalanen wrote: > On Fri, 22 Nov 2013 17:26:58 + > Daniel Stone wrote: > > > Hi, > > > > On 22 November 2013 15:30, wrote: > > > The symbol is needed only for the EGL buffer path. If --disable-egl is > > > given to ./configure, there is no need for it, so fix it to actually not > > > look for that symbol needlessly. > > > > > > This should fix the runtime error: > > > > > > Failed to load module: .../rpi-backend.so: undefined symbol: > > > vc_dispmanx_set_wl_buffer_in_use > > > > > > when you use --disable-egl and do not have a recent enough > > > libraspberrypi package (/opt/vc, a.k.a userland.git) that would provide > > > vc_dispmanx_set_wl_buffer_in_use. Apparently no released version of > > > userland yet provides this. > > > > > > The calls are organized into two helper functions to avoid a boolean > > > argument, and put the #ifdefs away from the main parts of the code. > > > > If you really wanted to gold-plate it, you could call it through dlsym > > instead to avoid the link error altogether, even when someone builds > > with --enable-egl, but doesn't have the support from the vendor > > libraries? > > If someone did that, they'd be missing all EGL support anyway, no? > > So using --enable-egl would have been in vain in the first place, > we'd just silently not enable it after all. I think that would be > fairly many functions to dlsym, too. > > I could do that if you really see use for it, but I don't see it that > useful. Our build guide still has --disable-egl. Making that work > was my goal. > > If we had a configure check when --enable-egl on rpi to see > that the function declarations are in the /opt/vc headers, we could > make it complain of an unsupported combination at configure time. I'll take this to mean that the patch is good to apply. Done. Kristian ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGL
On 23 November 2013 10:30, Pekka Paalanen wrote: > On Fri, 22 Nov 2013 17:26:58 + > Daniel Stone wrote: > >> Hi, >> >> On 22 November 2013 15:30, wrote: >> > The symbol is needed only for the EGL buffer path. If --disable-egl is >> > given to ./configure, there is no need for it, so fix it to actually not >> > look for that symbol needlessly. >> > >> > This should fix the runtime error: >> > >> > Failed to load module: .../rpi-backend.so: undefined symbol: >> > vc_dispmanx_set_wl_buffer_in_use >> > >> > when you use --disable-egl and do not have a recent enough >> > libraspberrypi package (/opt/vc, a.k.a userland.git) that would provide >> > vc_dispmanx_set_wl_buffer_in_use. Apparently no released version of >> > userland yet provides this. >> > >> > The calls are organized into two helper functions to avoid a boolean >> > argument, and put the #ifdefs away from the main parts of the code. >> >> If you really wanted to gold-plate it, you could call it through dlsym >> instead to avoid the link error altogether, even when someone builds >> with --enable-egl, but doesn't have the support from the vendor >> libraries? > > If someone did that, they'd be missing all EGL support anyway, no? > > So using --enable-egl would have been in vain in the first place, > we'd just silently not enable it after all. I think that would be > fairly many functions to dlsym, too. > > I could do that if you really see use for it, but I don't see it that > useful. Our build guide still has --disable-egl. Making that work > was my goal. > > If we had a configure check when --enable-egl on rpi to see > that the function declarations are in the /opt/vc headers, we could > make it complain of an unsupported combination at configure time. Yeah, I would go with the least invasive solution for now, as Wayland support in rpi's EGL is something we still think is going to happen any day from now. This looks good to me, even if I slightly prefer set_in_use over _lock because I feel the term locked has a bit less of meaning. Reviewed-by: Tomeu Vizoso Regards, Tomeu ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGL
On Fri, 22 Nov 2013 17:26:58 + Daniel Stone wrote: > Hi, > > On 22 November 2013 15:30, wrote: > > The symbol is needed only for the EGL buffer path. If --disable-egl is > > given to ./configure, there is no need for it, so fix it to actually not > > look for that symbol needlessly. > > > > This should fix the runtime error: > > > > Failed to load module: .../rpi-backend.so: undefined symbol: > > vc_dispmanx_set_wl_buffer_in_use > > > > when you use --disable-egl and do not have a recent enough > > libraspberrypi package (/opt/vc, a.k.a userland.git) that would provide > > vc_dispmanx_set_wl_buffer_in_use. Apparently no released version of > > userland yet provides this. > > > > The calls are organized into two helper functions to avoid a boolean > > argument, and put the #ifdefs away from the main parts of the code. > > If you really wanted to gold-plate it, you could call it through dlsym > instead to avoid the link error altogether, even when someone builds > with --enable-egl, but doesn't have the support from the vendor > libraries? If someone did that, they'd be missing all EGL support anyway, no? So using --enable-egl would have been in vain in the first place, we'd just silently not enable it after all. I think that would be fairly many functions to dlsym, too. I could do that if you really see use for it, but I don't see it that useful. Our build guide still has --disable-egl. Making that work was my goal. If we had a configure check when --enable-egl on rpi to see that the function declarations are in the /opt/vc headers, we could make it complain of an unsupported combination at configure time. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGL
Hi, On 22 November 2013 15:30, wrote: > The symbol is needed only for the EGL buffer path. If --disable-egl is > given to ./configure, there is no need for it, so fix it to actually not > look for that symbol needlessly. > > This should fix the runtime error: > > Failed to load module: .../rpi-backend.so: undefined symbol: > vc_dispmanx_set_wl_buffer_in_use > > when you use --disable-egl and do not have a recent enough > libraspberrypi package (/opt/vc, a.k.a userland.git) that would provide > vc_dispmanx_set_wl_buffer_in_use. Apparently no released version of > userland yet provides this. > > The calls are organized into two helper functions to avoid a boolean > argument, and put the #ifdefs away from the main parts of the code. If you really wanted to gold-plate it, you could call it through dlsym instead to avoid the link error altogether, even when someone builds with --enable-egl, but doesn't have the support from the vendor libraries? Cheers, Daniel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston] rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGL
From: Pekka Paalanen The symbol is needed only for the EGL buffer path. If --disable-egl is given to ./configure, there is no need for it, so fix it to actually not look for that symbol needlessly. This should fix the runtime error: Failed to load module: .../rpi-backend.so: undefined symbol: vc_dispmanx_set_wl_buffer_in_use when you use --disable-egl and do not have a recent enough libraspberrypi package (/opt/vc, a.k.a userland.git) that would provide vc_dispmanx_set_wl_buffer_in_use. Apparently no released version of userland yet provides this. The calls are organized into two helper functions to avoid a boolean argument, and put the #ifdefs away from the main parts of the code. Signed-off-by: Pekka Paalanen Cc: Tomeu Vizoso --- Tomeu, would this be ok with you? --- src/rpi-renderer.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c index 1940db7..2b6d12c 100644 --- a/src/rpi-renderer.c +++ b/src/rpi-renderer.c @@ -385,6 +385,22 @@ rpi_resource_update(struct rpi_resource *resource, struct weston_buffer *buffer, return ret ? -1 : 0; } +static inline void +rpi_buffer_egl_lock(struct weston_buffer *buffer) +{ +#ifdef ENABLE_EGL + vc_dispmanx_set_wl_buffer_in_use(buffer->resource, 1); +#endif +} + +static inline void +rpi_buffer_egl_unlock(struct weston_buffer *buffer) +{ +#ifdef ENABLE_EGL + vc_dispmanx_set_wl_buffer_in_use(buffer->resource, 0); +#endif +} + static void rpir_egl_buffer_destroy(struct rpir_egl_buffer *egl_buffer) { @@ -400,7 +416,7 @@ rpir_egl_buffer_destroy(struct rpir_egl_buffer *egl_buffer) */ vc_dispmanx_resource_delete(egl_buffer->resource_handle); } else { - vc_dispmanx_set_wl_buffer_in_use(buffer->resource, 0); + rpi_buffer_egl_unlock(buffer); weston_buffer_reference(&egl_buffer->buffer_ref, NULL); } @@ -1294,7 +1310,7 @@ rpi_renderer_repaint_output(struct weston_output *base, struct weston_buffer *buffer; buffer = view->surface->egl_front->buffer_ref.buffer; if (buffer != NULL) { - vc_dispmanx_set_wl_buffer_in_use(buffer->resource, 1); + rpi_buffer_egl_lock(buffer); } else { weston_log("warning: client destroyed current front buffer\n"); -- 1.8.1.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel