From patchwork Fri Apr 19 08:04:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 2463311 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id AA9D83FD8C for ; Fri, 19 Apr 2013 08:05:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 82182E679F for ; Fri, 19 Apr 2013 01:05:42 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BFA2E6746; Fri, 19 Apr 2013 01:05:07 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 19 Apr 2013 01:04:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,507,1363158000"; d="scan'208";a="288485307" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by azsmga001.ch.intel.com with SMTP; 19 Apr 2013 01:04:49 -0700 Received: by stinkbox (sSMTP sendmail emulation); Fri, 19 Apr 2013 11:04:49 +0300 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm: Add drm_rect_equals() Date: Fri, 19 Apr 2013 11:04:47 +0300 Message-Id: <1366358689-28127-1-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <20130416152708.GB16940@cantiga.alporthouse.com> References: <20130416152708.GB16940@cantiga.alporthouse.com> MIME-Version: 1.0 Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä drm_rect_equals() tells whether two drm_rects are equal. Signed-off-by: Ville Syrjälä --- include/drm/drm_rect.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h index fe767b7..64fa265 100644 --- a/include/drm/drm_rect.h +++ b/include/drm/drm_rect.h @@ -124,6 +124,21 @@ static inline bool drm_rect_visible(const struct drm_rect *r) return drm_rect_width(r) > 0 && drm_rect_height(r) > 0; } +/** + * drm_rect_equals - determine if two rectangles are equal + * @r1: first rectangle + * @r2: second rectangle + * + * RETURNS: + * %true if the rectangles are equal, %false otherwise. + */ +static inline bool drm_rect_equals(const struct drm_rect *r1, + const struct drm_rect *r2) +{ + return r1->x1 == r2->x1 && r1->x2 == r2->x2 && + r1->y1 == r2->y1 && r1->y2 == r2->y2; +} + bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip); bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst, const struct drm_rect *clip,