commit 6161af550e0cdb2119e22544b6d54aa92101f1e0 Author: Jakob Bornecrantz Date: Mon Mar 12 21:49:10 2007 +0100 Testing danger! diff --git a/libdrm/Makefile.am b/libdrm/Makefile.am index e7e07e4..24c3203 100644 --- a/libdrm/Makefile.am +++ b/libdrm/Makefile.am @@ -23,9 +23,9 @@ libdrm_ladir = $(libdir) libdrm_la_LDFLAGS = -version-number 2:3:0 -no-undefined AM_CFLAGS = -I$(top_srcdir)/shared-core -libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c +libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c xf86drmMode.c libdrmincludedir = ${includedir} -libdrminclude_HEADERS = xf86drm.h xf86mm.h +libdrminclude_HEADERS = xf86drm.h xf86mm.h xf86drmMode.h EXTRA_DIST = ChangeLog TODO diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c new file mode 100644 index 0000000..815e841 --- /dev/null +++ b/libdrm/xf86drmMode.c @@ -0,0 +1,403 @@ +/* + * Copyright (c) + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +/* + * \file xf86drmMode.c + * Header for DRM modesetting interface. + * + * \author Jakob Bornecrantz + * + * \par Acknowledgements: + * Feb 2007, Dave Airlie + */ + +// TODO the types we are after are defined in diffrent headers on diffrent +// platforms find which headers to include to get uint32_t +#include + +#include "xf86drmMode.h" +#include "xf86drm.h" +#include + +/* + * Util functions + */ + +static uint32_t* drmAllocCpy( unsigned int *array, int count ) +{ + uint32_t *r; + int i; + + if( !count || !array ) + return 0; + + r = drmMalloc( count * sizeof(*r) ); + + if( !r ) + return 0; + + for( i = 0; i < count; i++) + r[i] = array[i]; + + return r; +} + +/* + * A couple of free functions. + */ + +void drmModeFreeModeInfo( drmModeInfoPtr ptr ) +{ + if( !ptr ) + return; + + drmFree( ptr->modeFlags ); + drmFree( ptr ); +} + +void drmModeFreeResources( drmModeResPtr ptr ) +{ + if( !ptr ) + return; + + drmFree( ptr->crtcs ); + drmFree( ptr->outputs ); + drmFree( ptr->modes ); + drmFree( ptr ); + +} + +void drmModeFreeFrameBufferInfo( drmModeFrameBufferInfoPtr ptr ) +{ + if( !ptr ) + return; + + // we might add more stuff later. + drmFree( ptr ); +} + +void drmModeFreeCrtcInfo( drmModeCrtcInfoPtr ptr ) +{ + if( !ptr ) + return; + + drmFree( ptr->outputs ); + drmFree( ptr->possibles ); + drmFree( ptr ); + +} + +void drmModeFreeOutputInfo( drmModeOutputInfoPtr ptr ) +{ + if( !ptr ) + return; + + drmFree( ptr->crtcs ); + drmFree( ptr->clones ); + drmFree( ptr->modes ); + drmFree( ptr ); + +} + +/* + * ModeSetting functions. + */ + +drmModeResPtr drmModeGetResources( int fd ) +{ + drm_mode_card_res_t res; + int i; + drmModeResPtr r = 0; + + res.count_crtcs = 0; + res.crtcs = 0; + res.count_outputs = 0; + res.outputs = 0; + res.count_modes = 0; + res.modes = 0; + + if( ioctl( fd, DRM_IOCTL_MODE_GET_RESOURCES, &res ) ) + return 0; + + if( res.count_crtcs ) + res.crtcs = drmMalloc( res.count_crtcs * sizeof(*res.crtcs) ); + + if( res.count_outputs ) + res.outputs = drmMalloc( res.count_outputs * sizeof(*res.outputs) ); + + if( res.count_modes ) + res.modes = drmMalloc( res.count_modes * sizeof(*res.modes) ); + + if( icotl( fd, DRM_IOCTL_MODE_GET_RESOURCES, &res ) ) + goto err_allocs; + + /* + * return + */ + + + if( !( r = drmMalloc( sizeof(*r) ) ) ) + return 0; + + r->frameBufferId = res.frameBufferId; + r->count_crtcs = res.count_crtcs; + r->count_outputs = res.count_outputs; + r->count_modes = res.count_modes; + // TODO we realy should test if these allocs fails. + r->crtcs = drmAllocCpy( res.crtcs, res.count_crtcs ); + r->outputs = drmAllocCpy( res.outputs, res.count_outputs ); + r->modes = drmAllocCpy( res.modes, res.count_modes ); + + drmFree( res.crtcs ); + drmFree( res.outputs ); + drmFree( res.modes ); + + return r; + +err_allocs: + drmFree( res.crtcs ); + drmFree( res.outputs ); + drmFree( res.modes ); + + return 0; +} + +int drmModeForceProbe( int fd, uint32_t outputId ) +{ + // TODO impl/keep? +} + +drmModeFrameBufferInfoPtr drmModeGetFramebufferInfo( int fd, uint32_t buf ) +{ + drm_mode_get_fb_t info; + drmModeFrameBufferInfoPtr r; + + if( ioctl( fd, DRM_IOCTL_MODE_GETFRAMEBUFFER, &info ) ) + return 0; + + if( !( r = drmMalloc( sizeof(*r) ) ) ) + return 0; + + r->minWidth = info.minWidth; + r->maxWidth = info.maxWidth; + r->minHeight = info.minHeight; + r->maxHeight = info.maxHeight; + + return r; +} + +int drmModeSetFrameBufferSize( int fd, uint32_t bufferId, + uint32_t width, uint32_t height ) +{ + drm_mode_set_fb_t f; + + f.bufferId = bufferId; + f.width = width; + f.height = height; + + return ioctl( fd, DRM_IOCTL_MODE_SETFRAMEBUFFER, &f ); +} + + +/* + * Crtc function. + */ + +drmModeCrtcInfoPtr drmModeGetCrtcInfo( int fd, uint32_t crtcId ) +{ + drm_mode_crtc_t crtc; + drmModeCrtcInfoPtr r; + int i = 0; + + crtc.count_outputs = 0; + crtc.outputs = 0; + crtc.count_possibles = 0; + crtc.possibles = 0; + + if( ioctl( fd, DRM_IOCTL_MODE_GETCRTC, &crtc ) ) + return 0; + + if( crtc.count_outputs ) + crtc.outputs = drmMalloc( crtc.count_outputs * sizeof(*crtc.outputs) ); + + if( crtc.count_possibles ) + crtc.possibles = drmMalloc( + crtc.count_possibles * sizeof(*crtc.possibles) ); + + if( ioctl( fd, DRM_IOCTL_MODE_GETCRTC, &crtc ) ) + goto err_allocs; + + /* + * return + */ + + if( !( r = drmMalloc( sizeof(*r) ) ) ) + return 0; + + r->x = crtc.x; + r->y = crtc.y; + r->mode = crtc.mode; + r->width = crtc.width; + r->height = crtc.height; + r->bufferId = crtc.bufferId; + r->gamma_size = crtc.gamma_size; + r->count_outputs = crtc.count_outputs; + r->count_possibles = crtc.count_possibles; + // TODO we realy should test if these alloc & cpy fails. + r->outputs = drmAllocCpy( crtc.outputs, crtc.count_outputs ); + r->possibles = drmAllocCpy( crtc.possibles, crtc.count_possibles ); + + drmFree( crtc.outputs ); + drmFree( crtc.possibles ); + + return r; + +err_allocs: + drmFree( crtc.outputs ); + drmFree( crtc.possibles ); + + return 0; +} + +int drmModeSetCrtcConfig( + int fd, uint32_t crtcId, uint32_t bufferId, + uint32_t x, uint32_t y, uint32_t modeId, + uint32_t *outputs, int count + ) +{ + drm_mode_crtc_t crtc; + + crtc.count_outputs = 0; + crtc.outputs = 0; + crtc.count_possibles = 0; + crtc.possibles = 0; + + crtc.x = x; + crtc.y = y; + crtc.crtcId = crtcId; + crtc.bufferId = bufferId; + crtc.outputs = outputs; + crtc.count_outputs = count; + + return ioctl( fd, DRM_IOCTL_MODE_SETCRTC, &crtc ); +} + +drmModeGammaTriplePtr drmModeGetCrtcGamma( int fd, uint32_t crtc, int *count ) +{ + // TODO impl +} + +int drmModeSetCrtcGamma( int fd, uint32_t crtcId, + drmModeGammaTriplePtr ptr, int count ) +{ + // TODO impl +} + + +/* + * Output manipulation + */ + +drmModeOutputInfoPtr drmModeGetOutputInfo( int fd, uint32_t outputId ) +{ + drm_mode_get_output_t out; + drmModeOutputInfoPtr r = 0; + + out.count_crtcs = 0; + out.crtcs = 0; + out.count_clones = 0; + out.clones = 0; + out.count_modes = 0; + out.modes = 0; + + if( ioctl( fd, DRM_IOCTL_MODE_GETOUTPUT, &out ) ) + return 0; + + if( out.count_crtcs ) + out.crtcs = drmMalloc( out.count_crtcs * sizeof(*out.crtcs) ); + + if( out.count_clones ) + out.clones = drmMalloc( out.count_clones * sizeof(*out.clones) ); + + if( out.count_modes ) + out.modes = drmMalloc( out.count_modes * sizeof(*out.modes) ); + + if( icotl( fd, DRM_IOCTL_MODE_GETOUTPUT, &out ) ) + goto err_allocs; + + if( !( r = drmMalloc( sizeof(*r) ) ) ) + return 0; + + r->connection = out.connection; + r->width = out.width; + r->height = out.height; + r->subpixel = out.subpixel; + r->count_crtcs = out.count_crtcs; + r->count_clones = out.count_clones; + r->count_modes = out.count_modes; + // TODO we realy should test if these alloc & cpy fails. + r->crtcs = drmAllocCpy( out.crtcs, out.count_crtcs ); + r->clones = drmAllocCpy( out.clones, out.count_clones ); + r->modes = drmAllocCpy( out.modes, out.count_modes ); + + return r; + +err_allocs: + drmFree( out.crtcs ); + drmFree( out.clones ); + drmFree( out.modes ); + + return 0; +} + +uint32_t drmModeCreateMode( int fd, drmModeInfoPtr modeInfo ) +{ + // TODO impl +} + +int drmModeDestroyMode( int fd, uint32_t modeId ) +{ + return ioctl( fd, DRM_IOCTL_MODE_DESTROYMODE, modeId ); +} + +int drmModeAddOutputMode( int fd, uint32_t outputId, uint32_t modeId ) +{ + + drm_mode_outputmode_t res; + + res.outputId = outputId; + res.modeId = modeId; + + return ioctl( fd, DRM_IOCTL_MODE_ADDOUTPUTMODE, &res ); +} + +int drmModeDeleteOutputMode( int fd, uint32_t outputId, uint32_t modeId ) +{ + drm_mode_outputmode_t res; + + res.outputId = outputId; + res.modeId = modeId; + + return ioctl( fd, DRM_IOCTL_MODE_DELOUTPUTMODE, &res ); +} + diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h new file mode 100644 index 0000000..90b0ff0 --- /dev/null +++ b/libdrm/xf86drmMode.h @@ -0,0 +1,298 @@ +/* + * Copyright (c) + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +/* + * \file xf86drmMode.h + * Header for DRM modesetting interface. + * + * \author Jakob Bornecrantz + * + * \par Acknowledgements: + * Feb 2007, Dave Airlie + */ + +#include + +/* + * This is the interface for modesetting for drm. + * + * In order to use this interface you must include either or another + * header defining uint32_t, int32_t and uint16_t. + * + * It aims to provide a randr compatible interface for modesettings in the + * kernel, the interface is also ment to be used by libraries like EGL. + * + * More information can be found in randrproto.txt which can be found here: + * http://gitweb.freedesktop.org/?p=xorg/proto/randrproto.git + * + * All framebuffer, crtc and output ids start at 1 while 0 is either an invalid + * parameter or used to indicate that the command should disconnect from the + * currently bound target, as with drmModeMapOutput. + * + * Currently only one framebuffer exist and has a id of 1, which is also the + * default framebuffer and should allways be avaible to the client, unless + * it is locked/used or any other limiting state is applied on it. + * + */ + +typedef struct _drmModeInfo { + + uint32_t id; + + int count_name; + char *name; + + uint16_t width, height; + uint32_t dotClock; + + uint16_t hSyncStart, hSyncEnd, hTotal, hSkew; + uint16_t vSyncStart, vSyncEnd, vTotal; + + int count_flags; + uint32_t *modeFlags; + +} drmModeInfo, *drmModeInfoPtr; + +typedef struct _drmModeGammaTriple { + uint16_t r, g, b; +} drmModeGammaTriple, *drmModeGammaTriplePtr; + +typedef struct _drmModeRes { + + uint32_t frameBufferId; + + int count_crtcs; + uint32_t *crtcs; + + int count_outputs; + uint32_t *outputs; + + int count_modes; + uint32_t *modes; + +} drmModeRes, *drmModeResPtr; + +typedef struct _drmModeFrameBufferInfo { + + uint32_t minWidth, maxWidth; + uint32_t minHeight, maxHeight; + +} drmModeFrameBufferInfo, *drmModeFrameBufferInfoPtr; + +typedef struct _drmModeCrtcInfo { + + unsigned int bufferId; /**< Buffer currently connected to */ + + uint32_t x, y; /**< Position on the frameuffer */ + uint32_t width, height; + uint32_t mode; /**< Current mode used */ + + int count_outputs; + uint32_t *outputs; /**< Outputs that are connected */ + + int count_possibles; + uint32_t *possibles; /**< Outputs that can be connected */ + + int gamma_size; /**< Number of gamma stops */ + +} drmModeCrtcInfo, *drmModeCrtcInfoPtr; + +typedef enum { + DRM_MODE_CONNECTED = 1, + DRM_MODE_DISCONNECTED = 2, + DRM_MODE_UNKNOWNCONNECTION = 3 +} drmModeConnection; + +typedef enum { + DRM_MODE_SUBPIXEL_UNKNOWN = 1, + DRM_MODE_SUBPIXEL_HORIZONTAL_RGB = 2, + DRM_MODE_SUBPIXEL_HORIZONTAL_BGR = 3, + DRM_MODE_SUBPIXEL_VERTICAL_RGB = 4, + DRM_MODE_SUBPIXEL_VERTICAL_BGR = 5, + DRM_MODE_SUBPIXEL_NONE = 6 +} drmModeSubPixel; + +typedef struct _drmModeOutputInfo { + + unsigned int crtc; /**< Crtc currently connected to */ + + drmModeConnection connection; + uint32_t width, height; /**< HxW in millimeters */ + drmModeSubPixel subpixel; + + int count_crtcs; + uint32_t *crtcs; /**< Possible crtc to connect to */ + + int count_clones; + uint32_t *clones; /**< List of clones */ + + int count_modes; + uint32_t *modes; /**< List of modes */ + +} drmModeOutputInfo, *drmModeOutputInfoPtr; + +/* + * RRSetScreenConfig o + * RRGetScreenInfo o + * + * RRGetScreenSizeRange - see frameBuffer info + * RRSetScreenSize + * RRGetScreenResources + * + * RRGetOutputInfo + * + * RRListOutputProperties * + * RRQueryOutputProperty * + * RRConfigureOutputProperty * + * RRChangeOutputProperty * + * RRDeleteOutputProperty * + * RRGetOutputProperty * + * + * RRCreateMode + * RRDestroyMode + * RRAddOutputMode + * RRDeleteOutputMode + * + * RRGetCrtcInfo + * RRSetCrtcConfig + * + * RRGetCrtcGammaSize - see crtc info + * RRGetCrtcGamma + * RRSetCrtcGamma + * + * drmModeGetResources + * drmModeForceProbe + * + * drmModeGetFrameBufferInfo + * drmModeSetFrameBufferSize + * + * drmModeGetCrtcInfo + * drmModeSetCrtcConfig + * drmModeGetCrtcGamma + * drmModeSetCrtcGamma + * + * drmModeGetOutputInfo + * + * drmModeAddMode + * drmModeDestroyMode + * drmModeAddOutputMode + * drmModeDeleteOutputMode + */ + +extern void drmModeFreeModeInfo( drmModeInfoPtr ptr ); +extern void drmModeFreeResources( drmModeResPtr ptr ); +extern void drmModeFreeFrameBufferInfo( drmModeFrameBufferInfoPtr ptr ); +extern void drmModeFreeCrtcInfo( drmModeCrtcInfoPtr ptr ); +extern void drmModeFreeOutputInfo( drmModeOutputInfoPtr ptr ); + +/** + * Retrives all of the resources associated with a card. + */ +extern drmModeResPtr drmModeGetResources( int fd ); + +/** + * Forces a probe of the give output outputId, on 0 all will be probed. + */ +extern int drmModeForceProbe( int fd, uint32_t outputId ); + + +/* + * FrameBuffer manipulation. + */ + +/** + * Retrive information about framebuffer bufferId + */ +extern drmModeFrameBufferInfoPtr drmModeGetFramebufferInfo( int fd, + uint32_t bufferId ); + +/** + * Sets the framebuffer to a given size. + */ +extern int drmModeSetFrameBufferSize( int fd, uint32_t bufferId, + uint32_t x, uint32_t y ); + + +/* + * Crtc function. + */ + +/** + * Retrive information about the ctrt crtcId + */ +extern drmModeCrtcInfoPtr drmModeGetCrtcInfo( int fd, uint32_t crtcId ); + +/** + * Set the mode on a crtc crtcId with the given mode modeId. + */ +extern int drmModeSetCrtcConfig( int fd, uint32_t crtcId, uint32_t bufferId, + uint32_t x, uint32_t y, uint32_t modeId, + uint32_t *outputs, int count ); + +/** + * Gets the gamma from a crtc + */ +extern drmModeGammaTriplePtr drmModeGetCrtcGamma( int fd, uint32_t crtcId, + int *count ); + +/** + * Sets the gamma on a crtc + */ +extern int drmModeSetCrtcGamma( int fd, uint32_t crtcId, + drmModeGammaTriplePtr ptr, int count ); + + + +/* + * Output manipulation + */ + +/** + * Retrive information about the output outputId. + */ +extern drmModeOutputInfoPtr drmModeGetOutputInfo( int fd, + uint32_t outputId ); + +/** + * Creates a new mode from the given mode info. + * Name must be unique. + */ +extern uint32_t drmModeCreateMode( int fd, drmModeInfoPtr modeInfo ); + +/** + * Destroys a mode created with CreateMode, must be unused. + */ +extern int drmModeDestroyMode( int fd, uint32_t modeId ); + +/** + * Adds the given mode to an output. + */ +extern int drmModeAddOutputMode( int fd, uint32_t outputId, uint32_t modeId ); + +/** + * Deletes a mode Added with AddOutputMode from the output, + * must be unused, by the given mode. + */ +extern int drmModeDeleteOutputMode( int fd, uint32_t outputId, + uint32_t modeId ); + diff --git a/shared-core/drm.h b/shared-core/drm.h index 447065c..2ccf0ef 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -887,6 +887,117 @@ typedef union drm_mm_init_arg{ } rep; } drm_mm_init_arg_t; +/* + * Drm mode setting + */ + +typedef struct drm_mode_modeinfo { + + unsigned int id; + + unsigned short width, height; + unsigned int dotClock; + unsigned short hSyncStart, hSyncEnd, hTotal, hSkew; + unsigned short vSyncStart, vSyncEnd, vTotal; + + int count_flag; + unsigned int __user *modeFlags; + +} drm_mode_modeinfo_t; + +typedef struct drm_mode_card_res { + + unsigned int frameBufferId; + + int count_crtcs; + unsigned int __user *crtcs; + + int count_outputs; + unsigned int __user *outputs; + + int count_modes; + unsigned int __user *modes; + +} drm_mode_card_res_t; + +typedef struct drm_mode_get_fb { + + unsigned int minWidth, maxWidth; + unsigned int minHeight, maxHeight; + +} drm_mode_get_fb_t; + +typedef struct drm_mode_set_fb { + + unsigned int bufferId; + + unsigned int width, height; + +} drm_mode_set_fb_t; + +typedef struct drm_mode_crtc +{ + unsigned int crtcId; /**< Id */ + unsigned int bufferId; /**< Id of framebuffer */ + + int x, y; /**< Position on the frameuffer */ + unsigned int width, height; + unsigned int mode; /**< Current mode used */ + + int count_outputs; + unsigned int __user *outputs; /**< Outputs that are connected */ + + int count_possibles; + unsigned int __user *possibles; /**< Outputs that can be connected */ + + int gamma_size; + +} drm_mode_crtc_t; + +typedef struct drm_mode_crtc_gamma { + + unsigned int crtc; + + int count_ramp; + unsigned short __user *ramps; + +} drm_mode_crtc_gamma_t; + +typedef struct drm_mode_get_output { + + unsigned int output; /**< Id */ + unsigned int crtc; /**< Id of crtc */ + + unsigned int connection; + unsigned int width, height; /**< HxW in millimeters */ + unsigned int subpixel; + + int count_crtcs; + unsigned int __user *crtcs; /**< possible crtc to connect to */ + + int count_clones; + unsigned int __user *clones; /**< list of clones */ + + int count_modes; + unsigned int __user *modes; /**< list of modes it supports */ + +} drm_mode_get_output_t; + +typedef struct drm_mode_create_mode { + + unsigned int modeId; /**< return id */ + + drm_mode_modeinfo_t m; + +} drm_mode_create_mode_t; + +typedef struct drm_mode_outputmode { + + unsigned int outputId; + unsigned int modeId; /**< mode to be added/deleted */ + +} drm_mode_outputmode_t; + /** * \name Ioctls Definitions */ @@ -958,6 +1069,20 @@ #define DRM_IOCTL_MM_INIT #define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, drm_update_draw_t) +#define DRM_IOCTL_MODE_GET_RESOURCES DRM_IOWR(0xA0, drm_mode_card_res_t) +#define DRM_IOCTL_MODE_FORCEPROBE DRM_IO( 0xA1) +#define DRM_IOCTL_MODE_GETFRAMEBUFFER DRM_IOWR(0xA2, drm_mode_get_fb_t) +#define DRM_IOCTL_MODE_SETFRAMEBUFFER DRM_IOR( 0xA3, drm_mode_set_fb_t) +#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA4, drm_mode_crtc_t) +#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA5, drm_mode_crtc_t) +#define DRM_IOCTL_MODE_GETCRTCGAMMA DRM_IOWR(0xA6, drm_mode_crtc_gamma_t) +#define DRM_IOCTL_MODE_SETCRTCGAMMA DRM_IOWR(0xA7, drm_mode_crtc_gamma_t) +#define DRM_IOCTL_MODE_GETOUTPUT DRM_IOWR(0xA8, drm_mode_get_output_t) +#define DRM_IOCTL_MODE_ADDMODE DRM_IOWR(0xA9, drm_mode_create_mode_t) +#define DRM_IOCTL_MODE_DESTROYMODE DRM_IO( 0xAA) +#define DRM_IOCTL_MODE_ADDOUTPUTMODE DRM_IOWR(0xAB, drm_mode_outputmode_t) +#define DRM_IOCTL_MODE_DELOUTPUTMODE DRM_IOWR(0xAC, drm_mode_outputmode_t) + /*@}*/ /**