From patchwork Tue Oct 21 05:10:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 5110351 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CAE4C9F30B for ; Tue, 21 Oct 2014 05:10:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA3A720122 for ; Tue, 21 Oct 2014 05:10:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 129AC20121 for ; Tue, 21 Oct 2014 05:10:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752164AbaJUFKr (ORCPT ); Tue, 21 Oct 2014 01:10:47 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:58829 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014AbaJUFKp (ORCPT ); Tue, 21 Oct 2014 01:10:45 -0400 Received: by mail-pd0-f173.google.com with SMTP id g10so554495pdj.18 for ; Mon, 20 Oct 2014 22:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ACg1EmEcuCEHAFx0SSAV7Qk8mh5tdeq6ClqyVaRke/8=; b=Z3iyhOoSzKGnX4oKSZ46KDcOFqGi5BvRqKanFMCJhndlFZ8NvBalsJCu9luyq58cRU a+i0dLlLJY/gX7BEK2SwiVL0TpSNhrunwxgg7/iUyz4BhPB2wi5zwu1+Nav4wELm0GBf Edx+6rZtKLJIXZmEwP6c7U5Si28YglEILU4kZR10kDOmy/xQCPqoIxfOJsi5b5o405ir geIby2Yaz0jEjyL/I/noj0DRIc6zisFFuKyPeTUVyjq+qPjjv7WMrEHtBOVNDwAe6abe U3g4U1ncgDIhtLl1lDqIpsq3Wjyys/x1KBCV72huDuTeZim8XI2A9R23pXfIqa0dz10Y zcNQ== X-Received: by 10.66.142.163 with SMTP id rx3mr8255908pab.124.1413868245208; Mon, 20 Oct 2014 22:10:45 -0700 (PDT) Received: from localhost.localdomain (p5095-ipngn6701marunouchi.tokyo.ocn.ne.jp. [153.174.4.95]) by mx.google.com with ESMTPSA id fv3sm1567790pac.7.2014.10.20.22.10.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Oct 2014 22:10:44 -0700 (PDT) From: Yoshihiro Kaneko To: linux-media@vger.kernel.org Cc: Guennadi Liakhovetski , Simon Horman , Magnus Damm , linux-sh@vger.kernel.org Subject: [PATCH v3 3/3] media: soc_camera: rcar_vin: Add NV16 horizontal scaling-up support Date: Tue, 21 Oct 2014 14:10:29 +0900 Message-Id: <1413868229-22205-4-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413868229-22205-1-git-send-email-ykaneko0929@gmail.com> References: <1413868229-22205-1-git-send-email-ykaneko0929@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Koji Matsuoka Up until now scaling has been forbidden for the NV16 capture format. This patch adds support for horizontal scaling-up for NV16. Vertical scaling-up for NV16 is forbidden by the H/W specification. Signed-off-by: Koji Matsuoka Signed-off-by: Yoshihiro Kaneko --- v3 [Yoshihiro Kaneko] * no changes v2 [Yoshihiro Kaneko] * Updated change log text from Simon Horman * Code-style fixes as suggested by Sergei Shtylyov drivers/media/platform/soc_camera/rcar_vin.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index ecdbd48..fd2207a 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -644,7 +644,7 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) /* output format */ switch (icd->current_fmt->host_fmt->fourcc) { case V4L2_PIX_FMT_NV16: - iowrite32(ALIGN(ALIGN(cam->width, 0x20) * cam->height, 0x80), + iowrite32(ALIGN((cam->out_width * cam->out_height), 0x80), priv->base + VNUVAOF_REG); dmr = VNDMR_DTMD_YCSEP; output_is_yuv = true; @@ -1614,9 +1614,17 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd, * At the time of NV16 capture format, the user has to specify the * width of the multiple of 32 for H/W specification. */ - if ((pixfmt == V4L2_PIX_FMT_NV16) && (pix->width & 0x1F)) { - dev_err(icd->parent, "Specified width error in NV16 format.\n"); - return -EINVAL; + if (pixfmt == V4L2_PIX_FMT_NV16) { + if (pix->width & 0x1F) { + dev_err(icd->parent, + "Specified width error in NV16 format. Please specify the multiple of 32.\n"); + return -EINVAL; + } + if (pix->height != cam->height) { + dev_err(icd->parent, + "Vertical scaling-up error in NV16 format. Please specify input height size.\n"); + return -EINVAL; + } } switch (pix->field) { @@ -1661,6 +1669,7 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd, case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_RGB565: case V4L2_PIX_FMT_RGB555X: + case V4L2_PIX_FMT_NV16: /* horizontal scaling-up only is supported */ can_scale = true; break; default: