From patchwork Fri Aug 31 14:40:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10583941 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A4E714E1 for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A9482BA7B for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EED72BF3B; Fri, 31 Aug 2018 14:41:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 19C842BA7B for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728750AbeHaSsj (ORCPT ); Fri, 31 Aug 2018 14:48:39 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:44516 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbeHaSsj (ORCPT ); Fri, 31 Aug 2018 14:48:39 -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 59800158B; Fri, 31 Aug 2018 16:40:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1535726449; bh=Dlnp2XqV2L66jvacBjz+iCTxpHBPB2fV6Cu4HMpP4pU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjaOLdBAQ6uvWYU4lqvR2B8qggdzb/GH4SXBrBXIdL+EFYPj9b4nXMAyqw/Etw7jp h+Ntu+qrotk0oESTt6Mhpc2LxoP3TnzhM5DFKwV/T6Af5GXvYV0dWz5TVUrk7vkDho mTLHTuv1wvZl8Mb6P6cJwhjDdlN+Ka1SJa1bFP44= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH 1/6] media: vsp1: Remove artificial pixel limitation Date: Fri, 31 Aug 2018 15:40:39 +0100 Message-Id: <20180831144044.31713-2-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> References: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Laurent Pinchart --- 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