From patchwork Sat Feb 16 10:18:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 2151511 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id CC50DE014A for ; Sat, 16 Feb 2013 10:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753033Ab3BPKSt (ORCPT ); Sat, 16 Feb 2013 05:18:49 -0500 Received: from smtp-vbr8.xs4all.nl ([194.109.24.28]:1530 "EHLO smtp-vbr8.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899Ab3BPKSo (ORCPT ); Sat, 16 Feb 2013 05:18:44 -0500 Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166] (may be forged)) (authenticated bits=0) by smtp-vbr8.xs4all.nl (8.13.8/8.13.8) with ESMTP id r1GAIWNK053293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 16 Feb 2013 11:18:34 +0100 (CET) (envelope-from hverkuil@xs4all.nl) Received: from durdane.fritz.box (marune.xs4all.nl [80.101.105.217]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id 4543711E0164; Sat, 16 Feb 2013 11:18:31 +0100 (CET) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Anatolij Gustschin , Hans Verkuil Subject: [RFC PATCH 3/5] fsl-viu: fill in colorspace, zero priv, always set field to interlaced. Date: Sat, 16 Feb 2013 11:18:25 +0100 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361009907-30990-1-git-send-email-hverkuil@xs4all.nl> References: <1361009907-30990-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <77816a8ba6f0fe685a83a012371cf07b1ab505da.1361009701.git.hans.verkuil@cisco.com> References: <77816a8ba6f0fe685a83a012371cf07b1ab505da.1361009701.git.hans.verkuil@cisco.com> X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Hans Verkuil - fill in the missing colorspace value. - the priv field of v4l2_pix_format must be zeroed. - don't reject incorrect field values, always replace with a valid value. Signed-off-by: Hans Verkuil --- drivers/media/platform/fsl-viu.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index 1567878..961fc72 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -595,6 +595,8 @@ static int vidioc_g_fmt_cap(struct file *file, void *priv, f->fmt.pix.bytesperline = (f->fmt.pix.width * fh->fmt->depth) >> 3; f->fmt.pix.sizeimage = fh->sizeimage; + f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; + f->fmt.pix.priv = 0; return 0; } @@ -602,7 +604,6 @@ static int vidioc_try_fmt_cap(struct file *file, void *priv, struct v4l2_format *f) { struct viu_fmt *fmt; - enum v4l2_field field; unsigned int maxw, maxh; fmt = format_by_fourcc(f->fmt.pix.pixelformat); @@ -612,19 +613,10 @@ static int vidioc_try_fmt_cap(struct file *file, void *priv, return -EINVAL; } - field = f->fmt.pix.field; - - if (field == V4L2_FIELD_ANY) { - field = V4L2_FIELD_INTERLACED; - } else if (field != V4L2_FIELD_INTERLACED) { - dprintk(1, "Field type invalid.\n"); - return -EINVAL; - } - maxw = norm_maxw(); maxh = norm_maxh(); - f->fmt.pix.field = field; + f->fmt.pix.field = V4L2_FIELD_INTERLACED; if (f->fmt.pix.height < 32) f->fmt.pix.height = 32; if (f->fmt.pix.height > maxh) @@ -636,6 +628,8 @@ static int vidioc_try_fmt_cap(struct file *file, void *priv, f->fmt.pix.width &= ~0x03; f->fmt.pix.bytesperline = (f->fmt.pix.width * fmt->depth) >> 3; + f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; + f->fmt.pix.priv = 0; return 0; }