diff options
author | Ming Qian <ming.qian@nxp.com> | 2022-06-09 10:27:59 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-06-20 10:30:35 +0100 |
commit | a3a2efca36a3a1ddba229a7be7991e8b5de4ac35 (patch) | |
tree | 80abc8edd420695a2e2816abbd5ef9556006d31f /drivers/media/platform/amphion | |
parent | b99bea15156332be806a24ba1192948244e3976a (diff) | |
download | linux-a3a2efca36a3a1ddba229a7be7991e8b5de4ac35.tar.gz |
media: amphion: return error if format is unsupported by vpu
return error if format is unsupported by vpu,
otherwise the vpu will be stalled at decoding
Fixes: 3cd084519c6f9 ("media: amphion: add vpu v4l2 m2m support")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/amphion')
-rw-r--r-- | drivers/media/platform/amphion/vpu_malone.c | 2 | ||||
-rw-r--r-- | drivers/media/platform/amphion/vpu_v4l2.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c index 7a06011a217a..c62b49e85060 100644 --- a/drivers/media/platform/amphion/vpu_malone.c +++ b/drivers/media/platform/amphion/vpu_malone.c @@ -626,6 +626,8 @@ static int vpu_malone_set_params(struct vpu_shared_addr *shared, enum vpu_malone_format malone_format; malone_format = vpu_malone_format_remap(params->codec_format); + if (WARN_ON(malone_format == MALONE_FMT_NULL)) + return -EINVAL; iface->udata_buffer[instance].base = params->udata.base; iface->udata_buffer[instance].slot_size = params->udata.size; diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c index 446f07d09d0b..da455e5ab337 100644 --- a/drivers/media/platform/amphion/vpu_v4l2.c +++ b/drivers/media/platform/amphion/vpu_v4l2.c @@ -500,10 +500,12 @@ static int vpu_vb2_start_streaming(struct vb2_queue *q, unsigned int count) fmt->sizeimage[1], fmt->bytesperline[1], fmt->sizeimage[2], fmt->bytesperline[2], q->num_buffers); - call_void_vop(inst, start, q->type); + ret = call_vop(inst, start, q->type); vb2_clear_last_buffer_dequeued(q); + if (ret) + vpu_vb2_buffers_return(inst, q->type, VB2_BUF_STATE_QUEUED); - return 0; + return ret; } static void vpu_vb2_stop_streaming(struct vb2_queue *q) |