backend-drm: Add more view-to-plane failure states
Specifically log if there were no suitable planes for us to use, or if we tried to place it on a plane but were told no by the kernel. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
@@ -236,6 +236,8 @@ enum try_view_on_plane_failure_reasons {
|
|||||||
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE = (1 << 1),
|
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE = (1 << 1),
|
||||||
FAILURE_REASONS_DMABUF_MODIFIER_INVALID = (1 << 2),
|
FAILURE_REASONS_DMABUF_MODIFIER_INVALID = (1 << 2),
|
||||||
FAILURE_REASONS_ADD_FB_FAILED = (1 << 3),
|
FAILURE_REASONS_ADD_FB_FAILED = (1 << 3),
|
||||||
|
FAILURE_REASONS_NO_PLANES_AVAILABLE = (1 << 4),
|
||||||
|
FAILURE_REASONS_PLANES_REJECTED = (1 << 5),
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -438,20 +438,30 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
|
|||||||
bool view_matches_entire_output, scanout_has_view_assigned;
|
bool view_matches_entire_output, scanout_has_view_assigned;
|
||||||
uint32_t possible_plane_mask = 0;
|
uint32_t possible_plane_mask = 0;
|
||||||
|
|
||||||
|
pnode->try_view_on_plane_failure_reasons = FAILURE_REASONS_NONE;
|
||||||
|
|
||||||
/* check view for valid buffer, doesn't make sense to even try */
|
/* check view for valid buffer, doesn't make sense to even try */
|
||||||
if (!weston_view_has_valid_buffer(ev))
|
if (!weston_view_has_valid_buffer(ev)) {
|
||||||
return ps;
|
pnode->try_view_on_plane_failure_reasons |=
|
||||||
|
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
buffer = ev->surface->buffer_ref.buffer;
|
buffer = ev->surface->buffer_ref.buffer;
|
||||||
shmbuf = wl_shm_buffer_get(buffer->resource);
|
shmbuf = wl_shm_buffer_get(buffer->resource);
|
||||||
if (shmbuf) {
|
if (shmbuf) {
|
||||||
if (!output->cursor_plane || b->cursors_are_broken)
|
if (!output->cursor_plane || b->cursors_are_broken) {
|
||||||
|
pnode->try_view_on_plane_failure_reasons |=
|
||||||
|
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (wl_shm_buffer_get_format(shmbuf) != WL_SHM_FORMAT_ARGB8888) {
|
if (wl_shm_buffer_get_format(shmbuf) != WL_SHM_FORMAT_ARGB8888) {
|
||||||
drm_debug(b, "\t\t\t\t[view] not placing view %p on "
|
drm_debug(b, "\t\t\t\t[view] not placing view %p on "
|
||||||
"plane; SHM buffers must be ARGB8888 for "
|
"plane; SHM buffers must be ARGB8888 for "
|
||||||
"cursor view", ev);
|
"cursor view", ev);
|
||||||
|
pnode->try_view_on_plane_failure_reasons |=
|
||||||
|
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -460,6 +470,8 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
|
|||||||
drm_debug(b, "\t\t\t\t[view] not assigning view %p to plane "
|
drm_debug(b, "\t\t\t\t[view] not assigning view %p to plane "
|
||||||
"(buffer (%dx%d) too large for cursor plane)",
|
"(buffer (%dx%d) too large for cursor plane)",
|
||||||
ev, buffer->width, buffer->height);
|
ev, buffer->width, buffer->height);
|
||||||
|
pnode->try_view_on_plane_failure_reasons |=
|
||||||
|
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,12 +593,22 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
|
|||||||
ps = drm_output_try_view_on_plane(plane, state, ev,
|
ps = drm_output_try_view_on_plane(plane, state, ev,
|
||||||
mode, fb, zpos);
|
mode, fb, zpos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps) {
|
if (ps) {
|
||||||
drm_debug(b, "\t\t\t\t[view] view %p has been placed to "
|
drm_debug(b, "\t\t\t\t[view] view %p has been placed to "
|
||||||
"%s plane with computed zpos %"PRIu64"\n",
|
"%s plane with computed zpos %"PRIu64"\n",
|
||||||
ev, p_name, zpos);
|
ev, p_name, zpos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pnode->try_view_on_plane_failure_reasons |=
|
||||||
|
FAILURE_REASONS_PLANES_REJECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ps &&
|
||||||
|
pnode->try_view_on_plane_failure_reasons == FAILURE_REASONS_NONE) {
|
||||||
|
pnode->try_view_on_plane_failure_reasons |=
|
||||||
|
FAILURE_REASONS_NO_PLANES_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we have a plane state, it has its own ref to the fb; if not then
|
/* if we have a plane state, it has its own ref to the fb; if not then
|
||||||
@@ -784,11 +806,6 @@ drm_output_propose_state(struct weston_output *output_base,
|
|||||||
ps = drm_output_find_plane_for_view(state, pnode, mode,
|
ps = drm_output_find_plane_for_view(state, pnode, mode,
|
||||||
scanout_state,
|
scanout_state,
|
||||||
current_lowest_zpos);
|
current_lowest_zpos);
|
||||||
/* If we were able to place the view in a plane, set
|
|
||||||
* failure reasons to none. */
|
|
||||||
if (ps)
|
|
||||||
pnode->try_view_on_plane_failure_reasons =
|
|
||||||
FAILURE_REASONS_NONE;
|
|
||||||
} else {
|
} else {
|
||||||
/* We are forced to place the view in the renderer, set
|
/* We are forced to place the view in the renderer, set
|
||||||
* the failure reason accordingly. */
|
* the failure reason accordingly. */
|
||||||
|
|||||||
Reference in New Issue
Block a user