drm: Fix hang on zoom

Transforming the scanout damage by the zoom will result in rectangles
outside of the display, and some with negative co-ordinates. This makes
at least some drivers unhappy (tested on vmware), and the page flip fails,
and weston hangs indefinitely.

Clip the damage to the output so we don't fall down.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-01-20 10:27:17 -06:00 committed by Simon Ser
parent 6338dbd581
commit db7e85d5f8

View file

@ -415,9 +415,16 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
pixman_region32_copy(&scanout_damage, damage);
if (output->base.zoom.active) {
pixman_region32_t clip;
weston_matrix_transform_region(&scanout_damage,
&output->base.matrix,
&scanout_damage);
pixman_region32_init_rect(&clip, 0, 0,
output->base.width,
output->base.height);
pixman_region32_intersect(&scanout_damage, &scanout_damage, &clip);
pixman_region32_fini(&clip);
} else {
pixman_region32_translate(&scanout_damage,
-output->base.x, -output->base.y);