Commit e22b86e9 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/rect: Add drm_rect_init()

Add a helper to initialize a rectangle from x/y/w/h information.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930134214.24702-2-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 763ba2ec
...@@ -69,6 +69,23 @@ struct drm_rect { ...@@ -69,6 +69,23 @@ struct drm_rect {
(r)->x1 >> 16, (((r)->x1 & 0xffff) * 15625) >> 10, \ (r)->x1 >> 16, (((r)->x1 & 0xffff) * 15625) >> 10, \
(r)->y1 >> 16, (((r)->y1 & 0xffff) * 15625) >> 10 (r)->y1 >> 16, (((r)->y1 & 0xffff) * 15625) >> 10
/**
* drm_rect_init - initialize the rectangle from x/y/w/h
* @r: rectangle
* @x: x coordinate
* @y: y coordinate
* @width: width
* @height: height
*/
static inline void drm_rect_init(struct drm_rect *r, int x, int y,
int width, int height)
{
r->x1 = x;
r->y1 = y;
r->x2 = x + width;
r->y2 = y + height;
}
/** /**
* drm_rect_adjust_size - adjust the size of the rectangle * drm_rect_adjust_size - adjust the size of the rectangle
* @r: rectangle to be adjusted * @r: rectangle to be adjusted
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment