18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
38c2ecf20Sopenharmony_ci * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com>
48c2ecf20Sopenharmony_ci * Copyright (c) 2008 Red Hat Inc.
58c2ecf20Sopenharmony_ci * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
68c2ecf20Sopenharmony_ci * Copyright (c) 2007-2008 Intel Corporation
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
98c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
108c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
118c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
128c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
138c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
168c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
198c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
208c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
218c2ecf20Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
228c2ecf20Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
238c2ecf20Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
248c2ecf20Sopenharmony_ci * IN THE SOFTWARE.
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#ifndef _DRM_MODE_H
288c2ecf20Sopenharmony_ci#define _DRM_MODE_H
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#include "drm.h"
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#if defined(__cplusplus)
338c2ecf20Sopenharmony_ciextern "C" {
348c2ecf20Sopenharmony_ci#endif
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/**
378c2ecf20Sopenharmony_ci * DOC: overview
388c2ecf20Sopenharmony_ci *
398c2ecf20Sopenharmony_ci * DRM exposes many UAPI and structure definition to have a consistent
408c2ecf20Sopenharmony_ci * and standardized interface with user.
418c2ecf20Sopenharmony_ci * Userspace can refer to these structure definitions and UAPI formats
428c2ecf20Sopenharmony_ci * to communicate to driver
438c2ecf20Sopenharmony_ci */
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define DRM_CONNECTOR_NAME_LEN	32
468c2ecf20Sopenharmony_ci#define DRM_DISPLAY_MODE_LEN	32
478c2ecf20Sopenharmony_ci#define DRM_PROP_NAME_LEN	32
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_BUILTIN	(1<<0) /* deprecated */
508c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_CLOCK_C	((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
518c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_CRTC_C	((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
528c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_PREFERRED	(1<<3)
538c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_DEFAULT	(1<<4) /* deprecated */
548c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_USERDEF	(1<<5)
558c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_DRIVER	(1<<6)
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define DRM_MODE_TYPE_ALL	(DRM_MODE_TYPE_PREFERRED |	\
588c2ecf20Sopenharmony_ci				 DRM_MODE_TYPE_USERDEF |	\
598c2ecf20Sopenharmony_ci				 DRM_MODE_TYPE_DRIVER)
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/* Video mode flags */
628c2ecf20Sopenharmony_ci/* bit compatible with the xrandr RR_ definitions (bits 0-13)
638c2ecf20Sopenharmony_ci *
648c2ecf20Sopenharmony_ci * ABI warning: Existing userspace really expects
658c2ecf20Sopenharmony_ci * the mode flags to match the xrandr definitions. Any
668c2ecf20Sopenharmony_ci * changes that don't match the xrandr definitions will
678c2ecf20Sopenharmony_ci * likely need a new client cap or some other mechanism
688c2ecf20Sopenharmony_ci * to avoid breaking existing userspace. This includes
698c2ecf20Sopenharmony_ci * allocating new flags in the previously unused bits!
708c2ecf20Sopenharmony_ci */
718c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_PHSYNC			(1<<0)
728c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_NHSYNC			(1<<1)
738c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_PVSYNC			(1<<2)
748c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_NVSYNC			(1<<3)
758c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_INTERLACE			(1<<4)
768c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_DBLSCAN			(1<<5)
778c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_CSYNC			(1<<6)
788c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_PCSYNC			(1<<7)
798c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_NCSYNC			(1<<8)
808c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_HSKEW			(1<<9) /* hskew provided */
818c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_BCAST			(1<<10) /* deprecated */
828c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_PIXMUX			(1<<11) /* deprecated */
838c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_DBLCLK			(1<<12)
848c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_CLKDIV2			(1<<13)
858c2ecf20Sopenharmony_ci /*
868c2ecf20Sopenharmony_ci  * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX
878c2ecf20Sopenharmony_ci  * (define not exposed to user space).
888c2ecf20Sopenharmony_ci  */
898c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_3D_MASK			(0x1f<<14)
908c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_NONE		(0<<14)
918c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_FRAME_PACKING		(1<<14)
928c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE	(2<<14)
938c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_LINE_ALTERNATIVE	(3<<14)
948c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL	(4<<14)
958c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_L_DEPTH		(5<<14)
968c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH	(6<<14)
978c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_TOP_AND_BOTTOM	(7<<14)
988c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF	(8<<14)
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci/* Picture aspect ratio options */
1018c2ecf20Sopenharmony_ci#define DRM_MODE_PICTURE_ASPECT_NONE		0
1028c2ecf20Sopenharmony_ci#define DRM_MODE_PICTURE_ASPECT_4_3		1
1038c2ecf20Sopenharmony_ci#define DRM_MODE_PICTURE_ASPECT_16_9		2
1048c2ecf20Sopenharmony_ci#define DRM_MODE_PICTURE_ASPECT_64_27		3
1058c2ecf20Sopenharmony_ci#define DRM_MODE_PICTURE_ASPECT_256_135		4
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci/* Content type options */
1088c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_TYPE_NO_DATA		0
1098c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_TYPE_GRAPHICS		1
1108c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_TYPE_PHOTO		2
1118c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_TYPE_CINEMA		3
1128c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_TYPE_GAME		4
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci/* Aspect ratio flag bitmask (4 bits 22:19) */
1158c2ecf20Sopenharmony_ci#define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
1168c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_PIC_AR_NONE \
1178c2ecf20Sopenharmony_ci			(DRM_MODE_PICTURE_ASPECT_NONE<<19)
1188c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_PIC_AR_4_3 \
1198c2ecf20Sopenharmony_ci			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
1208c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_PIC_AR_16_9 \
1218c2ecf20Sopenharmony_ci			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
1228c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_PIC_AR_64_27 \
1238c2ecf20Sopenharmony_ci			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
1248c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_PIC_AR_256_135 \
1258c2ecf20Sopenharmony_ci			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci#define  DRM_MODE_FLAG_ALL	(DRM_MODE_FLAG_PHSYNC |		\
1288c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_NHSYNC |		\
1298c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_PVSYNC |		\
1308c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_NVSYNC |		\
1318c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_INTERLACE |	\
1328c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_DBLSCAN |	\
1338c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_CSYNC |		\
1348c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_PCSYNC |		\
1358c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_NCSYNC |		\
1368c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_HSKEW |		\
1378c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_DBLCLK |		\
1388c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_CLKDIV2 |	\
1398c2ecf20Sopenharmony_ci				 DRM_MODE_FLAG_3D_MASK)
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci/* DPMS flags */
1428c2ecf20Sopenharmony_ci/* bit compatible with the xorg definitions. */
1438c2ecf20Sopenharmony_ci#define DRM_MODE_DPMS_ON	0
1448c2ecf20Sopenharmony_ci#define DRM_MODE_DPMS_STANDBY	1
1458c2ecf20Sopenharmony_ci#define DRM_MODE_DPMS_SUSPEND	2
1468c2ecf20Sopenharmony_ci#define DRM_MODE_DPMS_OFF	3
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci/* Scaling mode options */
1498c2ecf20Sopenharmony_ci#define DRM_MODE_SCALE_NONE		0 /* Unmodified timing (display or
1508c2ecf20Sopenharmony_ci					     software can still scale) */
1518c2ecf20Sopenharmony_ci#define DRM_MODE_SCALE_FULLSCREEN	1 /* Full screen, ignore aspect */
1528c2ecf20Sopenharmony_ci#define DRM_MODE_SCALE_CENTER		2 /* Centered, no scaling */
1538c2ecf20Sopenharmony_ci#define DRM_MODE_SCALE_ASPECT		3 /* Full screen, preserve aspect */
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/* Dithering mode options */
1568c2ecf20Sopenharmony_ci#define DRM_MODE_DITHERING_OFF	0
1578c2ecf20Sopenharmony_ci#define DRM_MODE_DITHERING_ON	1
1588c2ecf20Sopenharmony_ci#define DRM_MODE_DITHERING_AUTO 2
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci/* Dirty info options */
1618c2ecf20Sopenharmony_ci#define DRM_MODE_DIRTY_OFF      0
1628c2ecf20Sopenharmony_ci#define DRM_MODE_DIRTY_ON       1
1638c2ecf20Sopenharmony_ci#define DRM_MODE_DIRTY_ANNOTATE 2
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci/* Link Status options */
1668c2ecf20Sopenharmony_ci#define DRM_MODE_LINK_STATUS_GOOD	0
1678c2ecf20Sopenharmony_ci#define DRM_MODE_LINK_STATUS_BAD	1
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci/*
1708c2ecf20Sopenharmony_ci * DRM_MODE_ROTATE_<degrees>
1718c2ecf20Sopenharmony_ci *
1728c2ecf20Sopenharmony_ci * Signals that a drm plane is been rotated <degrees> degrees in counter
1738c2ecf20Sopenharmony_ci * clockwise direction.
1748c2ecf20Sopenharmony_ci *
1758c2ecf20Sopenharmony_ci * This define is provided as a convenience, looking up the property id
1768c2ecf20Sopenharmony_ci * using the name->prop id lookup is the preferred method.
1778c2ecf20Sopenharmony_ci */
1788c2ecf20Sopenharmony_ci#define DRM_MODE_ROTATE_0       (1<<0)
1798c2ecf20Sopenharmony_ci#define DRM_MODE_ROTATE_90      (1<<1)
1808c2ecf20Sopenharmony_ci#define DRM_MODE_ROTATE_180     (1<<2)
1818c2ecf20Sopenharmony_ci#define DRM_MODE_ROTATE_270     (1<<3)
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci/*
1848c2ecf20Sopenharmony_ci * DRM_MODE_ROTATE_MASK
1858c2ecf20Sopenharmony_ci *
1868c2ecf20Sopenharmony_ci * Bitmask used to look for drm plane rotations.
1878c2ecf20Sopenharmony_ci */
1888c2ecf20Sopenharmony_ci#define DRM_MODE_ROTATE_MASK (\
1898c2ecf20Sopenharmony_ci		DRM_MODE_ROTATE_0  | \
1908c2ecf20Sopenharmony_ci		DRM_MODE_ROTATE_90  | \
1918c2ecf20Sopenharmony_ci		DRM_MODE_ROTATE_180 | \
1928c2ecf20Sopenharmony_ci		DRM_MODE_ROTATE_270)
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci/*
1958c2ecf20Sopenharmony_ci * DRM_MODE_REFLECT_<axis>
1968c2ecf20Sopenharmony_ci *
1978c2ecf20Sopenharmony_ci * Signals that the contents of a drm plane is reflected along the <axis> axis,
1988c2ecf20Sopenharmony_ci * in the same way as mirroring.
1998c2ecf20Sopenharmony_ci * See kerneldoc chapter "Plane Composition Properties" for more details.
2008c2ecf20Sopenharmony_ci *
2018c2ecf20Sopenharmony_ci * This define is provided as a convenience, looking up the property id
2028c2ecf20Sopenharmony_ci * using the name->prop id lookup is the preferred method.
2038c2ecf20Sopenharmony_ci */
2048c2ecf20Sopenharmony_ci#define DRM_MODE_REFLECT_X      (1<<4)
2058c2ecf20Sopenharmony_ci#define DRM_MODE_REFLECT_Y      (1<<5)
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/*
2088c2ecf20Sopenharmony_ci * DRM_MODE_REFLECT_MASK
2098c2ecf20Sopenharmony_ci *
2108c2ecf20Sopenharmony_ci * Bitmask used to look for drm plane reflections.
2118c2ecf20Sopenharmony_ci */
2128c2ecf20Sopenharmony_ci#define DRM_MODE_REFLECT_MASK (\
2138c2ecf20Sopenharmony_ci		DRM_MODE_REFLECT_X | \
2148c2ecf20Sopenharmony_ci		DRM_MODE_REFLECT_Y)
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci/* Content Protection Flags */
2178c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED	0
2188c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_PROTECTION_DESIRED     1
2198c2ecf20Sopenharmony_ci#define DRM_MODE_CONTENT_PROTECTION_ENABLED     2
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_cistruct drm_mode_modeinfo {
2228c2ecf20Sopenharmony_ci	__u32 clock;
2238c2ecf20Sopenharmony_ci	__u16 hdisplay;
2248c2ecf20Sopenharmony_ci	__u16 hsync_start;
2258c2ecf20Sopenharmony_ci	__u16 hsync_end;
2268c2ecf20Sopenharmony_ci	__u16 htotal;
2278c2ecf20Sopenharmony_ci	__u16 hskew;
2288c2ecf20Sopenharmony_ci	__u16 vdisplay;
2298c2ecf20Sopenharmony_ci	__u16 vsync_start;
2308c2ecf20Sopenharmony_ci	__u16 vsync_end;
2318c2ecf20Sopenharmony_ci	__u16 vtotal;
2328c2ecf20Sopenharmony_ci	__u16 vscan;
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_ci	__u32 vrefresh;
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci	__u32 flags;
2378c2ecf20Sopenharmony_ci	__u32 type;
2388c2ecf20Sopenharmony_ci	char name[DRM_DISPLAY_MODE_LEN];
2398c2ecf20Sopenharmony_ci};
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_cistruct drm_mode_card_res {
2428c2ecf20Sopenharmony_ci	__u64 fb_id_ptr;
2438c2ecf20Sopenharmony_ci	__u64 crtc_id_ptr;
2448c2ecf20Sopenharmony_ci	__u64 connector_id_ptr;
2458c2ecf20Sopenharmony_ci	__u64 encoder_id_ptr;
2468c2ecf20Sopenharmony_ci	__u32 count_fbs;
2478c2ecf20Sopenharmony_ci	__u32 count_crtcs;
2488c2ecf20Sopenharmony_ci	__u32 count_connectors;
2498c2ecf20Sopenharmony_ci	__u32 count_encoders;
2508c2ecf20Sopenharmony_ci	__u32 min_width;
2518c2ecf20Sopenharmony_ci	__u32 max_width;
2528c2ecf20Sopenharmony_ci	__u32 min_height;
2538c2ecf20Sopenharmony_ci	__u32 max_height;
2548c2ecf20Sopenharmony_ci};
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_cistruct drm_mode_crtc {
2578c2ecf20Sopenharmony_ci	__u64 set_connectors_ptr;
2588c2ecf20Sopenharmony_ci	__u32 count_connectors;
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci	__u32 crtc_id; /**< Id */
2618c2ecf20Sopenharmony_ci	__u32 fb_id; /**< Id of framebuffer */
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci	__u32 x; /**< x Position on the framebuffer */
2648c2ecf20Sopenharmony_ci	__u32 y; /**< y Position on the framebuffer */
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci	__u32 gamma_size;
2678c2ecf20Sopenharmony_ci	__u32 mode_valid;
2688c2ecf20Sopenharmony_ci	struct drm_mode_modeinfo mode;
2698c2ecf20Sopenharmony_ci};
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci#define DRM_MODE_PRESENT_TOP_FIELD	(1<<0)
2728c2ecf20Sopenharmony_ci#define DRM_MODE_PRESENT_BOTTOM_FIELD	(1<<1)
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci/* Planes blend with or override other bits on the CRTC */
2758c2ecf20Sopenharmony_cistruct drm_mode_set_plane {
2768c2ecf20Sopenharmony_ci	__u32 plane_id;
2778c2ecf20Sopenharmony_ci	__u32 crtc_id;
2788c2ecf20Sopenharmony_ci	__u32 fb_id; /* fb object contains surface format type */
2798c2ecf20Sopenharmony_ci	__u32 flags; /* see above flags */
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci	/* Signed dest location allows it to be partially off screen */
2828c2ecf20Sopenharmony_ci	__s32 crtc_x;
2838c2ecf20Sopenharmony_ci	__s32 crtc_y;
2848c2ecf20Sopenharmony_ci	__u32 crtc_w;
2858c2ecf20Sopenharmony_ci	__u32 crtc_h;
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci	/* Source values are 16.16 fixed point */
2888c2ecf20Sopenharmony_ci	__u32 src_x;
2898c2ecf20Sopenharmony_ci	__u32 src_y;
2908c2ecf20Sopenharmony_ci	__u32 src_h;
2918c2ecf20Sopenharmony_ci	__u32 src_w;
2928c2ecf20Sopenharmony_ci};
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_cistruct drm_mode_get_plane {
2958c2ecf20Sopenharmony_ci	__u32 plane_id;
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci	__u32 crtc_id;
2988c2ecf20Sopenharmony_ci	__u32 fb_id;
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci	__u32 possible_crtcs;
3018c2ecf20Sopenharmony_ci	__u32 gamma_size;
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci	__u32 count_format_types;
3048c2ecf20Sopenharmony_ci	__u64 format_type_ptr;
3058c2ecf20Sopenharmony_ci};
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_cistruct drm_mode_get_plane_res {
3088c2ecf20Sopenharmony_ci	__u64 plane_id_ptr;
3098c2ecf20Sopenharmony_ci	__u32 count_planes;
3108c2ecf20Sopenharmony_ci};
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_NONE	0
3138c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_DAC	1
3148c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_TMDS	2
3158c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_LVDS	3
3168c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_TVDAC	4
3178c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_VIRTUAL 5
3188c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_DSI	6
3198c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_DPMST	7
3208c2ecf20Sopenharmony_ci#define DRM_MODE_ENCODER_DPI	8
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_cistruct drm_mode_get_encoder {
3238c2ecf20Sopenharmony_ci	__u32 encoder_id;
3248c2ecf20Sopenharmony_ci	__u32 encoder_type;
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci	__u32 crtc_id; /**< Id of crtc */
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci	__u32 possible_crtcs;
3298c2ecf20Sopenharmony_ci	__u32 possible_clones;
3308c2ecf20Sopenharmony_ci};
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci/* This is for connectors with multiple signal types. */
3338c2ecf20Sopenharmony_ci/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
3348c2ecf20Sopenharmony_cienum drm_mode_subconnector {
3358c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_Automatic   = 0,  /* DVI-I, TV     */
3368c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_Unknown     = 0,  /* DVI-I, TV, DP */
3378c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_VGA	  = 1,  /*            DP */
3388c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_DVID	  = 3,  /* DVI-I      DP */
3398c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_DVIA	  = 4,  /* DVI-I         */
3408c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_Composite   = 5,  /*        TV     */
3418c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_SVIDEO	  = 6,  /*        TV     */
3428c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_Component   = 8,  /*        TV     */
3438c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_SCART	  = 9,  /*        TV     */
3448c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /*            DP */
3458c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_HDMIA       = 11, /*            DP */
3468c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_Native      = 15, /*            DP */
3478c2ecf20Sopenharmony_ci	DRM_MODE_SUBCONNECTOR_Wireless    = 18, /*            DP */
3488c2ecf20Sopenharmony_ci};
3498c2ecf20Sopenharmony_ci
3508c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_Unknown	0
3518c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_VGA		1
3528c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_DVII		2
3538c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_DVID		3
3548c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_DVIA		4
3558c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_Composite	5
3568c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_SVIDEO	6
3578c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_LVDS		7
3588c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_Component	8
3598c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_9PinDIN	9
3608c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_DisplayPort	10
3618c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_HDMIA	11
3628c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_HDMIB	12
3638c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_TV		13
3648c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_eDP		14
3658c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_VIRTUAL      15
3668c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_DSI		16
3678c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_DPI		17
3688c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_WRITEBACK	18
3698c2ecf20Sopenharmony_ci#define DRM_MODE_CONNECTOR_SPI		19
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_cistruct drm_mode_get_connector {
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_ci	__u64 encoders_ptr;
3748c2ecf20Sopenharmony_ci	__u64 modes_ptr;
3758c2ecf20Sopenharmony_ci	__u64 props_ptr;
3768c2ecf20Sopenharmony_ci	__u64 prop_values_ptr;
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_ci	__u32 count_modes;
3798c2ecf20Sopenharmony_ci	__u32 count_props;
3808c2ecf20Sopenharmony_ci	__u32 count_encoders;
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci	__u32 encoder_id; /**< Current Encoder */
3838c2ecf20Sopenharmony_ci	__u32 connector_id; /**< Id */
3848c2ecf20Sopenharmony_ci	__u32 connector_type;
3858c2ecf20Sopenharmony_ci	__u32 connector_type_id;
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_ci	__u32 connection;
3888c2ecf20Sopenharmony_ci	__u32 mm_width;  /**< width in millimeters */
3898c2ecf20Sopenharmony_ci	__u32 mm_height; /**< height in millimeters */
3908c2ecf20Sopenharmony_ci	__u32 subpixel;
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci	__u32 pad;
3938c2ecf20Sopenharmony_ci};
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_PENDING	(1<<0) /* deprecated, do not use */
3968c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_RANGE	(1<<1)
3978c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_IMMUTABLE	(1<<2)
3988c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_ENUM	(1<<3) /* enumerated type with text strings */
3998c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_BLOB	(1<<4)
4008c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_BITMASK	(1<<5) /* bitmask of enumerated types */
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci/* non-extended types: legacy bitmask, one bit per type: */
4038c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_LEGACY_TYPE  ( \
4048c2ecf20Sopenharmony_ci		DRM_MODE_PROP_RANGE | \
4058c2ecf20Sopenharmony_ci		DRM_MODE_PROP_ENUM | \
4068c2ecf20Sopenharmony_ci		DRM_MODE_PROP_BLOB | \
4078c2ecf20Sopenharmony_ci		DRM_MODE_PROP_BITMASK)
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_ci/* extended-types: rather than continue to consume a bit per type,
4108c2ecf20Sopenharmony_ci * grab a chunk of the bits to use as integer type id.
4118c2ecf20Sopenharmony_ci */
4128c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_EXTENDED_TYPE	0x0000ffc0
4138c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_TYPE(n)		((n) << 6)
4148c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_OBJECT		DRM_MODE_PROP_TYPE(1)
4158c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_SIGNED_RANGE	DRM_MODE_PROP_TYPE(2)
4168c2ecf20Sopenharmony_ci
4178c2ecf20Sopenharmony_ci/* the PROP_ATOMIC flag is used to hide properties from userspace that
4188c2ecf20Sopenharmony_ci * is not aware of atomic properties.  This is mostly to work around
4198c2ecf20Sopenharmony_ci * older userspace (DDX drivers) that read/write each prop they find,
4208c2ecf20Sopenharmony_ci * witout being aware that this could be triggering a lengthy modeset.
4218c2ecf20Sopenharmony_ci */
4228c2ecf20Sopenharmony_ci#define DRM_MODE_PROP_ATOMIC        0x80000000
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_cistruct drm_mode_property_enum {
4258c2ecf20Sopenharmony_ci	__u64 value;
4268c2ecf20Sopenharmony_ci	char name[DRM_PROP_NAME_LEN];
4278c2ecf20Sopenharmony_ci};
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_cistruct drm_mode_get_property {
4308c2ecf20Sopenharmony_ci	__u64 values_ptr; /* values and blob lengths */
4318c2ecf20Sopenharmony_ci	__u64 enum_blob_ptr; /* enum and blob id ptrs */
4328c2ecf20Sopenharmony_ci
4338c2ecf20Sopenharmony_ci	__u32 prop_id;
4348c2ecf20Sopenharmony_ci	__u32 flags;
4358c2ecf20Sopenharmony_ci	char name[DRM_PROP_NAME_LEN];
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci	__u32 count_values;
4388c2ecf20Sopenharmony_ci	/* This is only used to count enum values, not blobs. The _blobs is
4398c2ecf20Sopenharmony_ci	 * simply because of a historical reason, i.e. backwards compat. */
4408c2ecf20Sopenharmony_ci	__u32 count_enum_blobs;
4418c2ecf20Sopenharmony_ci};
4428c2ecf20Sopenharmony_ci
4438c2ecf20Sopenharmony_cistruct drm_mode_connector_set_property {
4448c2ecf20Sopenharmony_ci	__u64 value;
4458c2ecf20Sopenharmony_ci	__u32 prop_id;
4468c2ecf20Sopenharmony_ci	__u32 connector_id;
4478c2ecf20Sopenharmony_ci};
4488c2ecf20Sopenharmony_ci
4498c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_CRTC 0xcccccccc
4508c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
4518c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0
4528c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_MODE 0xdededede
4538c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0
4548c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
4558c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
4568c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
4578c2ecf20Sopenharmony_ci#define DRM_MODE_OBJECT_ANY 0
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_cistruct drm_mode_obj_get_properties {
4608c2ecf20Sopenharmony_ci	__u64 props_ptr;
4618c2ecf20Sopenharmony_ci	__u64 prop_values_ptr;
4628c2ecf20Sopenharmony_ci	__u32 count_props;
4638c2ecf20Sopenharmony_ci	__u32 obj_id;
4648c2ecf20Sopenharmony_ci	__u32 obj_type;
4658c2ecf20Sopenharmony_ci};
4668c2ecf20Sopenharmony_ci
4678c2ecf20Sopenharmony_cistruct drm_mode_obj_set_property {
4688c2ecf20Sopenharmony_ci	__u64 value;
4698c2ecf20Sopenharmony_ci	__u32 prop_id;
4708c2ecf20Sopenharmony_ci	__u32 obj_id;
4718c2ecf20Sopenharmony_ci	__u32 obj_type;
4728c2ecf20Sopenharmony_ci};
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_cistruct drm_mode_get_blob {
4758c2ecf20Sopenharmony_ci	__u32 blob_id;
4768c2ecf20Sopenharmony_ci	__u32 length;
4778c2ecf20Sopenharmony_ci	__u64 data;
4788c2ecf20Sopenharmony_ci};
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_cistruct drm_mode_fb_cmd {
4818c2ecf20Sopenharmony_ci	__u32 fb_id;
4828c2ecf20Sopenharmony_ci	__u32 width;
4838c2ecf20Sopenharmony_ci	__u32 height;
4848c2ecf20Sopenharmony_ci	__u32 pitch;
4858c2ecf20Sopenharmony_ci	__u32 bpp;
4868c2ecf20Sopenharmony_ci	__u32 depth;
4878c2ecf20Sopenharmony_ci	/* driver specific handle */
4888c2ecf20Sopenharmony_ci	__u32 handle;
4898c2ecf20Sopenharmony_ci};
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci#define DRM_MODE_FB_INTERLACED	(1<<0) /* for interlaced framebuffers */
4928c2ecf20Sopenharmony_ci#define DRM_MODE_FB_MODIFIERS	(1<<1) /* enables ->modifer[] */
4938c2ecf20Sopenharmony_ci
4948c2ecf20Sopenharmony_cistruct drm_mode_fb_cmd2 {
4958c2ecf20Sopenharmony_ci	__u32 fb_id;
4968c2ecf20Sopenharmony_ci	__u32 width;
4978c2ecf20Sopenharmony_ci	__u32 height;
4988c2ecf20Sopenharmony_ci	__u32 pixel_format; /* fourcc code from drm_fourcc.h */
4998c2ecf20Sopenharmony_ci	__u32 flags; /* see above flags */
5008c2ecf20Sopenharmony_ci
5018c2ecf20Sopenharmony_ci	/*
5028c2ecf20Sopenharmony_ci	 * In case of planar formats, this ioctl allows up to 4
5038c2ecf20Sopenharmony_ci	 * buffer objects with offsets and pitches per plane.
5048c2ecf20Sopenharmony_ci	 * The pitch and offset order is dictated by the fourcc,
5058c2ecf20Sopenharmony_ci	 * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as:
5068c2ecf20Sopenharmony_ci	 *
5078c2ecf20Sopenharmony_ci	 *   YUV 4:2:0 image with a plane of 8 bit Y samples
5088c2ecf20Sopenharmony_ci	 *   followed by an interleaved U/V plane containing
5098c2ecf20Sopenharmony_ci	 *   8 bit 2x2 subsampled colour difference samples.
5108c2ecf20Sopenharmony_ci	 *
5118c2ecf20Sopenharmony_ci	 * So it would consist of Y as offsets[0] and UV as
5128c2ecf20Sopenharmony_ci	 * offsets[1].  Note that offsets[0] will generally
5138c2ecf20Sopenharmony_ci	 * be 0 (but this is not required).
5148c2ecf20Sopenharmony_ci	 *
5158c2ecf20Sopenharmony_ci	 * To accommodate tiled, compressed, etc formats, a
5168c2ecf20Sopenharmony_ci	 * modifier can be specified.  The default value of zero
5178c2ecf20Sopenharmony_ci	 * indicates "native" format as specified by the fourcc.
5188c2ecf20Sopenharmony_ci	 * Vendor specific modifier token.  Note that even though
5198c2ecf20Sopenharmony_ci	 * it looks like we have a modifier per-plane, we in fact
5208c2ecf20Sopenharmony_ci	 * do not. The modifier for each plane must be identical.
5218c2ecf20Sopenharmony_ci	 * Thus all combinations of different data layouts for
5228c2ecf20Sopenharmony_ci	 * multi plane formats must be enumerated as separate
5238c2ecf20Sopenharmony_ci	 * modifiers.
5248c2ecf20Sopenharmony_ci	 */
5258c2ecf20Sopenharmony_ci	__u32 handles[4];
5268c2ecf20Sopenharmony_ci	__u32 pitches[4]; /* pitch for each plane */
5278c2ecf20Sopenharmony_ci	__u32 offsets[4]; /* offset of each plane */
5288c2ecf20Sopenharmony_ci	__u64 modifier[4]; /* ie, tiling, compress */
5298c2ecf20Sopenharmony_ci};
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
5328c2ecf20Sopenharmony_ci#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
5338c2ecf20Sopenharmony_ci#define DRM_MODE_FB_DIRTY_FLAGS         0x03
5348c2ecf20Sopenharmony_ci
5358c2ecf20Sopenharmony_ci#define DRM_MODE_FB_DIRTY_MAX_CLIPS     256
5368c2ecf20Sopenharmony_ci
5378c2ecf20Sopenharmony_ci/*
5388c2ecf20Sopenharmony_ci * Mark a region of a framebuffer as dirty.
5398c2ecf20Sopenharmony_ci *
5408c2ecf20Sopenharmony_ci * Some hardware does not automatically update display contents
5418c2ecf20Sopenharmony_ci * as a hardware or software draw to a framebuffer. This ioctl
5428c2ecf20Sopenharmony_ci * allows userspace to tell the kernel and the hardware what
5438c2ecf20Sopenharmony_ci * regions of the framebuffer have changed.
5448c2ecf20Sopenharmony_ci *
5458c2ecf20Sopenharmony_ci * The kernel or hardware is free to update more then just the
5468c2ecf20Sopenharmony_ci * region specified by the clip rects. The kernel or hardware
5478c2ecf20Sopenharmony_ci * may also delay and/or coalesce several calls to dirty into a
5488c2ecf20Sopenharmony_ci * single update.
5498c2ecf20Sopenharmony_ci *
5508c2ecf20Sopenharmony_ci * Userspace may annotate the updates, the annotates are a
5518c2ecf20Sopenharmony_ci * promise made by the caller that the change is either a copy
5528c2ecf20Sopenharmony_ci * of pixels or a fill of a single color in the region specified.
5538c2ecf20Sopenharmony_ci *
5548c2ecf20Sopenharmony_ci * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then
5558c2ecf20Sopenharmony_ci * the number of updated regions are half of num_clips given,
5568c2ecf20Sopenharmony_ci * where the clip rects are paired in src and dst. The width and
5578c2ecf20Sopenharmony_ci * height of each one of the pairs must match.
5588c2ecf20Sopenharmony_ci *
5598c2ecf20Sopenharmony_ci * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller
5608c2ecf20Sopenharmony_ci * promises that the region specified of the clip rects is filled
5618c2ecf20Sopenharmony_ci * completely with a single color as given in the color argument.
5628c2ecf20Sopenharmony_ci */
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_cistruct drm_mode_fb_dirty_cmd {
5658c2ecf20Sopenharmony_ci	__u32 fb_id;
5668c2ecf20Sopenharmony_ci	__u32 flags;
5678c2ecf20Sopenharmony_ci	__u32 color;
5688c2ecf20Sopenharmony_ci	__u32 num_clips;
5698c2ecf20Sopenharmony_ci	__u64 clips_ptr;
5708c2ecf20Sopenharmony_ci};
5718c2ecf20Sopenharmony_ci
5728c2ecf20Sopenharmony_cistruct drm_mode_mode_cmd {
5738c2ecf20Sopenharmony_ci	__u32 connector_id;
5748c2ecf20Sopenharmony_ci	struct drm_mode_modeinfo mode;
5758c2ecf20Sopenharmony_ci};
5768c2ecf20Sopenharmony_ci
5778c2ecf20Sopenharmony_ci#define DRM_MODE_CURSOR_BO	0x01
5788c2ecf20Sopenharmony_ci#define DRM_MODE_CURSOR_MOVE	0x02
5798c2ecf20Sopenharmony_ci#define DRM_MODE_CURSOR_FLAGS	0x03
5808c2ecf20Sopenharmony_ci
5818c2ecf20Sopenharmony_ci/*
5828c2ecf20Sopenharmony_ci * depending on the value in flags different members are used.
5838c2ecf20Sopenharmony_ci *
5848c2ecf20Sopenharmony_ci * CURSOR_BO uses
5858c2ecf20Sopenharmony_ci *    crtc_id
5868c2ecf20Sopenharmony_ci *    width
5878c2ecf20Sopenharmony_ci *    height
5888c2ecf20Sopenharmony_ci *    handle - if 0 turns the cursor off
5898c2ecf20Sopenharmony_ci *
5908c2ecf20Sopenharmony_ci * CURSOR_MOVE uses
5918c2ecf20Sopenharmony_ci *    crtc_id
5928c2ecf20Sopenharmony_ci *    x
5938c2ecf20Sopenharmony_ci *    y
5948c2ecf20Sopenharmony_ci */
5958c2ecf20Sopenharmony_cistruct drm_mode_cursor {
5968c2ecf20Sopenharmony_ci	__u32 flags;
5978c2ecf20Sopenharmony_ci	__u32 crtc_id;
5988c2ecf20Sopenharmony_ci	__s32 x;
5998c2ecf20Sopenharmony_ci	__s32 y;
6008c2ecf20Sopenharmony_ci	__u32 width;
6018c2ecf20Sopenharmony_ci	__u32 height;
6028c2ecf20Sopenharmony_ci	/* driver specific handle */
6038c2ecf20Sopenharmony_ci	__u32 handle;
6048c2ecf20Sopenharmony_ci};
6058c2ecf20Sopenharmony_ci
6068c2ecf20Sopenharmony_cistruct drm_mode_cursor2 {
6078c2ecf20Sopenharmony_ci	__u32 flags;
6088c2ecf20Sopenharmony_ci	__u32 crtc_id;
6098c2ecf20Sopenharmony_ci	__s32 x;
6108c2ecf20Sopenharmony_ci	__s32 y;
6118c2ecf20Sopenharmony_ci	__u32 width;
6128c2ecf20Sopenharmony_ci	__u32 height;
6138c2ecf20Sopenharmony_ci	/* driver specific handle */
6148c2ecf20Sopenharmony_ci	__u32 handle;
6158c2ecf20Sopenharmony_ci	__s32 hot_x;
6168c2ecf20Sopenharmony_ci	__s32 hot_y;
6178c2ecf20Sopenharmony_ci};
6188c2ecf20Sopenharmony_ci
6198c2ecf20Sopenharmony_cistruct drm_mode_crtc_lut {
6208c2ecf20Sopenharmony_ci	__u32 crtc_id;
6218c2ecf20Sopenharmony_ci	__u32 gamma_size;
6228c2ecf20Sopenharmony_ci
6238c2ecf20Sopenharmony_ci	/* pointers to arrays */
6248c2ecf20Sopenharmony_ci	__u64 red;
6258c2ecf20Sopenharmony_ci	__u64 green;
6268c2ecf20Sopenharmony_ci	__u64 blue;
6278c2ecf20Sopenharmony_ci};
6288c2ecf20Sopenharmony_ci
6298c2ecf20Sopenharmony_cistruct drm_color_ctm {
6308c2ecf20Sopenharmony_ci	/*
6318c2ecf20Sopenharmony_ci	 * Conversion matrix in S31.32 sign-magnitude
6328c2ecf20Sopenharmony_ci	 * (not two's complement!) format.
6338c2ecf20Sopenharmony_ci	 */
6348c2ecf20Sopenharmony_ci	__u64 matrix[9];
6358c2ecf20Sopenharmony_ci};
6368c2ecf20Sopenharmony_ci
6378c2ecf20Sopenharmony_cistruct drm_color_lut {
6388c2ecf20Sopenharmony_ci	/*
6398c2ecf20Sopenharmony_ci	 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
6408c2ecf20Sopenharmony_ci	 * 0xffff == 1.0.
6418c2ecf20Sopenharmony_ci	 */
6428c2ecf20Sopenharmony_ci	__u16 red;
6438c2ecf20Sopenharmony_ci	__u16 green;
6448c2ecf20Sopenharmony_ci	__u16 blue;
6458c2ecf20Sopenharmony_ci	__u16 reserved;
6468c2ecf20Sopenharmony_ci};
6478c2ecf20Sopenharmony_ci
6488c2ecf20Sopenharmony_ci/**
6498c2ecf20Sopenharmony_ci * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
6508c2ecf20Sopenharmony_ci *
6518c2ecf20Sopenharmony_ci * HDR Metadata Infoframe as per CTA 861.G spec. This is expected
6528c2ecf20Sopenharmony_ci * to match exactly with the spec.
6538c2ecf20Sopenharmony_ci *
6548c2ecf20Sopenharmony_ci * Userspace is expected to pass the metadata information as per
6558c2ecf20Sopenharmony_ci * the format described in this structure.
6568c2ecf20Sopenharmony_ci */
6578c2ecf20Sopenharmony_cistruct hdr_metadata_infoframe {
6588c2ecf20Sopenharmony_ci	/**
6598c2ecf20Sopenharmony_ci	 * @eotf: Electro-Optical Transfer Function (EOTF)
6608c2ecf20Sopenharmony_ci	 * used in the stream.
6618c2ecf20Sopenharmony_ci	 */
6628c2ecf20Sopenharmony_ci	__u8 eotf;
6638c2ecf20Sopenharmony_ci	/**
6648c2ecf20Sopenharmony_ci	 * @metadata_type: Static_Metadata_Descriptor_ID.
6658c2ecf20Sopenharmony_ci	 */
6668c2ecf20Sopenharmony_ci	__u8 metadata_type;
6678c2ecf20Sopenharmony_ci	/**
6688c2ecf20Sopenharmony_ci	 * @display_primaries: Color Primaries of the Data.
6698c2ecf20Sopenharmony_ci	 * These are coded as unsigned 16-bit values in units of
6708c2ecf20Sopenharmony_ci	 * 0.00002, where 0x0000 represents zero and 0xC350
6718c2ecf20Sopenharmony_ci	 * represents 1.0000.
6728c2ecf20Sopenharmony_ci	 * @display_primaries.x: X cordinate of color primary.
6738c2ecf20Sopenharmony_ci	 * @display_primaries.y: Y cordinate of color primary.
6748c2ecf20Sopenharmony_ci	 */
6758c2ecf20Sopenharmony_ci	struct {
6768c2ecf20Sopenharmony_ci		__u16 x, y;
6778c2ecf20Sopenharmony_ci		} display_primaries[3];
6788c2ecf20Sopenharmony_ci	/**
6798c2ecf20Sopenharmony_ci	 * @white_point: White Point of Colorspace Data.
6808c2ecf20Sopenharmony_ci	 * These are coded as unsigned 16-bit values in units of
6818c2ecf20Sopenharmony_ci	 * 0.00002, where 0x0000 represents zero and 0xC350
6828c2ecf20Sopenharmony_ci	 * represents 1.0000.
6838c2ecf20Sopenharmony_ci	 * @white_point.x: X cordinate of whitepoint of color primary.
6848c2ecf20Sopenharmony_ci	 * @white_point.y: Y cordinate of whitepoint of color primary.
6858c2ecf20Sopenharmony_ci	 */
6868c2ecf20Sopenharmony_ci	struct {
6878c2ecf20Sopenharmony_ci		__u16 x, y;
6888c2ecf20Sopenharmony_ci		} white_point;
6898c2ecf20Sopenharmony_ci	/**
6908c2ecf20Sopenharmony_ci	 * @max_display_mastering_luminance: Max Mastering Display Luminance.
6918c2ecf20Sopenharmony_ci	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
6928c2ecf20Sopenharmony_ci	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
6938c2ecf20Sopenharmony_ci	 */
6948c2ecf20Sopenharmony_ci	__u16 max_display_mastering_luminance;
6958c2ecf20Sopenharmony_ci	/**
6968c2ecf20Sopenharmony_ci	 * @min_display_mastering_luminance: Min Mastering Display Luminance.
6978c2ecf20Sopenharmony_ci	 * This value is coded as an unsigned 16-bit value in units of
6988c2ecf20Sopenharmony_ci	 * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
6998c2ecf20Sopenharmony_ci	 * represents 6.5535 cd/m2.
7008c2ecf20Sopenharmony_ci	 */
7018c2ecf20Sopenharmony_ci	__u16 min_display_mastering_luminance;
7028c2ecf20Sopenharmony_ci	/**
7038c2ecf20Sopenharmony_ci	 * @max_cll: Max Content Light Level.
7048c2ecf20Sopenharmony_ci	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
7058c2ecf20Sopenharmony_ci	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
7068c2ecf20Sopenharmony_ci	 */
7078c2ecf20Sopenharmony_ci	__u16 max_cll;
7088c2ecf20Sopenharmony_ci	/**
7098c2ecf20Sopenharmony_ci	 * @max_fall: Max Frame Average Light Level.
7108c2ecf20Sopenharmony_ci	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
7118c2ecf20Sopenharmony_ci	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
7128c2ecf20Sopenharmony_ci	 */
7138c2ecf20Sopenharmony_ci	__u16 max_fall;
7148c2ecf20Sopenharmony_ci};
7158c2ecf20Sopenharmony_ci
7168c2ecf20Sopenharmony_ci/**
7178c2ecf20Sopenharmony_ci * struct hdr_output_metadata - HDR output metadata
7188c2ecf20Sopenharmony_ci *
7198c2ecf20Sopenharmony_ci * Metadata Information to be passed from userspace
7208c2ecf20Sopenharmony_ci */
7218c2ecf20Sopenharmony_cistruct hdr_output_metadata {
7228c2ecf20Sopenharmony_ci	/**
7238c2ecf20Sopenharmony_ci	 * @metadata_type: Static_Metadata_Descriptor_ID.
7248c2ecf20Sopenharmony_ci	 */
7258c2ecf20Sopenharmony_ci	__u32 metadata_type;
7268c2ecf20Sopenharmony_ci	/**
7278c2ecf20Sopenharmony_ci	 * @hdmi_metadata_type1: HDR Metadata Infoframe.
7288c2ecf20Sopenharmony_ci	 */
7298c2ecf20Sopenharmony_ci	union {
7308c2ecf20Sopenharmony_ci		struct hdr_metadata_infoframe hdmi_metadata_type1;
7318c2ecf20Sopenharmony_ci	};
7328c2ecf20Sopenharmony_ci};
7338c2ecf20Sopenharmony_ci
7348c2ecf20Sopenharmony_ci#define DRM_MODE_PAGE_FLIP_EVENT 0x01
7358c2ecf20Sopenharmony_ci#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
7368c2ecf20Sopenharmony_ci#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
7378c2ecf20Sopenharmony_ci#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
7388c2ecf20Sopenharmony_ci#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
7398c2ecf20Sopenharmony_ci				   DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
7408c2ecf20Sopenharmony_ci#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
7418c2ecf20Sopenharmony_ci				  DRM_MODE_PAGE_FLIP_ASYNC | \
7428c2ecf20Sopenharmony_ci				  DRM_MODE_PAGE_FLIP_TARGET)
7438c2ecf20Sopenharmony_ci
7448c2ecf20Sopenharmony_ci/*
7458c2ecf20Sopenharmony_ci * Request a page flip on the specified crtc.
7468c2ecf20Sopenharmony_ci *
7478c2ecf20Sopenharmony_ci * This ioctl will ask KMS to schedule a page flip for the specified
7488c2ecf20Sopenharmony_ci * crtc.  Once any pending rendering targeting the specified fb (as of
7498c2ecf20Sopenharmony_ci * ioctl time) has completed, the crtc will be reprogrammed to display
7508c2ecf20Sopenharmony_ci * that fb after the next vertical refresh.  The ioctl returns
7518c2ecf20Sopenharmony_ci * immediately, but subsequent rendering to the current fb will block
7528c2ecf20Sopenharmony_ci * in the execbuffer ioctl until the page flip happens.  If a page
7538c2ecf20Sopenharmony_ci * flip is already pending as the ioctl is called, EBUSY will be
7548c2ecf20Sopenharmony_ci * returned.
7558c2ecf20Sopenharmony_ci *
7568c2ecf20Sopenharmony_ci * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank
7578c2ecf20Sopenharmony_ci * event (see drm.h: struct drm_event_vblank) when the page flip is
7588c2ecf20Sopenharmony_ci * done.  The user_data field passed in with this ioctl will be
7598c2ecf20Sopenharmony_ci * returned as the user_data field in the vblank event struct.
7608c2ecf20Sopenharmony_ci *
7618c2ecf20Sopenharmony_ci * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen
7628c2ecf20Sopenharmony_ci * 'as soon as possible', meaning that it not delay waiting for vblank.
7638c2ecf20Sopenharmony_ci * This may cause tearing on the screen.
7648c2ecf20Sopenharmony_ci *
7658c2ecf20Sopenharmony_ci * The reserved field must be zero.
7668c2ecf20Sopenharmony_ci */
7678c2ecf20Sopenharmony_ci
7688c2ecf20Sopenharmony_cistruct drm_mode_crtc_page_flip {
7698c2ecf20Sopenharmony_ci	__u32 crtc_id;
7708c2ecf20Sopenharmony_ci	__u32 fb_id;
7718c2ecf20Sopenharmony_ci	__u32 flags;
7728c2ecf20Sopenharmony_ci	__u32 reserved;
7738c2ecf20Sopenharmony_ci	__u64 user_data;
7748c2ecf20Sopenharmony_ci};
7758c2ecf20Sopenharmony_ci
7768c2ecf20Sopenharmony_ci/*
7778c2ecf20Sopenharmony_ci * Request a page flip on the specified crtc.
7788c2ecf20Sopenharmony_ci *
7798c2ecf20Sopenharmony_ci * Same as struct drm_mode_crtc_page_flip, but supports new flags and
7808c2ecf20Sopenharmony_ci * re-purposes the reserved field:
7818c2ecf20Sopenharmony_ci *
7828c2ecf20Sopenharmony_ci * The sequence field must be zero unless either of the
7838c2ecf20Sopenharmony_ci * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When
7848c2ecf20Sopenharmony_ci * the ABSOLUTE flag is specified, the sequence field denotes the absolute
7858c2ecf20Sopenharmony_ci * vblank sequence when the flip should take effect. When the RELATIVE
7868c2ecf20Sopenharmony_ci * flag is specified, the sequence field denotes the relative (to the
7878c2ecf20Sopenharmony_ci * current one when the ioctl is called) vblank sequence when the flip
7888c2ecf20Sopenharmony_ci * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to
7898c2ecf20Sopenharmony_ci * make sure the vblank sequence before the target one has passed before
7908c2ecf20Sopenharmony_ci * calling this ioctl. The purpose of the
7918c2ecf20Sopenharmony_ci * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify
7928c2ecf20Sopenharmony_ci * the target for when code dealing with a page flip runs during a
7938c2ecf20Sopenharmony_ci * vertical blank period.
7948c2ecf20Sopenharmony_ci */
7958c2ecf20Sopenharmony_ci
7968c2ecf20Sopenharmony_cistruct drm_mode_crtc_page_flip_target {
7978c2ecf20Sopenharmony_ci	__u32 crtc_id;
7988c2ecf20Sopenharmony_ci	__u32 fb_id;
7998c2ecf20Sopenharmony_ci	__u32 flags;
8008c2ecf20Sopenharmony_ci	__u32 sequence;
8018c2ecf20Sopenharmony_ci	__u64 user_data;
8028c2ecf20Sopenharmony_ci};
8038c2ecf20Sopenharmony_ci
8048c2ecf20Sopenharmony_ci/* create a dumb scanout buffer */
8058c2ecf20Sopenharmony_cistruct drm_mode_create_dumb {
8068c2ecf20Sopenharmony_ci	__u32 height;
8078c2ecf20Sopenharmony_ci	__u32 width;
8088c2ecf20Sopenharmony_ci	__u32 bpp;
8098c2ecf20Sopenharmony_ci	__u32 flags;
8108c2ecf20Sopenharmony_ci	/* handle, pitch, size will be returned */
8118c2ecf20Sopenharmony_ci	__u32 handle;
8128c2ecf20Sopenharmony_ci	__u32 pitch;
8138c2ecf20Sopenharmony_ci	__u64 size;
8148c2ecf20Sopenharmony_ci};
8158c2ecf20Sopenharmony_ci
8168c2ecf20Sopenharmony_ci/* set up for mmap of a dumb scanout buffer */
8178c2ecf20Sopenharmony_cistruct drm_mode_map_dumb {
8188c2ecf20Sopenharmony_ci	/** Handle for the object being mapped. */
8198c2ecf20Sopenharmony_ci	__u32 handle;
8208c2ecf20Sopenharmony_ci	__u32 pad;
8218c2ecf20Sopenharmony_ci	/**
8228c2ecf20Sopenharmony_ci	 * Fake offset to use for subsequent mmap call
8238c2ecf20Sopenharmony_ci	 *
8248c2ecf20Sopenharmony_ci	 * This is a fixed-size type for 32/64 compatibility.
8258c2ecf20Sopenharmony_ci	 */
8268c2ecf20Sopenharmony_ci	__u64 offset;
8278c2ecf20Sopenharmony_ci};
8288c2ecf20Sopenharmony_ci
8298c2ecf20Sopenharmony_cistruct drm_mode_destroy_dumb {
8308c2ecf20Sopenharmony_ci	__u32 handle;
8318c2ecf20Sopenharmony_ci};
8328c2ecf20Sopenharmony_ci
8338c2ecf20Sopenharmony_ci/* page-flip flags are valid, plus: */
8348c2ecf20Sopenharmony_ci#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
8358c2ecf20Sopenharmony_ci#define DRM_MODE_ATOMIC_NONBLOCK  0x0200
8368c2ecf20Sopenharmony_ci#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
8378c2ecf20Sopenharmony_ci
8388c2ecf20Sopenharmony_ci#define DRM_MODE_ATOMIC_FLAGS (\
8398c2ecf20Sopenharmony_ci		DRM_MODE_PAGE_FLIP_EVENT |\
8408c2ecf20Sopenharmony_ci		DRM_MODE_PAGE_FLIP_ASYNC |\
8418c2ecf20Sopenharmony_ci		DRM_MODE_ATOMIC_TEST_ONLY |\
8428c2ecf20Sopenharmony_ci		DRM_MODE_ATOMIC_NONBLOCK |\
8438c2ecf20Sopenharmony_ci		DRM_MODE_ATOMIC_ALLOW_MODESET)
8448c2ecf20Sopenharmony_ci
8458c2ecf20Sopenharmony_cistruct drm_mode_atomic {
8468c2ecf20Sopenharmony_ci	__u32 flags;
8478c2ecf20Sopenharmony_ci	__u32 count_objs;
8488c2ecf20Sopenharmony_ci	__u64 objs_ptr;
8498c2ecf20Sopenharmony_ci	__u64 count_props_ptr;
8508c2ecf20Sopenharmony_ci	__u64 props_ptr;
8518c2ecf20Sopenharmony_ci	__u64 prop_values_ptr;
8528c2ecf20Sopenharmony_ci	__u64 reserved;
8538c2ecf20Sopenharmony_ci	__u64 user_data;
8548c2ecf20Sopenharmony_ci};
8558c2ecf20Sopenharmony_ci
8568c2ecf20Sopenharmony_cistruct drm_format_modifier_blob {
8578c2ecf20Sopenharmony_ci#define FORMAT_BLOB_CURRENT 1
8588c2ecf20Sopenharmony_ci	/* Version of this blob format */
8598c2ecf20Sopenharmony_ci	__u32 version;
8608c2ecf20Sopenharmony_ci
8618c2ecf20Sopenharmony_ci	/* Flags */
8628c2ecf20Sopenharmony_ci	__u32 flags;
8638c2ecf20Sopenharmony_ci
8648c2ecf20Sopenharmony_ci	/* Number of fourcc formats supported */
8658c2ecf20Sopenharmony_ci	__u32 count_formats;
8668c2ecf20Sopenharmony_ci
8678c2ecf20Sopenharmony_ci	/* Where in this blob the formats exist (in bytes) */
8688c2ecf20Sopenharmony_ci	__u32 formats_offset;
8698c2ecf20Sopenharmony_ci
8708c2ecf20Sopenharmony_ci	/* Number of drm_format_modifiers */
8718c2ecf20Sopenharmony_ci	__u32 count_modifiers;
8728c2ecf20Sopenharmony_ci
8738c2ecf20Sopenharmony_ci	/* Where in this blob the modifiers exist (in bytes) */
8748c2ecf20Sopenharmony_ci	__u32 modifiers_offset;
8758c2ecf20Sopenharmony_ci
8768c2ecf20Sopenharmony_ci	/* __u32 formats[] */
8778c2ecf20Sopenharmony_ci	/* struct drm_format_modifier modifiers[] */
8788c2ecf20Sopenharmony_ci};
8798c2ecf20Sopenharmony_ci
8808c2ecf20Sopenharmony_cistruct drm_format_modifier {
8818c2ecf20Sopenharmony_ci	/* Bitmask of formats in get_plane format list this info applies to. The
8828c2ecf20Sopenharmony_ci	 * offset allows a sliding window of which 64 formats (bits).
8838c2ecf20Sopenharmony_ci	 *
8848c2ecf20Sopenharmony_ci	 * Some examples:
8858c2ecf20Sopenharmony_ci	 * In today's world with < 65 formats, and formats 0, and 2 are
8868c2ecf20Sopenharmony_ci	 * supported
8878c2ecf20Sopenharmony_ci	 * 0x0000000000000005
8888c2ecf20Sopenharmony_ci	 *		  ^-offset = 0, formats = 5
8898c2ecf20Sopenharmony_ci	 *
8908c2ecf20Sopenharmony_ci	 * If the number formats grew to 128, and formats 98-102 are
8918c2ecf20Sopenharmony_ci	 * supported with the modifier:
8928c2ecf20Sopenharmony_ci	 *
8938c2ecf20Sopenharmony_ci	 * 0x0000007c00000000 0000000000000000
8948c2ecf20Sopenharmony_ci	 *		  ^
8958c2ecf20Sopenharmony_ci	 *		  |__offset = 64, formats = 0x7c00000000
8968c2ecf20Sopenharmony_ci	 *
8978c2ecf20Sopenharmony_ci	 */
8988c2ecf20Sopenharmony_ci	__u64 formats;
8998c2ecf20Sopenharmony_ci	__u32 offset;
9008c2ecf20Sopenharmony_ci	__u32 pad;
9018c2ecf20Sopenharmony_ci
9028c2ecf20Sopenharmony_ci	/* The modifier that applies to the >get_plane format list bitmask. */
9038c2ecf20Sopenharmony_ci	__u64 modifier;
9048c2ecf20Sopenharmony_ci};
9058c2ecf20Sopenharmony_ci
9068c2ecf20Sopenharmony_ci/**
9078c2ecf20Sopenharmony_ci * struct drm_mode_create_blob - Create New block property
9088c2ecf20Sopenharmony_ci * @data: Pointer to data to copy.
9098c2ecf20Sopenharmony_ci * @length: Length of data to copy.
9108c2ecf20Sopenharmony_ci * @blob_id: new property ID.
9118c2ecf20Sopenharmony_ci * Create a new 'blob' data property, copying length bytes from data pointer,
9128c2ecf20Sopenharmony_ci * and returning new blob ID.
9138c2ecf20Sopenharmony_ci */
9148c2ecf20Sopenharmony_cistruct drm_mode_create_blob {
9158c2ecf20Sopenharmony_ci	/** Pointer to data to copy. */
9168c2ecf20Sopenharmony_ci	__u64 data;
9178c2ecf20Sopenharmony_ci	/** Length of data to copy. */
9188c2ecf20Sopenharmony_ci	__u32 length;
9198c2ecf20Sopenharmony_ci	/** Return: new property ID. */
9208c2ecf20Sopenharmony_ci	__u32 blob_id;
9218c2ecf20Sopenharmony_ci};
9228c2ecf20Sopenharmony_ci
9238c2ecf20Sopenharmony_ci/**
9248c2ecf20Sopenharmony_ci * struct drm_mode_destroy_blob - Destroy user blob
9258c2ecf20Sopenharmony_ci * @blob_id: blob_id to destroy
9268c2ecf20Sopenharmony_ci * Destroy a user-created blob property.
9278c2ecf20Sopenharmony_ci */
9288c2ecf20Sopenharmony_cistruct drm_mode_destroy_blob {
9298c2ecf20Sopenharmony_ci	__u32 blob_id;
9308c2ecf20Sopenharmony_ci};
9318c2ecf20Sopenharmony_ci
9328c2ecf20Sopenharmony_ci/**
9338c2ecf20Sopenharmony_ci * struct drm_mode_create_lease - Create lease
9348c2ecf20Sopenharmony_ci * @object_ids: Pointer to array of object ids.
9358c2ecf20Sopenharmony_ci * @object_count: Number of object ids.
9368c2ecf20Sopenharmony_ci * @flags: flags for new FD.
9378c2ecf20Sopenharmony_ci * @lessee_id: unique identifier for lessee.
9388c2ecf20Sopenharmony_ci * @fd: file descriptor to new drm_master file.
9398c2ecf20Sopenharmony_ci * Lease mode resources, creating another drm_master.
9408c2ecf20Sopenharmony_ci */
9418c2ecf20Sopenharmony_cistruct drm_mode_create_lease {
9428c2ecf20Sopenharmony_ci	/** Pointer to array of object ids (__u32) */
9438c2ecf20Sopenharmony_ci	__u64 object_ids;
9448c2ecf20Sopenharmony_ci	/** Number of object ids */
9458c2ecf20Sopenharmony_ci	__u32 object_count;
9468c2ecf20Sopenharmony_ci	/** flags for new FD (O_CLOEXEC, etc) */
9478c2ecf20Sopenharmony_ci	__u32 flags;
9488c2ecf20Sopenharmony_ci
9498c2ecf20Sopenharmony_ci	/** Return: unique identifier for lessee. */
9508c2ecf20Sopenharmony_ci	__u32 lessee_id;
9518c2ecf20Sopenharmony_ci	/** Return: file descriptor to new drm_master file */
9528c2ecf20Sopenharmony_ci	__u32 fd;
9538c2ecf20Sopenharmony_ci};
9548c2ecf20Sopenharmony_ci
9558c2ecf20Sopenharmony_ci/**
9568c2ecf20Sopenharmony_ci * struct drm_mode_list_lessees - List lessees
9578c2ecf20Sopenharmony_ci * @count_lessees: Number of lessees.
9588c2ecf20Sopenharmony_ci * @pad: pad.
9598c2ecf20Sopenharmony_ci * @lessees_ptr: Pointer to lessess.
9608c2ecf20Sopenharmony_ci * List lesses from a drm_master
9618c2ecf20Sopenharmony_ci */
9628c2ecf20Sopenharmony_cistruct drm_mode_list_lessees {
9638c2ecf20Sopenharmony_ci	/** Number of lessees.
9648c2ecf20Sopenharmony_ci	 * On input, provides length of the array.
9658c2ecf20Sopenharmony_ci	 * On output, provides total number. No
9668c2ecf20Sopenharmony_ci	 * more than the input number will be written
9678c2ecf20Sopenharmony_ci	 * back, so two calls can be used to get
9688c2ecf20Sopenharmony_ci	 * the size and then the data.
9698c2ecf20Sopenharmony_ci	 */
9708c2ecf20Sopenharmony_ci	__u32 count_lessees;
9718c2ecf20Sopenharmony_ci	__u32 pad;
9728c2ecf20Sopenharmony_ci
9738c2ecf20Sopenharmony_ci	/** Pointer to lessees.
9748c2ecf20Sopenharmony_ci	 * pointer to __u64 array of lessee ids
9758c2ecf20Sopenharmony_ci	 */
9768c2ecf20Sopenharmony_ci	__u64 lessees_ptr;
9778c2ecf20Sopenharmony_ci};
9788c2ecf20Sopenharmony_ci
9798c2ecf20Sopenharmony_ci/**
9808c2ecf20Sopenharmony_ci * struct drm_mode_get_lease - Get Lease
9818c2ecf20Sopenharmony_ci * @count_objects: Number of leased objects.
9828c2ecf20Sopenharmony_ci * @pad: pad.
9838c2ecf20Sopenharmony_ci * @objects_ptr: Pointer to objects.
9848c2ecf20Sopenharmony_ci * Get leased objects
9858c2ecf20Sopenharmony_ci */
9868c2ecf20Sopenharmony_cistruct drm_mode_get_lease {
9878c2ecf20Sopenharmony_ci	/** Number of leased objects.
9888c2ecf20Sopenharmony_ci	 * On input, provides length of the array.
9898c2ecf20Sopenharmony_ci	 * On output, provides total number. No
9908c2ecf20Sopenharmony_ci	 * more than the input number will be written
9918c2ecf20Sopenharmony_ci	 * back, so two calls can be used to get
9928c2ecf20Sopenharmony_ci	 * the size and then the data.
9938c2ecf20Sopenharmony_ci	 */
9948c2ecf20Sopenharmony_ci	__u32 count_objects;
9958c2ecf20Sopenharmony_ci	__u32 pad;
9968c2ecf20Sopenharmony_ci
9978c2ecf20Sopenharmony_ci	/** Pointer to objects.
9988c2ecf20Sopenharmony_ci	 * pointer to __u32 array of object ids
9998c2ecf20Sopenharmony_ci	 */
10008c2ecf20Sopenharmony_ci	__u64 objects_ptr;
10018c2ecf20Sopenharmony_ci};
10028c2ecf20Sopenharmony_ci
10038c2ecf20Sopenharmony_ci/**
10048c2ecf20Sopenharmony_ci * struct drm_mode_revoke_lease - Revoke lease
10058c2ecf20Sopenharmony_ci * @lessee_id: Unique ID of lessee.
10068c2ecf20Sopenharmony_ci * Revoke lease
10078c2ecf20Sopenharmony_ci */
10088c2ecf20Sopenharmony_cistruct drm_mode_revoke_lease {
10098c2ecf20Sopenharmony_ci	/** Unique ID of lessee
10108c2ecf20Sopenharmony_ci	 */
10118c2ecf20Sopenharmony_ci	__u32 lessee_id;
10128c2ecf20Sopenharmony_ci};
10138c2ecf20Sopenharmony_ci
10148c2ecf20Sopenharmony_ci/**
10158c2ecf20Sopenharmony_ci * struct drm_mode_rect - Two dimensional rectangle.
10168c2ecf20Sopenharmony_ci * @x1: Horizontal starting coordinate (inclusive).
10178c2ecf20Sopenharmony_ci * @y1: Vertical starting coordinate (inclusive).
10188c2ecf20Sopenharmony_ci * @x2: Horizontal ending coordinate (exclusive).
10198c2ecf20Sopenharmony_ci * @y2: Vertical ending coordinate (exclusive).
10208c2ecf20Sopenharmony_ci *
10218c2ecf20Sopenharmony_ci * With drm subsystem using struct drm_rect to manage rectangular area this
10228c2ecf20Sopenharmony_ci * export it to user-space.
10238c2ecf20Sopenharmony_ci *
10248c2ecf20Sopenharmony_ci * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS.
10258c2ecf20Sopenharmony_ci */
10268c2ecf20Sopenharmony_cistruct drm_mode_rect {
10278c2ecf20Sopenharmony_ci	__s32 x1;
10288c2ecf20Sopenharmony_ci	__s32 y1;
10298c2ecf20Sopenharmony_ci	__s32 x2;
10308c2ecf20Sopenharmony_ci	__s32 y2;
10318c2ecf20Sopenharmony_ci};
10328c2ecf20Sopenharmony_ci
10338c2ecf20Sopenharmony_ci#if defined(__cplusplus)
10348c2ecf20Sopenharmony_ci}
10358c2ecf20Sopenharmony_ci#endif
10368c2ecf20Sopenharmony_ci
10378c2ecf20Sopenharmony_ci#endif
1038