Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp655943pxa; Wed, 19 Aug 2020 11:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6KjGMaA4WncDG8z3ISSjo0zwba7kf1t9Can647Ro3P7ijZ1p4it4zmY5nkBaY9q3OeLc2 X-Received: by 2002:a05:6402:1545:: with SMTP id p5mr25094058edx.388.1597860527533; Wed, 19 Aug 2020 11:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597860527; cv=none; d=google.com; s=arc-20160816; b=voj4anhVnvNHVuYY50IBGMz4pEXNG83h3FgrjpflOfjNNF5hjlA9p8eEBgEvQc8e+Q su3J7YLy1GXjdMJ53FGcZQtkRBl5Gpf8F2+iol447YnPorys6uyG0ZhQFV9KNGedBTIp VS5FLINtgkZraUpdwLp28OcwVm2AatxPYF3zoqdQzf1MDazGcZbAJjrLy8NoQvb7E6h9 JWqN+7v2Mol9vUIkNMbi18C007SYyK/PvttNLY5JDygfehYOgZWDPmkVqi/Yt2PDW8ZX 2im4UCQwjI+Uw7FqZAOIu5BejChG37Tn0yb+rDmxg16U4thvHNoIxBSH4ZqmPwTqevWE Ic2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=I7Vn+tJdn/z3Gni7/IFrsXgR9xBszu9wFJcFR8d7t7c=; b=t7a/FYP9OeP93WeTEPrMDTRXw9/WG0NQN3/EkQWrW25ukAMj4whaztSSyxWd1LL0Kf 80eAaoZlJLcOdeuL74n1b6vF2y0OoZ5QYvR/eA4Vbhk1HZrw+VyAZLHIyVaFGnR5CsU+ mne//zSrKi98gWQioxeyTvkeo5134ebyPzvITPfDJOooAEQ8eF12GdRvOuKmchW7Ag1k k/p61FMKGu/CnXr4VvN5KjWa/yrEHdXfhB/GV9i9jzRDkd/+u6l12N/nIDhS9PQywEAq XLysThUYhLmDgV+ySSNZ7zjsRSPDN1R4WCNKmXtv7mZI2gN/s7aytR1POd2Sa5pvbvOv /3kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=DAYZaEy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=iitr.ac.in Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si16788749ejr.637.2020.08.19.11.08.23; Wed, 19 Aug 2020 11:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=DAYZaEy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=iitr.ac.in Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727046AbgHSSFs (ORCPT + 99 others); Wed, 19 Aug 2020 14:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbgHSSFn (ORCPT ); Wed, 19 Aug 2020 14:05:43 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED83FC061757 for ; Wed, 19 Aug 2020 11:05:42 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id r4so11203790pls.2 for ; Wed, 19 Aug 2020 11:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I7Vn+tJdn/z3Gni7/IFrsXgR9xBszu9wFJcFR8d7t7c=; b=DAYZaEy86+xUJSGKApxyGOw1UJsAyjFkzMLM5tSg7n2TcH2yRwDqVl0cjq3+FBqSA1 /rnPQh63tAwDge5VU8SR1vv0qKuje10IoqObeSEiAz3siLzce6e+Cv7UL0XNeFhzAEaw dinBxzAhcZlbdv8B+vDAnpD97Oefe7d4exSRz4g9obzEdBPXx7xwCdDFm5KqSZLjNSKv qBAxfA+xiMm4NugXUax/c5nuyBeszPMMostAdQcq0txo9xXH//20g6guUIAUQVqyZjlJ +KW1RCsZyNtyrSF4NnKa9U/sslH+g8I8H9x45oXuBDQCguoObxbsPVhoEwTGpmZ9MrnV q/Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=I7Vn+tJdn/z3Gni7/IFrsXgR9xBszu9wFJcFR8d7t7c=; b=k3HWJxxguVMMwvZE8NI3dKJQOr5AXIv2+VDQXBK/J/jes6UcAvo8Vcwb95fVKVSclK l3nmFxLYW8cfMXXW9VzHK0NjBaTi8xfFILcyAZXXxFxmWKXyT/nnxdL0uRjm0CcrkVyS WnEsSfjMpYLywK4qa8qaFpvqLdclorYYYb4/tVF0WgQL0sys1Kkm2vkQMIMLS21j4DJR Kis0/UjCVJQg/4X+TOkETRg/958c3C9vZpq6Jn7w4pDKoz9GwriYkkJLtWTgWOfdRHlF pRYxL5iIN2PIm9f+fl8tYz5YqXqIShmHjnCXpoNK73lfmsO6Nb8pUFPS0PXZu4vR8ehw 8WVA== X-Gm-Message-State: AOAM5338v/hi5sU4lyWEjGdWfOySWnUSEqTIR3x6GsZ7IsTboSuY009a pZxRToab5H7fsp2BcRePG97HTQ== X-Received: by 2002:a17:902:8504:: with SMTP id bj4mr192134plb.231.1597860342514; Wed, 19 Aug 2020 11:05:42 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.179]) by smtp.gmail.com with ESMTPSA id q2sm28843271pff.107.2020.08.19.11.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 11:05:42 -0700 (PDT) From: Kaaira Gupta To: Helen Koike , Shuah Khan , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Cc: Kaaira Gupta Subject: [PATCH v3 9/9] media: vimc: Run multiple captures on same thread Date: Wed, 19 Aug 2020 23:34:42 +0530 Message-Id: <20200819180442.11630-10-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200819180442.11630-1-kgupta@es.iitr.ac.in> References: <20200819180442.11630-1-kgupta@es.iitr.ac.in> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If multiple captures try to enable stream, start their stream but do not initialise the pipeline again. Also, don't start the thread separately. Starting their streams will update the use count and their frames would be processed by the already running thread. Signed-off-by: Kaaira Gupta --- drivers/media/test-drivers/vimc/vimc-streamer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/test-drivers/vimc/vimc-streamer.c b/drivers/media/test-drivers/vimc/vimc-streamer.c index fade37bee26d..880c31759cc0 100644 --- a/drivers/media/test-drivers/vimc/vimc-streamer.c +++ b/drivers/media/test-drivers/vimc/vimc-streamer.c @@ -275,13 +275,14 @@ int vimc_streamer_s_stream(struct vimc_stream *stream, return ret; if (enable) { - if (stream->kthread) - return 0; ret = vimc_streamer_stream_start(ved); if (ret) goto out; + if (stream->kthread) + goto out; + ret = vimc_streamer_pipeline_init(stream, ved); if (ret) goto out; -- 2.17.1