/*1* Copyright (c) 2007 Dave Airlie <[email protected]>2* Copyright (c) 2007 Jakob Bornecrantz <[email protected]>3* Copyright (c) 2008 Red Hat Inc.4* Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA5* Copyright (c) 2007-2008 Intel Corporation6*7* Permission is hereby granted, free of charge, to any person obtaining a8* copy of this software and associated documentation files (the "Software"),9* to deal in the Software without restriction, including without limitation10* the rights to use, copy, modify, merge, publish, distribute, sublicense,11* and/or sell copies of the Software, and to permit persons to whom the12* Software is furnished to do so, subject to the following conditions:13*14* The above copyright notice and this permission notice shall be included in15* all copies or substantial portions of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR18* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,19* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE20* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER21* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING22* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS23* IN THE SOFTWARE.24*/2526#ifndef _DRM_MODE_H27#define _DRM_MODE_H2829#include "drm.h"3031#if defined(__cplusplus)32extern "C" {33#endif3435/**36* DOC: overview37*38* DRM exposes many UAPI and structure definitions to have a consistent39* and standardized interface with users.40* Userspace can refer to these structure definitions and UAPI formats41* to communicate to drivers.42*/4344#define DRM_CONNECTOR_NAME_LEN 3245#define DRM_DISPLAY_MODE_LEN 3246#define DRM_PROP_NAME_LEN 324748#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */49#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */50#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */51#define DRM_MODE_TYPE_PREFERRED (1<<3)52#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */53#define DRM_MODE_TYPE_USERDEF (1<<5)54#define DRM_MODE_TYPE_DRIVER (1<<6)5556#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \57DRM_MODE_TYPE_USERDEF | \58DRM_MODE_TYPE_DRIVER)5960/* Video mode flags */61/* bit compatible with the xrandr RR_ definitions (bits 0-13)62*63* ABI warning: Existing userspace really expects64* the mode flags to match the xrandr definitions. Any65* changes that don't match the xrandr definitions will66* likely need a new client cap or some other mechanism67* to avoid breaking existing userspace. This includes68* allocating new flags in the previously unused bits!69*/70#define DRM_MODE_FLAG_PHSYNC (1<<0)71#define DRM_MODE_FLAG_NHSYNC (1<<1)72#define DRM_MODE_FLAG_PVSYNC (1<<2)73#define DRM_MODE_FLAG_NVSYNC (1<<3)74#define DRM_MODE_FLAG_INTERLACE (1<<4)75#define DRM_MODE_FLAG_DBLSCAN (1<<5)76#define DRM_MODE_FLAG_CSYNC (1<<6)77#define DRM_MODE_FLAG_PCSYNC (1<<7)78#define DRM_MODE_FLAG_NCSYNC (1<<8)79#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */80#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */81#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */82#define DRM_MODE_FLAG_DBLCLK (1<<12)83#define DRM_MODE_FLAG_CLKDIV2 (1<<13)84/*85* When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX86* (define not exposed to user space).87*/88#define DRM_MODE_FLAG_3D_MASK (0x1f<<14)89#define DRM_MODE_FLAG_3D_NONE (0<<14)90#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14)91#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14)92#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14)93#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14)94#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14)95#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14)96#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14)97#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14)9899/* Picture aspect ratio options */100#define DRM_MODE_PICTURE_ASPECT_NONE 0101#define DRM_MODE_PICTURE_ASPECT_4_3 1102#define DRM_MODE_PICTURE_ASPECT_16_9 2103#define DRM_MODE_PICTURE_ASPECT_64_27 3104#define DRM_MODE_PICTURE_ASPECT_256_135 4105106/* Content type options */107#define DRM_MODE_CONTENT_TYPE_NO_DATA 0108#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1109#define DRM_MODE_CONTENT_TYPE_PHOTO 2110#define DRM_MODE_CONTENT_TYPE_CINEMA 3111#define DRM_MODE_CONTENT_TYPE_GAME 4112113/* Aspect ratio flag bitmask (4 bits 22:19) */114#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19)115#define DRM_MODE_FLAG_PIC_AR_NONE \116(DRM_MODE_PICTURE_ASPECT_NONE<<19)117#define DRM_MODE_FLAG_PIC_AR_4_3 \118(DRM_MODE_PICTURE_ASPECT_4_3<<19)119#define DRM_MODE_FLAG_PIC_AR_16_9 \120(DRM_MODE_PICTURE_ASPECT_16_9<<19)121#define DRM_MODE_FLAG_PIC_AR_64_27 \122(DRM_MODE_PICTURE_ASPECT_64_27<<19)123#define DRM_MODE_FLAG_PIC_AR_256_135 \124(DRM_MODE_PICTURE_ASPECT_256_135<<19)125126#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \127DRM_MODE_FLAG_NHSYNC | \128DRM_MODE_FLAG_PVSYNC | \129DRM_MODE_FLAG_NVSYNC | \130DRM_MODE_FLAG_INTERLACE | \131DRM_MODE_FLAG_DBLSCAN | \132DRM_MODE_FLAG_CSYNC | \133DRM_MODE_FLAG_PCSYNC | \134DRM_MODE_FLAG_NCSYNC | \135DRM_MODE_FLAG_HSKEW | \136DRM_MODE_FLAG_DBLCLK | \137DRM_MODE_FLAG_CLKDIV2 | \138DRM_MODE_FLAG_3D_MASK)139140/* DPMS flags */141/* bit compatible with the xorg definitions. */142#define DRM_MODE_DPMS_ON 0143#define DRM_MODE_DPMS_STANDBY 1144#define DRM_MODE_DPMS_SUSPEND 2145#define DRM_MODE_DPMS_OFF 3146147/* Scaling mode options */148#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or149software can still scale) */150#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */151#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */152#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */153154/* Dithering mode options */155#define DRM_MODE_DITHERING_OFF 0156#define DRM_MODE_DITHERING_ON 1157#define DRM_MODE_DITHERING_AUTO 2158159/* Dirty info options */160#define DRM_MODE_DIRTY_OFF 0161#define DRM_MODE_DIRTY_ON 1162#define DRM_MODE_DIRTY_ANNOTATE 2163164/* Link Status options */165#define DRM_MODE_LINK_STATUS_GOOD 0166#define DRM_MODE_LINK_STATUS_BAD 1167168/*169* DRM_MODE_ROTATE_<degrees>170*171* Signals that a drm plane is been rotated <degrees> degrees in counter172* clockwise direction.173*174* This define is provided as a convenience, looking up the property id175* using the name->prop id lookup is the preferred method.176*/177#define DRM_MODE_ROTATE_0 (1<<0)178#define DRM_MODE_ROTATE_90 (1<<1)179#define DRM_MODE_ROTATE_180 (1<<2)180#define DRM_MODE_ROTATE_270 (1<<3)181182/*183* DRM_MODE_ROTATE_MASK184*185* Bitmask used to look for drm plane rotations.186*/187#define DRM_MODE_ROTATE_MASK (\188DRM_MODE_ROTATE_0 | \189DRM_MODE_ROTATE_90 | \190DRM_MODE_ROTATE_180 | \191DRM_MODE_ROTATE_270)192193/*194* DRM_MODE_REFLECT_<axis>195*196* Signals that the contents of a drm plane is reflected along the <axis> axis,197* in the same way as mirroring.198* See kerneldoc chapter "Plane Composition Properties" for more details.199*200* This define is provided as a convenience, looking up the property id201* using the name->prop id lookup is the preferred method.202*/203#define DRM_MODE_REFLECT_X (1<<4)204#define DRM_MODE_REFLECT_Y (1<<5)205206/*207* DRM_MODE_REFLECT_MASK208*209* Bitmask used to look for drm plane reflections.210*/211#define DRM_MODE_REFLECT_MASK (\212DRM_MODE_REFLECT_X | \213DRM_MODE_REFLECT_Y)214215/* Content Protection Flags */216#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0217#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1218#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2219220/**221* struct drm_mode_modeinfo - Display mode information.222* @clock: pixel clock in kHz223* @hdisplay: horizontal display size224* @hsync_start: horizontal sync start225* @hsync_end: horizontal sync end226* @htotal: horizontal total size227* @hskew: horizontal skew228* @vdisplay: vertical display size229* @vsync_start: vertical sync start230* @vsync_end: vertical sync end231* @vtotal: vertical total size232* @vscan: vertical scan233* @vrefresh: approximate vertical refresh rate in Hz234* @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines235* @type: bitmask of type flags, see DRM_MODE_TYPE_* defines236* @name: string describing the mode resolution237*238* This is the user-space API display mode information structure. For the239* kernel version see struct drm_display_mode.240*/241struct drm_mode_modeinfo {242__u32 clock;243__u16 hdisplay;244__u16 hsync_start;245__u16 hsync_end;246__u16 htotal;247__u16 hskew;248__u16 vdisplay;249__u16 vsync_start;250__u16 vsync_end;251__u16 vtotal;252__u16 vscan;253254__u32 vrefresh;255256__u32 flags;257__u32 type;258char name[DRM_DISPLAY_MODE_LEN];259};260261struct drm_mode_card_res {262__u64 fb_id_ptr;263__u64 crtc_id_ptr;264__u64 connector_id_ptr;265__u64 encoder_id_ptr;266__u32 count_fbs;267__u32 count_crtcs;268__u32 count_connectors;269__u32 count_encoders;270__u32 min_width;271__u32 max_width;272__u32 min_height;273__u32 max_height;274};275276struct drm_mode_crtc {277__u64 set_connectors_ptr;278__u32 count_connectors;279280__u32 crtc_id; /**< Id */281__u32 fb_id; /**< Id of framebuffer */282283__u32 x; /**< x Position on the framebuffer */284__u32 y; /**< y Position on the framebuffer */285286__u32 gamma_size;287__u32 mode_valid;288struct drm_mode_modeinfo mode;289};290291#define DRM_MODE_PRESENT_TOP_FIELD (1<<0)292#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1)293294/* Planes blend with or override other bits on the CRTC */295struct drm_mode_set_plane {296__u32 plane_id;297__u32 crtc_id;298__u32 fb_id; /* fb object contains surface format type */299__u32 flags; /* see above flags */300301/* Signed dest location allows it to be partially off screen */302__s32 crtc_x;303__s32 crtc_y;304__u32 crtc_w;305__u32 crtc_h;306307/* Source values are 16.16 fixed point */308__u32 src_x;309__u32 src_y;310__u32 src_h;311__u32 src_w;312};313314/**315* struct drm_mode_get_plane - Get plane metadata.316*317* Userspace can perform a GETPLANE ioctl to retrieve information about a318* plane.319*320* To retrieve the number of formats supported, set @count_format_types to zero321* and call the ioctl. @count_format_types will be updated with the value.322*323* To retrieve these formats, allocate an array with the memory needed to store324* @count_format_types formats. Point @format_type_ptr to this array and call325* the ioctl again (with @count_format_types still set to the value returned in326* the first ioctl call).327*/328struct drm_mode_get_plane {329/**330* @plane_id: Object ID of the plane whose information should be331* retrieved. Set by caller.332*/333__u32 plane_id;334335/** @crtc_id: Object ID of the current CRTC. */336__u32 crtc_id;337/** @fb_id: Object ID of the current fb. */338__u32 fb_id;339340/**341* @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's342* are created and they receive an index, which corresponds to their343* position in the bitmask. Bit N corresponds to344* :ref:`CRTC index<crtc_index>` N.345*/346__u32 possible_crtcs;347/** @gamma_size: Never used. */348__u32 gamma_size;349350/** @count_format_types: Number of formats. */351__u32 count_format_types;352/**353* @format_type_ptr: Pointer to ``__u32`` array of formats that are354* supported by the plane. These formats do not require modifiers.355*/356__u64 format_type_ptr;357};358359struct drm_mode_get_plane_res {360__u64 plane_id_ptr;361__u32 count_planes;362};363364#define DRM_MODE_ENCODER_NONE 0365#define DRM_MODE_ENCODER_DAC 1366#define DRM_MODE_ENCODER_TMDS 2367#define DRM_MODE_ENCODER_LVDS 3368#define DRM_MODE_ENCODER_TVDAC 4369#define DRM_MODE_ENCODER_VIRTUAL 5370#define DRM_MODE_ENCODER_DSI 6371#define DRM_MODE_ENCODER_DPMST 7372#define DRM_MODE_ENCODER_DPI 8373374struct drm_mode_get_encoder {375__u32 encoder_id;376__u32 encoder_type;377378__u32 crtc_id; /**< Id of crtc */379380__u32 possible_crtcs;381__u32 possible_clones;382};383384/* This is for connectors with multiple signal types. */385/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */386enum drm_mode_subconnector {387DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */388DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */389DRM_MODE_SUBCONNECTOR_VGA = 1, /* DP */390DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */391DRM_MODE_SUBCONNECTOR_DVIA = 4, /* DVI-I */392DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */393DRM_MODE_SUBCONNECTOR_SVIDEO = 6, /* TV */394DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */395DRM_MODE_SUBCONNECTOR_SCART = 9, /* TV */396DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /* DP */397DRM_MODE_SUBCONNECTOR_HDMIA = 11, /* DP */398DRM_MODE_SUBCONNECTOR_Native = 15, /* DP */399DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */400};401402#define DRM_MODE_CONNECTOR_Unknown 0403#define DRM_MODE_CONNECTOR_VGA 1404#define DRM_MODE_CONNECTOR_DVII 2405#define DRM_MODE_CONNECTOR_DVID 3406#define DRM_MODE_CONNECTOR_DVIA 4407#define DRM_MODE_CONNECTOR_Composite 5408#define DRM_MODE_CONNECTOR_SVIDEO 6409#define DRM_MODE_CONNECTOR_LVDS 7410#define DRM_MODE_CONNECTOR_Component 8411#define DRM_MODE_CONNECTOR_9PinDIN 9412#define DRM_MODE_CONNECTOR_DisplayPort 10413#define DRM_MODE_CONNECTOR_HDMIA 11414#define DRM_MODE_CONNECTOR_HDMIB 12415#define DRM_MODE_CONNECTOR_TV 13416#define DRM_MODE_CONNECTOR_eDP 14417#define DRM_MODE_CONNECTOR_VIRTUAL 15418#define DRM_MODE_CONNECTOR_DSI 16419#define DRM_MODE_CONNECTOR_DPI 17420#define DRM_MODE_CONNECTOR_WRITEBACK 18421#define DRM_MODE_CONNECTOR_SPI 19422#define DRM_MODE_CONNECTOR_USB 20423424/**425* struct drm_mode_get_connector - Get connector metadata.426*427* User-space can perform a GETCONNECTOR ioctl to retrieve information about a428* connector. User-space is expected to retrieve encoders, modes and properties429* by performing this ioctl at least twice: the first time to retrieve the430* number of elements, the second time to retrieve the elements themselves.431*432* To retrieve the number of elements, set @count_props and @count_encoders to433* zero, set @count_modes to 1, and set @modes_ptr to a temporary struct434* drm_mode_modeinfo element.435*436* To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr,437* @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and438* @count_encoders to their capacity.439*440* Performing the ioctl only twice may be racy: the number of elements may have441* changed with a hotplug event in-between the two ioctls. User-space is442* expected to retry the last ioctl until the number of elements stabilizes.443* The kernel won't fill any array which doesn't have the expected length.444*445* **Force-probing a connector**446*447* If the @count_modes field is set to zero and the DRM client is the current448* DRM master, the kernel will perform a forced probe on the connector to449* refresh the connector status, modes and EDID. A forced-probe can be slow,450* might cause flickering and the ioctl will block.451*452* User-space needs to force-probe connectors to ensure their metadata is453* up-to-date at startup and after receiving a hot-plug event. User-space454* may perform a forced-probe when the user explicitly requests it. User-space455* shouldn't perform a forced-probe in other situations.456*/457struct drm_mode_get_connector {458/** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */459__u64 encoders_ptr;460/** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */461__u64 modes_ptr;462/** @props_ptr: Pointer to ``__u32`` array of property IDs. */463__u64 props_ptr;464/** @prop_values_ptr: Pointer to ``__u64`` array of property values. */465__u64 prop_values_ptr;466467/** @count_modes: Number of modes. */468__u32 count_modes;469/** @count_props: Number of properties. */470__u32 count_props;471/** @count_encoders: Number of encoders. */472__u32 count_encoders;473474/** @encoder_id: Object ID of the current encoder. */475__u32 encoder_id;476/** @connector_id: Object ID of the connector. */477__u32 connector_id;478/**479* @connector_type: Type of the connector.480*481* See DRM_MODE_CONNECTOR_* defines.482*/483__u32 connector_type;484/**485* @connector_type_id: Type-specific connector number.486*487* This is not an object ID. This is a per-type connector number. Each488* (type, type_id) combination is unique across all connectors of a DRM489* device.490*491* The (type, type_id) combination is not a stable identifier: the492* type_id can change depending on the driver probe order.493*/494__u32 connector_type_id;495496/**497* @connection: Status of the connector.498*499* See enum drm_connector_status.500*/501__u32 connection;502/** @mm_width: Width of the connected sink in millimeters. */503__u32 mm_width;504/** @mm_height: Height of the connected sink in millimeters. */505__u32 mm_height;506/**507* @subpixel: Subpixel order of the connected sink.508*509* See enum subpixel_order.510*/511__u32 subpixel;512513/** @pad: Padding, must be zero. */514__u32 pad;515};516517#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */518#define DRM_MODE_PROP_RANGE (1<<1)519#define DRM_MODE_PROP_IMMUTABLE (1<<2)520#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */521#define DRM_MODE_PROP_BLOB (1<<4)522#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */523524/* non-extended types: legacy bitmask, one bit per type: */525#define DRM_MODE_PROP_LEGACY_TYPE ( \526DRM_MODE_PROP_RANGE | \527DRM_MODE_PROP_ENUM | \528DRM_MODE_PROP_BLOB | \529DRM_MODE_PROP_BITMASK)530531/* extended-types: rather than continue to consume a bit per type,532* grab a chunk of the bits to use as integer type id.533*/534#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0535#define DRM_MODE_PROP_TYPE(n) ((n) << 6)536#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)537#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)538539/* the PROP_ATOMIC flag is used to hide properties from userspace that540* is not aware of atomic properties. This is mostly to work around541* older userspace (DDX drivers) that read/write each prop they find,542* without being aware that this could be triggering a lengthy modeset.543*/544#define DRM_MODE_PROP_ATOMIC 0x80000000545546/**547* struct drm_mode_property_enum - Description for an enum/bitfield entry.548* @value: numeric value for this enum entry.549* @name: symbolic name for this enum entry.550*551* See struct drm_property_enum for details.552*/553struct drm_mode_property_enum {554__u64 value;555char name[DRM_PROP_NAME_LEN];556};557558/**559* struct drm_mode_get_property - Get property metadata.560*561* User-space can perform a GETPROPERTY ioctl to retrieve information about a562* property. The same property may be attached to multiple objects, see563* "Modeset Base Object Abstraction".564*565* The meaning of the @values_ptr field changes depending on the property type.566* See &drm_property.flags for more details.567*568* The @enum_blob_ptr and @count_enum_blobs fields are only meaningful when the569* property has the type &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK. For570* backwards compatibility, the kernel will always set @count_enum_blobs to571* zero when the property has the type &DRM_MODE_PROP_BLOB. User-space must572* ignore these two fields if the property has a different type.573*574* User-space is expected to retrieve values and enums by performing this ioctl575* at least twice: the first time to retrieve the number of elements, the576* second time to retrieve the elements themselves.577*578* To retrieve the number of elements, set @count_values and @count_enum_blobs579* to zero, then call the ioctl. @count_values will be updated with the number580* of elements. If the property has the type &DRM_MODE_PROP_ENUM or581* &DRM_MODE_PROP_BITMASK, @count_enum_blobs will be updated as well.582*583* To retrieve the elements themselves, allocate an array for @values_ptr and584* set @count_values to its capacity. If the property has the type585* &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK, allocate an array for586* @enum_blob_ptr and set @count_enum_blobs to its capacity. Calling the ioctl587* again will fill the arrays.588*/589struct drm_mode_get_property {590/** @values_ptr: Pointer to a ``__u64`` array. */591__u64 values_ptr;592/** @enum_blob_ptr: Pointer to a struct drm_mode_property_enum array. */593__u64 enum_blob_ptr;594595/**596* @prop_id: Object ID of the property which should be retrieved. Set597* by the caller.598*/599__u32 prop_id;600/**601* @flags: ``DRM_MODE_PROP_*`` bitfield. See &drm_property.flags for602* a definition of the flags.603*/604__u32 flags;605/**606* @name: Symbolic property name. User-space should use this field to607* recognize properties.608*/609char name[DRM_PROP_NAME_LEN];610611/** @count_values: Number of elements in @values_ptr. */612__u32 count_values;613/** @count_enum_blobs: Number of elements in @enum_blob_ptr. */614__u32 count_enum_blobs;615};616617struct drm_mode_connector_set_property {618__u64 value;619__u32 prop_id;620__u32 connector_id;621};622623#define DRM_MODE_OBJECT_CRTC 0xcccccccc624#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0625#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0626#define DRM_MODE_OBJECT_MODE 0xdededede627#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0628#define DRM_MODE_OBJECT_FB 0xfbfbfbfb629#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb630#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee631#define DRM_MODE_OBJECT_COLOROP 0xfafafafa632#define DRM_MODE_OBJECT_ANY 0633634struct drm_mode_obj_get_properties {635__u64 props_ptr;636__u64 prop_values_ptr;637__u32 count_props;638__u32 obj_id;639__u32 obj_type;640};641642struct drm_mode_obj_set_property {643__u64 value;644__u32 prop_id;645__u32 obj_id;646__u32 obj_type;647};648649struct drm_mode_get_blob {650__u32 blob_id;651__u32 length;652__u64 data;653};654655struct drm_mode_fb_cmd {656__u32 fb_id;657__u32 width;658__u32 height;659__u32 pitch;660__u32 bpp;661__u32 depth;662/* driver specific handle */663__u32 handle;664};665666#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */667#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifier[] */668669/**670* struct drm_mode_fb_cmd2 - Frame-buffer metadata.671*672* This struct holds frame-buffer metadata. There are two ways to use it:673*674* - User-space can fill this struct and perform a &DRM_IOCTL_MODE_ADDFB2675* ioctl to register a new frame-buffer. The new frame-buffer object ID will676* be set by the kernel in @fb_id.677* - User-space can set @fb_id and perform a &DRM_IOCTL_MODE_GETFB2 ioctl to678* fetch metadata about an existing frame-buffer.679*680* In case of planar formats, this struct allows up to 4 buffer objects with681* offsets and pitches per plane. The pitch and offset order are dictated by682* the format FourCC as defined by ``drm_fourcc.h``, e.g. NV12 is described as:683*684* YUV 4:2:0 image with a plane of 8-bit Y samples followed by an685* interleaved U/V plane containing 8-bit 2x2 subsampled colour difference686* samples.687*688* So it would consist of a Y plane at ``offsets[0]`` and a UV plane at689* ``offsets[1]``.690*691* To accommodate tiled, compressed, etc formats, a modifier can be specified.692* For more information see the "Format Modifiers" section. Note that even693* though it looks like we have a modifier per-plane, we in fact do not. The694* modifier for each plane must be identical. Thus all combinations of695* different data layouts for multi-plane formats must be enumerated as696* separate modifiers.697*698* All of the entries in @handles, @pitches, @offsets and @modifier must be699* zero when unused. Warning, for @offsets and @modifier zero can't be used to700* figure out whether the entry is used or not since it's a valid value (a zero701* offset is common, and a zero modifier is &DRM_FORMAT_MOD_LINEAR).702*/703struct drm_mode_fb_cmd2 {704/** @fb_id: Object ID of the frame-buffer. */705__u32 fb_id;706/** @width: Width of the frame-buffer. */707__u32 width;708/** @height: Height of the frame-buffer. */709__u32 height;710/**711* @pixel_format: FourCC format code, see ``DRM_FORMAT_*`` constants in712* ``drm_fourcc.h``.713*/714__u32 pixel_format;715/**716* @flags: Frame-buffer flags (see &DRM_MODE_FB_INTERLACED and717* &DRM_MODE_FB_MODIFIERS).718*/719__u32 flags;720721/**722* @handles: GEM buffer handle, one per plane. Set to 0 if the plane is723* unused. The same handle can be used for multiple planes.724*/725__u32 handles[4];726/** @pitches: Pitch (aka. stride) in bytes, one per plane. */727__u32 pitches[4];728/** @offsets: Offset into the buffer in bytes, one per plane. */729__u32 offsets[4];730/**731* @modifier: Format modifier, one per plane. See ``DRM_FORMAT_MOD_*``732* constants in ``drm_fourcc.h``. All planes must use the same733* modifier. Ignored unless &DRM_MODE_FB_MODIFIERS is set in @flags.734*/735__u64 modifier[4];736};737738#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01739#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02740#define DRM_MODE_FB_DIRTY_FLAGS 0x03741742#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256743744/*745* Mark a region of a framebuffer as dirty.746*747* Some hardware does not automatically update display contents748* as a hardware or software draw to a framebuffer. This ioctl749* allows userspace to tell the kernel and the hardware what750* regions of the framebuffer have changed.751*752* The kernel or hardware is free to update more then just the753* region specified by the clip rects. The kernel or hardware754* may also delay and/or coalesce several calls to dirty into a755* single update.756*757* Userspace may annotate the updates, the annotates are a758* promise made by the caller that the change is either a copy759* of pixels or a fill of a single color in the region specified.760*761* If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then762* the number of updated regions are half of num_clips given,763* where the clip rects are paired in src and dst. The width and764* height of each one of the pairs must match.765*766* If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller767* promises that the region specified of the clip rects is filled768* completely with a single color as given in the color argument.769*/770771struct drm_mode_fb_dirty_cmd {772__u32 fb_id;773__u32 flags;774__u32 color;775__u32 num_clips;776__u64 clips_ptr;777};778779struct drm_mode_mode_cmd {780__u32 connector_id;781struct drm_mode_modeinfo mode;782};783784#define DRM_MODE_CURSOR_BO 0x01785#define DRM_MODE_CURSOR_MOVE 0x02786#define DRM_MODE_CURSOR_FLAGS 0x03787788/*789* depending on the value in flags different members are used.790*791* CURSOR_BO uses792* crtc_id793* width794* height795* handle - if 0 turns the cursor off796*797* CURSOR_MOVE uses798* crtc_id799* x800* y801*/802struct drm_mode_cursor {803__u32 flags;804__u32 crtc_id;805__s32 x;806__s32 y;807__u32 width;808__u32 height;809/* driver specific handle */810__u32 handle;811};812813struct drm_mode_cursor2 {814__u32 flags;815__u32 crtc_id;816__s32 x;817__s32 y;818__u32 width;819__u32 height;820/* driver specific handle */821__u32 handle;822__s32 hot_x;823__s32 hot_y;824};825826struct drm_mode_crtc_lut {827__u32 crtc_id;828__u32 gamma_size;829830/* pointers to arrays */831__u64 red;832__u64 green;833__u64 blue;834};835836struct drm_color_ctm {837/*838* Conversion matrix in S31.32 sign-magnitude839* (not two's complement!) format.840*841* out matrix in842* |R| |0 1 2| |R|843* |G| = |3 4 5| x |G|844* |B| |6 7 8| |B|845*/846__u64 matrix[9];847};848849struct drm_color_ctm_3x4 {850/*851* Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude852* (not two's complement!) format.853*854* out matrix in855* |R| |0 1 2 3 | | R |856* |G| = |4 5 6 7 | x | G |857* |B| |8 9 10 11| | B |858* |1.0|859*/860__u64 matrix[12];861};862863struct drm_color_lut {864/*865* Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and866* 0xffff == 1.0.867*/868__u16 red;869__u16 green;870__u16 blue;871__u16 reserved;872};873874/*875* struct drm_color_lut32876*877* 32-bit per channel color LUT entry, similar to drm_color_lut.878*/879struct drm_color_lut32 {880__u32 red;881__u32 green;882__u32 blue;883__u32 reserved;884};885886/**887* enum drm_colorop_type - Type of color operation888*889* drm_colorops can be of many different types. Each type behaves differently890* and defines a different set of properties. This enum defines all types and891* gives a high-level description.892*/893enum drm_colorop_type {894/**895* @DRM_COLOROP_1D_CURVE:896*897* enum string "1D Curve"898*899* A 1D curve that is being applied to all color channels. The900* curve is specified via the CURVE_1D_TYPE colorop property.901*/902DRM_COLOROP_1D_CURVE,903904/**905* @DRM_COLOROP_1D_LUT:906*907* enum string "1D LUT"908*909* A simple 1D LUT of uniformly spaced &drm_color_lut32 entries,910* packed into a blob via the DATA property. The driver's911* expected LUT size is advertised via the SIZE property.912*913* The DATA blob is an array of struct drm_color_lut32 with size914* of "size".915*/916DRM_COLOROP_1D_LUT,917918/**919* @DRM_COLOROP_CTM_3X4:920*921* enum string "3x4 Matrix"922*923* A 3x4 matrix. Its values are specified via the924* &drm_color_ctm_3x4 struct provided via the DATA property.925*926* The DATA blob is a float[12]:927* out matrix in928* | R | | 0 1 2 3 | | R |929* | G | = | 4 5 6 7 | x | G |930* | B | | 8 9 10 12 | | B |931*/932DRM_COLOROP_CTM_3X4,933934/**935* @DRM_COLOROP_MULTIPLIER:936*937* enum string "Multiplier"938*939* A simple multiplier, applied to all color values. The940* multiplier is specified as a S31.32 via the MULTIPLIER941* property.942*/943DRM_COLOROP_MULTIPLIER,944945/**946* @DRM_COLOROP_3D_LUT:947*948* enum string "3D LUT"949*950* A 3D LUT of &drm_color_lut32 entries,951* packed into a blob via the DATA property. The driver's expected952* LUT size is advertised via the SIZE property, i.e., a 3D LUT with953* 17x17x17 entries will have SIZE set to 17.954*955* The DATA blob is a 3D array of struct drm_color_lut32 with dimension956* length of "size".957* The LUT elements are traversed like so:958*959* for B in range 0..n960* for G in range 0..n961* for R in range 0..n962* index = R + n * (G + n * B)963* color = lut3d[index]964*/965DRM_COLOROP_3D_LUT,966};967968/**969* enum drm_colorop_lut3d_interpolation_type - type of 3DLUT interpolation970*/971enum drm_colorop_lut3d_interpolation_type {972/**973* @DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL:974*975* Tetrahedral 3DLUT interpolation976*/977DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL,978};979980/**981* enum drm_colorop_lut1d_interpolation_type - type of interpolation for 1D LUTs982*/983enum drm_colorop_lut1d_interpolation_type {984/**985* @DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR:986*987* Linear interpolation. Values between points of the LUT will be988* linearly interpolated.989*/990DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR,991};992993/**994* struct drm_plane_size_hint - Plane size hints995* @width: The width of the plane in pixel996* @height: The height of the plane in pixel997*998* The plane SIZE_HINTS property blob contains an999* array of struct drm_plane_size_hint.1000*/1001struct drm_plane_size_hint {1002__u16 width;1003__u16 height;1004};10051006/**1007* struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.1008*1009* HDR Metadata Infoframe as per CTA 861.G spec. This is expected1010* to match exactly with the spec.1011*1012* Userspace is expected to pass the metadata information as per1013* the format described in this structure.1014*/1015struct hdr_metadata_infoframe {1016/**1017* @eotf: Electro-Optical Transfer Function (EOTF)1018* used in the stream.1019*/1020__u8 eotf;1021/**1022* @metadata_type: Static_Metadata_Descriptor_ID.1023*/1024__u8 metadata_type;1025/**1026* @display_primaries: Color Primaries of the Data.1027* These are coded as unsigned 16-bit values in units of1028* 0.00002, where 0x0000 represents zero and 0xC3501029* represents 1.0000.1030* @display_primaries.x: X coordinate of color primary.1031* @display_primaries.y: Y coordinate of color primary.1032*/1033struct {1034__u16 x, y;1035} display_primaries[3];1036/**1037* @white_point: White Point of Colorspace Data.1038* These are coded as unsigned 16-bit values in units of1039* 0.00002, where 0x0000 represents zero and 0xC3501040* represents 1.0000.1041* @white_point.x: X coordinate of whitepoint of color primary.1042* @white_point.y: Y coordinate of whitepoint of color primary.1043*/1044struct {1045__u16 x, y;1046} white_point;1047/**1048* @max_display_mastering_luminance: Max Mastering Display Luminance.1049* This value is coded as an unsigned 16-bit value in units of 1 cd/m2,1050* where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.1051*/1052__u16 max_display_mastering_luminance;1053/**1054* @min_display_mastering_luminance: Min Mastering Display Luminance.1055* This value is coded as an unsigned 16-bit value in units of1056* 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF1057* represents 6.5535 cd/m2.1058*/1059__u16 min_display_mastering_luminance;1060/**1061* @max_cll: Max Content Light Level.1062* This value is coded as an unsigned 16-bit value in units of 1 cd/m2,1063* where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.1064*/1065__u16 max_cll;1066/**1067* @max_fall: Max Frame Average Light Level.1068* This value is coded as an unsigned 16-bit value in units of 1 cd/m2,1069* where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.1070*/1071__u16 max_fall;1072};10731074/**1075* struct hdr_output_metadata - HDR output metadata1076*1077* Metadata Information to be passed from userspace1078*/1079struct hdr_output_metadata {1080/**1081* @metadata_type: Static_Metadata_Descriptor_ID.1082*/1083__u32 metadata_type;1084/**1085* @hdmi_metadata_type1: HDR Metadata Infoframe.1086*/1087union {1088struct hdr_metadata_infoframe hdmi_metadata_type1;1089};1090};10911092/**1093* DRM_MODE_PAGE_FLIP_EVENT1094*1095* Request that the kernel sends back a vblank event (see1096* struct drm_event_vblank) with the &DRM_EVENT_FLIP_COMPLETE type when the1097* page-flip is done.1098*1099* When used with atomic uAPI, one event will be delivered per CRTC included in1100* the atomic commit. A CRTC is included in an atomic commit if one of its1101* properties is set, or if a property is set on a connector or plane linked1102* via the CRTC_ID property to the CRTC. At least one CRTC must be included,1103* and all pulled in CRTCs must be either previously or newly powered on (in1104* other words, a powered off CRTC which stays off cannot be included in the1105* atomic commit).1106*/1107#define DRM_MODE_PAGE_FLIP_EVENT 0x011108/**1109* DRM_MODE_PAGE_FLIP_ASYNC1110*1111* Request that the page-flip is performed as soon as possible, ie. with no1112* delay due to waiting for vblank. This may cause tearing to be visible on1113* the screen.1114*1115* When used with atomic uAPI, the driver will return an error if the hardware1116* doesn't support performing an asynchronous page-flip for this update.1117* User-space should handle this, e.g. by falling back to a regular page-flip.1118*1119* Note, some hardware might need to perform one last synchronous page-flip1120* before being able to switch to asynchronous page-flips. As an exception,1121* the driver will return success even though that first page-flip is not1122* asynchronous.1123*/1124#define DRM_MODE_PAGE_FLIP_ASYNC 0x021125#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x41126#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x81127#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \1128DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)1129/**1130* DRM_MODE_PAGE_FLIP_FLAGS1131*1132* Bitmask of flags suitable for &drm_mode_crtc_page_flip_target.flags.1133*/1134#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \1135DRM_MODE_PAGE_FLIP_ASYNC | \1136DRM_MODE_PAGE_FLIP_TARGET)11371138/*1139* Request a page flip on the specified crtc.1140*1141* This ioctl will ask KMS to schedule a page flip for the specified1142* crtc. Once any pending rendering targeting the specified fb (as of1143* ioctl time) has completed, the crtc will be reprogrammed to display1144* that fb after the next vertical refresh. The ioctl returns1145* immediately, but subsequent rendering to the current fb will block1146* in the execbuffer ioctl until the page flip happens. If a page1147* flip is already pending as the ioctl is called, EBUSY will be1148* returned.1149*1150* Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank1151* event (see drm.h: struct drm_event_vblank) when the page flip is1152* done. The user_data field passed in with this ioctl will be1153* returned as the user_data field in the vblank event struct.1154*1155* Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen1156* 'as soon as possible', meaning that it not delay waiting for vblank.1157* This may cause tearing on the screen.1158*1159* The reserved field must be zero.1160*/11611162struct drm_mode_crtc_page_flip {1163__u32 crtc_id;1164__u32 fb_id;1165__u32 flags;1166__u32 reserved;1167__u64 user_data;1168};11691170/*1171* Request a page flip on the specified crtc.1172*1173* Same as struct drm_mode_crtc_page_flip, but supports new flags and1174* re-purposes the reserved field:1175*1176* The sequence field must be zero unless either of the1177* DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When1178* the ABSOLUTE flag is specified, the sequence field denotes the absolute1179* vblank sequence when the flip should take effect. When the RELATIVE1180* flag is specified, the sequence field denotes the relative (to the1181* current one when the ioctl is called) vblank sequence when the flip1182* should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to1183* make sure the vblank sequence before the target one has passed before1184* calling this ioctl. The purpose of the1185* DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify1186* the target for when code dealing with a page flip runs during a1187* vertical blank period.1188*/11891190struct drm_mode_crtc_page_flip_target {1191__u32 crtc_id;1192__u32 fb_id;1193__u32 flags;1194__u32 sequence;1195__u64 user_data;1196};11971198/**1199* struct drm_mode_create_dumb - Create a KMS dumb buffer for scanout.1200* @height: buffer height in pixels1201* @width: buffer width in pixels1202* @bpp: color mode1203* @flags: must be zero1204* @handle: buffer object handle1205* @pitch: number of bytes between two consecutive lines1206* @size: size of the whole buffer in bytes1207*1208* User-space fills @height, @width, @bpp and @flags. If the IOCTL succeeds,1209* the kernel fills @handle, @pitch and @size.1210*1211* The value of @bpp is a color-mode number describing a specific format1212* or a variant thereof. The value often corresponds to the number of bits1213* per pixel for most modes, although there are exceptions. Each color mode1214* maps to a DRM format plus a number of modes with similar pixel layout.1215* Framebuffer layout is always linear.1216*1217* Support for all modes and formats is optional. Even if dumb-buffer1218* creation with a certain color mode succeeds, it is not guaranteed that1219* the DRM driver supports any of the related formats. Most drivers support1220* a color mode of 32 with a format of DRM_FORMAT_XRGB8888 on their primary1221* plane.1222*1223* +------------+------------------------+------------------------+1224* | Color mode | Framebuffer format | Compatible formats |1225* +============+========================+========================+1226* | 32 | * DRM_FORMAT_XRGB8888 | * DRM_FORMAT_BGRX8888 |1227* | | | * DRM_FORMAT_RGBX8888 |1228* | | | * DRM_FORMAT_XBGR8888 |1229* +------------+------------------------+------------------------+1230* | 24 | * DRM_FORMAT_RGB888 | * DRM_FORMAT_BGR888 |1231* +------------+------------------------+------------------------+1232* | 16 | * DRM_FORMAT_RGB565 | * DRM_FORMAT_BGR565 |1233* +------------+------------------------+------------------------+1234* | 15 | * DRM_FORMAT_XRGB1555 | * DRM_FORMAT_BGRX1555 |1235* | | | * DRM_FORMAT_RGBX1555 |1236* | | | * DRM_FORMAT_XBGR1555 |1237* +------------+------------------------+------------------------+1238* | 8 | * DRM_FORMAT_C8 | * DRM_FORMAT_D8 |1239* | | | * DRM_FORMAT_R8 |1240* +------------+------------------------+------------------------+1241* | 4 | * DRM_FORMAT_C4 | * DRM_FORMAT_D4 |1242* | | | * DRM_FORMAT_R4 |1243* +------------+------------------------+------------------------+1244* | 2 | * DRM_FORMAT_C2 | * DRM_FORMAT_D2 |1245* | | | * DRM_FORMAT_R2 |1246* +------------+------------------------+------------------------+1247* | 1 | * DRM_FORMAT_C1 | * DRM_FORMAT_D1 |1248* | | | * DRM_FORMAT_R1 |1249* +------------+------------------------+------------------------+1250*1251* Color modes of 10, 12, 15, 30 and 64 are only supported for use by1252* legacy user space. Please don't use them in new code. Other modes1253* are not support.1254*1255* Do not attempt to allocate anything but linear framebuffer memory1256* with single-plane RGB data. Allocation of other framebuffer1257* layouts requires dedicated ioctls in the respective DRM driver.1258*/1259struct drm_mode_create_dumb {1260__u32 height;1261__u32 width;1262__u32 bpp;1263__u32 flags;12641265__u32 handle;1266__u32 pitch;1267__u64 size;1268};12691270/* set up for mmap of a dumb scanout buffer */1271struct drm_mode_map_dumb {1272/** Handle for the object being mapped. */1273__u32 handle;1274__u32 pad;1275/**1276* Fake offset to use for subsequent mmap call1277*1278* This is a fixed-size type for 32/64 compatibility.1279*/1280__u64 offset;1281};12821283struct drm_mode_destroy_dumb {1284__u32 handle;1285};12861287/**1288* DRM_MODE_ATOMIC_TEST_ONLY1289*1290* Do not apply the atomic commit, instead check whether the hardware supports1291* this configuration.1292*1293* See &drm_mode_config_funcs.atomic_check for more details on test-only1294* commits.1295*/1296#define DRM_MODE_ATOMIC_TEST_ONLY 0x01001297/**1298* DRM_MODE_ATOMIC_NONBLOCK1299*1300* Do not block while applying the atomic commit. The &DRM_IOCTL_MODE_ATOMIC1301* IOCTL returns immediately instead of waiting for the changes to be applied1302* in hardware. Note, the driver will still check that the update can be1303* applied before retuning.1304*/1305#define DRM_MODE_ATOMIC_NONBLOCK 0x02001306/**1307* DRM_MODE_ATOMIC_ALLOW_MODESET1308*1309* Allow the update to result in temporary or transient visible artifacts while1310* the update is being applied. Applying the update may also take significantly1311* more time than a page flip. All visual artifacts will disappear by the time1312* the update is completed, as signalled through the vblank event's timestamp1313* (see struct drm_event_vblank).1314*1315* This flag must be set when the KMS update might cause visible artifacts.1316* Without this flag such KMS update will return a EINVAL error. What kind of1317* update may cause visible artifacts depends on the driver and the hardware.1318* User-space that needs to know beforehand if an update might cause visible1319* artifacts can use &DRM_MODE_ATOMIC_TEST_ONLY without1320* &DRM_MODE_ATOMIC_ALLOW_MODESET to see if it fails.1321*1322* To the best of the driver's knowledge, visual artifacts are guaranteed to1323* not appear when this flag is not set. Some sinks might display visual1324* artifacts outside of the driver's control.1325*/1326#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x040013271328/**1329* DRM_MODE_ATOMIC_FLAGS1330*1331* Bitfield of flags accepted by the &DRM_IOCTL_MODE_ATOMIC IOCTL in1332* &drm_mode_atomic.flags.1333*/1334#define DRM_MODE_ATOMIC_FLAGS (\1335DRM_MODE_PAGE_FLIP_EVENT |\1336DRM_MODE_PAGE_FLIP_ASYNC |\1337DRM_MODE_ATOMIC_TEST_ONLY |\1338DRM_MODE_ATOMIC_NONBLOCK |\1339DRM_MODE_ATOMIC_ALLOW_MODESET)13401341struct drm_mode_atomic {1342__u32 flags;1343__u32 count_objs;1344__u64 objs_ptr;1345__u64 count_props_ptr;1346__u64 props_ptr;1347__u64 prop_values_ptr;1348__u64 reserved;1349__u64 user_data;1350};13511352struct drm_format_modifier_blob {1353#define FORMAT_BLOB_CURRENT 11354/* Version of this blob format */1355__u32 version;13561357/* Flags */1358__u32 flags;13591360/* Number of fourcc formats supported */1361__u32 count_formats;13621363/* Where in this blob the formats exist (in bytes) */1364__u32 formats_offset;13651366/* Number of drm_format_modifiers */1367__u32 count_modifiers;13681369/* Where in this blob the modifiers exist (in bytes) */1370__u32 modifiers_offset;13711372/* __u32 formats[] */1373/* struct drm_format_modifier modifiers[] */1374};13751376struct drm_format_modifier {1377/* Bitmask of formats in get_plane format list this info applies to. The1378* offset allows a sliding window of which 64 formats (bits).1379*1380* Some examples:1381* In today's world with < 65 formats, and formats 0, and 2 are1382* supported1383* 0x00000000000000051384* ^-offset = 0, formats = 51385*1386* If the number formats grew to 128, and formats 98-102 are1387* supported with the modifier:1388*1389* 0x0000007c00000000 00000000000000001390* ^1391* |__offset = 64, formats = 0x7c000000001392*1393*/1394__u64 formats;1395__u32 offset;1396__u32 pad;13971398/* The modifier that applies to the >get_plane format list bitmask. */1399__u64 modifier;1400};14011402/**1403* struct drm_mode_create_blob - Create New blob property1404*1405* Create a new 'blob' data property, copying length bytes from data pointer,1406* and returning new blob ID.1407*/1408struct drm_mode_create_blob {1409/** @data: Pointer to data to copy. */1410__u64 data;1411/** @length: Length of data to copy. */1412__u32 length;1413/** @blob_id: Return: new property ID. */1414__u32 blob_id;1415};14161417/**1418* struct drm_mode_destroy_blob - Destroy user blob1419* @blob_id: blob_id to destroy1420*1421* Destroy a user-created blob property.1422*1423* User-space can release blobs as soon as they do not need to refer to them by1424* their blob object ID. For instance, if you are using a MODE_ID blob in an1425* atomic commit and you will not make another commit re-using the same ID, you1426* can destroy the blob as soon as the commit has been issued, without waiting1427* for it to complete.1428*/1429struct drm_mode_destroy_blob {1430__u32 blob_id;1431};14321433/**1434* struct drm_mode_create_lease - Create lease1435*1436* Lease mode resources, creating another drm_master.1437*1438* The @object_ids array must reference at least one CRTC, one connector and1439* one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively,1440* the lease can be completely empty.1441*/1442struct drm_mode_create_lease {1443/** @object_ids: Pointer to array of object ids (__u32) */1444__u64 object_ids;1445/** @object_count: Number of object ids */1446__u32 object_count;1447/** @flags: flags for new FD (O_CLOEXEC, etc) */1448__u32 flags;14491450/** @lessee_id: Return: unique identifier for lessee. */1451__u32 lessee_id;1452/** @fd: Return: file descriptor to new drm_master file */1453__u32 fd;1454};14551456/**1457* struct drm_mode_list_lessees - List lessees1458*1459* List lesses from a drm_master.1460*/1461struct drm_mode_list_lessees {1462/**1463* @count_lessees: Number of lessees.1464*1465* On input, provides length of the array.1466* On output, provides total number. No1467* more than the input number will be written1468* back, so two calls can be used to get1469* the size and then the data.1470*/1471__u32 count_lessees;1472/** @pad: Padding. */1473__u32 pad;14741475/**1476* @lessees_ptr: Pointer to lessees.1477*1478* Pointer to __u64 array of lessee ids1479*/1480__u64 lessees_ptr;1481};14821483/**1484* struct drm_mode_get_lease - Get Lease1485*1486* Get leased objects.1487*/1488struct drm_mode_get_lease {1489/**1490* @count_objects: Number of leased objects.1491*1492* On input, provides length of the array.1493* On output, provides total number. No1494* more than the input number will be written1495* back, so two calls can be used to get1496* the size and then the data.1497*/1498__u32 count_objects;1499/** @pad: Padding. */1500__u32 pad;15011502/**1503* @objects_ptr: Pointer to objects.1504*1505* Pointer to __u32 array of object ids.1506*/1507__u64 objects_ptr;1508};15091510/**1511* struct drm_mode_revoke_lease - Revoke lease1512*/1513struct drm_mode_revoke_lease {1514/** @lessee_id: Unique ID of lessee */1515__u32 lessee_id;1516};15171518/**1519* struct drm_mode_rect - Two dimensional rectangle.1520* @x1: Horizontal starting coordinate (inclusive).1521* @y1: Vertical starting coordinate (inclusive).1522* @x2: Horizontal ending coordinate (exclusive).1523* @y2: Vertical ending coordinate (exclusive).1524*1525* With drm subsystem using struct drm_rect to manage rectangular area this1526* export it to user-space.1527*1528* Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS.1529*/1530struct drm_mode_rect {1531__s32 x1;1532__s32 y1;1533__s32 x2;1534__s32 y2;1535};15361537/**1538* struct drm_mode_closefb1539* @fb_id: Framebuffer ID.1540* @pad: Must be zero.1541*/1542struct drm_mode_closefb {1543__u32 fb_id;1544__u32 pad;1545};15461547#if defined(__cplusplus)1548}1549#endif15501551#endif155215531554