diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 16:54:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 16:54:50 -0400 |
commit | dfbbe89e197a77f2c8046a51c74e33e35f878080 (patch) | |
tree | 23b860ad3d68a12503f04c44c2e4465fbb8bdae9 /include/drm/drmP.h | |
parent | 712b0006bf3a9ed0b14a56c3291975e582127766 (diff) | |
parent | f23c20c83d523e5f8cda1f8f7ed52fe6afffbe29 (diff) |
Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (53 commits)
drm: detect hdmi monitor by hdmi identifier (v3)
drm: drm_fops.c unlock missing on error path
drm: reorder struct drm_ioctl_desc to save space on 64 bit builds
radeon: add some new pci ids
drm: read EDID extensions from monitor
drm: Use a little stash on the stack to avoid kmalloc in most DRM ioctls.
drm/radeon: add regs required for occlusion queries support
drm/i915: check the return value from the copy from user
drm/radeon: fix logic in r600_page_table_init() to match ati_gart
drm/radeon: r600 ptes are 64-bit, cleanup cleanup function.
drm/radeon: don't call irq changes on r600 suspend/resume
drm/radeon: fix r600 writeback across suspend/resume
drm/radeon: fix r600 writeback setup.
drm: fix warnings about new mappings in info code.
drm/radeon: NULL noise: drivers/gpu/drm/radeon/radeon_*.c
drm/radeon: fix r600 pci mapping calls.
drm/radeon: r6xx/r7xx: fix possible oops in r600_page_table_cleanup()
radeon: call the correct idle function, logic got inverted.
drm/radeon: RS600: fix interrupt handling
drm/r600: fix rptr address along lines of previous fixes to radeon.
...
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index c19a93c3be85..c8c422151431 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -281,16 +281,16 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, | |||
281 | 281 | ||
282 | struct drm_ioctl_desc { | 282 | struct drm_ioctl_desc { |
283 | unsigned int cmd; | 283 | unsigned int cmd; |
284 | drm_ioctl_t *func; | ||
285 | int flags; | 284 | int flags; |
285 | drm_ioctl_t *func; | ||
286 | }; | 286 | }; |
287 | 287 | ||
288 | /** | 288 | /** |
289 | * Creates a driver or general drm_ioctl_desc array entry for the given | 289 | * Creates a driver or general drm_ioctl_desc array entry for the given |
290 | * ioctl, for use by drm_ioctl(). | 290 | * ioctl, for use by drm_ioctl(). |
291 | */ | 291 | */ |
292 | #define DRM_IOCTL_DEF(ioctl, func, flags) \ | 292 | #define DRM_IOCTL_DEF(ioctl, _func, _flags) \ |
293 | [DRM_IOCTL_NR(ioctl)] = {ioctl, func, flags} | 293 | [DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags} |
294 | 294 | ||
295 | struct drm_magic_entry { | 295 | struct drm_magic_entry { |
296 | struct list_head head; | 296 | struct list_head head; |
@@ -523,19 +523,32 @@ struct drm_mm { | |||
523 | 523 | ||
524 | 524 | ||
525 | /** | 525 | /** |
526 | * Kernel side of a mapping | ||
527 | */ | ||
528 | struct drm_local_map { | ||
529 | resource_size_t offset; /**< Requested physical address (0 for SAREA)*/ | ||
530 | unsigned long size; /**< Requested physical size (bytes) */ | ||
531 | enum drm_map_type type; /**< Type of memory to map */ | ||
532 | enum drm_map_flags flags; /**< Flags */ | ||
533 | void *handle; /**< User-space: "Handle" to pass to mmap() */ | ||
534 | /**< Kernel-space: kernel-virtual address */ | ||
535 | int mtrr; /**< MTRR slot used */ | ||
536 | }; | ||
537 | |||
538 | typedef struct drm_local_map drm_local_map_t; | ||
539 | |||
540 | /** | ||
526 | * Mappings list | 541 | * Mappings list |
527 | */ | 542 | */ |
528 | struct drm_map_list { | 543 | struct drm_map_list { |
529 | struct list_head head; /**< list head */ | 544 | struct list_head head; /**< list head */ |
530 | struct drm_hash_item hash; | 545 | struct drm_hash_item hash; |
531 | struct drm_map *map; /**< mapping */ | 546 | struct drm_local_map *map; /**< mapping */ |
532 | uint64_t user_token; | 547 | uint64_t user_token; |
533 | struct drm_master *master; | 548 | struct drm_master *master; |
534 | struct drm_mm_node *file_offset_node; /**< fake offset */ | 549 | struct drm_mm_node *file_offset_node; /**< fake offset */ |
535 | }; | 550 | }; |
536 | 551 | ||
537 | typedef struct drm_map drm_local_map_t; | ||
538 | |||
539 | /** | 552 | /** |
540 | * Context handle list | 553 | * Context handle list |
541 | */ | 554 | */ |
@@ -560,7 +573,7 @@ struct drm_ati_pcigart_info { | |||
560 | dma_addr_t bus_addr; | 573 | dma_addr_t bus_addr; |
561 | dma_addr_t table_mask; | 574 | dma_addr_t table_mask; |
562 | struct drm_dma_handle *table_handle; | 575 | struct drm_dma_handle *table_handle; |
563 | drm_local_map_t mapping; | 576 | struct drm_local_map mapping; |
564 | int table_size; | 577 | int table_size; |
565 | }; | 578 | }; |
566 | 579 | ||
@@ -675,7 +688,6 @@ struct drm_driver { | |||
675 | int (*kernel_context_switch) (struct drm_device *dev, int old, | 688 | int (*kernel_context_switch) (struct drm_device *dev, int old, |
676 | int new); | 689 | int new); |
677 | void (*kernel_context_switch_unlock) (struct drm_device *dev); | 690 | void (*kernel_context_switch_unlock) (struct drm_device *dev); |
678 | int (*dri_library_name) (struct drm_device *dev, char *buf); | ||
679 | 691 | ||
680 | /** | 692 | /** |
681 | * get_vblank_counter - get raw hardware vblank counter | 693 | * get_vblank_counter - get raw hardware vblank counter |
@@ -747,8 +759,8 @@ struct drm_driver { | |||
747 | struct drm_file *file_priv); | 759 | struct drm_file *file_priv); |
748 | void (*reclaim_buffers_idlelocked) (struct drm_device *dev, | 760 | void (*reclaim_buffers_idlelocked) (struct drm_device *dev, |
749 | struct drm_file *file_priv); | 761 | struct drm_file *file_priv); |
750 | unsigned long (*get_map_ofs) (struct drm_map * map); | 762 | resource_size_t (*get_map_ofs) (struct drm_local_map * map); |
751 | unsigned long (*get_reg_ofs) (struct drm_device *dev); | 763 | resource_size_t (*get_reg_ofs) (struct drm_device *dev); |
752 | void (*set_version) (struct drm_device *dev, | 764 | void (*set_version) (struct drm_device *dev, |
753 | struct drm_set_version *sv); | 765 | struct drm_set_version *sv); |
754 | 766 | ||
@@ -981,7 +993,7 @@ struct drm_device { | |||
981 | sigset_t sigmask; | 993 | sigset_t sigmask; |
982 | 994 | ||
983 | struct drm_driver *driver; | 995 | struct drm_driver *driver; |
984 | drm_local_map_t *agp_buffer_map; | 996 | struct drm_local_map *agp_buffer_map; |
985 | unsigned int agp_buffer_token; | 997 | unsigned int agp_buffer_token; |
986 | struct drm_minor *control; /**< Control node for card */ | 998 | struct drm_minor *control; /**< Control node for card */ |
987 | struct drm_minor *primary; /**< render type primary screen head */ | 999 | struct drm_minor *primary; /**< render type primary screen head */ |
@@ -1098,8 +1110,8 @@ extern int drm_release(struct inode *inode, struct file *filp); | |||
1098 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); | 1110 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); |
1099 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); | 1111 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); |
1100 | extern void drm_vm_open_locked(struct vm_area_struct *vma); | 1112 | extern void drm_vm_open_locked(struct vm_area_struct *vma); |
1101 | extern unsigned long drm_core_get_map_ofs(struct drm_map * map); | 1113 | extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map); |
1102 | extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev); | 1114 | extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev); |
1103 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); | 1115 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
1104 | 1116 | ||
1105 | /* Memory management support (drm_memory.h) */ | 1117 | /* Memory management support (drm_memory.h) */ |
@@ -1202,13 +1214,13 @@ extern int drm_i_have_hw_lock(struct drm_device *dev, struct drm_file *file_priv | |||
1202 | /* Buffer management support (drm_bufs.h) */ | 1214 | /* Buffer management support (drm_bufs.h) */ |
1203 | extern int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request); | 1215 | extern int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request); |
1204 | extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request); | 1216 | extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request); |
1205 | extern int drm_addmap(struct drm_device *dev, unsigned int offset, | 1217 | extern int drm_addmap(struct drm_device *dev, resource_size_t offset, |
1206 | unsigned int size, enum drm_map_type type, | 1218 | unsigned int size, enum drm_map_type type, |
1207 | enum drm_map_flags flags, drm_local_map_t ** map_ptr); | 1219 | enum drm_map_flags flags, struct drm_local_map **map_ptr); |
1208 | extern int drm_addmap_ioctl(struct drm_device *dev, void *data, | 1220 | extern int drm_addmap_ioctl(struct drm_device *dev, void *data, |
1209 | struct drm_file *file_priv); | 1221 | struct drm_file *file_priv); |
1210 | extern int drm_rmmap(struct drm_device *dev, drm_local_map_t *map); | 1222 | extern int drm_rmmap(struct drm_device *dev, struct drm_local_map *map); |
1211 | extern int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map); | 1223 | extern int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map); |
1212 | extern int drm_rmmap_ioctl(struct drm_device *dev, void *data, | 1224 | extern int drm_rmmap_ioctl(struct drm_device *dev, void *data, |
1213 | struct drm_file *file_priv); | 1225 | struct drm_file *file_priv); |
1214 | extern int drm_addbufs(struct drm_device *dev, void *data, | 1226 | extern int drm_addbufs(struct drm_device *dev, void *data, |
@@ -1222,10 +1234,10 @@ extern int drm_freebufs(struct drm_device *dev, void *data, | |||
1222 | extern int drm_mapbufs(struct drm_device *dev, void *data, | 1234 | extern int drm_mapbufs(struct drm_device *dev, void *data, |
1223 | struct drm_file *file_priv); | 1235 | struct drm_file *file_priv); |
1224 | extern int drm_order(unsigned long size); | 1236 | extern int drm_order(unsigned long size); |
1225 | extern unsigned long drm_get_resource_start(struct drm_device *dev, | 1237 | extern resource_size_t drm_get_resource_start(struct drm_device *dev, |
1238 | unsigned int resource); | ||
1239 | extern resource_size_t drm_get_resource_len(struct drm_device *dev, | ||
1226 | unsigned int resource); | 1240 | unsigned int resource); |
1227 | extern unsigned long drm_get_resource_len(struct drm_device *dev, | ||
1228 | unsigned int resource); | ||
1229 | 1241 | ||
1230 | /* DMA support (drm_dma.h) */ | 1242 | /* DMA support (drm_dma.h) */ |
1231 | extern int drm_dma_setup(struct drm_device *dev); | 1243 | extern int drm_dma_setup(struct drm_device *dev); |
@@ -1301,7 +1313,7 @@ extern struct drm_master *drm_master_get(struct drm_master *master); | |||
1301 | extern void drm_master_put(struct drm_master **master); | 1313 | extern void drm_master_put(struct drm_master **master); |
1302 | extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | 1314 | extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, |
1303 | struct drm_driver *driver); | 1315 | struct drm_driver *driver); |
1304 | extern int drm_put_dev(struct drm_device *dev); | 1316 | extern void drm_put_dev(struct drm_device *dev); |
1305 | extern int drm_put_minor(struct drm_minor **minor); | 1317 | extern int drm_put_minor(struct drm_minor **minor); |
1306 | extern unsigned int drm_debug; | 1318 | extern unsigned int drm_debug; |
1307 | 1319 | ||
@@ -1311,7 +1323,7 @@ extern struct dentry *drm_debugfs_root; | |||
1311 | 1323 | ||
1312 | extern struct idr drm_minors_idr; | 1324 | extern struct idr drm_minors_idr; |
1313 | 1325 | ||
1314 | extern drm_local_map_t *drm_getsarea(struct drm_device *dev); | 1326 | extern struct drm_local_map *drm_getsarea(struct drm_device *dev); |
1315 | 1327 | ||
1316 | /* Proc support (drm_proc.h) */ | 1328 | /* Proc support (drm_proc.h) */ |
1317 | extern int drm_proc_init(struct drm_minor *minor, int minor_id, | 1329 | extern int drm_proc_init(struct drm_minor *minor, int minor_id, |
@@ -1453,12 +1465,12 @@ int drm_gem_open_ioctl(struct drm_device *dev, void *data, | |||
1453 | void drm_gem_open(struct drm_device *dev, struct drm_file *file_private); | 1465 | void drm_gem_open(struct drm_device *dev, struct drm_file *file_private); |
1454 | void drm_gem_release(struct drm_device *dev, struct drm_file *file_private); | 1466 | void drm_gem_release(struct drm_device *dev, struct drm_file *file_private); |
1455 | 1467 | ||
1456 | extern void drm_core_ioremap(struct drm_map *map, struct drm_device *dev); | 1468 | extern void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev); |
1457 | extern void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev); | 1469 | extern void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev); |
1458 | extern void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev); | 1470 | extern void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev); |
1459 | 1471 | ||
1460 | static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, | 1472 | static __inline__ struct drm_local_map *drm_core_findmap(struct drm_device *dev, |
1461 | unsigned int token) | 1473 | unsigned int token) |
1462 | { | 1474 | { |
1463 | struct drm_map_list *_entry; | 1475 | struct drm_map_list *_entry; |
1464 | list_for_each_entry(_entry, &dev->maplist, head) | 1476 | list_for_each_entry(_entry, &dev->maplist, head) |
@@ -1485,7 +1497,7 @@ static __inline__ int drm_device_is_pcie(struct drm_device *dev) | |||
1485 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); | 1497 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); |
1486 | } | 1498 | } |
1487 | 1499 | ||
1488 | static __inline__ void drm_core_dropmap(struct drm_map *map) | 1500 | static __inline__ void drm_core_dropmap(struct drm_local_map *map) |
1489 | { | 1501 | { |
1490 | } | 1502 | } |
1491 | 1503 | ||