diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-04-24 11:52:37 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-04-30 16:20:05 -0400 |
commit | 0894c96bff762d0474a8722bba3d420f643db359 (patch) | |
tree | c29be8c57296ccd5d3be5f06788236412607e859 /include/drm | |
parent | e7272df342ba337e87e210470bb93d97d192f2e0 (diff) |
drm: Add drm_rect_equals()
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>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_rect.h | 15 |
1 files changed, 15 insertions, 0 deletions
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) | |||
124 | return drm_rect_width(r) > 0 && drm_rect_height(r) > 0; | 124 | return drm_rect_width(r) > 0 && drm_rect_height(r) > 0; |
125 | } | 125 | } |
126 | 126 | ||
127 | /** | ||
128 | * drm_rect_equals - determine if two rectangles are equal | ||
129 | * @r1: first rectangle | ||
130 | * @r2: second rectangle | ||
131 | * | ||
132 | * RETURNS: | ||
133 | * %true if the rectangles are equal, %false otherwise. | ||
134 | */ | ||
135 | static inline bool drm_rect_equals(const struct drm_rect *r1, | ||
136 | const struct drm_rect *r2) | ||
137 | { | ||
138 | return r1->x1 == r2->x1 && r1->x2 == r2->x2 && | ||
139 | r1->y1 == r2->y1 && r1->y2 == r2->y2; | ||
140 | } | ||
141 | |||
127 | bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip); | 142 | bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip); |
128 | bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst, | 143 | bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst, |
129 | const struct drm_rect *clip, | 144 | const struct drm_rect *clip, |