mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-04 04:48:03 +02:00
rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGL
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 <pekka.paalanen@collabora.co.uk> Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net>
This commit is contained in:
parent
234c5242ab
commit
d5fbfb2e35
1 changed files with 18 additions and 2 deletions
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue