You need to sign in or sign up before continuing.
提交 84509eed 编写于 作者: J José Expósito

drm/rect: Add DRM_RECT_INIT() macro

Add a helper macro to initialize a rectangle from x, y, width and
height information.
Reviewed-by: NJani Nikula <jani.nikula@intel.com>
Reviewed-by: NDavid Gow <davidgow@google.com>
Acked-by: NThomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: NJosé Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220620160640.3790-2-jose.exposito89@gmail.com
上级 016a14be
......@@ -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
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册