sna: Fix the reduction of xy reflection onto rotations.
PATCH 1/1 sna: Fix the reduction of xy reflection onto rotations.
When reducing a xy reflection to a 180 degree rotation, make sure only one rotation bit is set. Also by rotating the bit left, we can support cases where xy reflection happens with 90/270 degree rotation.
Signed-off-by Bob Paauwe <[email protected]>
--- src/sna/sna_display.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
src/sna/sna_display.c +4 -1
@@ -1007,6 +1007,8 @@ static unsigned rotation_reduce(struct plane *p, unsigned rotation) { unsigned unsupported_rotations = rotation & ~p->rotation.supported; +unsigned rr_mask = (RR_Rotate_0 | RR_Rotate_90 | + RR_Rotate_180 | RR_Rotate_270);if (unsupported_rotations ==0 )return rotation;
@@ -1016,7 +1018,8 @@ rotation_reduce(struct plane *p, unsigned rotation)if ((unsupported_rotations & RR_Reflect_XY) == RR_Reflect_XY && p->rotation.supported& RR_Rotate_180) { rotation &= ~RR_Reflect_XY; - rotation ^= RR_Rotate_180; + rotation = ((rotation <<2 & rr_mask) | + (((rotation <<2 ) & ~rr_mask) >>4 )); } if ((unsupported_rotations & RR_Rotate_180) &&
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Bob Paauwe
When reducing a xy reflection to a 180 degree rotation, make sure only one rotation bit is set. Also by rotating the bit left, we can support cases where xy reflection happens with 90/270 degree rotation.
Signed-off-by Bob Paauwe <[email protected]>
Nice. Took me a few moments to verify the shifting works as expected, so I left a couple of comments there for my future self.
Thanks, pushed
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx