Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp379454imm; Wed, 11 Jul 2018 04:14:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfvL5qxHjsy4V2pW5hO57hrqPjrQM0oHnu1P5t6ymN8mhFuuaWrKuZk9a2XxFfqHYnDpZV7 X-Received: by 2002:a17:902:8607:: with SMTP id f7-v6mr28500207plo.138.1531307656230; Wed, 11 Jul 2018 04:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531307656; cv=none; d=google.com; s=arc-20160816; b=OMvhOBFaZfRMh8fr7zRkqDa8Th7jHx0x403o/nYUXkTMapdo1NBL9xp7x+zxni5G9b xifQaEtKn4C+JIzk0EysfVSg8sHkq2vNazpBxWA73Hv0+YmrJpY3GV4MmHe61pFzxCAR 0LbuuDlyIvXSxJyM3+QwJLxw+iW49NuxMjUh8S+RZbPpbqE5J25MfCsc7FUqskdXdpP2 MdnKBpS/oYlevOilwVn4D/FnGNmue7AAZiT1NwhwVMhS0pBVlMtzg70xVbNwhJyD1umj F2DdUcUnXDDA002t+D/+Vq8YnOflifcXp/qnIt5+xz/Vb3Y3QyeY7zG1mstdIxzO83cg NOEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=+JuXkINzjdGUjTGbSQb3iDLjJ3eVWwZwJn0ZLDWER+I=; b=bYbs/NcqbJHowfnGmsUhXZTCNg5sbXXhRcdLE5x7Rvk/M6Lwvahozrhfka6ydZio/a E5uwXBtB0/p0NyOjFa+CRD4RMWV5/B7NdeuaoQTKH2BmXUhk+f+WN/Rod7VAWMfQaJ/X FIPFOZhm/8ukVIRJTy6c8svtx14sL+3KOx98fa+4FqcVNwZSeqDIcdMDAAc/VKkNd+P8 Wri2Sp30jhOa8l86F5H0Hv//ThV4D9P28UYO+QseeS3bhw2s9H4rlBVOQ6OctK2RHjN5 3a6pNy2oK8FDuEthkX39dsmRo/PmonJMirTAq3Ofe9pEkYB73jUbTO4XwZq+HHmbUoKn /MmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14-v6si18384698plo.357.2018.07.11.04.14.01; Wed, 11 Jul 2018 04:14:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732629AbeGKLQc (ORCPT + 99 others); Wed, 11 Jul 2018 07:16:32 -0400 Received: from mail.bootlin.com ([62.4.15.54]:47510 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732387AbeGKLQb (ORCPT ); Wed, 11 Jul 2018 07:16:31 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 5366B20775; Wed, 11 Jul 2018 13:12:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AAubervilliers-681-1-12-56.w90-88.abo.wanadoo.fr [90.88.133.56]) by mail.bootlin.com (Postfix) with ESMTPSA id 236BB207AD; Wed, 11 Jul 2018 13:12:31 +0200 (CEST) Date: Wed, 11 Jul 2018 13:12:30 +0200 From: Maxime Ripard To: Yong Cc: Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Chen-Yu Tsai , "David S. Miller" , Greg Kroah-Hartman , Andrew Morton , Linus Walleij , Randy Dunlap , Hans Verkuil , Arnd Bergmann , Sakari Ailus , Stanimir Varbanov , Philipp Zabel , Ramesh Shanmugasundaram , Jacob Chen , Yannick Fertre , Thierry Reding , Benjamin Gaignard , Todor Tomov , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v10 2/2] media: V3s: Add support for Allwinner CSI. Message-ID: <20180711111230.gpv7ww2nhaha5hou@flea> References: <1525417745-37964-1-git-send-email-yong.deng@magewell.com> <20180626110821.wkal6fcnoncsze6y@valkosipuli.retiisi.org.uk> <20180705154802.03604f156709be11892b19c0@magewell.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wbnyxjafmaafjrkv" Content-Disposition: inline In-Reply-To: <20180705154802.03604f156709be11892b19c0@magewell.com> User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --wbnyxjafmaafjrkv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Sakari, On Thu, Jul 05, 2018 at 03:48:02PM +0800, Yong wrote: > > > + > > > +/* -----------------------------------------------------------------= ------------ > > > + * Media Operations > > > + */ > > > +static int sun6i_video_formats_init(struct sun6i_video *video, > > > + const struct media_pad *remote) > > > +{ > > > + struct v4l2_subdev_mbus_code_enum mbus_code =3D { 0 }; > > > + struct sun6i_csi *csi =3D video->csi; > > > + struct v4l2_format format; > > > + struct v4l2_subdev *subdev; > > > + u32 pad; > > > + const u32 *pixformats; > > > + int pixformat_count =3D 0; > > > + u32 subdev_codes[32]; /* subdev format codes, 32 should be enough */ > > > + int codes_count =3D 0; > > > + int num_fmts =3D 0; > > > + int i, j; > > > + > > > + pad =3D remote->index; > > > + subdev =3D media_entity_to_v4l2_subdev(remote->entity); > > > + if (subdev =3D=3D NULL) > > > + return -ENXIO; > > > + > > > + /* Get supported pixformats of CSI */ > > > + pixformat_count =3D sun6i_csi_get_supported_pixformats(csi, &pixfor= mats); > > > + if (pixformat_count <=3D 0) > > > + return -ENXIO; > > > + > > > + /* Get subdev formats codes */ > > > + mbus_code.pad =3D pad; > > > + mbus_code.which =3D V4L2_SUBDEV_FORMAT_ACTIVE; > > > + while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, > > > + &mbus_code)) { > >=20 > > The formats supported by the external sub-device may depend on horizont= al > > and vertical flipping. You shouldn't assume any particular configuration > > here: instead, bridge drivers generally just need to make sure the form= ats > > match in link validation when streaming is started. At least the CSI-2 > > receiver driver and the DMA engine driver (video device) should check t= he > > configuration is valid. See e.g. the IPU3 driver: > > drivers/media/pci/intel/ipu3/ipu3-cio2.c . >=20 > Can mbus_code be added dynamically ? > The code here only enum the mbus code and get the possible supported > pairs of pixformat and mbus by SoC. Not try to check if the formats > (width height ...) is valid or not. The formats validation will be=20 > in link validation when streaming is started as per your advise.=20 Can you reply to this so that Yong has a chance to resubmit his serie before the 4.19 merge window starts? Or alternatively, is this something we can fix later on, once it's merged? Thanks! Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --wbnyxjafmaafjrkv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAltF5gwACgkQ0rTAlCFN r3TWNw/+KtCfTkV+mWO7syASSLV3TlKy+Uac+vNGvjw9EqP+7JKvxvosSriQMs8D Q2CFOLZam7c0+oTqMl8t+QXkW0Z2B54akBlcAGa2hSAd01mquQ3nEzI/BJlMx2Sm 0N9G2QQO4u440h2Nzi2wvEfj30Qc7P6x5dpir8vAlXYU870JRTPnUOIMwGZRn/a8 ZhBJ6TSxn572FFkyC7IcPWJBuCY8ZaJlGiiriIpF6MKq57WIDqyQ7lIT5zxbtry3 x68EPuGyRrjSaWcM08RVzjnVNEtNH9C2bN1WvjRldE00PmYJxLiskCOVN+ZHHrLE qNbRDGJOG1yMwSaRPEFJxs0bb7/lsmRZgsA7ZUnuTrLZnLIfe7vbfnBdTDcOgCxG cO/1kH/ub5l81UqPgGUjg5Q0ZohurUd5BzmUoR/x9EutW21m1rHLaJB/CYYaB37a pT+xKktQpFO5GLQDLKK2qsUw0jtv8WiL5PRsi8dnCHfGHUH1YUZ5RiCXZ5BBX4+2 giIlT91cIWKIcBsRdDfDAS9AMfAXiNS47VdFlb6rcXFBLQ/cK9LItSuLKc7yXVcS OJGoQPt8m985lFwIGIpZ8KLzsupee3gbvHy8RCvAdhGM6sdCi6SnZ0O8b1/86pMM OZGXDI9bfwI1vU4azLEoKBHe5x6GSkjhF8amdyPMUMrDZLw4Slo= =NKp6 -----END PGP SIGNATURE----- --wbnyxjafmaafjrkv--