blob: b4d0f6fea8fc29fd77d5f5b76a34abe77abfd908 [file] [log] [blame]
From c8d54d7f83ac5816b2533468745e1eff6e61c84f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
Date: Wed, 24 Apr 2013 18:52:37 +0300
Subject: drm: Add drm_rect_equals()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
drm_rect_equals() tells whether two drm_rects are equal.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 0894c96bff762d0474a8722bba3d420f643db359)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
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 fe767b757c8c..64fa265c6ffb 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,
--
1.8.5.rc3