From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 993D83FC5AB for ; Mon, 13 Jul 2026 12:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783944651; cv=none; b=Qfgg2ohaDGNhDfknMB2hvVJWZcYcvu+zFVcQzXpK11Xd5sQwefOBEdPc3uyTXOJx/gs6a51ObtvNe2JdbedLqISUeRffgIK0SALsg+vO7vtXdqfji1jw7gVZ7o7yqM0NzHEYj2yp0RII7nGvUQD9qPST5Su+PKaVc7a3dxjthiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783944651; c=relaxed/simple; bh=86BevP00Vb2nr0l/gWPTl/2RFuTXiK146v6jmeBi3CY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E12+NNedwVccS8L73EVNWgtKFRc7gUkxuQoW1i1gYPCsxT/TA0Idc5e+c1C+Wfig1jaOXA34JVjC5tC5tsuiYzCMWA8YaBdf1FuajyfehuUJ02TqB9Rcrn+IInSwqZ8fc5rJ1R6I/YprJOQ5SiFEupT787ClQd6wN9Fc3Y0qVYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XXOCGOpk; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XXOCGOpk" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-c9fe3c9bd5fso2768936a12.0 for ; Mon, 13 Jul 2026 05:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783944650; x=1784549450; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OBddtjFYWhyXG/z7saOr360Gpb3JLBOtzUiY/pJ38ko=; b=XXOCGOpkUgaV/3+z0sqPfYO7HxkLlNfIPH9eebx4mUe8KMFF8Z/hWVH+O0kReB5VJc RZuryn2ASjEC3RDkmPVmUSBKkvMxvDiq+13DW8ew7MOKY+MwpeIMz+Mhv0pnOreNtqlY ijbE9J0rHRL8IvDiHnbc6ITGU1J/BjlMyUo7Yu16Z+JMizr1cgEQQ90+wyKkFF1qrnwu XNQV9txsyDjOpTUC5qW28IegxQwdgdge8vdkD0HGnCAohX12Y/1V2B3DTw939vEXYISP 1zr4Cxv//NSwjYINsAepcGTbA9MiM1G0dP+bgcscBAOpM8CMlXjdqqr9RaORlFMlxSyN K3vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783944650; x=1784549450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=OBddtjFYWhyXG/z7saOr360Gpb3JLBOtzUiY/pJ38ko=; b=R+Rg1l3cjrEfo6CzdmDdFoV8A8V46Srq+ncam5DB+ohWurTRlRCNRvbkXiYmOZe1rr o1L7ZTx5+tiJwqfvlHON2p/aXG/4Wcwf0vWM08/Sp4tY0/rYit3bQmzK/f8NpVLtVmSn eYwqUjB/JY2FeC3/6dqOq78lCbBNIuE9adb0ob5K23jt6YaTEfNQwQd8kbFcQsN+UZYH vEqeDDVIHS+2QJcaujaSKqQPkWCdc8gF74WkZFx13lOXrFyPKSoCOC78Ls1PZJHecRvT CgmJ0owAC3KD7ctH/D9mjM3zjq/2WV++vrZY/xXWGBQsUIK/S89EKT32zDQL+awUrx9r Kk5g== X-Forwarded-Encrypted: i=1; AHgh+RrKLbmbffvL8sZDyr5q0BBjPF38SzEJ6IhbqxHgyDXlwe6tZZXNKXHny4FrU0wz7ms96si9LxlfBG9wgn0=@vger.kernel.org X-Gm-Message-State: AOJu0YwgAjUPfcHUEZoqpbsjKoKhEhi0eBcyK2w44L/AREbZmB9JPn/U U6MG6TxNC7Cq0P6MAvMQQo4WNbNZwzGgam4llEJXiqXQmdvkNG2KNSxa X-Gm-Gg: AfdE7cnKn4X3sQYJkIyftFbYyKIsaTOCwZM/Hpx1BmTGfJ3apQ7C5B0FKu6TwHW0syo TTkVzXF/9lQNn6NlVNarWWxzxGdB8Ff4f6WWyTbRuXPL/PKKo14Rb8kA4v7WF8/rldcENsh2Ehf G8eDjrVAKbBWH6yOtRUURyRB1+QBdejJ1mckzIlQ/U87TSZGTNQIkTsh31o/TKh85nkTME+6CAq kZp7SukXK8lEyXNK961hGZQZ3ju9cng5rXIe8ObINSEu/tMQED9Mnb1MmEDhFx2umpL/jBNqbwV pxx/I0Be0sH5l9heibxx7ua3o/BOuq5aCQpBTgtihuHNmZVIAQZH2kX/pmZuK39Hqv9C8EEP90z 1mRtNAr4h8gz3amk78cd25Os07KJdIe6oUadHKcXEA/drtO5frKd6Ftt0f1auPjPozHcjs+xoZw af286QFAozD0ag0Hz2c9Sm X-Received: by 2002:a17:90b:4cc7:b0:36b:b903:994 with SMTP id 98e67ed59e1d1-38d13768de2mr15327432a91.4.1783944650044; Mon, 13 Jul 2026 05:10:50 -0700 (PDT) Received: from rockpi-5b ([45.112.0.180]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311747f7293sm67756935eec.3.2026.07.13.05.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 05:10:49 -0700 (PDT) From: Anand Moon To: Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Mauro Carvalho Chehab , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-amlogic@lists.infradead.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Amlogic Meson SoC support), linux-kernel@vger.kernel.org (open list), linux-media@vger.kernel.org (open list:MESON VIDEO DECODER DRIVER FOR AMLOGIC SOCS), linux-staging@lists.linux.dev (open list:STAGING SUBSYSTEM) Cc: Anand Moon , Doruk Tan Ozturk , Nicolas Dufresne Subject: [PATCH v7 11/19] media: meson: vdec: Update core m2m stream state during transitions Date: Mon, 13 Jul 2026 17:37:06 +0530 Message-ID: <20260713120840.17427-12-linux.amoon@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260713120840.17427-1-linux.amoon@gmail.com> References: <20260713120840.17427-1-linux.amoon@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Explicitly update the V4L2 core Memory-to-Memory (m2m) framework's internal streaming states when initiating or terminating streaming on the device queues. Without invoking these core framework helpers, the m2m engine's bookkeeping of active source and destination queues drifts out of alignment with the driver's local 'streamon_out' and 'streamon_cap' tracking variables. This misalignment causes state validation stalls and incorrect polling outcomes when the device is subjected to quick runtime cycles or strict testing setups (such as v4l2-compliance). Fix this by integrating v4l2_m2m_update_start_streaming_state() right after a queue is marked active in vdec_start_streaming(), and pairing it cleanly with v4l2_m2m_update_stop_streaming_state() at the end of vdec_stop_streaming() before the session core mutex is released. Cc: Nicolas Dufresne Signed-off-by: Anand Moon --- drivers/staging/media/meson/vdec/vdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 83a9b1238972a..0eb39aa6014ee 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -299,6 +299,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) else sess->streamon_cap = 1; + v4l2_m2m_update_start_streaming_state(sess->m2m_ctx, q); + if (!sess->streamon_out) return 0; @@ -529,6 +531,8 @@ static void vdec_stop_streaming(struct vb2_queue *q) sess->changed_format = 0; } + v4l2_m2m_update_stop_streaming_state(sess->m2m_ctx, q); + mutex_unlock(&core->lock); } -- 2.50.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6CD8C43458 for ; Mon, 13 Jul 2026 12:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EaArksckGbXXHKn4HhhztZaRtJ5uAXwySIQs7MwDNdU=; b=Voqc+vNkU/3rNq O019lZuYzc+eWYGeyOA/gS8Aon+v5VoJOLl9wxeAGwlqiZ1YiV9C7nn75DVci/uwxlXxva1UdPYek hpbnwpHbis2Xgcy1aNwpyp2/N4gTvYpjeu08XdsONR+5znQ9lrWKoi7B/tBYoqK+h8gvqNfwpHmp9 GN4iXqXFg0mJcc3UlF34rPPYE/bhj/mTDU3692zY1GOTQx4To/KsTIZvkc+ad5ao2Y18h3YVD6sLn jV0h5cuWWRyO/7/M/gNnMGHi7Lrz5Rxoe007naabql+TgByzJHbMMHOIC7Gwo8x4O4Rs1kIUl1y9a Qfvh8ebuYkRVMEuN9Kgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjFV0-0000000998I-2iJJ; Mon, 13 Jul 2026 12:11:02 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjFUo-000000098zN-3Dxj for linux-amlogic@lists.infradead.org; Mon, 13 Jul 2026 12:10:54 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-38175907a56so3127493a91.0 for ; Mon, 13 Jul 2026 05:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783944650; x=1784549450; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OBddtjFYWhyXG/z7saOr360Gpb3JLBOtzUiY/pJ38ko=; b=EOG0GPJXGdMr+AGHCHv/mPS45z9pmglABFkhmP4qrISoGYu/UfO4kA7cQMxaYDFXwE enpQxT3KtEy/FoeJqnnPyNU9bEmJejpc+W4BXtSY5Ux3vkLyuYJ1Cl/OTaRQXZI6ok2P 5ZyjlvW87Xa5dca+MR5PXf5LT9njELaMaQQ7JbzygsDbmwyQbugxcg70Z5tDNHd6eL2y za6I/5d2B5uj/yHzEyIL2SN+18eVny2IKYQfXxz2bo90s4VinbL4BkqOHBFZGHAtNI5c JK6mz1Ojm3GNa5JdrMeZkTL4om08RQPMzARrIWEx0SvIpZSf2PDy5DPF40fwRWDIpPTp 9X3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783944650; x=1784549450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=OBddtjFYWhyXG/z7saOr360Gpb3JLBOtzUiY/pJ38ko=; b=FuPLy+M4qvcaTgdmt5aJRT5n1hnaQGTi68ztHr25SYP6n8cc8cRSCzfqdudbQA4QX0 sZl2UM5Ge+XnlPOxPJqF1TuReFMjEVL1wcoF+8GR6dzybCGkEtyOi1r0eW4SBLgDFiLu Sr8HwwEofRvYlpQHhDoS+g+1pf/jPvV/zNDrZ5yO5Z5m1zeo6qh3YfYza4ykVDH8Y+cb 8bNFx8O5+Pvq2zC/eazKqgs/FGVuyUldfeuLtTvPPd4fVkNLeIykZJd/P5iXQM6iaMsl zNDL329y+Sd5g2xOyDePo+Mee9pzwsNc6Wnez220Q+8/OQVKuVK+F+E55TfQKqfzKy1a E2jw== X-Forwarded-Encrypted: i=1; AHgh+RpyQk9S529drY3RQo7UsyXJDhcbfamgjCIqPN8NcuMrUWLyIV9+EUyty/PQ4mfmKwPhFFylMZktHooTJpjO@lists.infradead.org X-Gm-Message-State: AOJu0Yw4omZQEBX/6DBsQYOk70ErbTr1cTM86yxtg/+oXz6kzzD9ackp dWaDA7cZ6Hr/8pjXE/44cUMWqaWVZ6qvs0dOMgC0CRxCtNzrj5k75nZR X-Gm-Gg: AfdE7clF4LE08suLYu0l537TKujrAQq/jAoD81ilbzM5gKClrBGnEHMum2qW4QbXjAX pGltcPsGF4kt0Oac7TW72e1NlhL9kEs0rUwdki5T42YkDKHb+qqDsZMYlNrKWqeoaZs267q1xjZ IPZYZHJasX6hPRpDa6bzAlTw2xCW5S8h5ozbKsk0z54i+dgTO9VzF+p7ga/zCDVqjxhULwcxKvb HY+KddOHxku+TO0bIV+b86qIbv5zij4w/vv9IgOrNxXeg/Gkr3d9KgIst9w5RtGLHPtPbvjQxMx K6IfXVHbILvRVKRhiKlvz7btc4P4IaV+tVnzpPx6LYf74Brz+qTYtITvN6oZWg7w6UBHCFyjAOU XFVMg/xSnJUjiNB7QeT5VLXw8LHsuL9GCCEKRBP/cQFhss98ctvMyNk09b8VeUXEN5u+1jrA5Fb Ai2mqCR137etOuvyAWm/xG X-Received: by 2002:a17:90b:4cc7:b0:36b:b903:994 with SMTP id 98e67ed59e1d1-38d13768de2mr15327432a91.4.1783944650044; Mon, 13 Jul 2026 05:10:50 -0700 (PDT) Received: from rockpi-5b ([45.112.0.180]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311747f7293sm67756935eec.3.2026.07.13.05.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 05:10:49 -0700 (PDT) From: Anand Moon To: Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Mauro Carvalho Chehab , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-amlogic@lists.infradead.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Amlogic Meson SoC support), linux-kernel@vger.kernel.org (open list), linux-media@vger.kernel.org (open list:MESON VIDEO DECODER DRIVER FOR AMLOGIC SOCS), linux-staging@lists.linux.dev (open list:STAGING SUBSYSTEM) Subject: [PATCH v7 11/19] media: meson: vdec: Update core m2m stream state during transitions Date: Mon, 13 Jul 2026 17:37:06 +0530 Message-ID: <20260713120840.17427-12-linux.amoon@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260713120840.17427-1-linux.amoon@gmail.com> References: <20260713120840.17427-1-linux.amoon@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260713_051050_836358_300EB946 X-CRM114-Status: GOOD ( 13.17 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doruk Tan Ozturk , Nicolas Dufresne Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Explicitly update the V4L2 core Memory-to-Memory (m2m) framework's internal streaming states when initiating or terminating streaming on the device queues. Without invoking these core framework helpers, the m2m engine's bookkeeping of active source and destination queues drifts out of alignment with the driver's local 'streamon_out' and 'streamon_cap' tracking variables. This misalignment causes state validation stalls and incorrect polling outcomes when the device is subjected to quick runtime cycles or strict testing setups (such as v4l2-compliance). Fix this by integrating v4l2_m2m_update_start_streaming_state() right after a queue is marked active in vdec_start_streaming(), and pairing it cleanly with v4l2_m2m_update_stop_streaming_state() at the end of vdec_stop_streaming() before the session core mutex is released. Cc: Nicolas Dufresne Signed-off-by: Anand Moon --- drivers/staging/media/meson/vdec/vdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 83a9b1238972a..0eb39aa6014ee 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -299,6 +299,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) else sess->streamon_cap = 1; + v4l2_m2m_update_start_streaming_state(sess->m2m_ctx, q); + if (!sess->streamon_out) return 0; @@ -529,6 +531,8 @@ static void vdec_stop_streaming(struct vb2_queue *q) sess->changed_format = 0; } + v4l2_m2m_update_stop_streaming_state(sess->m2m_ctx, q); + mutex_unlock(&core->lock); } -- 2.50.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF227C43458 for ; Mon, 13 Jul 2026 12:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OBddtjFYWhyXG/z7saOr360Gpb3JLBOtzUiY/pJ38ko=; b=rP4umAN+emgoT/ 8hehDAGe11cD4utm8JrMF2Mv0YLZLfyEZW345VDC1xajxp1WXSakIE1KvLp61bOXu1L8L+YSqZoWa FIbTa+LAV7GEtCZ510ldjqQzvKqrnSFSLpqBWTripSIfWgMn4dFMk/B8YjiTHR31cPsFNeA1SYGGY klX6TD3kLOCLMLUTNIRBkajEyXkMzOGV6/1umrMZBEdfW9RWTNk4kCps8HbuvcMGi4+YfvrO4k8YH lqtTtwhJ+8Kq7q7hX45biAjv5dJvJqM1XULJKc2+1iG/UUrNW8LGlPIz+Cq1J/Zt0so++jz0H4hkM 5pCaXXvdxEQk/PsDZjgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjFV0-0000000997w-2EO1; Mon, 13 Jul 2026 12:11:02 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjFUo-000000098zO-3DNe for linux-arm-kernel@lists.infradead.org; Mon, 13 Jul 2026 12:10:53 +0000 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-38175907a56so3127495a91.0 for ; Mon, 13 Jul 2026 05:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783944650; x=1784549450; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OBddtjFYWhyXG/z7saOr360Gpb3JLBOtzUiY/pJ38ko=; b=EOG0GPJXGdMr+AGHCHv/mPS45z9pmglABFkhmP4qrISoGYu/UfO4kA7cQMxaYDFXwE enpQxT3KtEy/FoeJqnnPyNU9bEmJejpc+W4BXtSY5Ux3vkLyuYJ1Cl/OTaRQXZI6ok2P 5ZyjlvW87Xa5dca+MR5PXf5LT9njELaMaQQ7JbzygsDbmwyQbugxcg70Z5tDNHd6eL2y za6I/5d2B5uj/yHzEyIL2SN+18eVny2IKYQfXxz2bo90s4VinbL4BkqOHBFZGHAtNI5c JK6mz1Ojm3GNa5JdrMeZkTL4om08RQPMzARrIWEx0SvIpZSf2PDy5DPF40fwRWDIpPTp 9X3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783944650; x=1784549450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=OBddtjFYWhyXG/z7saOr360Gpb3JLBOtzUiY/pJ38ko=; b=XXMoaS33GoBF1seY9vf1YM2P5ovb6unn8ynQ2cgnPIdnmAe1c1C3zKbKx8p9P1+BH0 oCbK1cbArQJGGcrtMyFdCXusUKb9U3VVe8nuwsngZ11MvY1QurFxifMQ3kuaQwEp+cto EQA1W8NufFVKZTzmKXGlaKEaADzBtYVR3c+1wjtJQTmSUoiLyOyAmrkO94KJn2/Gtqxs Hs4XDDM/L5y7d5J5mkh1zlb9EKXJSXM9cFn0cBPFRbxh4juicSU2Vsr1C8KyrN3EPi/1 PSyuESINkMBOiKkZowCdpLd/c8oFXgJdT4ki3bb0QnpR7alVn5QcjdTeTe7erZ5Gypy2 5jYQ== X-Forwarded-Encrypted: i=1; AHgh+Rpyrw9nSLxBj2NJeJGuRYfNrBNSt4HhvSAI5orhPAe0B6ZnslrkQHO6cyM5u6XRVaxDgkTGR529nh6Tohv9sziU@lists.infradead.org X-Gm-Message-State: AOJu0YyMGxOupJ2MRcpbVVAgMv2Sjcls8u8mmh1/CKgVR7zRkf3q55dp PlsKWWqPkABf0Cm5GLHLOAw8anPskRj0IpDEDK4GoW7ZEy/EhBzED3ve X-Gm-Gg: AfdE7cn3faZjjHnsea1FN5V0lwtAVcfIdbfuzsvcCzLIDzPS/uMKtw0yoODESvXtdmx 1pZnxT6DWqPspU2yNbMXe334PQsM2Yum5cHu34cDdd4BDiy9isWt7uSPY+hxeaCdX6jnUVmv6zB mBpA+NlOYdvrhqclj/72FygW2WKX3kdIKUTZZjn6aUwyZP/9PnlZ+hupKuMVNM44k+gE3y4Www4 /ySZsWuJI+Py/GfYwvC/LcZI3jt1yuxad3ewjyBoKDmE1ufRnCd36fWfimE72UqO+hACfYnCCkr jpq3DFKfRdWSuL1Bq5BzT3mU2aDx9z0sS0bgL8064dGY3XChPmg7GOtbJLCKl+sqFR85Rigr2ej EJKVBsNxV/txncm2nSicsFf4ch+nn5d2gh97pCgNYT+kaoXDH/ga2ao4hnyUjI5I+fu74+LRSpP cy3etOLTepOfZwOuNZsqdO X-Received: by 2002:a17:90b:4cc7:b0:36b:b903:994 with SMTP id 98e67ed59e1d1-38d13768de2mr15327432a91.4.1783944650044; Mon, 13 Jul 2026 05:10:50 -0700 (PDT) Received: from rockpi-5b ([45.112.0.180]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311747f7293sm67756935eec.3.2026.07.13.05.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 05:10:49 -0700 (PDT) From: Anand Moon To: Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Mauro Carvalho Chehab , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-amlogic@lists.infradead.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Amlogic Meson SoC support), linux-kernel@vger.kernel.org (open list), linux-media@vger.kernel.org (open list:MESON VIDEO DECODER DRIVER FOR AMLOGIC SOCS), linux-staging@lists.linux.dev (open list:STAGING SUBSYSTEM) Subject: [PATCH v7 11/19] media: meson: vdec: Update core m2m stream state during transitions Date: Mon, 13 Jul 2026 17:37:06 +0530 Message-ID: <20260713120840.17427-12-linux.amoon@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260713120840.17427-1-linux.amoon@gmail.com> References: <20260713120840.17427-1-linux.amoon@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260713_051050_832349_91453CD0 X-CRM114-Status: GOOD ( 14.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doruk Tan Ozturk , Nicolas Dufresne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Explicitly update the V4L2 core Memory-to-Memory (m2m) framework's internal streaming states when initiating or terminating streaming on the device queues. Without invoking these core framework helpers, the m2m engine's bookkeeping of active source and destination queues drifts out of alignment with the driver's local 'streamon_out' and 'streamon_cap' tracking variables. This misalignment causes state validation stalls and incorrect polling outcomes when the device is subjected to quick runtime cycles or strict testing setups (such as v4l2-compliance). Fix this by integrating v4l2_m2m_update_start_streaming_state() right after a queue is marked active in vdec_start_streaming(), and pairing it cleanly with v4l2_m2m_update_stop_streaming_state() at the end of vdec_stop_streaming() before the session core mutex is released. Cc: Nicolas Dufresne Signed-off-by: Anand Moon --- drivers/staging/media/meson/vdec/vdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 83a9b1238972a..0eb39aa6014ee 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -299,6 +299,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) else sess->streamon_cap = 1; + v4l2_m2m_update_start_streaming_state(sess->m2m_ctx, q); + if (!sess->streamon_out) return 0; @@ -529,6 +531,8 @@ static void vdec_stop_streaming(struct vb2_queue *q) sess->changed_format = 0; } + v4l2_m2m_update_stop_streaming_state(sess->m2m_ctx, q); + mutex_unlock(&core->lock); } -- 2.50.1