Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp478254ybm; Fri, 29 May 2020 05:00:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz41Qa9x+infc0w7oiv7N/T5gYv0P4Ka8umi+2Kn7/ii0TkaZ5B3wDY+lWW6975MykAf1L3 X-Received: by 2002:a17:906:d98:: with SMTP id m24mr7067330eji.553.1590753617310; Fri, 29 May 2020 05:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590753617; cv=none; d=google.com; s=arc-20160816; b=ZzKIHBhtFuGd8IukJB3IZuz+TC2BOvHEGhUJP17HDAwl2oNaRPipvmHwLTM1VhtvBp Ci8pcdw5v/dUe7Jnaq9jQTPVCfqyYFIevXtBqM4r7MpKsC7X8hioa44SXo09tIKMIoPf blPB9uiIpSm/PvOPvMqZETJJxu42DBSZ8IcPM/0S0aDvq9EAbzECSAzCCF0jZFprcnCt hHbMwGzZD5TVsW7+M7/uZ+fTgrerXmxEbJ9LmSN3m0GSbu/OjpaAS2Wb98xhpKi2LKKF VC0RsktYTnvOmsy2XcTpdY3g5+hKXDR2ITLALzlYJuuftmXKlncqZjMdGMDmlA75H71z Mn6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=cWtX/Y7VOzPG7YV3Ogf5zp2+kyBwby9lvWTjXpKpYH8=; b=0mdNOhR6hh7kK+56ryY7k3Z+ybu/V9TJw8XFE7KaRwYoMv2ZU8FZKWc3pB0xFL/y7f cLkU813vToCETfl7w0D8OcQHqUU1LP87TKwKwD/KCXmubx0K+TEfg8m0FwNiLSsT2Dt6 O7b6B4T0yBgeLpv9TpzBG+2dtOiLtRFjM2cD4ztZAtOb1BuxAaG5GRUAo+ycgYRg/x5y JJxAxtsli1PieMamhpPMuQTnDkeKFVn13DPMa4yzLgiLW16iYdIsIq4JntagZa38hSYy XEw1ozffVH7T5pp8cGAlz/Lt+fpEi+tkTqVfQpkfjJKenD69iDYIdrNjN98r+/Z/Zhyr kuzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lARNPdfT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si5238873ede.41.2020.05.29.04.59.52; Fri, 29 May 2020 05:00:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lARNPdfT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbgE2L55 (ORCPT + 99 others); Fri, 29 May 2020 07:57:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbgE2L54 (ORCPT ); Fri, 29 May 2020 07:57:56 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E78DC03E969; Fri, 29 May 2020 04:57:56 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id n24so1835481ejd.0; Fri, 29 May 2020 04:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cWtX/Y7VOzPG7YV3Ogf5zp2+kyBwby9lvWTjXpKpYH8=; b=lARNPdfTRqupIOF/rO/4xOcYmKiia1su27v0OMgzUH2NkfqQLq3tncArxkxnvqG3EP xyqBPHSetqJZ7xKEI4ofC2lA4SI4zuDy492w51jY0YmM+qZQMzbgfq1Czwpw9cLWJ5en uNV/gSrUMufnxTWGE1Vg6+S0hhQi0wUCSFmmcqYqxbinG0EAKa5ad6tBgEj3P39Nb74J 7ipVCnKdI9i5GOSxyFee3es/1DOLQHbcpThsFqLLvA2xYQNoQeHLfFKOW9wy7FJCISur +7lDDd/nrJy81P8uXHO/HencRfO6xZ3LygPa4Y+gpFy515BH+HJFclEnEafcuKpxjDiZ BaZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cWtX/Y7VOzPG7YV3Ogf5zp2+kyBwby9lvWTjXpKpYH8=; b=E1vvAG/yxmSWnWnUGzfTmG1RP9fVJmu5kc+DZls8VI3aGrXWK3s8AWJ/FsXVu1tvgE ZYK3omerDhDWVMI/AZ7ETO6qeaHKSgz8OmeDzlu9rNH3NBu1SUZ38hKxxzxhY4HtTuCl ZrXRIoJt22sEad5PgQXhZ+AfjsOZm/2Vjp2ZX1tRhSKp7uCVqpFmDXvBbvM+c5QiWxpd FDnW4r7PfqhK/TX6dqlFjcOH7lEdQv4d5qbHKDtriifFKGeB/BKnKBNgWW7qzCipJz3C rTb/btlrToTA6iUe34GGYE03FbV/u4rWbClbjfxPvLNDCV5zWOk28uR0sSB+qe+tBbfh TrGQ== X-Gm-Message-State: AOAM532hRVk9T97rxknjsMTB8IEbWzQZ7qJX4ipip8NZU43XjnkTFknY /APB/SeyEmJlRKJVz+mkmT/kk0ZYcYo= X-Received: by 2002:a17:906:b2c6:: with SMTP id cf6mr7321483ejb.210.1590753474289; Fri, 29 May 2020 04:57:54 -0700 (PDT) Received: from [192.168.15.109] ([194.152.46.38]) by smtp.gmail.com with ESMTPSA id af15sm7258857ejc.89.2020.05.29.04.57.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 04:57:53 -0700 (PDT) Subject: Re: [Patch 1/2] media: v4l2-rect.h: add enclosed rectangle helper To: Benoit Parrot , Hans Verkuil , Prabhakar Lad , Kyungmin Park , Kukjin Kim , Sylwester Nawrocki , Krzysztof Kozlowski , Jacek Anaszewski Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200528132605.18339-1-bparrot@ti.com> <20200528132605.18339-2-bparrot@ti.com> From: Andrzej Pietrasiewicz Message-ID: <6b88258e-4567-3c0b-8c90-6053dbb7634a@gmail.com> Date: Fri, 29 May 2020 13:57:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200528132605.18339-2-bparrot@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Benoit, Thank you for the patch, W dniu 28.05.2020 o 15:26, Benoit Parrot pisze: > Add a helper function to check if one rectangle is enclosed inside > another. > > Signed-off-by: Benoit Parrot Acked-by: Andrzej Pietrasiewicz > --- > include/media/v4l2-rect.h | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/include/media/v4l2-rect.h b/include/media/v4l2-rect.h > index 8800a640c224..bd587d0c0dc3 100644 > --- a/include/media/v4l2-rect.h > +++ b/include/media/v4l2-rect.h > @@ -184,4 +184,24 @@ static inline bool v4l2_rect_overlap(const struct v4l2_rect *r1, > return true; > } > > +/** > + * v4l2_rect_enclosed() - is r1 enclosed in r2? > + * @r1: rectangle. > + * @r2: rectangle. > + * > + * Returns true if @r1 is enclosed in @r2. > + */ > +static inline bool v4l2_rect_enclosed(struct v4l2_rect *r1, > + struct v4l2_rect *r2) > +{ > + if (r1->left < r2->left || r1->top < r2->top) > + return false; > + if (r1->left + r1->width > r2->left + r2->width) > + return false; > + if (r1->top + r1->height > r2->top + r2->height) > + return false; > + > + return true; > +} > + > #endif >