Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/rect: Add DRM_RECT_INIT() macro

Add a helper macro to initialize a rectangle from x, y, width and
height information.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: David Gow <davidgow@google.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220620160640.3790-2-jose.exposito89@gmail.com

+16
+16
include/drm/drm_rect.h
··· 48 48 }; 49 49 50 50 /** 51 + * DRM_RECT_INIT - initialize a rectangle from x/y/w/h 52 + * @x: x coordinate 53 + * @y: y coordinate 54 + * @w: width 55 + * @h: height 56 + * 57 + * RETURNS: 58 + * A new rectangle of the specified size. 59 + */ 60 + #define DRM_RECT_INIT(x, y, w, h) ((struct drm_rect){ \ 61 + .x1 = (x), \ 62 + .y1 = (y), \ 63 + .x2 = (x) + (w), \ 64 + .y2 = (y) + (h) }) 65 + 66 + /** 51 67 * DRM_RECT_FMT - printf string for &struct drm_rect 52 68 */ 53 69 #define DRM_RECT_FMT "%dx%d%+d%+d"