Skip to content

Commit 527a73d

Browse files
Ming Qiangregkh
authored andcommitted
media: amphion: Remove vpu_vb_is_codecconfig
[ Upstream commit 634c2cd ] Currently the function vpu_vb_is_codecconfig() always returns 0. Delete it and its related code. Fixes: 3cd0845 ("media: amphion: add vpu v4l2 m2m support") Cc: stable@vger.kernel.org Signed-off-by: Ming Qian <ming.qian@oss.nxp.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 915775d commit 527a73d

3 files changed

Lines changed: 3 additions & 40 deletions

File tree

drivers/media/platform/amphion/vpu_malone.c

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,22 +1315,18 @@ static int vpu_malone_insert_scode_vc1_g_seq(struct malone_scode_t *scode)
13151315
{
13161316
if (!scode->inst->total_input_count)
13171317
return 0;
1318-
if (vpu_vb_is_codecconfig(to_vb2_v4l2_buffer(scode->vb)))
1319-
scode->need_data = 0;
13201318
return 0;
13211319
}
13221320

13231321
static int vpu_malone_insert_scode_vc1_g_pic(struct malone_scode_t *scode)
13241322
{
1325-
struct vb2_v4l2_buffer *vbuf;
13261323
u8 nal_hdr[MALONE_VC1_NAL_HEADER_LEN];
13271324
u32 *data = NULL;
13281325
int ret;
13291326

1330-
vbuf = to_vb2_v4l2_buffer(scode->vb);
13311327
data = vb2_plane_vaddr(scode->vb, 0);
13321328

1333-
if (scode->inst->total_input_count == 0 || vpu_vb_is_codecconfig(vbuf))
1329+
if (scode->inst->total_input_count == 0)
13341330
return 0;
13351331
if (MALONE_VC1_CONTAIN_NAL(*data))
13361332
return 0;
@@ -1351,8 +1347,6 @@ static int vpu_malone_insert_scode_vc1_l_seq(struct malone_scode_t *scode)
13511347
int size = 0;
13521348
u8 rcv_seqhdr[MALONE_VC1_RCV_SEQ_HEADER_LEN];
13531349

1354-
if (vpu_vb_is_codecconfig(to_vb2_v4l2_buffer(scode->vb)))
1355-
scode->need_data = 0;
13561350
if (scode->inst->total_input_count)
13571351
return 0;
13581352
scode->need_data = 0;
@@ -1538,7 +1532,7 @@ static int vpu_malone_input_frame_data(struct vpu_malone_str_buffer __iomem *str
15381532
scode.vb = vb;
15391533
scode.wptr = wptr;
15401534
scode.need_data = 1;
1541-
if (vbuf->sequence == 0 || vpu_vb_is_codecconfig(vbuf))
1535+
if (vbuf->sequence == 0)
15421536
ret = vpu_malone_insert_scode(&scode, SCODE_SEQUENCE);
15431537

15441538
if (ret < 0)
@@ -1574,7 +1568,7 @@ static int vpu_malone_input_frame_data(struct vpu_malone_str_buffer __iomem *str
15741568
* This module is currently only supported for the H264 and HEVC formats,
15751569
* for other formats, vpu_malone_add_scode() will return 0.
15761570
*/
1577-
if ((disp_imm || low_latency) && !vpu_vb_is_codecconfig(vbuf)) {
1571+
if (disp_imm || low_latency) {
15781572
ret = vpu_malone_add_scode(inst->core->iface,
15791573
inst->id,
15801574
&inst->stream_buffer,
@@ -1621,7 +1615,6 @@ int vpu_malone_input_frame(struct vpu_shared_addr *shared,
16211615
struct vpu_inst *inst, struct vb2_buffer *vb)
16221616
{
16231617
struct vpu_dec_ctrl *hc = shared->priv;
1624-
struct vb2_v4l2_buffer *vbuf;
16251618
struct vpu_malone_str_buffer __iomem *str_buf = hc->str_buf[inst->id];
16261619
u32 disp_imm = hc->codec_param[inst->id].disp_imm;
16271620
u32 size;
@@ -1635,16 +1628,6 @@ int vpu_malone_input_frame(struct vpu_shared_addr *shared,
16351628
return ret;
16361629
size = ret;
16371630

1638-
/*
1639-
* if buffer only contain codec data, and the timestamp is invalid,
1640-
* don't put the invalid timestamp to resync
1641-
* merge the data to next frame
1642-
*/
1643-
vbuf = to_vb2_v4l2_buffer(vb);
1644-
if (vpu_vb_is_codecconfig(vbuf)) {
1645-
inst->extra_size += size;
1646-
return 0;
1647-
}
16481631
if (inst->extra_size) {
16491632
size += inst->extra_size;
16501633
inst->extra_size = 0;

drivers/media/platform/amphion/vpu_v4l2.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,6 @@ struct vb2_v4l2_buffer *vpu_next_src_buf(struct vpu_inst *inst)
349349
if (!src_buf || vpu_get_buffer_state(src_buf) == VPU_BUF_STATE_IDLE)
350350
return NULL;
351351

352-
while (vpu_vb_is_codecconfig(src_buf)) {
353-
v4l2_m2m_src_buf_remove(inst->fh.m2m_ctx);
354-
vpu_set_buffer_state(src_buf, VPU_BUF_STATE_IDLE);
355-
v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);
356-
357-
src_buf = v4l2_m2m_next_src_buf(inst->fh.m2m_ctx);
358-
if (!src_buf || vpu_get_buffer_state(src_buf) == VPU_BUF_STATE_IDLE)
359-
return NULL;
360-
}
361-
362352
return src_buf;
363353
}
364354

drivers/media/platform/amphion/vpu_v4l2.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,4 @@ static inline struct vpu_format *vpu_get_format(struct vpu_inst *inst, u32 type)
3939
else
4040
return &inst->cap_format;
4141
}
42-
43-
static inline int vpu_vb_is_codecconfig(struct vb2_v4l2_buffer *vbuf)
44-
{
45-
#ifdef V4L2_BUF_FLAG_CODECCONFIG
46-
return (vbuf->flags & V4L2_BUF_FLAG_CODECCONFIG) ? 1 : 0;
47-
#else
48-
return 0;
49-
#endif
50-
}
51-
5242
#endif

0 commit comments

Comments
 (0)