# define DEPRECATED __attribute__ ((deprecated))
#else
# define DEPRECATED
+# ifndef __FUNCTION__
+# define __FUNCTION__ __func__ /* C99 */
+# endif
+# ifndef __volatile__
+# define __volatile__ volatile
+# endif
#endif
#if defined(__linux__)
_DRM_AGP = 3, /**< AGP/GART */
_DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
_DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
- _DRM_TTM = 6
+ _DRM_GEM = 6,
+ _DRM_TTM = 7,
};
/**
struct drm_wait_vblank_reply reply;
};
-/* Handle monitor hotplug.
- *
- * May want to extend this later to pass reply information which
- * details the connectors which generated the hotplug event.
- * Some chipsets can't determine that though, and we'd need to leave
- * it to the higher levels to determine exactly what changed.
- */
-enum drm_hotplug_seq_type {
- _DRM_HOTPLUG_SIGNAL = 0x00000001, /**< Send signal instead of blocking */
-};
-struct drm_wait_hotplug_request {
- enum drm_hotplug_seq_type type;
- unsigned long signal;
-};
-
-struct drm_wait_hotplug_reply {
- enum drm_hotplug_seq_type type;
- unsigned int counter;
- long tval_sec;
- long tval_usec;
-};
-
-/**
- * DRM_IOCTL_WAIT_HOTPLUG ioctl argument type.
- *
- * \sa drmWaitHotplug().
- */
-union drm_wait_hotplug {
- struct drm_wait_hotplug_request request;
- struct drm_wait_hotplug_reply reply;
-};
-
-enum drm_modeset_ctl_cmd {
- _DRM_PRE_MODESET = 1,
- _DRM_POST_MODESET = 2,
-};
+#define _DRM_PRE_MODESET 1
+#define _DRM_POST_MODESET 2
/**
* DRM_IOCTL_MODESET_CTL ioctl argument type
uint64_t p_size;
};
-
-/*
- * Drm mode setting
- */
-#define DRM_DISPLAY_INFO_LEN 32
-#define DRM_CONNECTOR_NAME_LEN 32
-#define DRM_DISPLAY_MODE_LEN 32
-#define DRM_PROP_NAME_LEN 32
-
-#define DRM_MODE_TYPE_BUILTIN (1<<0)
-#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN)
-#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN)
-#define DRM_MODE_TYPE_PREFERRED (1<<3)
-#define DRM_MODE_TYPE_DEFAULT (1<<4)
-#define DRM_MODE_TYPE_USERDEF (1<<5)
-#define DRM_MODE_TYPE_DRIVER (1<<6)
-
-struct drm_mode_modeinfo {
- unsigned int clock;
- unsigned short hdisplay, hsync_start, hsync_end, htotal, hskew;
- unsigned short vdisplay, vsync_start, vsync_end, vtotal, vscan;
-
- unsigned int vrefresh; /* vertical refresh * 1000 */
-
- unsigned int flags;
- unsigned int type;
- char name[DRM_DISPLAY_MODE_LEN];
-};
-
-struct drm_mode_card_res {
- uint64_t fb_id_ptr;
- uint64_t crtc_id_ptr;
- uint64_t connector_id_ptr;
- uint64_t encoder_id_ptr;
- int count_fbs;
- int count_crtcs;
- int count_connectors;
- int count_encoders;
- int min_width, max_width;
- int min_height, max_height;
-};
-
-struct drm_mode_crtc {
- uint64_t set_connectors_ptr;
-
- unsigned int crtc_id; /**< Id */
- unsigned int fb_id; /**< Id of framebuffer */
-
- int x, y; /**< Position on the frameuffer */
-
- int count_connectors;
- unsigned int connectors; /**< Connectors that are connected */
-
- int count_possibles;
- unsigned int possibles; /**< Connectors that can be connected */
- int gamma_size;
- int mode_valid;
- struct drm_mode_modeinfo mode;
-};
-
-struct drm_mode_get_encoder {
-
- uint32_t encoder_type;
- uint32_t encoder_id;
-
- uint32_t crtcs;
- uint32_t clones;
-};
-
-#define DRM_MODE_ENCODER_NONE 0
-#define DRM_MODE_ENCODER_DAC 1
-#define DRM_MODE_ENCODER_TMDS 2
-#define DRM_MODE_ENCODER_LVDS 3
-#define DRM_MODE_ENCODER_TVDAC 4
-
-struct drm_mode_get_connector {
-
- uint64_t encoders_ptr;
- uint64_t modes_ptr;
- uint64_t props_ptr;
- uint64_t prop_values_ptr;
-
- int count_modes;
- int count_props;
- int count_encoders;
-
- unsigned int connector; /**< Id */
- unsigned int crtc; /**< Id of crtc */
- unsigned int connector_type;
- unsigned int connector_type_id;
-
- unsigned int connection;
- unsigned int mm_width, mm_height; /**< HxW in millimeters */
- unsigned int subpixel;
-};
-
-#define DRM_MODE_PROP_PENDING (1<<0)
-#define DRM_MODE_PROP_RANGE (1<<1)
-#define DRM_MODE_PROP_IMMUTABLE (1<<2)
-#define DRM_MODE_PROP_ENUM (1<<3) // enumerated type with text strings
-#define DRM_MODE_PROP_BLOB (1<<4)
-
-struct drm_mode_property_enum {
- uint64_t value;
- unsigned char name[DRM_PROP_NAME_LEN];
-};
-
-struct drm_mode_get_property {
- uint64_t values_ptr; /* values and blob lengths */
- uint64_t enum_blob_ptr; /* enum and blob id ptrs */
-
- unsigned int prop_id;
- unsigned int flags;
- unsigned char name[DRM_PROP_NAME_LEN];
-
- int count_values;
- int count_enum_blobs;
+struct drm_gem_close {
+ /** Handle of the object to be closed. */
+ uint32_t handle;
+ uint32_t pad;
};
-struct drm_mode_connector_set_property {
- uint64_t value;
- unsigned int prop_id;
- unsigned int connector_id;
-};
-
-struct drm_mode_get_blob {
- uint32_t blob_id;
- uint32_t length;
- uint64_t data;
-};
+struct drm_gem_flink {
+ /** Handle for the object being named */
+ uint32_t handle;
-struct drm_mode_fb_cmd {
- unsigned int buffer_id;
- unsigned int width, height;
- unsigned int pitch;
- unsigned int bpp;
- unsigned int handle;
- unsigned int depth;
+ /** Returned global name */
+ uint32_t name;
};
-struct drm_mode_mode_cmd {
- unsigned int connector_id;
- struct drm_mode_modeinfo mode;
-};
+struct drm_gem_open {
+ /** Name of object being opened */
+ uint32_t name;
-#define DRM_MODE_CURSOR_BO 0x01
-#define DRM_MODE_CURSOR_MOVE 0x02
-
-/*
- * depending on the value in flags diffrent members are used.
- *
- * CURSOR_BO uses
- * crtc
- * width
- * height
- * handle - if 0 turns the cursor of
- *
- * CURSOR_MOVE uses
- * crtc
- * x
- * y
- */
-struct drm_mode_cursor {
- unsigned int flags;
- unsigned int crtc;
- int x;
- int y;
- uint32_t width;
- uint32_t height;
- unsigned int handle;
+ /** Returned handle for the object */
+ uint32_t handle;
+
+ /** Returned size of the object */
+ uint64_t size;
};
-/*
- * oh so ugly hotplug
- */
-struct drm_mode_hotplug {
- uint32_t counter;
-};
+#include "drm_mode.h"
/**
* \name Ioctls Definitions
#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
-#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
+#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
+
+#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
+#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
-#define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, struct drm_scatter_gather)
+#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
#define DRM_IOCTL_MM_INFO DRM_IOWR(0xd7, struct drm_mm_info_arg)
#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
+
#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
-#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA2, struct drm_mode_get_connector)
-#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA3, struct drm_mode_crtc)
-#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xA4, struct drm_mode_fb_cmd)
-#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xA5, unsigned int)
-#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xA6, struct drm_mode_fb_cmd)
-
-#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xA7, struct drm_mode_connector_set_property)
-#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xA8, struct drm_mode_get_blob)
-#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd)
-#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xAA, struct drm_mode_mode_cmd)
-
-#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAB, struct drm_mode_get_property)
-#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xAC, struct drm_mode_cursor)
-#define DRM_IOCTL_MODE_HOTPLUG DRM_IOWR(0xAD, struct drm_mode_hotplug)
-#define DRM_IOCTL_WAIT_HOTPLUG DRM_IOWR(0xAE, union drm_wait_hotplug)
-
-#define DRM_IOCTL_MODE_REPLACEFB DRM_IOWR(0xAF, struct drm_mode_fb_cmd)
-#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xB0, struct drm_mode_get_encoder)
+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
+#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
+#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
+#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
+
+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
+
+#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd)
+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd)
+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
+#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
+#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
+
+#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
+#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, uint32_t)
+#define DRM_IOCTL_MODE_REPLACEFB DRM_IOWR(0xB0, struct drm_mode_fb_cmd)
+
/*@}*/
/**
#define DRM_COMMAND_END 0xA0
/* typedef area */
-#if !defined(__KERNEL__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#ifndef __KERNEL__
typedef struct drm_clip_rect drm_clip_rect_t;
typedef struct drm_tex_region drm_tex_region_t;
typedef struct drm_hw_lock drm_hw_lock_t;