From patchwork Thu Sep 15 13:59:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9333737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABEE86077A for ; Thu, 15 Sep 2016 13:59:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95165297B5 for ; Thu, 15 Sep 2016 13:59:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89A58297C9; Thu, 15 Sep 2016 13:59:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4761297B5 for ; Thu, 15 Sep 2016 13:59:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934485AbcION7w (ORCPT ); Thu, 15 Sep 2016 09:59:52 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:33513 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934451AbcION7v (ORCPT ); Thu, 15 Sep 2016 09:59:51 -0400 Received: by mail-lf0-f45.google.com with SMTP id h127so38241683lfh.0 for ; Thu, 15 Sep 2016 06:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=RccW8+Tu0YQ1iz5XfB92oDem+PXaA72QQnAVfnF92kY=; b=FIAhYTd5ooVT3u0Udx0TZAsNWbWwRCGk5/apF8agC7dfH9bEt2nq5KYnv/THIrFuVf KEl6tRKM1CCeNh6W9DyetLXNHjrVVdOYxQz/Q9puoh4plo1FyCq6PQSg/pKeavgimu/v tut3vyE44Hl7TPRNZsdJrcHhQ4Cn8Lw7aZnY5PhMh0rr0iVCDq/ye333xH1Wd213Daep ybKuo0B4aGPP0ngo0CLhxhk+MP+QltSPD3qMICNFDVlCPzGJbXvsl8zb9xeXJlIna6IO 2jKv8XogxCf+7EiJeqUuMjj6cNX31clFiRNMnIRD7aFEy5+tojy99dirdnhqFvYgUtvJ NupQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=RccW8+Tu0YQ1iz5XfB92oDem+PXaA72QQnAVfnF92kY=; b=RJxHxDQ3TLH0XXVbiUyzayuzAdch4MMXhCrM/tmT7xrKSZncx1GG2jvJVdNSp7IJim cotxKjj9+85o2425uR9lbCmAm4XPlp8WqfM7vX/AbFxXk+PGXnagpxBburulAfMnlKFN 1PQED2LZUHfUX8vVpsXOY1kRJQF2WT8WwWWGZBpUZk1nApMVoRCyJeZeZwLcf21E9vBR iuXXduaykmuKnDC4GC7QjcoLT+lQG5/w0+GxVcU9UCb6VLXHnQE71jfQrBuTYr6TCSxo qOQe2zZozZEn8Y1nBrSsDRwDmgHD5Gj2rsMJfCivyMyYoR4nsbnlDYEWYKI19jVOzfrS xX5A== X-Gm-Message-State: AE9vXwMKMkePZ2nK/wQJ6Tag1XXfHABCJNigINbnoane1efD+jKDsD3Pz5886xnNMReZJw== X-Received: by 10.25.155.18 with SMTP id d18mr3517277lfe.120.1473947989064; Thu, 15 Sep 2016 06:59:49 -0700 (PDT) Received: from localhost ([89.233.230.99]) by smtp.gmail.com with ESMTPSA id 72sm1037611ljf.5.2016.09.15.06.59.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Sep 2016 06:59:48 -0700 (PDT) Date: Thu, 15 Sep 2016 15:59:47 +0200 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: Ulrich Hecht Cc: hans.verkuil@cisco.com, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, william.towle@codethink.co.uk Subject: Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls Message-ID: <20160915135947.GC19172@bigcity.dyn.berto.se> References: <20160915132408.20776-1-ulrich.hecht+renesas@gmail.com> <20160915132408.20776-3-ulrich.hecht+renesas@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160915132408.20776-3-ulrich.hecht+renesas@gmail.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Ulrich, Thanks for your patch. Can you append another patch ontop of this one whit the following change: Whit that change the driver pass v4l2-compliance check for the HDMI input on Koelsch for me. On 2016-09-15 15:24:08 +0200, Ulrich Hecht wrote: > Adds G_EDID and S_EDID. > > Signed-off-by: Ulrich Hecht > --- > drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 +++++++++++++++++++++++++++++ > drivers/media/platform/rcar-vin/rcar-vin.h | 1 + > 2 files changed, 43 insertions(+) > > diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c > index 62ca7e3..f679182 100644 > --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c > +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c > @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void *priv_fh, > return ret; > } > > +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid) > +{ > + struct rvin_dev *vin = video_drvdata(file); > + struct v4l2_subdev *sd = vin_to_source(vin); > + int input, ret; > + > + input = edid->pad; > + edid->pad = vin->sink_pad_idx; > + > + ret = v4l2_subdev_call(sd, pad, get_edid, edid); > + > + edid->pad = input; > + > + return ret; > +} > + > +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid) > +{ > + struct rvin_dev *vin = video_drvdata(file); > + struct v4l2_subdev *sd = vin_to_source(vin); > + int input, ret; > + > + input = edid->pad; > + edid->pad = vin->sink_pad_idx; > + > + ret = v4l2_subdev_call(sd, pad, set_edid, edid); > + > + edid->pad = input; > + > + return ret; > +} > + > static const struct v4l2_ioctl_ops rvin_ioctl_ops = { > .vidioc_querycap = rvin_querycap, > .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap, > @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = { > .vidioc_s_dv_timings = rvin_s_dv_timings, > .vidioc_query_dv_timings = rvin_query_dv_timings, > > + .vidioc_g_edid = rvin_g_edid, > + .vidioc_s_edid = rvin_s_edid, > + > .vidioc_querystd = rvin_querystd, > .vidioc_g_std = rvin_g_std, > .vidioc_s_std = rvin_s_std, > @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin) > vin->src_pad_idx = pad_idx; > fmt.pad = vin->src_pad_idx; > > + vin->sink_pad_idx = 0; > + for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++) > + if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) { > + vin->sink_pad_idx = pad_idx; > + break; > + } > + > /* Try to improve our guess of a reasonable window format */ > ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt); > if (ret) { > diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h > index 793184d..af815cc 100644 > --- a/drivers/media/platform/rcar-vin/rcar-vin.h > +++ b/drivers/media/platform/rcar-vin/rcar-vin.h > @@ -121,6 +121,7 @@ struct rvin_dev { > struct video_device vdev; > struct v4l2_device v4l2_dev; > int src_pad_idx; > + int sink_pad_idx; sink_pad_idx should be documented in the comment above the struct. If you fix that feel free to add my: Acked-by: Niklas Söderlund > struct v4l2_ctrl_handler ctrl_handler; > struct v4l2_async_notifier notifier; > struct rvin_graph_entity digital; > -- > 2.9.3 > diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index ac26738..7ba728d 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -494,7 +494,7 @@ static int rvin_enum_dv_timings(struct file *file, void *priv_fh, int pad, ret; pad = timings->pad; - timings->pad = vin->src_pad_idx; + timings->pad = vin->sink_pad_idx; ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings); @@ -548,7 +548,7 @@ static int rvin_dv_timings_cap(struct file *file, void *priv_fh, int pad, ret; pad = cap->pad; - cap->pad = vin->src_pad_idx; + cap->pad = vin->sink_pad_idx; ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);