Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp567391lqo; Fri, 10 May 2024 08:11:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEVP5UWeoCOCMVP8vs9/pQgFdCITA45HGcCW6+dEFjX5YfWAh++var4ccuC1tMiE4fk9SMQbgXMSEvdb8AuPT313YQXQsq+3uoOMz+zA== X-Google-Smtp-Source: AGHT+IEv7Cg2dUvk7jK91rassyJDS2PiBb1Nar5N8ffYu0PeeR5q8ba68yrVKDX4L0vSa/++97pu X-Received: by 2002:a05:620a:13d4:b0:790:9e84:9b75 with SMTP id af79cd13be357-792c6c4d779mr479638785a.12.1715353871482; Fri, 10 May 2024 08:11:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715353871; cv=pass; d=google.com; s=arc-20160816; b=xKrRUYjxAwj/JpB1bo0bD7UUek4cwWvyAS1+0KJwSJHleBHezys1ly0h7hAfzXdFcX VXVmgkPCBL1edFyFTrrCBrykDKjuD6F0qN7akaNeH0OSaWJnO2E58o4h0jSjnNMOiYLP H2WVVl7kKD43kE2Trtgc0jMLS7fqs2u0yAni7KafXwOkNFIq76YvVR5vuEuo7zgz3vYP ux44GMCYM/qdhzTiBiyVQihx83V7jMcFGACCMCtXFKDMApncGm7YUBNdpfP1j/A/YhxZ 9MwfBSASSSZXkalga9KSuW0JemBwvzf+JF+1QKiEm9Gwj7V+I1+9vRz2siucBbv2qM85 32EQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=+Q+zeFNQjctI63Pd7iV9Yckytka6FaTlmeMmn9UGAhI=; fh=2PbqBbzTlcuL+s0NaxAWdOgiJCZo4r0PtOEW/i84ihk=; b=opuQf0LS+XlJvzbpKgPg2et32Cm/e65KkmVS7R0xk0DM3W7dgC1TnV8uIkCPiFqegx 0lFrQNbSPt1okQ4lz84pSd/k4nfWGCN30Sg8VK6QG0ZvMCgJ5cLFk6TH/gQ02OCFcDQF WM7pWQ61L3F0l8OW6UpLp6y0hmUPCh+8D+kuw4gU8RPgv9jO1IF0J12RaEUI8ChAPDAU 5KiJCRUMfU0FugGbfuoIacoZTDJjA7V2zvApXhcbaKeN1il/Sikbc/xP3U8IHfqavsWH pRn4L1SJCwdziNx9cDYv8Tr/nJYZ2AoaVgVrnvIngvRk0FPtpAOfBa8gh8Gvhzcd9DDu f0fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BpprehXU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-175931-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf30a578si358493685a.325.2024.05.10.08.11.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175931-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BpprehXU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-175931-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3B1A51C23EE2 for ; Fri, 10 May 2024 15:11:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A06C171E57; Fri, 10 May 2024 15:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BpprehXU" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B765F17166F; Fri, 10 May 2024 15:10:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715353850; cv=none; b=WaOYhTljJvvHRDG/2qet7FBGCymHr3Z9cojM8h2AOnuY3Q7NqyXEvrN62FpawsT97WrjNw9GiypupBT5QKbvHdW2P91umunOHwCk2GpPDOVJt58siancbDl7hdj6kjGmj1ekpMVaEv8K9/ThpuVEBeEng99vNxqirTT9dMdiUrg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715353850; c=relaxed/simple; bh=1j7eg+9n1ylc7PMU1qKoy953XxcAw3FLb1qDay6E/FI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=V8GIj7D3WiAq07EZAa6S2l/dCkr/hmatWQiHtmth3oz1Y2JPXT35tSRgJKkMKfFKvHDrD9Z1Rp1srY+n566R5d+do0do8LUdU7bwujXwUdmwUow9hm9HqBmSXi239exsBy6GZgtqTT1YFlvw86v4EIHoKhhuk5kZo8bbwPM1uWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BpprehXU; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715353848; x=1746889848; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=1j7eg+9n1ylc7PMU1qKoy953XxcAw3FLb1qDay6E/FI=; b=BpprehXUhdtp8LWG3bdIzCRxhOUpbTOTYLmJivb1nK14IVm1o33jOWrk fU26FbyZEv+HRhvADwQxjoGDyNW82R4CME2mlRUvw44Z44G9cS0fqPqvZ MytA1HjaODFN121a4kcRjTrBkp1p/Ux52mcd8BEoW1Z8LLfaTvncej33+ 4ysy8ozR2SnKKfKFWuTVb8utj3dJOC9k3GTAeqiyYizq0bUEzhyCqvPa7 0sabDT4M5NQ3YMj738qfcKleWe3RuXUoQfi1aXd4qcPOpxKJR5nmrkrN3 GGYR7j2LzgkCUmJbjyWIdMPX7uPKtZrxGNIjruDBlKuD5MwEE/CURp12W g==; X-CSE-ConnectionGUID: XDZxHLDZSaeyCL4Z7XIilw== X-CSE-MsgGUID: vHZSQCaFRJKCbJq4aJGD6A== X-IronPort-AV: E=McAfee;i="6600,9927,11068"; a="11468751" X-IronPort-AV: E=Sophos;i="6.08,151,1712646000"; d="scan'208";a="11468751" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2024 08:10:46 -0700 X-CSE-ConnectionGUID: NAF67pl8Qe+TSKl8VaEpXQ== X-CSE-MsgGUID: SGb+tI1vQvi8k665RFaHhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,151,1712646000"; d="scan'208";a="29592182" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2024 08:10:41 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1s5RtN-000000068i4-1K3v; Fri, 10 May 2024 18:10:37 +0300 Date: Fri, 10 May 2024 18:10:37 +0300 From: Andy Shevchenko To: Devarsh Thakkar Cc: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, benjamin.gaignard@collabora.com, sebastian.fricke@collabora.com, dri-devel@lists.freedesktop.org, laurent.pinchart@ideasonboard.com, praneeth@ti.com, nm@ti.com, vigneshr@ti.com, a-bhatia1@ti.com, j-luthra@ti.com, b-brnich@ti.com, detheridge@ti.com, p-mantena@ti.com, vijayp@ti.com, andrzej.p@collabora.com, nicolas@ndufresne.ca, p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, akpm@linux-foundation.org, gregkh@linuxfoundation.org, adobriyan@gmail.com, jani.nikula@intel.com Subject: Re: [PATCH v7 7/8] media: imagination: Round to closest multiple for cropping region Message-ID: References: <20240509184001.4064820-1-devarsht@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240509184001.4064820-1-devarsht@ti.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Fri, May 10, 2024 at 12:10:01AM +0530, Devarsh Thakkar wrote: > If neither of the flags to round down (V4L2_SEL_FLAG_LE) or round up > (V4L2_SEL_FLAG_GE) are specified by the user, then round to nearest > multiple of requested value while updating the crop rectangle coordinates. > > Use the rounding macro which gives preference to rounding down in case two > nearest values (high and low) are possible to raise the probability of > cropping rectangle falling inside the bound region. This is arguable. How do we know that the bigger range is supported? The safest side is to go smaller than bigger. -- With Best Regards, Andy Shevchenko