Skip to content

Commit 6f14661

Browse files
Aakarsh JainHans Verkuil
authored andcommitted
media: s5p-mfc: Add YV12 and I420 multiplanar format support
YV12 and I420 format (3-plane) support is added. Stride information is added to all formats and planes since it is necessary for YV12/I420 which are different from width. Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy <smithatmurthy@gmail.com> Signed-off-by: Aakarsh Jain <aakarsh.jain@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent e57b6d3 commit 6f14661

9 files changed

Lines changed: 276 additions & 63 deletions

File tree

drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#define MFC_VERSION_V12 0xC0
2727
#define MFC_NUM_PORTS_V12 1
2828
#define S5P_FIMV_CODEC_VP9_ENC 27
29+
#define MFC_CHROMA_PAD_BYTES_V12 256
30+
#define S5P_FIMV_D_ALIGN_PLANE_SIZE_V12 256
2931

3032
/* Encoder buffer size for MFCv12 */
3133
#define ENC_V120_BASE_SIZE(x, y) \

drivers/media/platform/samsung/s5p-mfc/regs-mfc-v7.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#define S5P_FIMV_E_ENCODED_SOURCE_FIRST_ADDR_V7 0xfa70
2626
#define S5P_FIMV_E_ENCODED_SOURCE_SECOND_ADDR_V7 0xfa74
27+
#define S5P_FIMV_E_ENCODED_SOURCE_THIRD_ADDR_V7 0xfa78
2728

2829
#define S5P_FIMV_E_VP8_OPTIONS_V7 0xfdb0
2930
#define S5P_FIMV_E_VP8_FILTER_OPTIONS_V7 0xfdb4

drivers/media/platform/samsung/s5p-mfc/regs-mfc-v8.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
#define S5P_FIMV_D_MIN_SCRATCH_BUFFER_SIZE_V8 0xf108
1818
#define S5P_FIMV_D_FIRST_PLANE_DPB_SIZE_V8 0xf144
1919
#define S5P_FIMV_D_SECOND_PLANE_DPB_SIZE_V8 0xf148
20+
#define S5P_FIMV_D_THIRD_PLANE_DPB_SIZE_V8 0xf14C
2021
#define S5P_FIMV_D_MV_BUFFER_SIZE_V8 0xf150
2122

2223
#define S5P_FIMV_D_FIRST_PLANE_DPB_STRIDE_SIZE_V8 0xf138
2324
#define S5P_FIMV_D_SECOND_PLANE_DPB_STRIDE_SIZE_V8 0xf13c
25+
#define S5P_FIMV_D_THIRD_PLANE_DPB_STRIDE_SIZE_V8 0xf140
2426

2527
#define S5P_FIMV_D_FIRST_PLANE_DPB_V8 0xf160
2628
#define S5P_FIMV_D_SECOND_PLANE_DPB_V8 0xf260
29+
#define S5P_FIMV_D_THIRD_PLANE_DPB_V8 0xf360
2730
#define S5P_FIMV_D_MV_BUFFER_V8 0xf460
2831

2932
#define S5P_FIMV_D_NUM_MV_V8 0xf134

drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define MFC_NO_INSTANCE_SET -1
5757
#define MFC_ENC_CAP_PLANE_COUNT 1
5858
#define MFC_ENC_OUT_PLANE_COUNT 2
59+
#define VB2_MAX_PLANE_COUNT 3
5960
#define STUFF_BYTE 4
6061
#define MFC_MAX_CTRLS 128
6162

