[media] coda: fix ENC_SEQ_OPTION for CODA7
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 23 May 2013 13:42:53 +0000 (10:42 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 3 Jun 2013 19:00:26 +0000 (16:00 -0300)
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>
drivers/media/platform/coda.c
drivers/media/platform/coda.h

index efb42b2..1f3ab53 100644 (file)
@@ -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) {
index f3f5e43..3c350ac 100644 (file)
 #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