Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4984777imm; Tue, 21 Aug 2018 04:30:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzOIfu7Q/1OzwxZ7eNduTgr0kpgNJwEAHghpTlMY4LPWcXYe79svyAF7h+JCgiu3/xR2dyj X-Received: by 2002:a63:1f52:: with SMTP id q18-v6mr4403263pgm.88.1534851049482; Tue, 21 Aug 2018 04:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534851049; cv=none; d=google.com; s=arc-20160816; b=D7wPalZLcFrwI8XKVQVZadyoCCuJcSLVI633+w0BR1yIYgDZuRaeZCvfLOPle/R5/M 9j5bgwwnDD6HC4WDo1MAMdgko+wx5MymSO7yVG+7aVioe6ZOP/brEvKuDb7DS/QI3rz5 xTb8NLeRNXDicKhlTHEkczqw1K3BPuV1OTdRzRrqIE0yRLarpp2MaODaP1pOdpXLVxBj 5pVDcReEvedXDROpCp4HRUrs08asFKOH8xpWYuwcWYPEDkUSgRfgMNO3ihNDYJgdRMo5 P/U83/yii06rA8NDTPJx2a1EzxFnhOVE5JeMR/dLyC3j3CQvU/Xi2Zxdzdr9ujdCqZlm ocaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=a4We2Wa/gKTOCXDyTPT7ckZh3jRqrpg67Q5AzYAz3RM=; b=Cq7QESIe90pBPugi2sZ8nkSh3DK1x4uKO1OSIewVTtn9VRnaGdyLxVsQVt1OOHUPIx Tg36DFn4j0f3NvgQ5eRp/7SkymDcHIK18tpr8Eww56Bv06H7VhesrL8JTzzvaWJutCjb PngA1zqVjZC4GQCUB66+CztuIXdij03Ko3Ston2RGK0930PuEc1sZxgBGnsLFPSMvkKm VI5mKJ3llNTLjGUywsZMvkCAHC6yaZxW0MmeUa3k0ipDB+0klQmb/zhstaj5Ntl7hkV+ Eq24OgqpeY53zmGYw5ySUockd0u64lzqXPsu/V1qey3oaykuw+iqX2Zlpsi6d1RJ3hEK oswA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dqW1pfoz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c125-v6si11622686pga.268.2018.08.21.04.30.34; Tue, 21 Aug 2018 04:30:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dqW1pfoz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727111AbeHUOe7 (ORCPT + 99 others); Tue, 21 Aug 2018 10:34:59 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:54410 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbeHUOe7 (ORCPT ); Tue, 21 Aug 2018 10:34:59 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9364B1C00; Tue, 21 Aug 2018 13:15:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1534850113; bh=Dlnp2XqV2L66jvacBjz+iCTxpHBPB2fV6Cu4HMpP4pU=; h=From:To:Cc:Subject:Date:From; b=dqW1pfoz7muxfHr8ajY0qjD9sTux7mt6vI9X/23Vu+USclgWPIp9C1Pb2QanVrVHn yd0dYWMTmfhWpGIzOTEYS9lsGyJaplRnjyzPWh8PXZX/hkGH98/fE7y7ZTLrfmGg1/ x348PSBJhhrzHvoyxAiC8d7awRe9/zxiqnhoGj7w= From: Kieran Bingham To: Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH] media: vsp1: Remove artificial pixel limitation Date: Tue, 21 Aug 2018 12:15:10 +0100 Message-Id: <20180821111510.14620-1-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The VSP1 has a minimum width and height of a single pixel, with the exception of pixel formats with sub-sampling. Remove the artificial minimum width and minimum height limitation, and instead clamp the minimum dimensions based upon the sub-sampling parameter of that dimension. Signed-off-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_video.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 81d47a09d7bc..e78eadd0295b 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -38,9 +38,7 @@ #define VSP1_VIDEO_DEF_WIDTH 1024 #define VSP1_VIDEO_DEF_HEIGHT 768 -#define VSP1_VIDEO_MIN_WIDTH 2U #define VSP1_VIDEO_MAX_WIDTH 8190U -#define VSP1_VIDEO_MIN_HEIGHT 2U #define VSP1_VIDEO_MAX_HEIGHT 8190U /* ----------------------------------------------------------------------------- @@ -136,9 +134,8 @@ static int __vsp1_video_try_format(struct vsp1_video *video, height = round_down(height, info->vsub); /* Clamp the width and height. */ - pix->width = clamp(width, VSP1_VIDEO_MIN_WIDTH, VSP1_VIDEO_MAX_WIDTH); - pix->height = clamp(height, VSP1_VIDEO_MIN_HEIGHT, - VSP1_VIDEO_MAX_HEIGHT); + pix->width = clamp(width, info->hsub, VSP1_VIDEO_MAX_WIDTH); + pix->height = clamp(height, info->vsub, VSP1_VIDEO_MAX_HEIGHT); /* * Compute and clamp the stride and image size. While not documented in -- 2.17.1