Skip to content

Commit

Permalink
[media] s5p-fimc: Fix horizontal/vertical image flip
Browse files Browse the repository at this point in the history
Setting FIMC_REG_CITRGFMT_FLIP_X_MIRROR bit causes X-axis image
flip (vertical flip) and thus it corresponds to V4L2_CID_VFLIP.
Likewise, setting FIMC_REG_CITRGFMT_FLIP_Y_MIRROR bit causes Y-axis
image flip (horizontal flip) and thus it corresponds to V4L2_CID_HFLIP.
Currently the driver does X-axis flip when V4L2_CID_HFLIP is set and
Y-axis flip for V4L2_CID_VFLIP. Fix this incorrect assignment by setting
proper FIMC_REG_CITRGFMT register bits for ctx->hflip and ctx->vflip.

Reported-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Dec 21, 2012
1 parent fe4abb5 commit 1bc05e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/media/platform/s5p-fimc/fimc-reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ static u32 fimc_hw_get_in_flip(struct fimc_ctx *ctx)
u32 flip = FIMC_REG_MSCTRL_FLIP_NORMAL;

if (ctx->hflip)
flip = FIMC_REG_MSCTRL_FLIP_X_MIRROR;
if (ctx->vflip)
flip = FIMC_REG_MSCTRL_FLIP_Y_MIRROR;
if (ctx->vflip)
flip = FIMC_REG_MSCTRL_FLIP_X_MIRROR;

if (ctx->rotation <= 90)
return flip;
Expand All @@ -59,9 +59,9 @@ static u32 fimc_hw_get_target_flip(struct fimc_ctx *ctx)
u32 flip = FIMC_REG_CITRGFMT_FLIP_NORMAL;

if (ctx->hflip)
flip |= FIMC_REG_CITRGFMT_FLIP_X_MIRROR;
if (ctx->vflip)
flip |= FIMC_REG_CITRGFMT_FLIP_Y_MIRROR;
if (ctx->vflip)
flip |= FIMC_REG_CITRGFMT_FLIP_X_MIRROR;

if (ctx->rotation <= 90)
return flip;
Expand Down

0 comments on commit 1bc05e7

Please sign in to comment.