Skip to contentSkip to conversation

drm/mali-dp: Don't enable scaling engine for planes that only rotate.

PATCH New Liviu Dudau 1 participant 1 message Feb 28, 2018

Subsystems (3)
lore
Share & tools
lore

Liviu Dudau

author maintainer
#0 lore raw

PATCH 4/23 drm/mali-dp: Don't enable scaling engine for planes that only rotate.

Currently the scaling engine gets enabled for a plane where the input size differs from the composition size. As rotation is done natively by the plane's hardware layer, we don't need the scaling engine to be enabled.

---
 drivers/gpu/drm/arm/malidp_planes.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/arm/malidp_planes.c +8 -2
index 9d5039f0f84e..651bd10557e0 100644
@@ -159,8 +159,14 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,
 	if (ret)
 		return ret;
 
-	src_w = state->src_w >> 16;
-	src_h = state->src_h >> 16;
+	if (state->rotation & MALIDP_ROTATED_MASK) {
+		src_w = state->src_h >> 16;
+		src_h = state->src_w >> 16;
+	} else {
+		src_w = state->src_w >> 16;
+		src_h = state->src_h >> 16;
+	}
+
 	if ((state->crtc_w == src_w) && (state->crtc_h == src_h)) {
 		/* Scaling not necessary for this plane. */
 		mc->scaled_planes_mask &= ~(mp->layer->id);
Signature · 6 lines
2.16.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel