From patchwork Fri May 26 10:55:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 9750337 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 3F81260246 for ; Fri, 26 May 2017 10:55:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EF01262FF for ; Fri, 26 May 2017 10:55:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22A2F283BB; Fri, 26 May 2017 10:55:42 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham 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 0F565262FF for ; Fri, 26 May 2017 10:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971171AbdEZKzi (ORCPT ); Fri, 26 May 2017 06:55:38 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:44473 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965647AbdEZKzg (ORCPT ); Fri, 26 May 2017 06:55:36 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4QAtUoP020391; Fri, 26 May 2017 05:55:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1495796130; bh=t0AVRQe8vqvUvuk74bzHrYhKjsdMCc99C4rOIo6CyOo=; h=From:To:CC:Subject:Date; b=nESPTeh7pbEckENfscOmPYWftSTutkNbl06OTb1l/BoaQ1DQdzDTSy/8CUtnCIbMO KFHDWdpNLVMOKgIjjQMH4s+r7fiZ0prkE6XjkHrM6wkD1kkJOmdFMDa4s2VlDJuL0P y5I6mwUpn8Bsh+0WVyjZJH1pAMCHH6R5JNemgK1g= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4QAtUKY007448; Fri, 26 May 2017 05:55:30 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Fri, 26 May 2017 05:55:29 -0500 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4QAtRcM017635; Fri, 26 May 2017 05:55:28 -0500 From: Sekhar Nori To: Prabhakar Lad , Mauro Carvalho Chehab , Hans Verkuil CC: , Kevin Hilman , Alejandro Hernandez , Sekhar Nori Subject: [PATCH] davinci: vpif_capture: fix default pixel format for BT.656/BT.1120 video Date: Fri, 26 May 2017 16:25:27 +0530 Message-ID: <20170526105527.10522-1-nsekhar@ti.com> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 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 For both BT.656 and BT.1120 video, the pixel format used by VPIF is Y/CbCr 4:2:2 in semi-planar format (Luma in one plane and Chroma in another). This corresponds to NV16 pixel format. This is documented in section 36.2.3 of OMAP-L138 Technical Reference Manual, SPRUH77A. The VPIF driver incorrectly sets the default format to V4L2_PIX_FMT_YUV422P. Fix it. Reported-by: Alejandro Hernandez Signed-off-by: Sekhar Nori Acked-by: Kevin Hilman Acked-by: Lad, Prabhakar Acked-by: Benoit Parrot --- drivers/media/platform/davinci/vpif_capture.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 44f702752d3a..128e92d1dd5a 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -513,7 +513,7 @@ static int vpif_update_std_info(struct channel_obj *ch) if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; else - common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV422P; + common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_NV16; common->fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; @@ -917,8 +917,8 @@ static int vpif_enum_fmt_vid_cap(struct file *file, void *priv, fmt->pixelformat = V4L2_PIX_FMT_SBGGR8; } else { fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - strcpy(fmt->description, "YCbCr4:2:2 YC Planar"); - fmt->pixelformat = V4L2_PIX_FMT_YUV422P; + strcpy(fmt->description, "YCbCr4:2:2 Semi-Planar"); + fmt->pixelformat = V4L2_PIX_FMT_NV16; } return 0; } @@ -946,8 +946,8 @@ static int vpif_try_fmt_vid_cap(struct file *file, void *priv, if (pixfmt->pixelformat != V4L2_PIX_FMT_SBGGR8) pixfmt->pixelformat = V4L2_PIX_FMT_SBGGR8; } else { - if (pixfmt->pixelformat != V4L2_PIX_FMT_YUV422P) - pixfmt->pixelformat = V4L2_PIX_FMT_YUV422P; + if (pixfmt->pixelformat != V4L2_PIX_FMT_NV16) + pixfmt->pixelformat = V4L2_PIX_FMT_NV16; } common->fmt.fmt.pix.pixelformat = pixfmt->pixelformat;