[PATCH weston v11 11/13] compositor-drm: Don't repaint if no damage
Pekka Paalanen
ppaalanen at gmail.com
Fri Jul 21 14:18:21 UTC 2017
On Tue, 18 Jul 2017 14:14:33 +0100
Daniel Stone <daniels at collabora.com> wrote:
> If we don't have any damage for the primary plane, then don't force a
> repaint; simply reuse the old buffer we already have.
>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
> libweston/compositor-drm.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index bf3273ba..ca4146a5 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -1507,6 +1507,7 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
> struct drm_output *output = state->output;
> struct weston_compositor *c = output->base.compositor;
> struct drm_plane_state *scanout_state;
> + struct drm_plane *scanout_plane = output->scanout_plane;
> struct drm_backend *b = to_drm_backend(c);
> struct drm_fb *fb;
>
> @@ -1517,10 +1518,20 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
> if (scanout_state->fb)
> return;
>
> - if (b->use_pixman)
> + if (!pixman_region32_not_empty(damage) &&
> + scanout_plane->state_cur->fb &&
> + (scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE ||
> + scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB) &&
> + scanout_plane->state_cur->fb->width ==
> + output->base.current_mode->width &&
> + scanout_plane->state_cur->fb->height ==
> + output->base.current_mode->height) {
> + fb = drm_fb_ref(scanout_plane->state_cur->fb);
> + } else if (b->use_pixman) {
> fb = drm_output_render_pixman(state, damage);
> - else
> + } else {
> fb = drm_output_render_gl(state, damage);
> + }
>
> if (!fb) {
> drm_plane_state_put_back(scanout_state);
Hi,
is there a reason to check the buffer type at all? You want to be sure
the previous buffer came from the renderer? But if there is no damage
and state_cur has a BUFFER_CLIENT, is there any harm in re-using that?
OTOH, if there is no damage, one would assume the BUFFER_CLIENT would
have been kept promoted to scanout...
Shrug? :-)
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170721/03190b22/attachment.sig>
More information about the wayland-devel
mailing list