Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1298409ybm; Sat, 30 May 2020 04:54:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4siL4mNIQHroroSsyCOhV4wrfpBzcQ5l0gA8I7cJDnfvJIzcU8AZ2SKODIhJxWRcuj8BG X-Received: by 2002:a50:858d:: with SMTP id a13mr12720422edh.239.1590839654593; Sat, 30 May 2020 04:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590839654; cv=none; d=google.com; s=arc-20160816; b=I7gK4jHDnqavIB8GItZCmJxpoz+BX+QyNKpD2UY/498DCBeYpO4tkQwHFZl7sx/zRN qOecI9DKsYa1jARPh+iH5sMgmtzzqUY2iaLj06lGbTkRjyepdeeOClrd7VYly5Ayobdx TAjajt96e2b0DjGsZZnoHplETwAk4wIv8QYhvOyZuJBhz42ybOxxcs71EaTkVjhNiX2f SPZ/5hWKePlRlRYdHNf2ex4XX3m1qHjAbYg3nQw3y020kHj3g8QJVgOTVszZSS1gBkOy PanqlMkJAPax/dAIJOaHNAJ9R1iwb3XkY8CXZliehYz1EdVThgjPByWhE1voa0WNUTzS UgbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xCXAfOioBbxUVL8mTl6H9BT4lkk40qtADdxo9zWE6eo=; b=nJf7SfEb64gRWm9p22rAmvynB2cr6fH9fPMmc6qtO1LJIYfGiksKPefTE/5kJ5HXJh uUfhgZ3m4YMwsL++92hREVZVjN1JNQBU/pK9HH9IUneFtfJzQhuvJSxWoVmDVnJst/KA WDJB3XSQTcAIJQZVIU8kt/AFSMqozXu8b7pIPMWDW/cyQrBJSUMKMWuucnJB/uPk41lC Nyco4w6411P416LEbPQgewRfE5RJ25tX8V6rYBwXi5Hp0hvo/nEqcv2TWSGCJaTYVKnW R5qJHO6X9pTmTN2iJ0DnpGgKFjSRPx0D5+ytM7xIUIeYoZhEhNgtrbtZ/IdEx3nfov+o dBjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O5BSzgPz; 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 y19si67756edm.534.2020.05.30.04.53.49; Sat, 30 May 2020 04:54:14 -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=O5BSzgPz; 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 S1728850AbgE3Lv3 (ORCPT + 99 others); Sat, 30 May 2020 07:51:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728433AbgE3Lv2 (ORCPT ); Sat, 30 May 2020 07:51:28 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04383C03E969; Sat, 30 May 2020 04:51:28 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id b18so4090711oti.1; Sat, 30 May 2020 04:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xCXAfOioBbxUVL8mTl6H9BT4lkk40qtADdxo9zWE6eo=; b=O5BSzgPzPryy0HvONiyGE6SzGpUrGWja9Etknk/zTZsMqXvtbronBpfqQ+28vFoND3 F/EWaNUuenDPs/HyK+CzAcP9Kq+LHbTR1cEvEPZ6eYD66oFWn5huq6kLY9Pa4Nr7jbSj MS+NcGDOwvu/tHjds7XDBf4c3/b2XQrb7ZlZB7niYEDgF7kgK6+lAPlP72+9ww4SK5ZE q0JI31YnsV54OfYU6mb9JvTXJyZxYJwk5G8b3EharS/3YNiU+Du1xqvc9LEERMZ4MTVg 1k1zyE3b/+eoHnsJxR7i2llwH8GphvYdwVx9X3QeaPqZnIb1JLbJ+fUiGPNhfdkGeag1 ts7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xCXAfOioBbxUVL8mTl6H9BT4lkk40qtADdxo9zWE6eo=; b=otqaxoJCjsazjAdhAlU34YJNfrfC3TBlSrRaL6+1wznqIAqNfebfEeeWMptxlLWdaG xYP/9ez/WxTuC7KP0w0gmgpdxuaZ7V6RCFmqZGkL+fvNWBflCPXYn5LpEnjxreQ0bdg3 6+bqTCFrkg/djr0G15N8t38dsSHxLd3KNggM1OQlxVe7VKj7ufJ1q+q/cnZVPGyGkQy4 ZrE9pqhXcbkbQIsPQ1g+6nra7JxVVEEm8dZ8euwBxuv8p+1zB1nqVfX0CeLurEXtpfxN 1vG8I3tPQ1cKbUblPIaBEoiO/BHE/pLh6gxruY9QQf7RrXykefXFJzoUb0B8vtx6rSa3 MlQg== X-Gm-Message-State: AOAM533zLE0CoZld6qiy0riFZj4TkJPfwhiyROnahPrryxd8fKr8FWRB HygNwK0AintGH2R+2vub2okYrL/iMznAZXS95EVFNIiLHbd9cQ== X-Received: by 2002:a05:6830:1658:: with SMTP id h24mr9208019otr.43.1590839487411; Sat, 30 May 2020 04:51:27 -0700 (PDT) MIME-Version: 1.0 References: <20200528132605.18339-1-bparrot@ti.com> <20200528132605.18339-2-bparrot@ti.com> In-Reply-To: <20200528132605.18339-2-bparrot@ti.com> From: "Lad, Prabhakar" Date: Sat, 30 May 2020 12:51:01 +0100 Message-ID: Subject: Re: [Patch 1/2] media: v4l2-rect.h: add enclosed rectangle helper To: Benoit Parrot Cc: Hans Verkuil , Kyungmin Park , Kukjin Kim , Sylwester Nawrocki , Krzysztof Kozlowski , Andrzej Pietrasiewicz , Jacek Anaszewski , linux-media , LKML Content-Type: text/plain; charset="UTF-8" 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. On Thu, May 28, 2020 at 2:26 PM Benoit Parrot wrote: > > Add a helper function to check if one rectangle is enclosed inside > another. > > Signed-off-by: Benoit Parrot > --- > include/media/v4l2-rect.h | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > Reviewed-by: Lad Prabhakar Cheers, --Prabhakar > 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 > -- > 2.17.1 >