@@ -181,6 +182,7 @@ struct s5p_mfc_buf {
181182
struct {
182183
size_t luma;
183184
size_t chroma;
185+
size_t chroma_1;
184186
} raw;
185187
size_t stream;
186188
} cookie;
@@ -623,6 +625,8 @@ struct s5p_mfc_codec_ops {
623625
* @scratch_buf_size: scratch buffer size
624626
* @is_10bit: state to check 10bit support
625627
* @is_422: state to check YUV422 10bit format
628+
* @chroma_size_1: size of a chroma third plane
629+
* @stride: size of stride for all planes
626630
*/
627631
struct s5p_mfc_ctx {
628632
struct s5p_mfc_dev *dev;
@@ -659,6 +663,7 @@ struct s5p_mfc_ctx {
659663

660664
int luma_size;
661665
int chroma_size;
666+
int chroma_size_1;
662667
int mv_size;
663668

664669
unsigned long consumed_stream;
@@ -724,6 +729,7 @@ struct s5p_mfc_ctx {
724729
size_t scratch_buf_size;
725730
int is_10bit;
726731
int is_422;
732+
int stride[VB2_MAX_PLANE_COUNT];
727733
};
728734

729735
/*

drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ static struct s5p_mfc_fmt formats[] = {
5656
.num_planes = 2,
5757
.versions = MFC_V6PLUS_BITS,
5858
},
59+
{
60+
.fourcc = V4L2_PIX_FMT_YUV420M,
61+
.codec_mode = S5P_MFC_CODEC_NONE,
62+
.type = MFC_FMT_RAW,
63+
.num_planes = 3,
64+
.versions = MFC_V12_BIT,
65+
},
66+
{
67+
.fourcc = V4L2_PIX_FMT_YVU420M,
68+
.codec_mode = S5P_MFC_CODEC_NONE,
69+
.type = MFC_FMT_RAW,
70+
.num_planes = 3,
71+
.versions = MFC_V12_BIT
72+
},
5973
{
6074
.fourcc = V4L2_PIX_FMT_H264,
6175
.codec_mode = S5P_MFC_CODEC_H264_DEC,
@@ -359,10 +373,15 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f)
359373
/* Set pixelformat to the format in which MFC
360374
outputs the decoded frame */
361375
pix_mp->pixelformat = ctx->dst_fmt->fourcc;
362-
pix_mp->plane_fmt[0].bytesperline = ctx->buf_width;
376+
pix_mp->plane_fmt[0].bytesperline = ctx->stride[0];
363377
pix_mp->plane_fmt[0].sizeimage = ctx->luma_size;
364-
pix_mp->plane_fmt[1].bytesperline = ctx->buf_width;
378+
pix_mp->plane_fmt[1].bytesperline = ctx->stride[1];
365379
pix_mp->plane_fmt[1].sizeimage = ctx->chroma_size;
380+
if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->dst_fmt->fourcc ==
381+
V4L2_PIX_FMT_YVU420M) {
382+
pix_mp->plane_fmt[2].bytesperline = ctx->stride[2];
383+
pix_mp->plane_fmt[2].sizeimage = ctx->chroma_size_1;
384+
}
366385
} else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
367386
/* This is run on OUTPUT
368387
The buffer contains compressed image
@@ -920,6 +939,7 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
920939
{
921940
struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv);
922941
struct s5p_mfc_dev *dev = ctx->dev;
942+
const struct v4l2_format_info *format;
923943

924944
/* Video output for decoding (source)
925945
* this can be set after getting an instance */
@@ -936,7 +956,13 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
936956
} else if (ctx->state == MFCINST_HEAD_PARSED &&
937957
vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
938958
/* Output plane count is 2 - one for Y and one for CbCr */
939-
*plane_count = 2;
959+
format = v4l2_format_info(ctx->dst_fmt->fourcc);
960+
if (!format) {
961+
mfc_err("invalid format\n");
962+
return -EINVAL;
963+
}
964+
*plane_count = format->comp_planes;
965+
940966
/* Setup buffer count */
941967
if (*buf_count < ctx->pb_count)
942968
*buf_count = ctx->pb_count;
@@ -955,14 +981,18 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
955981
vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
956982
psize[0] = ctx->luma_size;
957983
psize[1] = ctx->chroma_size;
958-
984+
if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->dst_fmt->fourcc ==
985+
V4L2_PIX_FMT_YVU420M)
986+
psize[2] = ctx->chroma_size_1;
959987
if (IS_MFCV6_PLUS(dev))
960988
alloc_devs[0] = ctx->dev->mem_dev[BANK_L_CTX];
961989
else
962990
alloc_devs[0] = ctx->dev->mem_dev[BANK_R_CTX];
963991
alloc_devs[1] = ctx->dev->mem_dev[BANK_L_CTX];
964-
} else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE &&
965-
ctx->state == MFCINST_INIT) {
992+
if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->dst_fmt->fourcc ==
993+
V4L2_PIX_FMT_YVU420M)
994+
alloc_devs[2] = ctx->dev->mem_dev[BANK_L_CTX];
995+
} else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && ctx->state == MFCINST_INIT) {
966996
psize[0] = ctx->dec_src_buf_size;
967997
alloc_devs[0] = ctx->dev->mem_dev[BANK_L_CTX];
968998
} else {
@@ -994,12 +1024,24 @@ static int s5p_mfc_buf_init(struct vb2_buffer *vb)
9941024
mfc_err("Plane buffer (CAPTURE) is too small\n");
9951025
return -EINVAL;
9961026
}
1027+
if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->dst_fmt->fourcc ==
1028+
V4L2_PIX_FMT_YVU420M) {
1029+
if (vb2_plane_size(vb, 2) < ctx->chroma_size_1) {
1030+
mfc_err("Plane buffer (CAPTURE) is too small\n");
1031+
return -EINVAL;
1032+
}
1033+
}
9971034
i = vb->index;
9981035
ctx->dst_bufs[i].b = vbuf;
9991036
ctx->dst_bufs[i].cookie.raw.luma =
10001037
vb2_dma_contig_plane_dma_addr(vb, 0);
10011038
ctx->dst_bufs[i].cookie.raw.chroma =
10021039
vb2_dma_contig_plane_dma_addr(vb, 1);
1040+
if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->dst_fmt->fourcc ==
1041+
V4L2_PIX_FMT_YVU420M) {
1042+
ctx->dst_bufs[i].cookie.raw.chroma_1 =
1043+
vb2_dma_contig_plane_dma_addr(vb, 2);
1044+
}
10031045
ctx->dst_bufs_cnt++;
10041046
} else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
10051047
if (IS_ERR_OR_NULL(ERR_PTR(

drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c

Lines changed: 81 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ static struct s5p_mfc_fmt formats[] = {
5959
.num_planes = 2,
6060
.versions = MFC_V6PLUS_BITS,
6161
},
62+
{
63+
.fourcc = V4L2_PIX_FMT_YUV420M,
64+
.codec_mode = S5P_MFC_CODEC_NONE,
65+
.type = MFC_FMT_RAW,
66+
.num_planes = 3,
67+
.versions = MFC_V12_BIT,
68+
},
69+
{
70+
.fourcc = V4L2_PIX_FMT_YVU420M,
71+
.codec_mode = S5P_MFC_CODEC_NONE,
72+
.type = MFC_FMT_RAW,
73+
.num_planes = 3,
74+
.versions = MFC_V12_BIT,
75+
},
6276
{
6377
.fourcc = V4L2_PIX_FMT_H264,
6478
.codec_mode = S5P_MFC_CODEC_H264_ENC,
@@ -1193,14 +1207,20 @@ static int enc_pre_frame_start(struct s5p_mfc_ctx *ctx)
11931207
struct s5p_mfc_dev *dev = ctx->dev;
11941208
struct s5p_mfc_buf *dst_mb;
11951209
struct s5p_mfc_buf *src_mb;
1196-
unsigned long src_y_addr, src_c_addr, dst_addr;
1210+
unsigned long src_y_addr, src_c_addr, src_c_1_addr, dst_addr;
11971211
unsigned int dst_size;
11981212

11991213
src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
12001214
src_y_addr = vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 0);
12011215
src_c_addr = vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 1);
1216+
if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->src_fmt->fourcc ==
1217+
V4L2_PIX_FMT_YVU420M)
1218+
src_c_1_addr =
1219+
vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 2);
1220+
else
1221+
src_c_1_addr = 0;
12021222
s5p_mfc_hw_call(dev->mfc_ops, set_enc_frame_buffer, ctx,
1203-
src_y_addr, src_c_addr);
1223+
src_y_addr, src_c_addr, src_c_1_addr);
12041224

12051225
dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
12061226
dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
@@ -1215,8 +1235,8 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
12151235
{
12161236
struct s5p_mfc_dev *dev = ctx->dev;
12171237
struct s5p_mfc_buf *mb_entry;
1218-
unsigned long enc_y_addr = 0, enc_c_addr = 0;
1219-
unsigned long mb_y_addr, mb_c_addr;
1238+
unsigned long enc_y_addr = 0, enc_c_addr = 0, enc_c_1_addr = 0;
1239+
unsigned long mb_y_addr, mb_c_addr, mb_c_1_addr;
12201240
int slice_type;
12211241
unsigned int strm_size;
12221242
bool src_ready;
@@ -1229,18 +1249,26 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
12291249
mfc_read(dev, S5P_FIMV_ENC_SI_PIC_CNT));
12301250
if (slice_type >= 0) {
12311251
s5p_mfc_hw_call(dev->mfc_ops, get_enc_frame_buffer, ctx,
1232-
&enc_y_addr, &enc_c_addr);
1252+
&enc_y_addr, &enc_c_addr, &enc_c_1_addr);
12331253
list_for_each_entry(mb_entry, &ctx->src_queue, list) {
12341254
mb_y_addr = vb2_dma_contig_plane_dma_addr(
12351255
&mb_entry->b->vb2_buf, 0);
12361256
mb_c_addr = vb2_dma_contig_plane_dma_addr(
12371257
&mb_entry->b->vb2_buf, 1);
1238-
if ((enc_y_addr == mb_y_addr) &&
1239-
(enc_c_addr == mb_c_addr)) {
1258+
if (ctx->src_fmt->fourcc ==
1259+
V4L2_PIX_FMT_YUV420M ||
1260+
ctx->src_fmt->fourcc ==
1261+
V4L2_PIX_FMT_YVU420M)
1262+
mb_c_1_addr = vb2_dma_contig_plane_dma_addr
1263+
(&mb_entry->b->vb2_buf, 2);
1264+
else
1265+
mb_c_1_addr = 0;
1266+
if (enc_y_addr == mb_y_addr && enc_c_addr == mb_c_addr && enc_c_1_addr
1267+
== mb_c_1_addr) {
12401268
list_del(&mb_entry->list);
12411269
ctx->src_queue_cnt--;
12421270
vb2_buffer_done(&mb_entry->b->vb2_buf,
1243-
VB2_BUF_STATE_DONE);
1271+
VB2_BUF_STATE_DONE);
12441272
break;
12451273
}
12461274
}
@@ -1249,20 +1277,27 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
12491277
&mb_entry->b->vb2_buf, 0);
12501278
mb_c_addr = vb2_dma_contig_plane_dma_addr(
12511279
&mb_entry->b->vb2_buf, 1);
1252-
if ((enc_y_addr == mb_y_addr) &&
1253-
(enc_c_addr == mb_c_addr)) {
1280+
if (ctx->src_fmt->fourcc ==
1281+
V4L2_PIX_FMT_YUV420M ||
1282+
ctx->src_fmt->fourcc == V4L2_PIX_FMT_YVU420M)
1283+
mb_c_1_addr = vb2_dma_contig_plane_dma_addr(&
1284+
mb_entry->b->vb2_buf, 2);
1285+
else
1286+
mb_c_1_addr = 0;
1287+
if (enc_y_addr == mb_y_addr && enc_c_addr == mb_c_addr && enc_c_1_addr
1288+
== mb_c_1_addr) {
12541289
list_del(&mb_entry->list);
12551290
ctx->ref_queue_cnt--;
12561291
vb2_buffer_done(&mb_entry->b->vb2_buf,
1257-
VB2_BUF_STATE_DONE);
1292+
VB2_BUF_STATE_DONE);
12581293
break;
12591294
}
12601295
}
12611296
}
12621297
if (ctx->src_queue_cnt > 0 && (ctx->state == MFCINST_RUNNING ||
1263-
ctx->state == MFCINST_FINISHING)) {
1298+
ctx->state == MFCINST_FINISHING)) {
12641299
mb_entry = list_entry(ctx->src_queue.next, struct s5p_mfc_buf,
1265-
list);
1300+
list);
12661301
if (mb_entry->flags & MFC_BUF_FLAG_USED) {
12671302
list_del(&mb_entry->list);
12681303
ctx->src_queue_cnt--;
@@ -1381,10 +1416,15 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f)
13811416
pix_fmt_mp->pixelformat = ctx->src_fmt->fourcc;
13821417
pix_fmt_mp->num_planes = ctx->src_fmt->num_planes;
13831418

