From patchwork Tue Jul 26 09:04:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12929053 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 388F9C43334 for ; Tue, 26 Jul 2022 09:06:19 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EXv3lIbZgWMHi+c4aI9D7XI0bFMr1TUg6TJ32GPCTzU=; b=N7jDpJS6t4JMmL SlUAi1OpqYtJTkZHNF0TCdyJ9yZwZIXj5b2SWjbxCLT/xkIy/wLsJS5mK17CbqVO0/C9jk5F+sNji xEcUdZ11+HwfTkGRccUhwwmVtPlECS0PjSJFCf9hGAMlBzrk4T6BnlgpjRLDdRk3vY39Mly23eBNY NEKM4St/ZvEsIxz2IQgZA41/EFPEaLLSVQDBD4zz5pZLfz4erXVQWiivpFBoJ4p6dh/ffLHv0Xjdd VNuUo6vlrChIvlh9uNLXXlkIi25XyRUZy/2OZmBM8Liu6Kfc8LsI+RdMzO/8BZO4m3V6jjJT9fuaP YZ7CHl4eGNWVRryq3dTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGGV5-00ApMl-80; Tue, 26 Jul 2022 09:05:11 +0000 Received: from mail-db8eur05on2041.outbound.protection.outlook.com ([40.107.20.41] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGGV2-00ApCH-18 for linux-arm-kernel@lists.infradead.org; Tue, 26 Jul 2022 09:05:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XgKWM/t7Oe39u3q/AwcwM82gcvUo9oPRt0YCECPZgRSMTQyUtpB1cdZW9Xrv7SW68RICpbhKYEtgwukaLHktklBcL1V6Pv9WM2xmP2f3Z5hS8GY5WwQvUXKSCSyg5mWLwRYn0SQ5THzTpSGz6H7nd0fie6EYu3QFmKV6vTSCocbQT+AGvwis1X+fcgtvpwwG8rjYKm46g7m1Kopp+OdO4wjNXobfzTbnlai+ruoCVRQWCjQgjaTsQN+Agq3Wt3lGqLVxd3nw2LFrsFK1t/0mVI0mfzHiD42CFvrYjOVpxntr8BD90lmBU5zXvTVtwP1wGDHRoMVJQze4j3Q+/GobmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v2/jm1V/QejqzGDKVWKSIxksy6nivJFeZNZrcaFNZF8=; b=QGtoUHD9n+MncQfMM0zT4jXEwKn4sX+/A2KKyvyD0JHnjZb13MHaYCb0HKlzjnNmXcqNpO1gbDZmpfJR4Ge/Y/MOQ58LSgLp2D3IeHKu2AVgjluHvaZ3MkcDybm4DQuivoAm2L58quPOvLIOCwk/VkvUrRhCYCARK8CeJUr1ulmGjcF5QwUwffwlgGhQU/SJOtqPipKkzItyHzi1GTA/uRdLWACQG9idaKn4gW17viC/OMjE/HLSWPdgi9yR0RUWb6eX/kdOcbHvd8IejLeQUELXIaAQWLss+zgCA60NxLlv+OBu2zsHETADC4SYLsWrpU+NL7XkMUNCy6pjgAv7Ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v2/jm1V/QejqzGDKVWKSIxksy6nivJFeZNZrcaFNZF8=; b=m6RWaAxqr4hUg/ti5UNsGGNUgElQI1++us5khAP6OZ7WZ4qggxiPEc2UjYxoyKfghfp9yYp1FZP4N0D9O2Jwvdk0m3mXOBYMDPXk2a0BXXaUAP6ccJNnCzDidNzgcnDAXu67ohxGeUJ6RSBqXTNEUrY25FzSQSeu9DESdxrAixo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AM6PR04MB4344.eurprd04.prod.outlook.com (2603:10a6:209:3f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Tue, 26 Jul 2022 09:04:49 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::5db6:3f08:2e04:33c]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::5db6:3f08:2e04:33c%4]) with mapi id 15.20.5438.023; Tue, 26 Jul 2022 09:04:49 +0000 From: Ming Qian To: mchehab@kernel.org, mirela.rabulea@oss.nxp.com, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] media: imx-jpeg: Don't clear stop state in handling dynamic resolution change Date: Tue, 26 Jul 2022 17:04:27 +0800 Message-Id: <20220726090427.28093-1-ming.qian@nxp.com> X-Mailer: git-send-email 2.36.1 X-ClientProxiedBy: SG2PR02CA0108.apcprd02.prod.outlook.com (2603:1096:4:92::24) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1eadfed7-293d-43e0-dbca-08da6ee5e50b X-MS-TrafficTypeDiagnostic: AM6PR04MB4344:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M+3XaO7Own0LHB7TMR6F34UZuUi6zqk6vkZDrr4pKbtcnUuP9dYE5l/daSFpuLw/r/9V14kNO0yraU1fajrVQ8XjBSLSSaDzHw2+LQinKb7ej51bR/34qUnxAOjumKO1zU1MRYpgG1cAHciGRtx4QQz1+TNhhl/s9I0pp596d5YponjofJSDQVO0q4AMxtlk1kH/yG1N91TFHg5CYBdNsH2l64rRnSIlLjqY5wAFzuPZd+lzaOH261ePBSdosumDnE+X96/XEeEmxoSTXKhhFDZk6LSylyLwwurkaPMtVOK4X90t2QxzZbAkdtIAF9DAJNNV0yrpDpI+8nneHZTNJRRlc9HvIZpbjIrpGcd5nV2x1r0AXuqeWBPjPWnZvdQn/xjJyoRTWwEZZXYreU5gLeCIx5CFzF0QxQt3VD/B2fFhoz5cGfceX53Q4kJ24Q2bLzRfJ0II8q0qQWFAsnMkZlbZ0V9xIUInQy1+6v7Qc+i3pyvRyGndboRqMM7tHuDc83PDtvHAPPxd12/+hDTuKDx1fdqcBZEFzYxxHabq9cgKEqvmNaMk82pkmN3wDUZqzM9RXcr0hdkTc0RVN+LWw4VBFSZbhPcfQpnGm9YgaZBnInaVSL7ZVpicbrUpMMQs6+DjLek0W2R5OdH1/fNXR7wLd/6/NGFT2n3J/b6uUEupyMKM1vMu7pJTIR6zWa+LOkU+cRLSAKOn5Ic767SrzhxVW+rCyXCilMDKMc8FJ1G2cjOTMYhSW2GsykWxO1moNxQx0+2fgCzqg5hdpx/0/MWPsX8zB4PlRfJLhpzyJ14= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(39860400002)(396003)(136003)(376002)(366004)(8676002)(6486002)(36756003)(66946007)(5660300002)(66476007)(66556008)(4326008)(44832011)(478600001)(8936002)(316002)(7416002)(26005)(2616005)(186003)(52116002)(6666004)(41300700001)(2906002)(6506007)(38350700002)(83380400001)(86362001)(6512007)(38100700002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Vdze6Fe51TDH+SyWzhCJ1qWjRVxbtfQrTsVx5oTBDBpbluNBM9ke3sowWfy8RO+UQjI4Nsx4lotbhtVlsbmyK70qUynZ2/9T2i4X8uDL2QHmiRxeqL6zCE8GazdX//dWyX9mjS9GNW9T2/UImp6v0U4UbWntr7W5M0QO53AuCwAhYGBwORx1eyYl5xGVoKFdekcKgUBvu+DSeOvaijO4jk9xDn3bJcyqgvVdJUqsDpR6vIcwVdjz8Nk3TveZx3tR9fwSs2FXsdG9XrmXJHfpQjvgCIj7Zn6kTeDg6GOKyff2JeNV5yvXKPz5phuVvdTaPNuLSKSRXISqZsJdNObXjkWvtwdbwt1f3XbxkrsX1e6f8AU1O4vb6MpQRDbyUEGVVD+UhvJdY8nYgq49Nn8FpyMKSwoWBgQJOAIiLHu9X0n6XRVeMb6jJTY7sWIiVBpqE9D+fN2fTO0RmnQzN97S63EgtrTSLpV+XGp9qRXJQPScA63AYhx8arrHwL+fd1UTavgfWspfNA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+MQ1WpJ9s4jGSA+XPcq0K X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1eadfed7-293d-43e0-dbca-08da6ee5e50b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2022 09:04:49.8328 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: il/m7bneQiHSFy1YUGdghbjk9u4lp7q31KUAJybdhK79IOQjHv+QoV3uqRr4PrXOOrb33uuJ71tzptssyZjMKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4344 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220726_020508_105884_A1B0A5FD X-CRM114-Status: UNSURE ( 9.90 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In dynamic resolution change, streamoff and streamon on the capture queue may be called, the V4L2_DEC_CMD_STOP cmd may be called before driver parsed the jpeg header. don't clear the stop state in streamoff of handling the dynamic resolution change, otherwise the drain may not complete. Fixes: 4911c5acf9351 ("media: imx-jpeg: Implement drain using v4l2-mem2mem helpers") Signed-off-by: Ming Qian --- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index fd5a65e577f4..ec13394bdddd 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -1278,7 +1278,8 @@ static void mxc_jpeg_stop_streaming(struct vb2_queue *q) v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR); } - v4l2_m2m_update_stop_streaming_state(ctx->fh.m2m_ctx, q); + if (V4L2_TYPE_IS_OUTPUT(q->type) || !ctx->source_change) + v4l2_m2m_update_stop_streaming_state(ctx->fh.m2m_ctx, q); if (V4L2_TYPE_IS_OUTPUT(q->type) && v4l2_m2m_has_stopped(ctx->fh.m2m_ctx)) { notify_eos(ctx);