libweston: Remove runtime render switching

It is only enabled by a debug key binding, currently not tested at all,
and is seems it doesn't really work, so let's remove it. This also
removes it from the man page.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
dev
Marius Vlad 2 years ago committed by Daniel Stone
parent 6744a6278e
commit 78ccc99d0a
  1. 66
      libweston/backend-drm/drm-gbm.c
  2. 10
      libweston/backend-drm/drm-internal.h
  3. 2
      libweston/backend-drm/drm.c
  4. 9
      libweston/backend-drm/state-propose.c
  5. 3
      libweston/renderer-gl/gl-renderer.c
  6. 6
      man/weston-bindings.man

@ -315,69 +315,3 @@ drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage)
return ret; return ret;
} }
static void
switch_to_gl_renderer(struct drm_backend *b)
{
struct drm_device *device = b->drm;
struct drm_output *output;
bool dmabuf_support_inited;
bool linux_explicit_sync_inited;
if (!b->use_pixman)
return;
dmabuf_support_inited = !!b->compositor->renderer->import_dmabuf;
linux_explicit_sync_inited =
b->compositor->capabilities & WESTON_CAP_EXPLICIT_SYNC;
weston_log("Switching to GL renderer\n");
b->gbm = create_gbm_device(device->drm.fd);
if (!b->gbm) {
weston_log("Failed to create gbm device. "
"Aborting renderer switch\n");
return;
}
wl_list_for_each(output, &b->compositor->output_list, base.link)
pixman_renderer_output_destroy(&output->base);
b->compositor->renderer->destroy(b->compositor);
if (drm_backend_create_gl_renderer(b) < 0) {
gbm_device_destroy(b->gbm);
weston_log("Failed to create GL renderer. Quitting.\n");
/* FIXME: we need a function to shutdown cleanly */
assert(0);
}
wl_list_for_each(output, &b->compositor->output_list, base.link)
drm_output_init_egl(output, b);
b->use_pixman = 0;
if (!dmabuf_support_inited && b->compositor->renderer->import_dmabuf) {
if (linux_dmabuf_setup(b->compositor) < 0)
weston_log("Error: initializing dmabuf "
"support failed.\n");
}
if (!linux_explicit_sync_inited &&
(b->compositor->capabilities & WESTON_CAP_EXPLICIT_SYNC)) {
if (linux_explicit_synchronization_setup(b->compositor) < 0)
weston_log("Error: initializing explicit "
" synchronization support failed.\n");
}
}
void
renderer_switch_binding(struct weston_keyboard *keyboard,
const struct timespec *time, uint32_t key, void *data)
{
struct drm_backend *b =
to_drm_backend(keyboard->seat->compositor);
switch_to_gl_renderer(b);
}

@ -867,9 +867,6 @@ drm_output_fini_egl(struct drm_output *output);
struct drm_fb * struct drm_fb *
drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage); drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage);
void
renderer_switch_binding(struct weston_keyboard *keyboard,
const struct timespec *time, uint32_t key, void *data);
#else #else
inline static int inline static int
init_egl(struct drm_backend *b) init_egl(struct drm_backend *b)
@ -894,11 +891,4 @@ drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage)
{ {
return NULL; return NULL;
} }
inline static void
renderer_switch_binding(struct weston_keyboard *keyboard,
const struct timespec *time, uint32_t key, void *data)
{
weston_log("Compiled without GBM/EGL support\n");
}
#endif #endif

@ -3239,8 +3239,6 @@ drm_backend_create(struct weston_compositor *compositor,
planes_binding, b); planes_binding, b);
weston_compositor_add_debug_binding(compositor, KEY_Q, weston_compositor_add_debug_binding(compositor, KEY_Q,
recorder_binding, b); recorder_binding, b);
weston_compositor_add_debug_binding(compositor, KEY_W,
renderer_switch_binding, b);
if (compositor->renderer->import_dmabuf) { if (compositor->renderer->import_dmabuf) {
if (linux_dmabuf_setup(compositor) < 0) if (linux_dmabuf_setup(compositor) < 0)

@ -979,14 +979,7 @@ drm_assign_planes(struct weston_output *output_base)
pnode->try_view_on_plane_failure_reasons = FAILURE_REASONS_NONE; pnode->try_view_on_plane_failure_reasons = FAILURE_REASONS_NONE;
/* Test whether this buffer can ever go into a plane: /* Test whether this buffer can ever go into a plane:
* non-shm, or small enough to be a cursor. * non-shm, or small enough to be a cursor. */
*
* FIXME: Also, we should keep a reference when using the
* pixman renderer. That makes it possible to do a seamless
* switch to the GL renderer and since the pixman renderer
* keeps a reference to the buffer anyway, there is no side
* effects.
*/
ev->surface->keep_buffer = false; ev->surface->keep_buffer = false;
if (weston_view_has_valid_buffer(ev)) { if (weston_view_has_valid_buffer(ev)) {
struct weston_buffer *buffer = struct weston_buffer *buffer =

@ -1011,9 +1011,6 @@ draw_paint_node(struct weston_paint_node *pnode,
GLint filter; GLint filter;
struct gl_shader_config sconf; struct gl_shader_config sconf;
/* In case of a runtime switch of renderers, we may not have received
* an attach for this surface since the switch. In that case we don't
* have a valid buffer or a proper shader set up so skip rendering. */
if (gb->shader_variant == SHADER_VARIANT_NONE && if (gb->shader_variant == SHADER_VARIANT_NONE &&
!buffer->direct_display) !buffer->direct_display)
return; return;

@ -130,10 +130,6 @@ Enable/Disable overlay planes.
.RS 4 .RS 4
Start VAAPI recorder. Start VAAPI recorder.
.RE .RE
- KEY_W :
.RS 4
Switch to gl-renderer from pixman.
.RE
- KEY_S : - KEY_S :
.RS 4 .RS 4
Enable fragment debugging for gl-renderer. Enable fragment debugging for gl-renderer.
@ -144,7 +140,7 @@ Enable fan debugging for gl-renderer.
.RE .RE
- KEY_R : - KEY_R :
.RS 4 .RS 4
Enable repaint debugging for pixman: Enable repaint debugging for Pixman.
.RE .RE
.RE .RE

Loading…
Cancel
Save