Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4298410img; Tue, 26 Mar 2019 06:56:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAs533ysJ3l8JZ3ZQu+Nyf2vHHuJBcyGrhV4pn6b5vKdt4mqBNhOGn1lt3gj7b4QEdZ6K4 X-Received: by 2002:a17:902:f094:: with SMTP id go20mr8528143plb.159.1553608560564; Tue, 26 Mar 2019 06:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553608560; cv=none; d=google.com; s=arc-20160816; b=YcrYhCtg80+E0ZTj5xI0scWiC74w960htehwm0SontITZTEnvc0ZP/G6BpXOQIeSQl mmONMcawP737JLuDNC9RCmbg8XeNAut8W9OMTKHv5ZUfYzroLoCq+0EklaJF1pPWIq3+ wnMj/FtyKgpTl/Uf6/Lj9JUMgst5BOuOqoRRkBldDPXaaM97vnCIHSuUuU2sr4nh+s8j 9sPmJ5hCiMPgglmeYDvSA2JFyBmIYC52EKLKXAgqCS9Dn1o/zwEarK1nW0lak/8uYhPG LWuz6EP4oUjUJ2zZgnxoOaA2eTbEtNGPsGgTMA2vCWBTr3yN0Qd3TvsPcUwZbt4rWr9e idGQ== 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; bh=f2mrDHuwoU87IojD0fRA+3K8TvGtxkcXl4WRlANpl8A=; b=NYL7NHPZ1kmJ9s3IpdBcMWjWYf2jfEz3fkybjbM9GfN1u792kpmodUeLTz0T9ph+pA 64UBpBZrWiEVR7tg5fBNXktNWUJOnBtrV5Tadnkpy74Z7TU4WWCEhXvkXcWjdpYg8jQQ 7sIDaCL3sD1sJhgfWXg1YQXk94a69LqXTug7ZEmutJkAaHUpnAqKlpURnkN5m91aMbtx yn7fWm7uF5deLJ94Neuot+AgN/S0D2+uhh69eKYtYky9d4a+IYPAasVFfrzdNRRvSF9z gGwN2vo8xAStFDcU8p5sIrhmbkT+Jj0FwphjicGQBS2MQB1g8hL5ENUSmYejFi30tvvZ 0Heg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si7734289pgi.284.2019.03.26.06.55.45; Tue, 26 Mar 2019 06:56:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731656AbfCZNyr (ORCPT + 99 others); Tue, 26 Mar 2019 09:54:47 -0400 Received: from mga12.intel.com ([192.55.52.136]:49562 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfCZNyq (ORCPT ); Tue, 26 Mar 2019 09:54:46 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 06:54:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="286006541" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga004.jf.intel.com with ESMTP; 26 Mar 2019 06:54:40 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id C828A205E7; Tue, 26 Mar 2019 15:54:39 +0200 (EET) Date: Tue, 26 Mar 2019 15:54:39 +0200 From: Sakari Ailus To: Mickael GUENE Cc: "linux-media@vger.kernel.org" , Hugues FRUCHET , Mauro Carvalho Chehab , Matt Ranostay , Petr Cvek , Akinobu Mita , "linux-kernel@vger.kernel.org" , "David S. Miller" , Ben Kao , Nicolas Ferre , Todor Tomov , Rui Miguel Silva , Greg Kroah-Hartman , Hans Verkuil , Ricardo Ribalda Delgado , Jacopo Mondi , Tianshu Qiu , Bingbu Cao Subject: Re: [PATCH v3 2/2] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver Message-ID: <20190326135439.oju2k6idndjaulfj@paasikivi.fi.intel.com> References: <1552373045-134493-1-git-send-email-mickael.guene@st.com> <1553594620-88280-1-git-send-email-mickael.guene@st.com> <1553594620-88280-3-git-send-email-mickael.guene@st.com> <20190326113308.mp5hqdw3ktbpcawu@paasikivi.fi.intel.com> <9c8fb935-5c67-d4aa-d0ba-2aae0edd2b55@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c8fb935-5c67-d4aa-d0ba-2aae0edd2b55@st.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mickael, On Tue, Mar 26, 2019 at 12:57:03PM +0000, Mickael GUENE wrote: ... > >> +static int mipid02_set_fmt(struct v4l2_subdev *sd, > >> + struct v4l2_subdev_pad_config *cfg, > >> + struct v4l2_subdev_format *format) > >> +{ > >> + struct v4l2_mbus_framefmt *mbus_fmt = &format->format; > >> + struct mipid02_dev *bridge = to_mipid02_dev(sd); > >> + struct i2c_client *client = bridge->i2c_client; > >> + struct v4l2_mbus_framefmt *fmt; > >> + int ret; > >> + > >> + dev_dbg(&client->dev, "%s for %d", __func__, format->pad); > >> + > >> + if (format->pad >= MIPID02_PAD_NB) > >> + return -EINVAL; > >> + /* second CSI-2 pad not yet supported */ > >> + if (format->pad == 1) > >> + return -EINVAL; > >> + > >> + mutex_lock(&bridge->lock); > >> + > >> + if (bridge->streaming) { > >> + ret = -EBUSY; > >> + goto error; > >> + } > >> + > >> + if (format->which == V4L2_SUBDEV_FORMAT_TRY) > >> + fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); > >> + else > >> + fmt = &bridge->fmt; > >> + > >> + *fmt = *mbus_fmt; > > > > What are the limits of the hardware regarding the size of the image? Aren't > > there any? > > > There are no limits for image size. > > The format on the sink pad needs to be propagated to the source pad as > > well. I presume there's nothing to set on the sink pad for this device, is > > there? > User only need to set format code so the driver can configure hardware. > In the mipid02 we have always the same format for sink and source. So I > only store one configuration during set_fmt when called from either pad0 > (sink) or pad2 (source). Is it the correct way to implement it ? or > should I only accept set_fmt on pad0 ? > For get_fmt I return stored configuration for pad0 and pad2. Only 76 or so characters per line, please. For pad 0 (sink) the format must be settable freely (as you don't have any hardware restrictions) and on the pad 2 (source) the driver converts the format set on the pad 0 according to the hardware functionality. This is what the link validation from the source pad onwards is based on. -- Regards, Sakari Ailus sakari.ailus@linux.intel.com