Message ID | 20221102131500.476024-7-eugen.hristev@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3613664wru; Wed, 2 Nov 2022 06:18:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6PqhLipOR2CtzDEjgh2jneNdGhFjDyk8Pog8tgcMRoo5hTmRcgUpCV0/iKFaLn+fiQ7qlg X-Received: by 2002:a17:907:1c01:b0:79d:637c:7848 with SMTP id nc1-20020a1709071c0100b0079d637c7848mr24175031ejc.513.1667395110623; Wed, 02 Nov 2022 06:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667395110; cv=none; d=google.com; s=arc-20160816; b=qU9Krq3G+lHphZo91DDqtekJVdN4xF1p0ZO0eiHCFcTmknpeF0jI8/8cBACQgvy1vU qvXfeeEwQ+QCZkgonPqZGj6tZ0n54bnkHaZcvmHRDXGZjORw9j3sa5XLShn6o3n0nGf9 RH1AN7PwpV9nZY1lyhV85RlhzOukb5k/DcgUNPoeSqxicDY3dxzpK/R1k13MDHMFW6o6 046z18XwZGRbgqps9qOtKMMEpK1MM/WBvm52c6Q7ChuV3lOh+tbvdHVD9hu10ouojbr9 qJRxsCg77A2fdiy1SUG3aM1bVOHK+qxaJvn8YV6v0V+JIxuzJ1jiBVhdaN5jUoH8ufan DJdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IcNMPPxcAHGcz09BYSwTP2wH6Iwc89OEjb4RJfzJdG8=; b=EEJdccfgZEShfJuSpp15Kxx/cOy6h9IsMBOUU+gNZIGavhDN4G9x7zAMDnTbtBFooJ 0TqLtB0dpe4uQrMLGUF2v/PnxlaujPXTD4K+UNwsilkPgUAfqOyUKaBrhJrz0U88ZKyj 33+PZ4IjI5+st6HCKagAMrx/IJiksyQbe58WN0MHqIVMwwmtTuVfi8PIfEgrB763lpJk smPcllnzRjkJy5jx/MA6z6BIy/PgWPAyEyl+N2Q8joNST//9YyWgW6GuSdM0fSF/ZByj R6VEoVlEQk9/8Hi2rds4e0ww3mDSE6u2ACcuXAShIl/7POXgDosvuQxyy3887uutqlRl EFcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="2qV/jK2S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du12-20020a17090772cc00b00781df71dbc1si17518497ejc.174.2022.11.02.06.18.07; Wed, 02 Nov 2022 06:18:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="2qV/jK2S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbiKBNQS (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Wed, 2 Nov 2022 09:16:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbiKBNPo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Nov 2022 09:15:44 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE2712AC69; Wed, 2 Nov 2022 06:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667394938; x=1698930938; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cOD+lDlaA4B/ArMiUay7i5XoiBIAeb6MV0seZdHgvxg=; b=2qV/jK2S4DKPgsxpl6E/zqXJXLZ0W8lrxmMlmmLwy3CAdHYbpkpurIRy 3PRk0QMdmsGMxG55GQQNpE0dHxv5ZDyBPpUolaujfQmAEx22dAV+4D9DA 2oeGjxCK4LLXd1RpgPml9gmAEmrU5QAzxnBK5WAazAdzMj1WJgXeRmGpw uYXDJgQwYJQv/sYgJ2T/N5g1x4GaHmAUgU/aOmg3qoVfptnQJ513Xm1mR 4VNbJQoX5maPco43KkCsVyMr19LbYHSAOZjuPJ29gPKVNcXLwpYIWWhrJ KTzbjHpT+IfDnkAcWLVtubY4LoaIwrIyvdyDrhVViDAs7fjNaokuA6eZx w==; X-IronPort-AV: E=Sophos;i="5.95,234,1661842800"; d="scan'208";a="185022392" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Nov 2022 06:15:37 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Wed, 2 Nov 2022 06:15:38 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Wed, 2 Nov 2022 06:15:36 -0700 From: Eugen Hristev <eugen.hristev@microchip.com> To: <linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>, <hverkuil-cisco@xs4all.nl>, <jacopo@jmondi.org> CC: <linux-arm-kernel@lists.infradead.org>, <linux-staging@lists.linux.dev>, Eugen Hristev <eugen.hristev@microchip.com> Subject: [PATCH v11 6/6] media: microchip: microchip-isc: move media_pipeline_* to (un)prepare cb Date: Wed, 2 Nov 2022 15:15:00 +0200 Message-ID: <20221102131500.476024-7-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221102131500.476024-1-eugen.hristev@microchip.com> References: <20221102131500.476024-1-eugen.hristev@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748390495429419472?= X-GMAIL-MSGID: =?utf-8?q?1748390495429419472?= |
Series |
media: atmel: atmel-isc: driver redesign
|
|
Commit Message
Eugen Hristev
Nov. 2, 2022, 1:15 p.m. UTC
Move the media_pipeline_start/stop calls from start/stop streaming to
the new prepare_streaming and unprepare_streaming callbacks.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
.../platform/microchip/microchip-isc-base.c | 27 ++++++++++++-------
1 file changed, 17 insertions(+), 10 deletions(-)
Comments
Hi Eugen, I love your patch! Perhaps something to improve: [auto build test WARNING on media-tree/master] [also build test WARNING on sailus-media-tree/streams soc/for-next linus/master v6.1-rc3 next-20221102] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Eugen-Hristev/media-atmel-atmel-isc-driver-redesign/20221102-211809 base: git://linuxtv.org/media_tree.git master patch link: https://lore.kernel.org/r/20221102131500.476024-7-eugen.hristev%40microchip.com patch subject: [PATCH v11 6/6] media: microchip: microchip-isc: move media_pipeline_* to (un)prepare cb config: sparc-allyesconfig compiler: sparc64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/1a1878d4c57910ecb143eaf6056fbbac80c29027 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Eugen-Hristev/media-atmel-atmel-isc-driver-redesign/20221102-211809 git checkout 1a1878d4c57910ecb143eaf6056fbbac80c29027 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash drivers/media/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): drivers/media/platform/microchip/microchip-isc-base.c:480:10: error: 'const struct vb2_ops' has no member named 'prepare_streaming'; did you mean 'start_streaming'? 480 | .prepare_streaming = isc_prepare_streaming, | ^~~~~~~~~~~~~~~~~ | start_streaming drivers/media/platform/microchip/microchip-isc-base.c:480:35: error: initialization of 'void (*)(struct vb2_buffer *)' from incompatible pointer type 'int (*)(struct vb2_queue *)' [-Werror=incompatible-pointer-types] 480 | .prepare_streaming = isc_prepare_streaming, | ^~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/microchip/microchip-isc-base.c:480:35: note: (near initialization for 'isc_vb2_ops.buf_request_complete') drivers/media/platform/microchip/microchip-isc-base.c:481:10: error: 'const struct vb2_ops' has no member named 'unprepare_streaming'; did you mean 'start_streaming'? 481 | .unprepare_streaming = isc_unprepare_streaming, | ^~~~~~~~~~~~~~~~~~~ | start_streaming >> drivers/media/platform/microchip/microchip-isc-base.c:481:35: warning: excess elements in struct initializer 481 | .unprepare_streaming = isc_unprepare_streaming, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/microchip/microchip-isc-base.c:481:35: note: (near initialization for 'isc_vb2_ops') cc1: some warnings being treated as errors vim +481 drivers/media/platform/microchip/microchip-isc-base.c 471 472 static const struct vb2_ops isc_vb2_ops = { 473 .queue_setup = isc_queue_setup, 474 .wait_prepare = vb2_ops_wait_prepare, 475 .wait_finish = vb2_ops_wait_finish, 476 .buf_prepare = isc_buffer_prepare, 477 .start_streaming = isc_start_streaming, 478 .stop_streaming = isc_stop_streaming, 479 .buf_queue = isc_buffer_queue, 480 .prepare_streaming = isc_prepare_streaming, > 481 .unprepare_streaming = isc_unprepare_streaming, 482 }; 483
Hi Eugen, I love your patch! Yet something to improve: [auto build test ERROR on media-tree/master] [also build test ERROR on sailus-media-tree/streams soc/for-next linus/master v6.1-rc3 next-20221102] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Eugen-Hristev/media-atmel-atmel-isc-driver-redesign/20221102-211809 base: git://linuxtv.org/media_tree.git master patch link: https://lore.kernel.org/r/20221102131500.476024-7-eugen.hristev%40microchip.com patch subject: [PATCH v11 6/6] media: microchip: microchip-isc: move media_pipeline_* to (un)prepare cb config: s390-allyesconfig compiler: s390-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/1a1878d4c57910ecb143eaf6056fbbac80c29027 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Eugen-Hristev/media-atmel-atmel-isc-driver-redesign/20221102-211809 git checkout 1a1878d4c57910ecb143eaf6056fbbac80c29027 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/media/platform/microchip/microchip-isc-base.c:480:10: error: 'const struct vb2_ops' has no member named 'prepare_streaming'; did you mean 'start_streaming'? 480 | .prepare_streaming = isc_prepare_streaming, | ^~~~~~~~~~~~~~~~~ | start_streaming >> drivers/media/platform/microchip/microchip-isc-base.c:480:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] 480 | .prepare_streaming = isc_prepare_streaming, | ^~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/microchip/microchip-isc-base.c:480:35: note: (near initialization for 'isc_vb2_ops') drivers/media/platform/microchip/microchip-isc-base.c:480:35: error: initialization of 'void (*)(struct vb2_queue *)' from incompatible pointer type 'int (*)(struct vb2_queue *)' [-Werror=incompatible-pointer-types] drivers/media/platform/microchip/microchip-isc-base.c:480:35: note: (near initialization for 'isc_vb2_ops.wait_finish') drivers/media/platform/microchip/microchip-isc-base.c:480:35: warning: initialized field overwritten [-Woverride-init] drivers/media/platform/microchip/microchip-isc-base.c:480:35: note: (near initialization for 'isc_vb2_ops.wait_finish') drivers/media/platform/microchip/microchip-isc-base.c:481:10: error: 'const struct vb2_ops' has no member named 'unprepare_streaming'; did you mean 'start_streaming'? 481 | .unprepare_streaming = isc_unprepare_streaming, | ^~~~~~~~~~~~~~~~~~~ | start_streaming drivers/media/platform/microchip/microchip-isc-base.c:481:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] 481 | .unprepare_streaming = isc_unprepare_streaming, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/microchip/microchip-isc-base.c:481:35: note: (near initialization for 'isc_vb2_ops') drivers/media/platform/microchip/microchip-isc-base.c:481:35: error: initialization of 'int (*)(struct vb2_buffer *)' from incompatible pointer type 'void (*)(struct vb2_queue *)' [-Werror=incompatible-pointer-types] drivers/media/platform/microchip/microchip-isc-base.c:481:35: note: (near initialization for 'isc_vb2_ops.buf_init') cc1: some warnings being treated as errors vim +480 drivers/media/platform/microchip/microchip-isc-base.c 471 472 static const struct vb2_ops isc_vb2_ops = { 473 .queue_setup = isc_queue_setup, 474 .wait_prepare = vb2_ops_wait_prepare, 475 .wait_finish = vb2_ops_wait_finish, 476 .buf_prepare = isc_buffer_prepare, 477 .start_streaming = isc_start_streaming, 478 .stop_streaming = isc_stop_streaming, 479 .buf_queue = isc_buffer_queue, > 480 .prepare_streaming = isc_prepare_streaming, 481 .unprepare_streaming = isc_unprepare_streaming, 482 }; 483
Hi Eugen, I love your patch! Yet something to improve: [auto build test ERROR on media-tree/master] [also build test ERROR on sailus-media-tree/streams soc/for-next linus/master v6.1-rc3 next-20221102] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Eugen-Hristev/media-atmel-atmel-isc-driver-redesign/20221102-211809 base: git://linuxtv.org/media_tree.git master patch link: https://lore.kernel.org/r/20221102131500.476024-7-eugen.hristev%40microchip.com patch subject: [PATCH v11 6/6] media: microchip: microchip-isc: move media_pipeline_* to (un)prepare cb config: mips-allyesconfig compiler: mips-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/1a1878d4c57910ecb143eaf6056fbbac80c29027 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Eugen-Hristev/media-atmel-atmel-isc-driver-redesign/20221102-211809 git checkout 1a1878d4c57910ecb143eaf6056fbbac80c29027 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/media/platform/microchip/microchip-isc-base.c:480:10: error: 'const struct vb2_ops' has no member named 'prepare_streaming'; did you mean 'start_streaming'? 480 | .prepare_streaming = isc_prepare_streaming, | ^~~~~~~~~~~~~~~~~ | start_streaming drivers/media/platform/microchip/microchip-isc-base.c:480:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] 480 | .prepare_streaming = isc_prepare_streaming, | ^~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/microchip/microchip-isc-base.c:480:35: note: (near initialization for 'isc_vb2_ops') drivers/media/platform/microchip/microchip-isc-base.c:480:35: error: initialization of 'int (*)(struct vb2_queue *, unsigned int *, unsigned int *, unsigned int *, struct device **)' from incompatible pointer type 'int (*)(struct vb2_queue *)' [-Werror=incompatible-pointer-types] drivers/media/platform/microchip/microchip-isc-base.c:480:35: note: (near initialization for 'isc_vb2_ops.queue_setup') drivers/media/platform/microchip/microchip-isc-base.c:480:35: warning: initialized field overwritten [-Woverride-init] drivers/media/platform/microchip/microchip-isc-base.c:480:35: note: (near initialization for 'isc_vb2_ops.queue_setup') drivers/media/platform/microchip/microchip-isc-base.c:481:10: error: 'const struct vb2_ops' has no member named 'unprepare_streaming'; did you mean 'start_streaming'? 481 | .unprepare_streaming = isc_unprepare_streaming, | ^~~~~~~~~~~~~~~~~~~ | start_streaming drivers/media/platform/microchip/microchip-isc-base.c:481:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] 481 | .unprepare_streaming = isc_unprepare_streaming, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/microchip/microchip-isc-base.c:481:35: note: (near initialization for 'isc_vb2_ops') >> drivers/media/platform/microchip/microchip-isc-base.c:481:35: error: initialization of 'int (*)(struct vb2_buffer *)' from incompatible pointer type 'void (*)(struct vb2_queue *)' [-Werror=incompatible-pointer-types] drivers/media/platform/microchip/microchip-isc-base.c:481:35: note: (near initialization for 'isc_vb2_ops.buf_prepare') drivers/media/platform/microchip/microchip-isc-base.c:481:35: warning: initialized field overwritten [-Woverride-init] drivers/media/platform/microchip/microchip-isc-base.c:481:35: note: (near initialization for 'isc_vb2_ops.buf_prepare') cc1: some warnings being treated as errors vim +481 drivers/media/platform/microchip/microchip-isc-base.c 471 472 static const struct vb2_ops isc_vb2_ops = { 473 .queue_setup = isc_queue_setup, 474 .wait_prepare = vb2_ops_wait_prepare, 475 .wait_finish = vb2_ops_wait_finish, 476 .buf_prepare = isc_buffer_prepare, 477 .start_streaming = isc_start_streaming, 478 .stop_streaming = isc_stop_streaming, 479 .buf_queue = isc_buffer_queue, 480 .prepare_streaming = isc_prepare_streaming, > 481 .unprepare_streaming = isc_unprepare_streaming, 482 }; 483
diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c index 00651c313e9d..eed96e2a6a00 100644 --- a/drivers/media/platform/microchip/microchip-isc-base.c +++ b/drivers/media/platform/microchip/microchip-isc-base.c @@ -328,6 +328,13 @@ static int isc_configure(struct isc_device *isc) return isc_update_profile(isc); } +static int isc_prepare_streaming(struct vb2_queue *vq) +{ + struct isc_device *isc = vb2_get_drv_priv(vq); + + return media_pipeline_start(isc->video_dev.entity.pads, &isc->mpipe); +} + static int isc_start_streaming(struct vb2_queue *vq, unsigned int count) { struct isc_device *isc = vb2_get_drv_priv(vq); @@ -336,10 +343,6 @@ static int isc_start_streaming(struct vb2_queue *vq, unsigned int count) unsigned long flags; int ret; - ret = media_pipeline_start(isc->video_dev.entity.pads, &isc->mpipe); - if (ret) - goto err_pipeline_start; - /* Enable stream on the sub device */ ret = v4l2_subdev_call(isc->current_subdev->sd, video, s_stream, 1); if (ret && ret != -ENOIOCTLCMD) { @@ -389,9 +392,6 @@ static int isc_start_streaming(struct vb2_queue *vq, unsigned int count) v4l2_subdev_call(isc->current_subdev->sd, video, s_stream, 0); err_start_stream: - media_pipeline_stop(isc->video_dev.entity.pads); - -err_pipeline_start: spin_lock_irqsave(&isc->dma_queue_lock, flags); list_for_each_entry(buf, &isc->dma_queue, list) vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_QUEUED); @@ -401,6 +401,14 @@ static int isc_start_streaming(struct vb2_queue *vq, unsigned int count) return ret; } +static void isc_unprepare_streaming(struct vb2_queue *vq) +{ + struct isc_device *isc = vb2_get_drv_priv(vq); + + /* Stop media pipeline */ + media_pipeline_stop(isc->video_dev.entity.pads); +} + static void isc_stop_streaming(struct vb2_queue *vq) { struct isc_device *isc = vb2_get_drv_priv(vq); @@ -430,9 +438,6 @@ static void isc_stop_streaming(struct vb2_queue *vq) if (ret && ret != -ENOIOCTLCMD) v4l2_err(&isc->v4l2_dev, "stream off failed in subdev\n"); - /* Stop media pipeline */ - media_pipeline_stop(isc->video_dev.entity.pads); - /* Release all active buffers */ spin_lock_irqsave(&isc->dma_queue_lock, flags); if (unlikely(isc->cur_frm)) { @@ -472,6 +477,8 @@ static const struct vb2_ops isc_vb2_ops = { .start_streaming = isc_start_streaming, .stop_streaming = isc_stop_streaming, .buf_queue = isc_buffer_queue, + .prepare_streaming = isc_prepare_streaming, + .unprepare_streaming = isc_unprepare_streaming, }; static int isc_querycap(struct file *file, void *priv,