[weston,3/3] compositor-drm: Set damage for scanout plane

Submitted by Deepak Singh Rawat on Sept. 6, 2018, 12:18 a.m.

Details

Message ID 20180906001817.2585-3-drawat@vmware.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Deepak Singh Rawat Sept. 6, 2018, 12:18 a.m.
Copy the damage region to scanout drm_plane_state which will be sent to
kernel during atomic state update.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
---
 libweston/compositor-drm.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 30f6fce9..e2ee35eb 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2111,6 +2111,21 @@  drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
 	scanout_state->dest_w = scanout_state->src_w >> 16;
 	scanout_state->dest_h = scanout_state->src_h >> 16;
 
+	pixman_region32_copy(&scanout_state->damage, damage);
+	if (output->base.zoom.active) {
+		weston_matrix_transform_region(&scanout_state->damage,
+					       &output->base.matrix,
+					       &scanout_state->damage);
+	} else {
+		pixman_region32_translate(&scanout_state->damage,
+					  -output->base.x, -output->base.y);
+		weston_transformed_region(output->base.width,
+					  output->base.height,
+					  output->base.transform,
+					  output->base.current_scale,
+					  &scanout_state->damage,
+					  &scanout_state->damage);
+	}
 
 	pixman_region32_subtract(&c->primary_plane.damage,
 				 &c->primary_plane.damage, damage);