1384-
pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width;
1419+
pix_fmt_mp->plane_fmt[0].bytesperline = ctx->stride[0];
13851420
pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size;
1386-
pix_fmt_mp->plane_fmt[1].bytesperline = ctx->buf_width;
1421+
pix_fmt_mp->plane_fmt[1].bytesperline = ctx->stride[1];
13871422
pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size;
1423+
if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->src_fmt->fourcc ==
1424+
V4L2_PIX_FMT_YVU420M) {
1425+
pix_fmt_mp->plane_fmt[2].bytesperline = ctx->stride[2];
1426+
pix_fmt_mp->plane_fmt[2].sizeimage = ctx->chroma_size_1;
1427+
}
13881428
} else {
13891429
mfc_err("invalid buf type\n");
13901430
return -EINVAL;
@@ -1468,9 +1508,14 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
14681508

14691509
s5p_mfc_hw_call(dev->mfc_ops, enc_calc_src_size, ctx);
14701510
pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size;
1471-
pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width;
1511+
pix_fmt_mp->plane_fmt[0].bytesperline = ctx->stride[0];
14721512
pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size;
1473-
pix_fmt_mp->plane_fmt[1].bytesperline = ctx->buf_width;
1513+
pix_fmt_mp->plane_fmt[1].bytesperline = ctx->stride[1];
1514+
if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_YUV420M || ctx->src_fmt->fourcc ==
1515+
V4L2_PIX_FMT_YVU420M) {
1516+
pix_fmt_mp->plane_fmt[2].bytesperline = ctx->stride[2];
1517+
pix_fmt_mp->plane_fmt[2].sizeimage = ctx->chroma_size_1;
1518+
}
14741519

