diff options
author | Dave Airlie <airlied@redhat.com> | 2008-11-07 17:05:41 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-12-29 02:47:23 -0500 |
commit | f453ba0460742ad027ae0c4c7d61e62817b3e7ef (patch) | |
tree | 29e6ecacd6e8971aa62e1825d77f2c1876ac3eb2 /include/drm/drmP.h | |
parent | de151cf67ce52ed2d88083daa5e60c7858947329 (diff) |
DRM: add mode setting support
Add mode setting support to the DRM layer.
This is a fairly big chunk of work that allows DRM drivers to provide
full output control and configuration capabilities to userspace. It was
motivated by several factors:
- the fb layer's APIs aren't suited for anything but simple
configurations
- coordination between the fb layer, DRM layer, and various userspace
drivers is poor to non-existent (radeonfb excepted)
- user level mode setting drivers makes displaying panic & oops
messages more difficult
- suspend/resume of graphics state is possible in many more
configurations with kernel level support
This commit just adds the core DRM part of the mode setting APIs.
Driver specific commits using these new structure and APIs will follow.
Co-authors: Jesse Barnes <jbarnes@virtuousgeek.org>, Jakob Bornecrantz <jakob@tungstengraphics.com>
Contributors: Alan Hourihane <alanh@tungstengraphics.com>, Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index ae42a6a5c24e..7802c80f2b23 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -105,6 +105,7 @@ struct drm_device; | |||
105 | #define DRIVER_FB_DMA 0x400 | 105 | #define DRIVER_FB_DMA 0x400 |
106 | #define DRIVER_IRQ_VBL2 0x800 | 106 | #define DRIVER_IRQ_VBL2 0x800 |
107 | #define DRIVER_GEM 0x1000 | 107 | #define DRIVER_GEM 0x1000 |
108 | #define DRIVER_MODESET 0x2000 | ||
108 | 109 | ||
109 | /***********************************************************************/ | 110 | /***********************************************************************/ |
110 | /** \name Begin the DRM... */ | 111 | /** \name Begin the DRM... */ |
@@ -276,6 +277,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, | |||
276 | #define DRM_AUTH 0x1 | 277 | #define DRM_AUTH 0x1 |
277 | #define DRM_MASTER 0x2 | 278 | #define DRM_MASTER 0x2 |
278 | #define DRM_ROOT_ONLY 0x4 | 279 | #define DRM_ROOT_ONLY 0x4 |
280 | #define DRM_CONTROL_ALLOW 0x8 | ||
279 | 281 | ||
280 | struct drm_ioctl_desc { | 282 | struct drm_ioctl_desc { |
281 | unsigned int cmd; | 283 | unsigned int cmd; |
@@ -398,6 +400,7 @@ struct drm_file { | |||
398 | int is_master; /* this file private is a master for a minor */ | 400 | int is_master; /* this file private is a master for a minor */ |
399 | struct drm_master *master; /* master this node is currently associated with | 401 | struct drm_master *master; /* master this node is currently associated with |
400 | N.B. not always minor->master */ | 402 | N.B. not always minor->master */ |
403 | struct list_head fbs; | ||
401 | }; | 404 | }; |
402 | 405 | ||
403 | /** Wait queue */ | 406 | /** Wait queue */ |
@@ -629,6 +632,8 @@ struct drm_gem_object { | |||
629 | void *driver_private; | 632 | void *driver_private; |
630 | }; | 633 | }; |
631 | 634 | ||
635 | #include "drm_crtc.h" | ||
636 | |||
632 | /* per-master structure */ | 637 | /* per-master structure */ |
633 | struct drm_master { | 638 | struct drm_master { |
634 | 639 | ||
@@ -792,6 +797,8 @@ struct drm_driver { | |||
792 | 797 | ||
793 | #define DRM_MINOR_UNASSIGNED 0 | 798 | #define DRM_MINOR_UNASSIGNED 0 |
794 | #define DRM_MINOR_LEGACY 1 | 799 | #define DRM_MINOR_LEGACY 1 |
800 | #define DRM_MINOR_CONTROL 2 | ||
801 | #define DRM_MINOR_RENDER 3 | ||
795 | 802 | ||
796 | /** | 803 | /** |
797 | * DRM minor structure. This structure represents a drm minor number. | 804 | * DRM minor structure. This structure represents a drm minor number. |
@@ -805,6 +812,7 @@ struct drm_minor { | |||
805 | struct proc_dir_entry *dev_root; /**< proc directory entry */ | 812 | struct proc_dir_entry *dev_root; /**< proc directory entry */ |
806 | struct drm_master *master; /* currently active master for this node */ | 813 | struct drm_master *master; /* currently active master for this node */ |
807 | struct list_head master_list; | 814 | struct list_head master_list; |
815 | struct drm_mode_group mode_group; | ||
808 | }; | 816 | }; |
809 | 817 | ||
810 | /** | 818 | /** |
@@ -855,6 +863,7 @@ struct drm_device { | |||
855 | struct idr ctx_idr; | 863 | struct idr ctx_idr; |
856 | 864 | ||
857 | struct list_head vmalist; /**< List of vmas (for debugging) */ | 865 | struct list_head vmalist; /**< List of vmas (for debugging) */ |
866 | |||
858 | /*@} */ | 867 | /*@} */ |
859 | 868 | ||
860 | /** \name DMA queues (contexts) */ | 869 | /** \name DMA queues (contexts) */ |
@@ -933,6 +942,7 @@ struct drm_device { | |||
933 | struct drm_driver *driver; | 942 | struct drm_driver *driver; |
934 | drm_local_map_t *agp_buffer_map; | 943 | drm_local_map_t *agp_buffer_map; |
935 | unsigned int agp_buffer_token; | 944 | unsigned int agp_buffer_token; |
945 | struct drm_minor *control; /**< Control node for card */ | ||
936 | struct drm_minor *primary; /**< render type primary screen head */ | 946 | struct drm_minor *primary; /**< render type primary screen head */ |
937 | 947 | ||
938 | /** \name Drawable information */ | 948 | /** \name Drawable information */ |
@@ -941,6 +951,8 @@ struct drm_device { | |||
941 | struct idr drw_idr; | 951 | struct idr drw_idr; |
942 | /*@} */ | 952 | /*@} */ |
943 | 953 | ||
954 | struct drm_mode_config mode_config; /**< Current mode config */ | ||
955 | |||
944 | /** \name GEM information */ | 956 | /** \name GEM information */ |
945 | /*@{ */ | 957 | /*@{ */ |
946 | spinlock_t object_name_lock; | 958 | spinlock_t object_name_lock; |
@@ -1201,6 +1213,8 @@ extern int drm_vblank_get(struct drm_device *dev, int crtc); | |||
1201 | extern void drm_vblank_put(struct drm_device *dev, int crtc); | 1213 | extern void drm_vblank_put(struct drm_device *dev, int crtc); |
1202 | extern void drm_vblank_cleanup(struct drm_device *dev); | 1214 | extern void drm_vblank_cleanup(struct drm_device *dev); |
1203 | /* Modesetting support */ | 1215 | /* Modesetting support */ |
1216 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | ||
1217 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); | ||
1204 | extern int drm_modeset_ctl(struct drm_device *dev, void *data, | 1218 | extern int drm_modeset_ctl(struct drm_device *dev, void *data, |
1205 | struct drm_file *file_priv); | 1219 | struct drm_file *file_priv); |
1206 | 1220 | ||
@@ -1286,7 +1300,11 @@ struct drm_sysfs_class; | |||
1286 | extern struct class *drm_sysfs_create(struct module *owner, char *name); | 1300 | extern struct class *drm_sysfs_create(struct module *owner, char *name); |
1287 | extern void drm_sysfs_destroy(void); | 1301 | extern void drm_sysfs_destroy(void); |
1288 | extern int drm_sysfs_device_add(struct drm_minor *minor); | 1302 | extern int drm_sysfs_device_add(struct drm_minor *minor); |
1303 | extern void drm_sysfs_hotplug_event(struct drm_device *dev); | ||
1289 | extern void drm_sysfs_device_remove(struct drm_minor *minor); | 1304 | extern void drm_sysfs_device_remove(struct drm_minor *minor); |
1305 | extern char *drm_get_connector_status_name(enum drm_connector_status status); | ||
1306 | extern int drm_sysfs_connector_add(struct drm_connector *connector); | ||
1307 | extern void drm_sysfs_connector_remove(struct drm_connector *connector); | ||
1290 | 1308 | ||
1291 | /* | 1309 | /* |
1292 | * Basic memory manager support (drm_mm.c) | 1310 | * Basic memory manager support (drm_mm.c) |