From: Philipp Zabel
Date: Mon, 29 Sep 2014 12:53:45 +0000 (-0300)
Subject: [media] coda: disable rotator if not needed
X-Git-Tag: v3.19-rc1~126^2~362
X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=59ebc2e4464dd376df234621a5ad678ac74b9d39;p=karo-tx-linux.git
[media] coda: disable rotator if not needed
This will still do a 1:1 copy into the internal buffers, but stop
producing visual artifacts in chroma interleaved (NV12) mode.
Signed-off-by: Philipp Zabel
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index f01393ccf30c..747b54405bf1 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1037,6 +1037,7 @@ static int coda_prepare_encode(struct coda_ctx *ctx)
int force_ipicture;
int quant_param = 0;
u32 pic_stream_buffer_addr, pic_stream_buffer_size;
+ u32 rot_mode = 0;
u32 dst_fourcc;
u32 reg;
@@ -1124,8 +1125,9 @@ static int coda_prepare_encode(struct coda_ctx *ctx)
}
/* submit */
- coda_write(dev, CODA_ROT_MIR_ENABLE | ctx->params.rot_mode,
- CODA_CMD_ENC_PIC_ROT_MODE);
+ if (ctx->params.rot_mode)
+ rot_mode = CODA_ROT_MIR_ENABLE | ctx->params.rot_mode;
+ coda_write(dev, rot_mode, CODA_CMD_ENC_PIC_ROT_MODE);
coda_write(dev, quant_param, CODA_CMD_ENC_PIC_QS);