media: mediatek: vcodec: Core thread depends on core_list
authorYunfei Dong <yunfei.dong@mediatek.com>
Thu, 17 Nov 2022 09:24:53 +0000 (09:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:17 +0000 (13:32 +0100)
[ Upstream commit 95bc23513c9188065a22194f9af870376fc38fdd ]

Core thread will continue to work when core_list is not empty, not
depends on lat_list.

Fixes: 365e4ba01df4 ("media: mtk-vcodec: Add work queue for core hardware decode")
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c

index ae50098..dc20047 100644 (file)
@@ -221,7 +221,7 @@ static void vdec_msg_queue_core_work(struct work_struct *work)
        mtk_vcodec_dec_disable_hardware(ctx, MTK_VDEC_CORE);
        vdec_msg_queue_qbuf(&ctx->msg_queue.lat_ctx, lat_buf);
 
-       if (!list_empty(&ctx->msg_queue.lat_ctx.ready_queue)) {
+       if (!list_empty(&dev->msg_queue_core_ctx.ready_queue)) {
                mtk_v4l2_debug(3, "re-schedule to decode for core: %d",
                               dev->msg_queue_core_ctx.ready_num);
                queue_work(dev->core_workqueue, &msg_queue->core_work);