Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4317773img; Tue, 26 Mar 2019 07:14:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+AHDW2vyLzYfO6eGN8M+QdHm8+r6zqUL0Hc4iB6G6ceK+TAvFSsO7/oFeCwDGLVNwKZ3/ X-Received: by 2002:a17:902:b484:: with SMTP id y4mr23990025plr.88.1553609664168; Tue, 26 Mar 2019 07:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553609664; cv=none; d=google.com; s=arc-20160816; b=NKQtR4Vsr98LBZ8WUSx7KtOoL7LM4MjSID0ylgBe1PKuW7d9zdMpK0MUXU7k5DJSJC 9jms24MvxX4RqMo/FhiGaIAy4Hn7qm6HMqVzqYIcfpggIZH+J7e0+hD6YPaQK8yrZ67D oP9p04Furz76vLzIu1fRm6w6dCtgOqCNK9oKnSIp7Y7XlZ7rIqryW11ysEhm+WKEtvJc AGSA64zLY4/NcrvmqforHzAoYcD9jejzSElI3jPYnrrE7FzybMlKe55pHi50gq04mLGp j6U1ay1faW4kULt3NBlrZ2HyEKmweNEBTPboF+ejF92TMhLSyYrdnpIKZ2NAcxtjk6Ca Zong== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:user-agent:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from; bh=3X4lkMTlxiUI9LmhFEl8Xm1bMhUhLkqPoSSY61pibTI=; b=mzI9GFFTKXsZSZFk0p1ru+TCnCe5h8mIkHFGZZJgNJ7WaOVXWTOXPb8t8S0mmGQP8/ je6FtPo6TEUcVKevtDvJLbnOaodoAYEr5WKZDK/oKZuKh95/cI1bIm368kbHpAwTb8ai Na4bNDHpnTXR3qyIoFOueL240SuDsSycXul+7ign2x5e8UDA4iBm8C0tRufC/MeGM276 Yetk+1HK7Sa2j8yBtJaBVHN5ecRgJj7v3IYCpwHKBl4j3dZiUl2aygPaZbfhjVq5iolR DaZQGj3541RzXWh/gWGciuPsX7szjXFg0kyir844umWgEkWsPs4ddqFD4ke74ZpM/PlC P4Dg== 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 s35si16026534pgl.101.2019.03.26.07.14.08; Tue, 26 Mar 2019 07:14:24 -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 S1731664AbfCZONb convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Mar 2019 10:13:31 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:45288 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726285AbfCZONa (ORCPT ); Tue, 26 Mar 2019 10:13:30 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2QEBcUu029942; Tue, 26 Mar 2019 15:12:56 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2rf4ybvyjy-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 26 Mar 2019 15:12:56 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0770A49; Tue, 26 Mar 2019 14:12:53 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 66451A495; Tue, 26 Mar 2019 14:12:53 +0000 (GMT) Received: from SFHDAG5NODE3.st.com (10.75.127.15) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 26 Mar 2019 15:12:53 +0100 Received: from SFHDAG5NODE3.st.com ([fe80::7c09:5d6b:d2c7:5f47]) by SFHDAG5NODE3.st.com ([fe80::7c09:5d6b:d2c7:5f47%20]) with mapi id 15.00.1347.000; Tue, 26 Mar 2019 15:12:53 +0100 From: Mickael GUENE To: Sakari Ailus 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 Thread-Topic: [PATCH v3 2/2] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver Thread-Index: AQHU47s4T23daefrHk6Z36vjlaOK2qYdtyWAgAAXcYCAABAYgIAABRaA Date: Tue, 26 Mar 2019 14:12:52 +0000 Message-ID: <23f2f17c-7c3d-30c0-d191-1a5c7a4a2989@st.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> <20190326135439.oju2k6idndjaulfj@paasikivi.fi.intel.com> In-Reply-To: <20190326135439.oju2k6idndjaulfj@paasikivi.fi.intel.com> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.51] Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-26_10:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sakari, On 3/26/19 14:54, Sakari Ailus wrote: > 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. > So for a set_fmt on pad 2 I return current configuration ? (as in my case I have the same configuration for pad 0 and pad2) And I only update format when set_fmt is called for pad 0 ? Thanks for your help Rgs Mickael