diff mbox

[v4,16/16] media: coda: support >1024 px height on CODA7, set max frame size to 1080p

Message ID 1347291000-340-17-git-send-email-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel Sept. 10, 2012, 3:30 p.m. UTC
Increases the maximum encoded frame buffer size to 1 MiB.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/platform/coda.c |   11 +++++------
 drivers/media/platform/coda.h |    3 ++-
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Javier Martin Sept. 11, 2012, 10:52 a.m. UTC | #1
On 10 September 2012 17:30, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> Increases the maximum encoded frame buffer size to 1 MiB.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/media/platform/coda.c |   11 +++++------
>  drivers/media/platform/coda.h |    3 ++-
>  2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
> index 4c3e100..defab64 100644
> --- a/drivers/media/platform/coda.c
> +++ b/drivers/media/platform/coda.c
> @@ -47,16 +47,14 @@
>
>  #define CODA_MAX_FRAMEBUFFERS  2
>
> -#define MAX_W          720
> -#define MAX_H          576
> -#define CODA_MAX_FRAME_SIZE    0x90000
> +#define MAX_W          1920
> +#define MAX_H          1080

You need to define separate MAX_W and MAX_H for codadx6 and coda7. The
reason of this is that 'try_fmt' in codadx6 must adjust the width and
height to 720x576 not to 1920x1080. So you need to modify "try_fmt"
too.


> +#define CODA_MAX_FRAME_SIZE    0x100000
>  #define FMO_SLICE_SAVE_BUF_SIZE         (32)
>  #define CODA_DEFAULT_GAMMA             4096
>
>  #define MIN_W 176
>  #define MIN_H 144
> -#define MAX_W 720
> -#define MAX_H 576
>
>  #define S_ALIGN                1 /* multiple of 2 */
>  #define W_ALIGN                1 /* multiple of 2 */
> @@ -1016,11 +1014,12 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
>         switch (dev->devtype->product) {
>         case CODA_DX6:
>                 value = (q_data_src->width & CODADX6_PICWIDTH_MASK) << CODADX6_PICWIDTH_OFFSET;
> +               value |= (q_data_src->height & CODADX6_PICHEIGHT_MASK) << CODA_PICHEIGHT_OFFSET;
>                 break;
>         default:
>                 value = (q_data_src->width & CODA7_PICWIDTH_MASK) << CODA7_PICWIDTH_OFFSET;
> +               value |= (q_data_src->height & CODA7_PICHEIGHT_MASK) << CODA_PICHEIGHT_OFFSET;
>         }
> -       value |= (q_data_src->height & CODA_PICHEIGHT_MASK) << CODA_PICHEIGHT_OFFSET;
>         coda_write(dev, value, CODA_CMD_ENC_SEQ_SRC_SIZE);
>         coda_write(dev, ctx->params.framerate,
>                    CODA_CMD_ENC_SEQ_SRC_F_RATE);
> diff --git a/drivers/media/platform/coda.h b/drivers/media/platform/coda.h
> index f3f5e43..60338c3 100644
> --- a/drivers/media/platform/coda.h
> +++ b/drivers/media/platform/coda.h
> @@ -117,7 +117,8 @@
>  #define                CODADX6_PICWIDTH_OFFSET                         10
>  #define                CODADX6_PICWIDTH_MASK                           0x3ff
>  #define                CODA_PICHEIGHT_OFFSET                           0
> -#define                CODA_PICHEIGHT_MASK                             0x3ff
> +#define                CODADX6_PICHEIGHT_MASK                          0x3ff
> +#define                CODA7_PICHEIGHT_MASK                            0xffff
>  #define CODA_CMD_ENC_SEQ_SRC_F_RATE                            0x194
>  #define CODA_CMD_ENC_SEQ_MP4_PARA                              0x198
>  #define                CODA_MP4PARAM_VERID_OFFSET                      6
> --
> 1.7.10.4
>
diff mbox

Patch

diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index 4c3e100..defab64 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -47,16 +47,14 @@ 
 
 #define CODA_MAX_FRAMEBUFFERS	2
 
-#define MAX_W		720
-#define MAX_H		576
-#define CODA_MAX_FRAME_SIZE	0x90000
+#define MAX_W		1920
+#define MAX_H		1080
+#define CODA_MAX_FRAME_SIZE	0x100000
 #define FMO_SLICE_SAVE_BUF_SIZE         (32)
 #define CODA_DEFAULT_GAMMA		4096
 
 #define MIN_W 176
 #define MIN_H 144
-#define MAX_W 720
-#define MAX_H 576
 
 #define S_ALIGN		1 /* multiple of 2 */
 #define W_ALIGN		1 /* multiple of 2 */
@@ -1016,11 +1014,12 @@  static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
 	switch (dev->devtype->product) {
 	case CODA_DX6:
 		value = (q_data_src->width & CODADX6_PICWIDTH_MASK) << CODADX6_PICWIDTH_OFFSET;
+		value |= (q_data_src->height & CODADX6_PICHEIGHT_MASK) << CODA_PICHEIGHT_OFFSET;
 		break;
 	default:
 		value = (q_data_src->width & CODA7_PICWIDTH_MASK) << CODA7_PICWIDTH_OFFSET;
+		value |= (q_data_src->height & CODA7_PICHEIGHT_MASK) << CODA_PICHEIGHT_OFFSET;
 	}
-	value |= (q_data_src->height & CODA_PICHEIGHT_MASK) << CODA_PICHEIGHT_OFFSET;
 	coda_write(dev, value, CODA_CMD_ENC_SEQ_SRC_SIZE);
 	coda_write(dev, ctx->params.framerate,
 		   CODA_CMD_ENC_SEQ_SRC_F_RATE);
diff --git a/drivers/media/platform/coda.h b/drivers/media/platform/coda.h
index f3f5e43..60338c3 100644
--- a/drivers/media/platform/coda.h
+++ b/drivers/media/platform/coda.h
@@ -117,7 +117,8 @@ 
 #define		CODADX6_PICWIDTH_OFFSET				10
 #define		CODADX6_PICWIDTH_MASK				0x3ff
 #define		CODA_PICHEIGHT_OFFSET				0
-#define		CODA_PICHEIGHT_MASK				0x3ff
+#define		CODADX6_PICHEIGHT_MASK				0x3ff
+#define		CODA7_PICHEIGHT_MASK				0xffff
 #define CODA_CMD_ENC_SEQ_SRC_F_RATE				0x194
 #define CODA_CMD_ENC_SEQ_MP4_PARA				0x198
 #define		CODA_MP4PARAM_VERID_OFFSET			6