From patchwork Thu Oct 16 06:12:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 5088091 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 5B1999F2BA for ; Thu, 16 Oct 2014 06:13:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B2B92017E for ; Thu, 16 Oct 2014 06:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A77ED20176 for ; Thu, 16 Oct 2014 06:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751178AbaJPGNX (ORCPT ); Thu, 16 Oct 2014 02:13:23 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:54081 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033AbaJPGNV (ORCPT ); Thu, 16 Oct 2014 02:13:21 -0400 Received: by mail-pa0-f48.google.com with SMTP id eu11so2784966pac.7 for ; Wed, 15 Oct 2014 23:13:21 -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=U8tNjifEtEvFWQdgB88uOsiZU2kzC2GS2AupjJjlk40=; b=iNkwWcFaEKF/YEiwFkLKyZAi8Xmam0YubFw8PgTygAnlRK2wI6TR6G0ycPlhzF1G+/ 5WLnEy9VHuX/UlkvRLs7u1RawTeKy7SDhR5nwxcDNjjkbBZqdNO7w4365r6MA3u9bmdP bf4aXLbNmlt36A99tW7uGY5eBu8p2j9WhZ41op+/2ME+GTzStvY/sgUY2qmlRepr/cMT puKFlYRa8zjv4AhCL+s5LoDZqAwo7jthMt+WUZC4CY+lYA7wkvjCUIKrZq+PLRMbEOTV kr8Mp0CqS39lg9rT9WZ6oaNZAYnE243/upu5bNLjSQrZ1YvdauJxzV5dxnK2hzv507Wv pCuw== X-Received: by 10.68.174.193 with SMTP id bu1mr18209861pbc.26.1413440001267; Wed, 15 Oct 2014 23:13:21 -0700 (PDT) Received: from localhost.localdomain (p5095-ipngn6701marunouchi.tokyo.ocn.ne.jp. [153.174.4.95]) by mx.google.com with ESMTPSA id ow7sm18722397pbc.30.2014.10.15.23.13.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Oct 2014 23:13:20 -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 v2 3/3] media: soc_camera: rcar_vin: Add NV16 horizontal scaling-up support Date: Thu, 16 Oct 2014 15:12:48 +0900 Message-Id: <1413439968-6349-4-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413439968-6349-1-git-send-email-ykaneko0929@gmail.com> References: <1413439968-6349-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 --- 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 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index ff5f80a..234cf86 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -646,7 +646,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; @@ -1619,9 +1619,15 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd, width of the multiple of 32 for H/W specification. */ if (priv->error_flag == false) priv->error_flag = true; - else { - if ((pixfmt == V4L2_PIX_FMT_NV16) && (pix->width & 0x1F)) { - dev_err(icd->parent, "Specified width error in NV16 format.\n"); + else 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; } } @@ -1668,6 +1674,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: