From patchwork Fri Apr 13 02:18:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10339341 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 A3DF0600D0 for ; Fri, 13 Apr 2018 02:18:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98358286AE for ; Fri, 13 Apr 2018 02:18:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86DFF286B2; Fri, 13 Apr 2018 02:18: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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, 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 D7685286AE for ; Fri, 13 Apr 2018 02:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690AbeDMCSW (ORCPT ); Thu, 12 Apr 2018 22:18:22 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:10289 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752512AbeDMCSV (ORCPT ); Thu, 12 Apr 2018 22:18:21 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 13 Apr 2018 11:18:20 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 389EB7551B; Fri, 13 Apr 2018 11:18:20 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.48,444,1517842800"; d="scan'208";a="278057440" Received: from mail-ty1jpn01lp0179.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([23.103.139.179]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 13 Apr 2018 11:18:19 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yeH0X8WBMf2G17X9/H5uoqiGt5xKao7SRN9w13CqczQ=; b=KCPanrwFOiBJhOTKMgIMr6bIn05xzm40zfOkDsqh+/51o+HmeSOMkNIarGDX8ffR1gQheRFToMb943IiKd3wA2B3qs+ztmmGqEKRXIBqSp6+5D+OPd0JP5xT077ev49mnPSMuCAeD0nZHxzxLSmrh4D4bbSJLTNqt0GaPKHg9lE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.138) by TYAPR01MB2078.jpnprd01.prod.outlook.com (2603:1096:404:8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.13; Fri, 13 Apr 2018 02:18:13 +0000 Message-ID: <87vacv97ik.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] media: rcar-vin: Fix image alignment for setting pre clipping User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: =?ISO-8859-1?Q?=22Niklas_S=F6derlund=22?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Niklas Soderlund , , Magnus , Laurent , shimoda , shiiba , sakato , Kihara , Fukawa , , , , , In-Reply-To: <87bmepxga1.wl%kuninori.morimoto.gx@renesas.com> References: <87tw5iuoqa.wl%kuninori.morimoto.gx@renesas.com> <20170421130432.GT28868@bigcity.dyn.berto.se> <877f2awv7u.wl%kuninori.morimoto.gx@renesas.com> <87bmepxga1.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 13 Apr 2018 02:18:13 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: TY1PR01CA0146.jpnprd01.prod.outlook.com (2603:1096:402:1::22) To TYAPR01MB2078.jpnprd01.prod.outlook.com (2603:1096:404:8::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB2078; X-Microsoft-Exchange-Diagnostics: 1; TYAPR01MB2078; 3:JiWYZsgetElnK8PQUCiKwmSALTzlhc6zNUBg65n08cfm26cItOLcOntfoO9Yo+5aCUV33KhVA/w0HJqoIp1AjwFASBSq2sOCFnuROHfQwIgMxYAO1+YTZU/wtwhGbh9XIT6FZY+7ZZ/HUIoy+xI5QIX8BsT4lKBtttiHDVXwCcooeZQoJLtLO967NVDZoyOoucypxaNbiwZZe/m0AzfNecI/IVzQYfFJpJ+2hEDcoe/NlsBrgV3A1fy+GV/Nf4cW; 25:v1UwG9DB1FRPz5ncvN5QXUGImmi2/7bw3RyPasUwAiujkkBXt1nCk02WJDNBLHKYPfSxf9LKPvNUvg6MAXx1DT1l4Fv2gattXCR1YnqpCjd/5pNxhVJNttTsAO9rBwjFY+ACqTfhcHKyOKcFlFwmngaYi22fUsFerNk0EJTFDZIBQQr0nSoGnApgGcy4q+roL5TlOJRs2P1mML+eN2ZeLHREewZxGcOvDIrWYExVrp63ZCAxV7wTrrS/Jn0RPrM1u9u67WFC+PIAE3S6sHNB2crD5MxIYoyfpW5Ebc4EaSrO1W07jnv0sef2rkn+jUoAGIyWxBYDRt1Gs8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MZkTzdriMAR54MtO5h6H3kLMgWGfy2C6O+VckkA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231232)(944501327)(52105095)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:TYAPR01MB2078; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB2078; X-Forefront-PRVS: 0641678E68 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(376002)(39860400002)(346002)(39380400002)(396003)(189003)(199004)(8746002)(26005)(8936002)(93886005)(107886003)(58126008)(316002)(25786009)(23756003)(8676002)(39060400002)(97736004)(4326008)(36756003)(6116002)(54906003)(86362001)(3846002)(53936002)(110136005)(11346002)(69596002)(956004)(2616005)(476003)(446003)(2906002)(305945005)(66066001)(7736002)(5660300001)(47776003)(1857600001)(50466002)(386003)(6486002)(16526019)(186003)(478600001)(68736007)(105586002)(53416004)(76176011)(52116002)(106356001)(7696005)(486006)(81166006)(81156014)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB2078; H:morimoto-PC.renesas.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1; TYAPR01MB2078; 23:0UfgPqElmc8zOmd2BkbTq+SWKoLlsx9GrcJeySq?= =?iso-8859-1?Q?TZVoR27bfVS7EB4PtPPIDEvmdEB5zUpZfmSAWfoGTTD+k7cL1/rD1z75LF?= =?iso-8859-1?Q?vBJ1KLo3Xk5Hl2k8EtnTSrORxuZBn5kjSoVGl1OsjLnCHfmaDt1YPnpz0z?= =?iso-8859-1?Q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PiV3InVP1ZhxV0Uu2ei6g86XBCT2GoHAp+urkZVJtmkbkLovirglFrjvg==; 5:9pjpJEYU/JV0rUyyfaHT00GJCdecmGMmyKd/IYHJ5zzam6U2ytXjT6RGSn7He8osJ5nZwc9miDKGaBwYCQbLopoSvGtASHqG6sbFxPOF3Rq+r3PUB1BOXiC9NVgU5dFCkzufIwC74h97GrGnBxtMNkU3vDXmeUPQlIiAwMxLSsY=; 24:wlQldNXI4SbRLEZSwWl+yEAK43G65a59TA9vI8I8RIiGVxdRVhjE2C0ZIW5uYd2kh8WJxcwlmI0P/5JBoTZbuXsrS0mc/97kGysI4LRirk8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; TYAPR01MB2078; 7:ez4VTz1fQjNKedRM6OqcwAmrHQAQZiXNhQGazO8QwbZ/97YszsomKGydKEp5uIxl8VxMxxbeQl8efb8f1eznNDaPe1QBg5RVmk5bE9Vr+Rt1tWSXYyj3KshoB0sNo8KfXO5TlOt/FYoIX081hLocHYcr5VkCKwSikqcWdjA5TvcQ6OuEsQrNkl6XJshN7DSD+uNsH1IeEJPgGiNt+1R+GIZu0TPxzxLghRuZ6RIxhYh8MqxY8ugzFZr6V9ZtZhUg; 20:eb6rg1VSxyjZ7Mw1fquB5mGtcvnVBgdIsA9XgNQlI6MkdO8SK9AUo0pqgMK5ObWSHJYNuwYOYrWpJC2eDbxaK0Ig+MNZAWAxvvYxVVpxTTNVblEKR74xrOEq8H1pqhqE/CEIAMItKBi/5AhhyTkQKdlyoE56BZuXeRzoc5+iIho= X-MS-Office365-Filtering-Correlation-Id: 7d2c378e-a662-45a5-d655-08d5a0e4d263 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2018 02:18:13.3507 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d2c378e-a662-45a5-d655-08d5a0e4d263 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2078 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 From: Koji Matsuoka In Video Pixel/Line Pre-Clip Register, the setting value can be set in 1 line unit, but it can only be specified as a multiple of 4 by v4l_bound_align_image function(). So correct that it can be specified in 1 line unit with this patch. Signed-off-by: Koji Matsuoka Signed-off-by: Kuninori Morimoto Acked-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 22a6ecc..71ae65b 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -409,8 +409,8 @@ static int rvin_s_selection(struct file *file, void *fh, max_rect.height = vin->source.height; v4l2_rect_map_inside(&r, &max_rect); - v4l_bound_align_image(&r.width, 2, vin->source.width, 1, - &r.height, 4, vin->source.height, 2, 0); + v4l_bound_align_image(&r.width, 6, vin->source.width, 0, + &r.height, 2, vin->source.height, 0, 0); r.top = clamp_t(s32, r.top, 0, vin->source.height - r.height); r.left = clamp_t(s32, r.left, 0, vin->source.width - r.width);