Added structs and ioctls for modesetting in kernel
From c34f2024584b3a150bc42a1b9ae532f8246a2e8f Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz <[EMAIL PROTECTED]>
Date: Tue, 20 Mar 2007 20:11:39 +0100
Subject: [PATCH] Added structs and ioctls for modesetting in kernel
---
shared-core/drm.h | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 125 insertions(+), 0 deletions(-)
diff --git a/shared-core/drm.h b/shared-core/drm.h
index 3c59cd4..7dc6743 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -888,6 +888,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
*/
@@ -959,6 +1070,20 @@ #define DRM_IOCTL_MM_INIT
#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, drm_update_draw_t)
+#define DRM_IOCTL_MODE_GETRESOURCES 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_NEWMODE DRM_IOWR(0xA9, drm_mode_create_mode_t)
+#define DRM_IOCTL_MODE_DESMODE DRM_IO( 0xAA)
+#define DRM_IOCTL_MODE_ADDMODE DRM_IOWR(0xAB, drm_mode_outputmode_t)
+#define DRM_IOCTL_MODE_DELMODE DRM_IOWR(0xAC, drm_mode_outputmode_t)
+
/[EMAIL PROTECTED]/
/**
--
1.4.1
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel