diff options
author | Daniel Stone <daniels@collabora.com> | 2020-03-06 11:03:14 +0000 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2020-03-20 15:25:24 +0000 |
commit | 98d75e1b238bbf5da406ea53d42392749fc84dd3 (patch) | |
tree | e1408c75a767cfc1070b9d8ecb3428d1ce9429ba | |
parent | 7fa97e66eb0d9b0cf3a0056ba234df9988eaf7af (diff) | |
download | weston-98d75e1b238bbf5da406ea53d42392749fc84dd3.tar.gz |
drm: Remove unnecessary condition in drm_output_render reuse
This condition inside drm_output_render() checks if we can reuse the
existing renderer buffer for the primary plane; this occurs in
mixed-mode composition where a client buffer promoted to a plane has
changed, but the primary plane is unchanged.
We accomplish this by checking if there is no damage on the
primary/renderer plane, and then if there is already a renderer buffer
active on the primary plane: in that case, we can reuse the buffer we
already have.
There was a further condition checking if the width and height were
identical. This was designed to prevent against issues on mode changes.
However, runtime mode changes are already quite broken, and a mode
change will also cause damage on the full plane. We can simply remove
this condition.
Signed-off-by: Daniel Stone <daniels@collabora.com>
-rw-r--r-- | libweston/backend-drm/drm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index d495c24c..94729d89 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -364,14 +364,16 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage) if (scanout_state->fb) return; + /* + * If we don't have any damage on the primary plane, and we already + * have a renderer buffer active, we can reuse it; else we pass + * the damaged region into the renderer to re-render the affected + * area. + */ 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) { + scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB)) { fb = drm_fb_ref(scanout_plane->state_cur->fb); } else if (b->use_pixman) { fb = drm_output_render_pixman(state, damage); |