Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp84170rdb; Tue, 31 Oct 2023 01:05:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyjJCydrtcAQyxqsvEbNz2DnlcwW9zOPORo8Xk2bo8z0bmV6kpRCnQ7IHR4JrCTiCu3EtE X-Received: by 2002:a05:6a20:3956:b0:17f:66f7:e079 with SMTP id r22-20020a056a20395600b0017f66f7e079mr12379323pzg.19.1698739546867; Tue, 31 Oct 2023 01:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698739546; cv=none; d=google.com; s=arc-20160816; b=OVhnc2jWWKt7lYEwtkt3MyOlOtBfVXTQVsaRSNjwboKht3LVtN3+IhOBH+E9/rvOXX yObITZDQruyTylfLGbimpcONqkRuAN+C47w2KfRABpJhFHu+dR8J/1M6tWKzIp8bAL5O 3TZF3q9odkQlXEhEJKbHF8sd5f41B1Uf8NpyVU17xtktCVDp1MXcJAkrNSLQr/9z+o22 Vcag24aJ0Jdd0ixMpBub1wFG9dFUZwBdOKzkXG8VBR0KD10RiCuXRSjl3C3pwQXv4Y1A pYTeX544QhZoGHddeb8UJTjO9Kc7FKI9zUDCGu+xtbm6S7pQ4GRZ0wbVR3y1Ndd4Yg7F Jnwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=7fWeqrj4fHkMMshTS/C03FAM5xM7LY0U8+mhlJ753vE=; fh=kcArxxzO45gGGK1uWgfdwb3YeVfZ9w/EuQ4WqSve3ms=; b=SnHvT/DlxmE14nvsC/E8fEDbs9IQ4FAkNwvQFTBKQ1isLu4gMU6+EXoF56DpKo8MPg nEsTFQ4KSMkZnK+Vp53zLdK48a9GzL9xoAeuGCGls+vm2AAwnTsgqIsWbVog57Iy75Km 7OYKmc/avlrDQHk7Yk44xL77taKCnXGV5i0qGfzULtKV4o5qFj8g8TIPMyQ73u8asSHZ uDqrGRotkDEVpeaa+bFp1v5rhNcbMYnVXLboXLN7l0Ac8m0CtFqSe3CSAGiDeZVg2ed8 nhjLp+PWL+cieWJ+KuvlGb0ZqbQbppLoN8tLkU9gJ2rOo5wV6EfzFSdrIMfWUrR7LC0H alIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=aevNCxM0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id np11-20020a17090b4c4b00b00263eb5054f2si617736pjb.105.2023.10.31.01.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 01:05:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=aevNCxM0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C334C80294CF; Tue, 31 Oct 2023 01:05:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230478AbjJaIFm (ORCPT + 99 others); Tue, 31 Oct 2023 04:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjJaIFk (ORCPT ); Tue, 31 Oct 2023 04:05:40 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39798A6; Tue, 31 Oct 2023 01:05:38 -0700 (PDT) Received: from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1856F2E4; Tue, 31 Oct 2023 09:05:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698739520; bh=w9vKW6awM7gVSCcjD3dKnmahO/AjB/yzej+5UwO8HGs=; h=Date:From:To:Subject:References:In-Reply-To:From; b=aevNCxM0rTsyTLIVWnL3+UnDjot4cIif68kJ15nNKoKj1IAc5GPHT9S8JT1NsKseN tmf1SfR1JA4sGc28wsCfY/lEvLCJUQVOkj6k1iztqr5JiTzDeTQTSTLt56s5ss41Su 2U240XFsgkb7oqQenTZUS92+H5ps/y+N90P7prRk= Date: Tue, 31 Oct 2023 09:05:32 +0100 From: Jacopo Mondi To: Jacopo Mondi , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kieran Bingham , Rob Herring , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] media: i2c: gc2145: Galaxy Core GC2145 sensor support Message-ID: References: <20231011175735.1824782-1-alain.volmat@foss.st.com> <20231011175735.1824782-4-alain.volmat@foss.st.com> <20231030163711.GA2977022@gnbcxd0016.gnb.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231030163711.GA2977022@gnbcxd0016.gnb.st.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 01:05:45 -0700 (PDT) Hi Alain On Mon, Oct 30, 2023 at 05:37:11PM +0100, Alain Volmat wrote: > Hi Jacopo, > > On Mon, Oct 23, 2023 at 10:38:59AM +0200, Jacopo Mondi wrote: > > Hi Alain > > > > On Wed, Oct 11, 2023 at 07:57:30PM +0200, Alain Volmat wrote: > > > Addition of support for the Galaxy Core GC2145 XVGA sensor. > > > The sensor supports both DVP and CSI-2 interfaces however for > > > the time being only CSI-2 is implemented. > > > > > > Configurations is currently based on initialization scripts > > > coming from Galaxy Core and for that purpose only 3 static > > > resolutions are supported with static framerates. > > > - 640x480 (30fps) > > > - 1280x720 (30fps) > > > - 1600x1200 (20fps) > > > > Anything blocking having a writable VBLANK ? This is a YUV sensor but > > GC2145_REG_VBLANK seems to be writable. I don't want to push you to > > more work that what you actually need, but configurable blankings (and > > then frame durations) seems like an important feature ? (and if I > > recall right you want to use this sensor with libcamera, which will > > require blankings to be controllable (if the sensor supports any RAW > > format) > > No, nothing prevents to write the VBLANK register. I just did some > tests directly via rwmem into a running sensor and vertical blanking can > be updated, allowing to tune the framerate. > > > > > I don't see any RAW format being supported in this version. Is this > > something you plan to do on top ? > > Yes, absolutely, it is possible to output RAW formats as well however > this version of the driver doesn't support it yet. The plan is indeed > to add it on top of this. > Several things to be addressed on top of this serie: > - RAW format > - frame_interval vs H/V blank control. Is my understanding correct if > I say that if a sensor has RAW format (even if it ALSO has YUV / > RGB) then control is done via H/V blanking controls rather than > frame_interval ? I'll reply here to this question that is asked in a few other places. I can only point you to the ov5640 driver, which is capable of both YUV/RGB and RAW as this sensor is. The ov5640 driver supports both the g/s/enum_frame_interval and has writable blankings. I guess it's more for historical reasons, as when blankings have been made writable users of the frame_interval API would have been displeased if that interface went away. The resulting implementation is not nice, as changing vblank doesn't update the framerate reported through g_frame_interval, and keeping the two in sync is not trivial. I would suggest to go for writable blankings, and if you already plan to remove frame_interval then not add it in first place so there won't be displeased users. Sakari, Laurent, what's your opinion here ? > - parallel interface support > > > > > > [snip] > > > +/** > > > + * struct gc2145_format - GC2145 pixel format description > > > + * @code: media bus (MBUS) associated code > > > + * @colorspace: V4L2 colospace > > > + * @datatype: MIPI CSI2 data type > > > + * @output_fmt: GC2145 output format > > > + */ > > > +struct gc2145_format { > > > + unsigned int code; > > > + unsigned int colorspace; > > > + unsigned char datatype; > > > + unsigned char output_fmt; > > > +}; > > > + > > > +/* All supported formats */ > > > +static const struct gc2145_format supported_formats[] = { > > > + { > > > + .code = MEDIA_BUS_FMT_UYVY8_2X8, > > > > The driver supports CSI-2, the 1X16 format variants should be used for > > serial bus > > Yes. Doing this, this actually triggered big questioning since it seems > that the sensor, even in CSI, seems to be sending the RGB565 in > big-endian format ;-( I have just sent an email to GalaxyCore to clarify > this point however, once captured, I need to swap bytes in order to get > the right colors ;-( This is the reason why I used the RGB565_2X8_BE in > the first place and I believe this is correct for parallel mode, but my > understanding of the CSI formats makes me think that the sensor should > be sending the data differently. > I will wait for GalaxyCore reply before sending the v3. > Let's wait for GC to get back with more information then, it still feels weird that a CSI-2 compliant sensor sends data out in a way different from what is described in the spec.. > > > > > + .colorspace = V4L2_COLORSPACE_SRGB, > > > > [snip] > > > + > > > + if (i >= ARRAY_SIZE(supported_modes)) > > > + return -EINVAL; > > > + > > > + fie->interval.numerator = supported_modes[i].frame_interval.numerator; > > > + fie->interval.denominator = > > > + supported_modes[i].frame_interval.denominator; > > > + > > > > As soon as VBLANK is added and made writable, this will break > > Yes, is this correct to remove frame_interval ops once VBLANK/HBLANK is > added (in a further patchset) ? > See the above question Thanks j