mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 01:48:00 +02:00
gl-renderer: do not set compositor capabilities on failure
When gl_renderer_display_create() fails, do not change the compositor capabilities. The compositor may not abort when that happens, it may simply decide to fallback to another renderer. So setting anything on failure is wrong. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
parent
c10857df5d
commit
ed7ceef37e
1 changed files with 13 additions and 8 deletions
|
|
@ -4688,14 +4688,6 @@ gl_renderer_display_create(struct weston_compositor *ec,
|
|||
if (gl_renderer_setup(ec) < 0)
|
||||
goto fail_terminate;
|
||||
|
||||
ec->capabilities |= WESTON_CAP_ROTATION_ANY;
|
||||
ec->capabilities |= WESTON_CAP_CAPTURE_YFLIP;
|
||||
ec->capabilities |= WESTON_CAP_VIEW_CLIP_MASK;
|
||||
if (gl_features_has(gr, FEATURE_EXPLICIT_SYNC))
|
||||
ec->capabilities |= WESTON_CAP_EXPLICIT_SYNC;
|
||||
if (gl_features_has(gr, FEATURE_COLOR_TRANSFORMS))
|
||||
ec->capabilities |= WESTON_CAP_COLOR_OPS;
|
||||
|
||||
if (gr->allocator)
|
||||
gr->base.dmabuf_alloc = gl_renderer_dmabuf_alloc;
|
||||
|
||||
|
|
@ -4769,6 +4761,19 @@ gl_renderer_display_create(struct weston_compositor *ec,
|
|||
yuv_formats[i].format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep this at the end of the function. We don't want to change the
|
||||
* caps if something fails, as the compositor may fallback to another
|
||||
* renderer and the caps we set here would be invalid.
|
||||
*/
|
||||
ec->capabilities |= WESTON_CAP_ROTATION_ANY;
|
||||
ec->capabilities |= WESTON_CAP_CAPTURE_YFLIP;
|
||||
ec->capabilities |= WESTON_CAP_VIEW_CLIP_MASK;
|
||||
if (gl_features_has(gr, FEATURE_EXPLICIT_SYNC))
|
||||
ec->capabilities |= WESTON_CAP_EXPLICIT_SYNC;
|
||||
if (gl_features_has(gr, FEATURE_COLOR_TRANSFORMS))
|
||||
ec->capabilities |= WESTON_CAP_COLOR_OPS;
|
||||
|
||||
return 0;
|
||||
|
||||
fail_with_error:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue