Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp424074pxb; Fri, 29 Oct 2021 12:28:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9pewAcxAnTk4y5f6ruYLvw/avCoom524f/MbBvdtkjHScR8iZVocXNGPmKAc3bQDhREDe X-Received: by 2002:a05:6e02:1d9e:: with SMTP id h30mr2337434ila.138.1635535738455; Fri, 29 Oct 2021 12:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635535738; cv=none; d=google.com; s=arc-20160816; b=IMIudY5mhwIR4pu/bx4NFHm/2tsqGHZVeSPc0jwz6UpT8xCzmK1Yy1wLNnK/qmO5pS j4qrrFBmIIIbPaQ/m0dujpa0RghUwf3FPzofGof6ofzCpOGwuvso0Rn7Lf83+zmmnNVa 879WVwBRd9MxxtTeMMzaMLZMIffieNgPEI0rFmUSm+SSREkssel4flysMNDf0CcMBWVK ZyjQ4HFcH2T5+5QMhLYeCOHzJ9s4JxxaUql9hxEANTav0l6M5RkJi6kuKXEHtoeDCl0V Uom644p8UsXw923m7j2N5flPZWGzJQ8dhwjBvkRyom/kLHyfbr4YdWYTPMoF37V7scje V05A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:from:date :dkim-signature; bh=tohnL9e5qT9Z74SuXwFqgazIS/VhzqdFxOvz0Q9xv8g=; b=s3u3KzVaOdFcfxDhyFjTB265JYCzqSMu1sHwiOf6sMs+Yb1XjgKeD79zr7iEx3B+mP 3ENIUWOsrqvz6D+NdFuJSTLmOk/yjrt0sRUs9kBf7YuFjK1UUUvYKqiWoQElo9IHu2f/ N4wlG7a/FExML1xJw4FpmlV0pVB6F5NV1owy4kowOmiCuNFBfDWmYF0W+hW5b0jpI0Yi cNEWL8iNBqMfXJyBoJnAjZRcM2rysG2f8Vg+WSjh2/pAqulAnGJmID7Ui0QdOER8JGkv nBcXPNOq2RyLDkw/epK5JTpY8M/6ek7Pc6edr38WgJ63i7SKpIWUkr26rVMOXChdqAKC WKJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jXJ+MEO9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si9855805iow.21.2021.10.29.12.28.47; Fri, 29 Oct 2021 12:28:58 -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=@kernel.org header.s=k20201202 header.b=jXJ+MEO9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbhJ2T36 (ORCPT + 99 others); Fri, 29 Oct 2021 15:29:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:58370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbhJ2T3o (ORCPT ); Fri, 29 Oct 2021 15:29:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 991A560D07; Fri, 29 Oct 2021 19:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635535635; bh=wrlLeaQdneJCXxuP2usLUeHJCtlIqSI7Y3L+CH69mxU=; h=Date:From:Cc:Subject:In-Reply-To:References:From; b=jXJ+MEO9tauSPjIXg/9z5IS4SEDkwJbPc4i/XBxCCUOrF2VlDxvo59AETs6OfWLbN 03bgkgn1ZwDSwEeu5szeZGJVqIIK4Ln3yu1uJrDyxPpeli74+1iFZf3VuPTyhoNeWO YBmrtEMPi15YxRW7oMQphxzMV0pSEfv9gbeH2MV2KDPGs/OqwbHpSwKowO4cVRlZrd v9JYleR8pTx2wETYLVLORTVdIEfYVEEqRtI+AywcoI78zbnQGpBzy/rD7g21EfOY/V is+B7IXqRFEOFLooZulKzm9TKZ5fQlFa5HxySlXHf/cIFpjc7Gkh04af0eQnDTsKvX s5paGvJEmBBNw== Date: Fri, 29 Oct 2021 20:27:09 +0100 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Alan , Arnd Bergmann , Greg Kroah-Hartman , Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , Tomi Valkeinen , Tsuchiya Yuto , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 2/2] media: atomisp: set default mode Message-ID: <20211029202709.755b9a6b@sal.lan> In-Reply-To: <543e61dd07c90a7d8577b3a94696edc77953b9d8.1635497370.git.mchehab+huawei@kernel.org> References: <750e50daa3ed65a7eb060cb0eb5cfc60dc9386be.1635497370.git.mchehab+huawei@kernel.org> <543e61dd07c90a7d8577b3a94696edc77953b9d8.1635497370.git.mchehab+huawei@kernel.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, 29 Oct 2021 09:49:36 +0100 Mauro Carvalho Chehab escreveu: > Without setting a default mode at open(), applications that > don't call VIDIOC_SET_PARM with a custom atomisp parameters > won't work, as the pipeline won't be set: > > atomisp-isp2 0000:00:03.0: can't create streams > atomisp-isp2 0000:00:03.0: __get_frame_info 1600x1200 (padded to 0) returned -22 > > So, as an step to allow generic apps to use this driver, put > the device's run_mode in preview after open. > > After this patch, using v4l2grab starts to work: > > $ v4l2grab -D -f 'NV12' -x 1600 -y 1200 -d /dev/video2 -u > $ nvt/raw2pnm -x1600 -y1200 -f NV12 out017.raw out017.pnm > $ feh out017.pnm Added support for YUYV at v4l2grab (at contrib/test, under v4l-utils). The above can now be just: $ v4l2grab -f YUYV -x 1600 -y 1200 -d /dev/video2 -u $ feh out017.pnm (on a side note, the colorspace conversion from YUYV seems ackward, but this can be adjusted later on at the toolset and/or at atomisp) > > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/staging/media/atomisp/pci/atomisp_fops.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c > index 72cbdce2142a..7df982c80b1a 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c > @@ -893,6 +893,11 @@ static int atomisp_open(struct file *file) > else > pipe->users++; > rt_mutex_unlock(&isp->mutex); > + > + /* Ensure that a mode is set */ > + if (asd) > + v4l2_ctrl_s_ctrl(asd->run_mode, ATOMISP_RUN_MODE_PREVIEW); > + > return 0; > > css_error: