[PATCH v2 06/15] fb: add fb_rect functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add convenience functions for calculating the width/height of a
rectangle.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 include/fb.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/fb.h b/include/fb.h
index 2dd55eb83d..574a66a396 100644
--- a/include/fb.h
+++ b/include/fb.h
@@ -99,6 +99,16 @@ struct fb_rect {
 	u32 y2;
 };
 
+static inline int fb_rect_width(const struct fb_rect *r)
+{
+	return r->x2 - r->x1;
+}
+
+static inline int fb_rect_height(const struct fb_rect *r)
+{
+	return r->y2 - r->y1;
+}
+
 struct fb_ops {
 	/* set color register */
 	int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green,

-- 
2.39.5





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux