drm: allow to skip composition if pending capture is writeback
We have an optimization to skip composition if there's no damage on the primary plane and we already have a renderer buffer active. But we don't allow this optimization if there's a pending capture task for the output. For the renderer-based sources, that is really necessary, but for the writeback source we should allow this optimization. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
parent
9337d42741
commit
f95c2986dd
|
@ -384,7 +384,7 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
|
|||
*/
|
||||
if (!pixman_region32_not_empty(damage) &&
|
||||
wl_list_empty(&output->base.frame_signal.listener_list) &&
|
||||
!weston_output_has_capture_tasks(&output->base) &&
|
||||
!weston_output_has_renderer_capture_tasks(&output->base) &&
|
||||
scanout_plane->state_cur->fb &&
|
||||
(scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE ||
|
||||
scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB)) {
|
||||
|
|
|
@ -430,13 +430,17 @@ weston_output_pull_capture_task(struct weston_output *output,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/** Check if any capture tasks are waiting on the output */
|
||||
/** Check if any renderer-based capture tasks are waiting on the output */
|
||||
WL_EXPORT bool
|
||||
weston_output_has_capture_tasks(struct weston_output *output)
|
||||
weston_output_has_renderer_capture_tasks(struct weston_output *output)
|
||||
{
|
||||
struct weston_output_capture_info *ci = output->capture_info;
|
||||
struct weston_capture_task *ct;
|
||||
|
||||
return !wl_list_empty(&ci->pending_capture_list);
|
||||
wl_list_for_each(ct, &ci->pending_capture_list, link)
|
||||
if (ct->owner->pixel_source != WESTON_OUTPUT_CAPTURE_SOURCE_WRITEBACK)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get the destination buffer */
|
||||
|
|
|
@ -69,7 +69,7 @@ weston_output_update_capture_info(struct weston_output *output,
|
|||
const struct pixel_format_info *format);
|
||||
|
||||
bool
|
||||
weston_output_has_capture_tasks(struct weston_output *output);
|
||||
weston_output_has_renderer_capture_tasks(struct weston_output *output);
|
||||
|
||||
struct weston_capture_task;
|
||||
|
||||
|
|
Loading…
Reference in New Issue