Merge tag 'dma-mapping-5.20-2022-08-06' of git://git.infradead.org/users/hch/dma...
[linux-2.6-microblaze.git] / include / drm / drm_rect.h
index 6f6e19b..e8d94fc 100644 (file)
@@ -47,6 +47,22 @@ struct drm_rect {
        int x1, y1, x2, y2;
 };
 
+/**
+ * DRM_RECT_INIT - initialize a rectangle from x/y/w/h
+ * @x: x coordinate
+ * @y: y coordinate
+ * @w: width
+ * @h: height
+ *
+ * RETURNS:
+ * A new rectangle of the specified size.
+ */
+#define DRM_RECT_INIT(x, y, w, h) ((struct drm_rect){ \
+               .x1 = (x), \
+               .y1 = (y), \
+               .x2 = (x) + (w), \
+               .y2 = (y) + (h) })
+
 /**
  * DRM_RECT_FMT - printf string for &struct drm_rect
  */