Received: by 10.223.176.46 with SMTP id f43csp926711wra; Fri, 19 Jan 2018 04:21:10 -0800 (PST) X-Google-Smtp-Source: ACJfBoviXGDHRlEJTv26O/BEpDSSvILL6ez3lB5coUhDBFKvqeeZraPmQlyR2b0dR4JlkBPHcOEK X-Received: by 10.101.85.15 with SMTP id f15mr29620106pgr.153.1516364470298; Fri, 19 Jan 2018 04:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516364470; cv=none; d=google.com; s=arc-20160816; b=DSqXS8jgJNLxEbgQGKVhmkOPM/JA07d6xFdxp0r/Ya2AczX4ETlwXsVL3wf8skAInr 0xjapJg+l1psK9RZu9F/rYvsFcl/R05DRGkxHtaNsZaykwvayMQ1heq4wDSarwSGjEdT PDFz9wjW58+JtyK6Jobq6VEzdKZ266EqwB3yIKL8lRRe8nzEhedivAgEOhp1PFsCQspE fGB7Z8xgrq9EjZuoNNuPJSpMv948C4Wvhif5x3zbCvkqHwb7ulsTRq/utC9TDxdTzbr+ Etnp8kb967y+wpvRxCb1E9o4IRkNl+wC/uQqb4w8BZ0RQb3SgHZdhc9C+eaaC4uA53fU mw5g== 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:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=wgMmQ1JdmAu987TTIBt0BFz5npAogRF6aevI7Xb474A=; b=SDY3/osxnqWYhQS4HsulXz58ea08PQ+v75nPLfl7NYLu7icJhsdQLnmZS9Z9yFS+1D zwp7vkRr9+1uNzoduXV361ZxlqtG3Ct5+S+0p/3c6erLiPv4sgmDRXWUqZRL4kVNUmZ6 59OS2fLRORC9Vca6SxLcjNb9VQ1RhXSm1QCVUFU5Imuc2bPqibvCXTUVriunAZJk2bKW XtLUJX8cOaYIhARtrBS6fqS2HXT7a+wPQTWAmAKNajbubKmw5ICgppbTMg5xGzb9sDzr EU3VfYTUz1Zj7GBG7KwcpaMfkUgWq6EHp+YiKkbzZHSOQJmthNJ2ioyDUlLjNmQKPClx yxdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SVSxLaI2; 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 c19-v6si790199plo.278.2018.01.19.04.20.56; Fri, 19 Jan 2018 04:21:10 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SVSxLaI2; 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 S1755664AbeASMUc (ORCPT + 99 others); Fri, 19 Jan 2018 07:20:32 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:45353 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755226AbeASMU0 (ORCPT ); Fri, 19 Jan 2018 07:20:26 -0500 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id C6F64201C5; Fri, 19 Jan 2018 13:19:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1516364369; bh=ie9n+MSHlErT7tqt4tQIhFvRnkCtVad0C3hodG7yDtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SVSxLaI2eaoRyHS+ccQPhXyHTO2dr+DjQRGIMjwYypsLP/GsCnDCQE/5mwur8IXRQ CObus6rVDCWfyT1DVQoJrcHV5o10qFN+RlLGy0LUIjrqXHyKGbsXEFiCGa+mBECG9p J1SNnsM5IlOVjwjR5JDgKF9ttsPA2aUitVCdRbHY= From: Laurent Pinchart To: Hans Verkuil Cc: Jacopo Mondi , 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 Subject: Re: [PATCH v6 3/9] v4l: platform: Add Renesas CEU driver Date: Fri, 19 Jan 2018 14:20:33 +0200 Message-ID: <2529707.jzkV7c2yGz@avalon> Organization: Ideas on Board Oy In-Reply-To: References: <1516139101-7835-1-git-send-email-jacopo+renesas@jmondi.org> <1516139101-7835-4-git-send-email-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hans, On Friday, 19 January 2018 13:20:19 EET Hans Verkuil wrote: > On 01/16/18 22:44, Jacopo Mondi wrote: > > Add driver for Renesas Capture Engine Unit (CEU). > > > > The CEU interface supports capturing 'data' (YUV422) and 'images' > > (NV[12|21|16|61]). > > > > This driver aims to replace the soc_camera-based sh_mobile_ceu one. > > > > Tested with ov7670 camera sensor, providing YUYV_2X8 data on Renesas RZ > > platform GR-Peach. > > > > Tested with ov7725 camera sensor on SH4 platform Migo-R. > > > > Signed-off-by: Jacopo Mondi > > Reviewed-by: Laurent Pinchart > > --- > > > > drivers/media/platform/Kconfig | 9 + > > drivers/media/platform/Makefile | 1 + > > drivers/media/platform/renesas-ceu.c | 1659 +++++++++++++++++++++++++++++ > > 3 files changed, 1669 insertions(+) > > create mode 100644 drivers/media/platform/renesas-ceu.c [snip] > > diff --git a/drivers/media/platform/renesas-ceu.c > > b/drivers/media/platform/renesas-ceu.c new file mode 100644 > > index 0000000..1b8f0ef > > --- /dev/null > > +++ b/drivers/media/platform/renesas-ceu.c [snip] > > +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; > > As mentioned in your cover letter, you do need to check for invalid > bytesperline values. The v4l2-compliance test is to see what happens > when userspace gives insane values, so yes, drivers need to be able > to handle that. What limit would you set, what is an acceptable large value versus an invalid large value ? I think we should have rules for this at the API level (or at least, if not part of the API, rules that are consistent across drivers). > plane->sizeimage is set by the driver, so drop the 'if' before the > assignment. I don't think that's correct. Userspace should be able to control padding lines at the end of the image, the same way it controls padding pixels at the end of lines. > > +} [snip] > > +static const struct v4l2_ioctl_ops ceu_ioctl_ops = { > > + .vidioc_querycap = ceu_querycap, > > + > > + .vidioc_enum_fmt_vid_cap_mplane = ceu_enum_fmt_vid_cap, > > + .vidioc_try_fmt_vid_cap_mplane = ceu_try_fmt_vid_cap, > > + .vidioc_s_fmt_vid_cap_mplane = ceu_s_fmt_vid_cap, > > + .vidioc_g_fmt_vid_cap_mplane = ceu_g_fmt_vid_cap, > > + > > + .vidioc_enum_input = ceu_enum_input, > > + .vidioc_g_input = ceu_g_input, > > + .vidioc_s_input = ceu_s_input, > > + > > + .vidioc_reqbufs = vb2_ioctl_reqbufs, > > + .vidioc_querybuf = vb2_ioctl_querybuf, > > + .vidioc_qbuf = vb2_ioctl_qbuf, > > + .vidioc_expbuf = vb2_ioctl_expbuf, > > + .vidioc_dqbuf = vb2_ioctl_dqbuf, > > + .vidioc_create_bufs = vb2_ioctl_create_bufs, > > + .vidioc_prepare_buf = vb2_ioctl_prepare_buf, > > + .vidioc_streamon = vb2_ioctl_streamon, > > + .vidioc_streamoff = vb2_ioctl_streamoff, > > + > > + .vidioc_g_parm = ceu_g_parm, > > + .vidioc_s_parm = ceu_s_parm, > > + .vidioc_enum_framesizes = ceu_enum_framesizes, > > + .vidioc_enum_frameintervals = ceu_enum_frameintervals, > > You're missing these ioctls: > > .vidioc_log_status = v4l2_ctrl_log_status, Is log status mandatory ? > .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, > .vidioc_unsubscribe_event = v4l2_event_unsubscribe, > > These missing _event ops are the reason for this compliance failure: > > fail: v4l2-test-controls.cpp(782): subscribe event for control 'User > Controls' failed > > +}; [snip] -- Regards, Laurent Pinchart