media: amphion: output firmware error message
authorMing Qian <ming.qian@nxp.com>
Fri, 10 Jun 2022 06:26:11 +0000 (07:26 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 27 Jun 2022 07:53:56 +0000 (08:53 +0100)
Firmware may send the error event with some error message,
and it help locate the firmware error,
so output the error message if it exists

Fixes: 61cbf1c1fa6d7 ("media: amphion: implement vpu core communication based on mailbox")
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_msgs.c

index d5850df..d8247f3 100644 (file)
@@ -150,7 +150,12 @@ static void vpu_session_handle_eos(struct vpu_inst *inst, struct vpu_rpc_event *
 
 static void vpu_session_handle_error(struct vpu_inst *inst, struct vpu_rpc_event *pkt)
 {
-       dev_err(inst->dev, "unsupported stream\n");
+       char *str = (char *)pkt->data;
+
+       if (strlen(str))
+               dev_err(inst->dev, "instance %d firmware error : %s\n", inst->id, str);
+       else
+               dev_err(inst->dev, "instance %d is unsupported stream\n", inst->id);
        call_void_vop(inst, event_notify, VPU_MSG_ID_UNSUPPORTED, NULL);
        vpu_v4l2_set_error(inst);
 }