backend-drm: Don't try to prepare a non-cursor view in renderer-only mode

Doing this might cause unnecessary DRM importing, which might result in
an error when the DRM's memory address mapping is nearly full.

Return before attempting to create drm_fb to avoid that, since it will
fail in the later check anyway.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen 2022-06-30 09:16:58 +08:00 committed by Daniel Stone
parent cc3542b574
commit 296b5975f3

View file

@ -404,6 +404,11 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
return NULL;
}
/* filter out non-cursor views in renderer-only mode */
if (mode == DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY &&
ev->layer_link.layer != &b->compositor->cursor_layer)
return NULL;
buffer = ev->surface->buffer_ref.buffer;
if (buffer->type == WESTON_BUFFER_SOLID) {
pnode->try_view_on_plane_failure_reasons |=