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