Received: by 10.223.176.46 with SMTP id f43csp2708036wra; Mon, 22 Jan 2018 02:01:42 -0800 (PST) X-Google-Smtp-Source: AH8x2268gPOO7rMxqXTJqAMI0RDYi5EL5ps4z8+cttfW3Nub0/ZDPS47iiaheYjzotbzPerj+JiH X-Received: by 2002:a17:902:5a0b:: with SMTP id q11-v6mr3151752pli.207.1516615302030; Mon, 22 Jan 2018 02:01:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516615301; cv=none; d=google.com; s=arc-20160816; b=nmbHXvSXZew4ASqdUw+2WnLMPFOwlw3x5mgNBy6dt4ra225taWhxZYVJz+UilR7Q7E 44lT+DgO6/b33bXgMl0dNaIYrevuLClWSRMJHvEIg1yMTF8yI+M6rHI5MJnu3ECLf+w4 l1s+pWu2JeUVbN0w/KvuSQd3Kx8/eg+5u4xCzbywb74Mm/qeQVv1+NTiS8h+go68XpuR eT6IiqpIFG8H2mmBD6l+wSuImtx08KP12Zc0vByPsVrPTl3WnEtZ0xLTQ0W90hXFFXIq If+mu5cNGG7wDeRNfbBW6UmVcuvGXXhJK9gS9Ml7xcWKJrK5oo4kSegTADbfj6tf8DAc 0c8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=doBy2CrcvyVfpv8SZLiTLoZSy0jMkYtcJL6YlGQI+aE=; b=MssMmCcW6Sg5KBOGuD0XVvEvJ1Sr1A2LeMGtLNaTgZvyglOnDUsRyBUxpPwuCW/T8K pXUO9nbg+mIgfhoujbmenoCCmZ5BjeYLjCq7/j8AO3l9SZGqyTyvo6PQTvEr4hENZlzF RdLRgBc1UKI0rZF65sibY66lwf3iftztsdqQaeoCH64DUk2CYgF+opnHOYIx9xKEqPWq o4IJh6JnUfdMpRGi+72vle1j1AB7Ugw3fxm5ln1TB2iw/U5hRekvtQfJhfjRJKQyp82g ScaOTcXZzpJ7pwb7/u5yvq+IFkGEsXLEpJY3MlDNC+AEOl9ajW7+K36iyH8/QFjMKCqn 7xJw== 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 a80si15167022pfg.372.2018.01.22.02.01.27; Mon, 22 Jan 2018 02:01:41 -0800 (PST) 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 S1751207AbeAVKAz (ORCPT + 99 others); Mon, 22 Jan 2018 05:00:55 -0500 Received: from lb1-smtp-cloud7.xs4all.net ([194.109.24.24]:51614 "EHLO lb1-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbeAVKAx (ORCPT ); Mon, 22 Jan 2018 05:00:53 -0500 Received: from [192.168.1.10] ([80.101.105.217]) by smtp-cloud7.xs4all.net with ESMTPA id dYuIe8PqY0Ng3dYuJe2Vm2; Mon, 22 Jan 2018 11:00:52 +0100 Subject: Re: [PATCH v6 0/9] Renesas Capture Engine Unit (CEU) V4L2 driver To: jacopo mondi References: <1516139101-7835-1-git-send-email-jacopo+renesas@jmondi.org> <6fcd22c1-19a5-e0b7-2b00-961e1cd1ebaa@xs4all.nl> <20180121174909.GP24926@w540> Cc: Jacopo Mondi , laurent.pinchart@ideasonboard.com, magnus.damm@gmail.com, geert@glider.be, mchehab@kernel.org, festevam@gmail.com, sakari.ailus@iki.fi, robh+dt@kernel.org, mark.rutland@arm.com, pombredanne@nexb.com, linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Hans Verkuil Message-ID: <2a18ce21-8efd-6182-f626-8f7c7bcaebee@xs4all.nl> Date: Mon, 22 Jan 2018 11:00:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20180121174909.GP24926@w540> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfAgXmvWvs72LXmUq5VRwIhs05ipx9qN++pMNcTNQT3ke7cEboZGU1fVIyjqX0aV1IudNxMlxp6usygehPW4IPVLaolKDDqoC/9KuPgNgNc+KRbQJ5jx8 ImraWvPmzxC/jG8EAt4BITb37kdyIAngoaI1bU5oKqx8+K8OjPdjuzSMhoplwixmCaoxuWNWmj0wuFGkvHdWvwQ7SVvqO1LJl1RkkKDyHg9qcjYMcgjzdM0f cDzy0W903GNQirlB3hE636+RS4dVmK8AlVaSZVBfvyve3a+ktYWghA8XtIKBmlUL2+KY6ncwVY0rE1LTl6KIMJwuaggV5ukGzZcH/+nUyCHJmLDVACCyMlBU DSQ+77cvrMkaXNIZN40pBhWxHAu/1BGyLzjWI+DJw/6mxur11kdlGYVK7RTt1HBJk093RDoPlJQudpXK8Ss7fZ8xxcbP4AxXi6VehMczUWbgkqbxC4QASki4 o1f5DXnmTlxE8oJoeedCi+Fp9NTyeneS3v3HRPrOOQRlHaJvfobcMMSBU2mh0N1PcJY7bsK4+YUTf8f2scjvPNwdegJgvoBt+u1LIdQgW4H1MdVGL8GnjUPG Crs= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/01/18 18:49, jacopo mondi wrote: > Hi Hans, > > On Fri, Jan 19, 2018 at 12:26:09PM +0100, Hans Verkuil wrote: >> Hi Jacopo, >> >> On 01/16/18 22:44, Jacopo Mondi wrote: >>> Hello, >>> new version of CEU after Hans' review. >>> >>> Added his Acked-by to most patches and closed review comments. >>> Running v4l2-compliance, I noticed a new failure introduced by the way I now >>> calculate the plane sizes in set/try_fmt. >>> >>> This is the function used to update per-plane bytesperline and sizeimage: >>> >>> static void ceu_update_plane_sizes(struct v4l2_plane_pix_format *plane, >>> unsigned int bpl, unsigned int szimage) >>> { >>> if (plane->bytesperline < bpl) >>> plane->bytesperline = bpl; >>> if (plane->sizeimage < szimage) >>> plane->sizeimage = szimage; >>> } >>> >>> I'm seeing a failure as v4l2-compliance requires buffers with both bytesperline >>> and sizeimage set to MAX_INT . Hans, is this expected from v4l2-compliance? >>> How should I handle this, if that has to be handled by the single drivers? >> >> I commented on this in my review of patch 3/9. > > Fixed thank you. > >> >>> >>> Apart from that, here it is the output of v4l2-compliance, with the last tests >>> failing due to the above stated reason, and two errors in try/set format due to >>> the fact the driver is not setting ycbcr encoding after it receives an invalid >> >> Which driver? The CEU driver or the sensor driver? I don't actually see where >> it fails. >> > > Here it is: > > fail: v4l2-test-formats.cpp(335): ycbcr_enc >= 0xff > fail: v4l2-test-formats.cpp(451): testColorspace(pix_mp.pixelformat, pix_mp.colorspace, pix_mp.ycbcr_enc, pix_mp.quantization) > fail: v4l2-test-formats.cpp(736): Video Capture Multiplanar is valid, but TRY_FMT failed to return a format > test VIDIOC_TRY_FMT: FAIL > fail: v4l2-test-formats.cpp(335): ycbcr_enc >= 0xff > fail: v4l2-test-formats.cpp(451): testColorspace(pix_mp.pixelformat, pix_mp.colorspace, pix_mp.ycbcr_enc, pix_mp.quantization) > fail: v4l2-test-formats.cpp(996): Video Capture Multiplanar is valid, but no S_FMT was implemented > test VIDIOC_S_FMT: FAIL Sorry, I was perhaps confusing. I meant that I couldn't see where in the code ycbcr_enc was not overwritten by 0 (which should have happened). You will need to debug a bit, I think. It could be a bug in the ceu driver or the sensor driver. > > >>> format. I would set those, but I'm not sure what it the correct value and not >>> all mainline drivers do that. >> >> In any case, the default for ycbcr_enc, xfer_func and quantization is 0. >> > > Thanks again. I do expect to be the sensor driver to set ycbcr_enc and > quantization, but from a very trivial grep on media/i2c/ I see only a > few drivers taking care of them (adv7511 and adv7842). What about the > others? I assume v4l2-compliance would not fail on them as it does on > ov7670, but I don't see where ycbr_enc (and others) are managed. In most cases these values are initialized to 0 (either a memset or by initializing the struct), which is typically all you need for sensor drivers. HDMI drivers are more complicated which is why you see explicit handling of these fields only there. > > Overall, with this addressed, the other issue I mentioned on patch > [3/9] on readbuffers clarified and frameinterval handled for ov722x, I > hope we're done with this series. Thanks again your continued effort > in reviews and guidance. My pleasure! Regards, Hans