diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2013-05-23 13:42:53 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-03 19:00:26 (GMT) |
commit | fb1fcf1779bba4c034635cc8916261a6744584a9 (patch) | |
tree | 7bfe7664262cf13599ec161a4ee8cf0dfa599aef | |
parent | 7eac97d7e714429f7ef1ba5d35f94c07f4c34f8e (diff) | |
download | linux-fb1fcf1779bba4c034635cc8916261a6744584a9.tar.xz |
[media] coda: fix ENC_SEQ_OPTION for CODA7
GAMMA_OFFSET is different between CodaDx6 and CODA7.
Also, this is a bitfield.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/platform/coda.c | 10 | ||||
-rw-r--r-- | drivers/media/platform/coda.h | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c index efb42b2..1f3ab53 100644 --- a/drivers/media/platform/coda.c +++ b/drivers/media/platform/coda.c @@ -1129,8 +1129,14 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) value = (CODA_DEFAULT_GAMMA & CODA_GAMMA_MASK) << CODA_GAMMA_OFFSET; coda_write(dev, value, CODA_CMD_ENC_SEQ_RC_GAMMA); - value = (CODA_DEFAULT_GAMMA > 0) << CODA_OPTION_GAMMA_OFFSET; - value |= (0 & CODA_OPTION_SLICEREPORT_MASK) << CODA_OPTION_SLICEREPORT_OFFSET; + if (CODA_DEFAULT_GAMMA > 0) { + if (dev->devtype->product == CODA_DX6) + value = 1 << CODADX6_OPTION_GAMMA_OFFSET; + else + value = 1 << CODA7_OPTION_GAMMA_OFFSET; + } else { + value = 0; + } coda_write(dev, value, CODA_CMD_ENC_SEQ_OPTION); if (dst_fourcc == V4L2_PIX_FMT_H264) { diff --git a/drivers/media/platform/coda.h b/drivers/media/platform/coda.h index f3f5e43..3c350ac 100644 --- a/drivers/media/platform/coda.h +++ b/drivers/media/platform/coda.h @@ -96,16 +96,12 @@ #define CODA_CMD_ENC_SEQ_BB_START 0x180 #define CODA_CMD_ENC_SEQ_BB_SIZE 0x184 #define CODA_CMD_ENC_SEQ_OPTION 0x188 -#define CODA_OPTION_GAMMA_OFFSET 7 -#define CODA_OPTION_GAMMA_MASK 0x01 +#define CODA7_OPTION_GAMMA_OFFSET 8 +#define CODADX6_OPTION_GAMMA_OFFSET 7 #define CODA_OPTION_LIMITQP_OFFSET 6 -#define CODA_OPTION_LIMITQP_MASK 0x01 #define CODA_OPTION_RCINTRAQP_OFFSET 5 -#define CODA_OPTION_RCINTRAQP_MASK 0x01 #define CODA_OPTION_FMO_OFFSET 4 -#define CODA_OPTION_FMO_MASK 0x01 #define CODA_OPTION_SLICEREPORT_OFFSET 1 -#define CODA_OPTION_SLICEREPORT_MASK 0x01 #define CODA_CMD_ENC_SEQ_COD_STD 0x18c #define CODA_STD_MPEG4 0 #define CODA_STD_H263 1 |