OSDN Git Service

media: amphion: handle picture skipped event
authorMing Qian <ming.qian@nxp.com>
Wed, 20 Apr 2022 11:35:59 +0000 (13:35 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:19 +0000 (11:02 +0200)
For some invalid frames,
especially multiple consecutive invalid frames,
they all can't be decoded,
then the firmware can send picture skipped event
to notify driver that some frames are invalid,
driver can return them with error flag.

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>
drivers/media/platform/amphion/vpu_defs.h
drivers/media/platform/amphion/vpu_malone.c
drivers/media/platform/amphion/vpu_msgs.c

index 2826642..667637e 100644 (file)
@@ -69,8 +69,8 @@ enum {
        VPU_MSG_ID_BS_ERROR,
        VPU_MSG_ID_UNSUPPORTED,
        VPU_MSG_ID_TIMESTAMP_INFO,
-
        VPU_MSG_ID_FIRMWARE_XCPT,
+       VPU_MSG_ID_PIC_SKIPPED,
 };
 
 enum VPU_ENC_MEMORY_RESOURSE {
index f1eca88..f29c223 100644 (file)
@@ -170,6 +170,7 @@ enum {
        VID_API_EVENT_DEC_CHECK_RES             = 0x24,
        VID_API_EVENT_DEC_CFG_INFO              = 0x25,
        VID_API_EVENT_UNSUPPORTED_STREAM        = 0x26,
+       VID_API_EVENT_PIC_SKIPPED               = 0x27,
        VID_API_EVENT_STR_SUSPENDED             = 0x30,
        VID_API_EVENT_SNAPSHOT_DONE             = 0x40,
        VID_API_EVENT_FW_STATUS                 = 0xF0,
@@ -703,6 +704,7 @@ static struct vpu_pair malone_msgs[] = {
        {VPU_MSG_ID_BS_ERROR, VID_API_EVENT_BS_ERROR},
        {VPU_MSG_ID_UNSUPPORTED, VID_API_EVENT_UNSUPPORTED_STREAM},
        {VPU_MSG_ID_FIRMWARE_XCPT, VID_API_EVENT_FIRMWARE_XCPT},
+       {VPU_MSG_ID_PIC_SKIPPED, VID_API_EVENT_PIC_SKIPPED},
 };
 
 static void vpu_malone_pack_fs_alloc(struct vpu_rpc_event *pkt,
index 58502c5..d5850df 100644 (file)
@@ -166,6 +166,13 @@ static void vpu_session_handle_firmware_xcpt(struct vpu_inst *inst, struct vpu_r
        vpu_v4l2_set_error(inst);
 }
 
+static void vpu_session_handle_pic_skipped(struct vpu_inst *inst, struct vpu_rpc_event *pkt)
+{
+       vpu_inst_lock(inst);
+       vpu_skip_frame(inst, 1);
+       vpu_inst_unlock(inst);
+}
+
 static struct vpu_msg_handler handlers[] = {
        {VPU_MSG_ID_START_DONE, vpu_session_handle_start_done},
        {VPU_MSG_ID_STOP_DONE, vpu_session_handle_stop_done},
@@ -181,6 +188,7 @@ static struct vpu_msg_handler handlers[] = {
        {VPU_MSG_ID_PIC_EOS, vpu_session_handle_eos},
        {VPU_MSG_ID_UNSUPPORTED, vpu_session_handle_error},
        {VPU_MSG_ID_FIRMWARE_XCPT, vpu_session_handle_firmware_xcpt},
+       {VPU_MSG_ID_PIC_SKIPPED, vpu_session_handle_pic_skipped},
 };
 
 static int vpu_session_handle_msg(struct vpu_inst *inst, struct vpu_rpc_event *msg)