]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
media: mediatek: vcodec: using each instance lat_buf count replace core ready list
authorYunfei Dong <yunfei.dong@mediatek.com>
Wed, 1 Feb 2023 07:33:11 +0000 (07:33 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 10 Apr 2023 13:10:53 +0000 (14:10 +0100)
Core Hardware decoder depends on each instance lat_buf count,
calling queue_work decode again when the lat_buf count of each instance
isn't zero.

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>
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c

index 3f016c87d722cd519bc970c8e1eed89b77c87d7a..ad5002ca953e0a86d55a468639321ccb9d6acf73 100644 (file)
@@ -239,7 +239,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(&dev->msg_queue_core_ctx.ready_queue)) {
+       if (atomic_read(&lat_buf->ctx->msg_queue.core_list_cnt)) {
                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);