14751520
ctx->src_bufs_cnt = 0;
14761521
ctx->output_state = QUEUE_FREE;
@@ -2414,10 +2459,18 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
24142459

24152460
psize[0] = ctx->luma_size;
24162461
psize[1] = ctx->chroma_size;
2462+
if (ctx->src_fmt && (ctx->src_fmt->fourcc ==
2463+
V4L2_PIX_FMT_YUV420M || ctx->src_fmt->fourcc ==
2464+
V4L2_PIX_FMT_YVU420M))
2465+
psize[2] = ctx->chroma_size_1;
24172466

24182467
if (IS_MFCV6_PLUS(dev)) {
24192468
alloc_devs[0] = ctx->dev->mem_dev[BANK_L_CTX];
24202469
alloc_devs[1] = ctx->dev->mem_dev[BANK_L_CTX];
2470+
if (ctx->src_fmt && (ctx->src_fmt->fourcc ==
2471+
V4L2_PIX_FMT_YUV420M || ctx->src_fmt->fourcc ==
2472+
V4L2_PIX_FMT_YVU420M))
2473+
alloc_devs[2] = ctx->dev->mem_dev[BANK_L_CTX];
24212474
} else {
24222475
alloc_devs[0] = ctx->dev->mem_dev[BANK_R_CTX];
24232476
alloc_devs[1] = ctx->dev->mem_dev[BANK_R_CTX];
@@ -2456,6 +2509,11 @@ static int s5p_mfc_buf_init(struct vb2_buffer *vb)
24562509
vb2_dma_contig_plane_dma_addr(vb, 0);
24572510
ctx->src_bufs[i].cookie.raw.chroma =
24582511
vb2_dma_contig_plane_dma_addr(vb, 1);
2512+
if (ctx->src_fmt->fourcc ==
2513+
V4L2_PIX_FMT_YUV420M || ctx->src_fmt->fourcc ==
2514+
V4L2_PIX_FMT_YVU420M)
2515+
ctx->src_bufs[i].cookie.raw.chroma_1 =
2516+
vb2_dma_contig_plane_dma_addr(vb, 2);
24592517
ctx->src_bufs_cnt++;
24602518
} else {
24612519
mfc_err("invalid queue type: %d\n", vq->type);
@@ -2493,6 +2551,12 @@ static int s5p_mfc_buf_prepare(struct vb2_buffer *vb)
24932551
mfc_err("plane size is too small for output\n");
24942552
return -EINVAL;
24952553
}
2554+
if ((ctx->src_fmt->fourcc == V4L2_PIX_FMT_YUV420M ||
2555+
ctx->src_fmt->fourcc == V4L2_PIX_FMT_YVU420M) &&
2556+
(vb2_plane_size(vb, 2) < ctx->chroma_size_1)) {
2557+
mfc_err("plane size is too small for output\n");
2558+
return -EINVAL;
2559+
}
24962560
} else {
24972561
mfc_err("invalid queue type: %d\n", vq->type);
24982562
return -EINVAL;

drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,11 @@ struct s5p_mfc_hw_ops {
293293
int (*set_enc_stream_buffer)(struct s5p_mfc_ctx *ctx,
294294
unsigned long addr, unsigned int size);
295295
void (*set_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
296-
unsigned long y_addr, unsigned long c_addr);
296+
unsigned long y_addr, unsigned long c_addr,
297+
unsigned long c_1_addr);
297298
void (*get_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
298-
unsigned long *y_addr, unsigned long *c_addr);
299+
unsigned long *y_addr, unsigned long *c_addr,
300+
unsigned long *c_1_addr);
299301
void (*try_run)(struct s5p_mfc_dev *dev);
300302
void (*clear_int_flags)(struct s5p_mfc_dev *dev);
301303
int (*get_dspl_y_adr)(struct s5p_mfc_dev *dev);

0 commit comments

Comments
 (0)