aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2011-12-16 14:10:57 +0800
committerAndy Green <andy.green@linaro.org>2011-12-26 22:33:16 +0800
commit7b0491fb21aea7ac7a4b98155c426937d2fe67e6 (patch)
treedec8ea882d4b6a7c2ac301d4cf47f1cdeb258d89
parent10020e4019ab4c714a3a2dfaf4df1e63aad6dc3f (diff)
TILER: Fix tilview_flip logic
If TILER view was rotated, the flip logic was incorrectly flipping the view resulting in incorrect top-left coordinate. This is now fixed. Signed-off-by: Lajos Molnar <molnar@ti.com>
-rw-r--r--drivers/media/video/tiler/tiler-geom.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/video/tiler/tiler-geom.c b/drivers/media/video/tiler/tiler-geom.c
index 872a6e9c5e0..f95ae5c9ef9 100644
--- a/drivers/media/video/tiler/tiler-geom.c
+++ b/drivers/media/video/tiler/tiler-geom.c
@@ -315,14 +315,19 @@ s32 tilview_flip(struct tiler_view_t *view, bool flip_x, bool flip_y)
return -EPERM;
/* adjust top-left corner */
- if (flip_x) {
- orient ^= MASK_X_INVERT;
+ if (flip_x)
view->tsptr += (view->width - 1) * view->h_inc;
- }
- if (flip_y) {
- orient ^= MASK_Y_INVERT;
+ if (flip_y)
view->tsptr += (view->height - 1) * view->v_inc;
- }
+
+ /* flip view orientation */
+ if (orient & MASK_XY_FLIP)
+ swap(flip_x, flip_y);
+
+ if (flip_x)
+ orient ^= MASK_X_INVERT;
+ if (flip_y)
+ orient ^= MASK_Y_INVERT;
/* finally reorient view */
reorient(view, orient);