diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-11 01:43:25 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-12 09:28:12 -0400 |
commit | ba8286fab52652e431784d066b075c1bb4933ea1 (patch) | |
tree | 700d1372b71ae2df393bd1b4b6482eeecc7b00ed /include/drm/drmP.h | |
parent | 86c1fbd55c6abc72496a45b7cbf1940324983977 (diff) |
drm: Move legacy buffer structures to <drm/drm_legacy.h>
A few odd cases:
- mgag200 someho had a totally unused drm_dma_handle_t. Remove it.
- i915 still uses the legacy pci dma alloc api, so grows an include.
Everything else fairly standard.
v2: Include "drm_legacy.h" in drm.ko source files for consistency.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 119 |
1 files changed, 6 insertions, 113 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4a72db4b4329..0d68ecdb447a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -79,6 +79,9 @@ struct module; | |||
79 | struct drm_file; | 79 | struct drm_file; |
80 | struct drm_device; | 80 | struct drm_device; |
81 | struct drm_agp_head; | 81 | struct drm_agp_head; |
82 | struct drm_local_map; | ||
83 | struct drm_device_dma; | ||
84 | struct drm_dma_handle; | ||
82 | 85 | ||
83 | struct device_node; | 86 | struct device_node; |
84 | struct videomode; | 87 | struct videomode; |
@@ -275,57 +278,6 @@ struct drm_ioctl_desc { | |||
275 | #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ | 278 | #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ |
276 | [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl} | 279 | [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl} |
277 | 280 | ||
278 | /** | ||
279 | * DMA buffer. | ||
280 | */ | ||
281 | struct drm_buf { | ||
282 | int idx; /**< Index into master buflist */ | ||
283 | int total; /**< Buffer size */ | ||
284 | int order; /**< log-base-2(total) */ | ||
285 | int used; /**< Amount of buffer in use (for DMA) */ | ||
286 | unsigned long offset; /**< Byte offset (used internally) */ | ||
287 | void *address; /**< Address of buffer */ | ||
288 | unsigned long bus_address; /**< Bus address of buffer */ | ||
289 | struct drm_buf *next; /**< Kernel-only: used for free list */ | ||
290 | __volatile__ int waiting; /**< On kernel DMA queue */ | ||
291 | __volatile__ int pending; /**< On hardware DMA queue */ | ||
292 | struct drm_file *file_priv; /**< Private of holding file descr */ | ||
293 | int context; /**< Kernel queue for this buffer */ | ||
294 | int while_locked; /**< Dispatch this buffer while locked */ | ||
295 | enum { | ||
296 | DRM_LIST_NONE = 0, | ||
297 | DRM_LIST_FREE = 1, | ||
298 | DRM_LIST_WAIT = 2, | ||
299 | DRM_LIST_PEND = 3, | ||
300 | DRM_LIST_PRIO = 4, | ||
301 | DRM_LIST_RECLAIM = 5 | ||
302 | } list; /**< Which list we're on */ | ||
303 | |||
304 | int dev_priv_size; /**< Size of buffer private storage */ | ||
305 | void *dev_private; /**< Per-buffer private storage */ | ||
306 | }; | ||
307 | |||
308 | typedef struct drm_dma_handle { | ||
309 | dma_addr_t busaddr; | ||
310 | void *vaddr; | ||
311 | size_t size; | ||
312 | } drm_dma_handle_t; | ||
313 | |||
314 | /** | ||
315 | * Buffer entry. There is one of this for each buffer size order. | ||
316 | */ | ||
317 | struct drm_buf_entry { | ||
318 | int buf_size; /**< size */ | ||
319 | int buf_count; /**< number of buffers */ | ||
320 | struct drm_buf *buflist; /**< buffer list */ | ||
321 | int seg_count; | ||
322 | int page_order; | ||
323 | struct drm_dma_handle **seglist; | ||
324 | |||
325 | int low_mark; /**< Low water mark */ | ||
326 | int high_mark; /**< High water mark */ | ||
327 | }; | ||
328 | |||
329 | /* Event queued up for userspace to read */ | 281 | /* Event queued up for userspace to read */ |
330 | struct drm_pending_event { | 282 | struct drm_pending_event { |
331 | struct drm_event *event; | 283 | struct drm_event *event; |
@@ -404,65 +356,6 @@ struct drm_lock_data { | |||
404 | }; | 356 | }; |
405 | 357 | ||
406 | /** | 358 | /** |
407 | * DMA data. | ||
408 | */ | ||
409 | struct drm_device_dma { | ||
410 | |||
411 | struct drm_buf_entry bufs[DRM_MAX_ORDER + 1]; /**< buffers, grouped by their size order */ | ||
412 | int buf_count; /**< total number of buffers */ | ||
413 | struct drm_buf **buflist; /**< Vector of pointers into drm_device_dma::bufs */ | ||
414 | int seg_count; | ||
415 | int page_count; /**< number of pages */ | ||
416 | unsigned long *pagelist; /**< page list */ | ||
417 | unsigned long byte_count; | ||
418 | enum { | ||
419 | _DRM_DMA_USE_AGP = 0x01, | ||
420 | _DRM_DMA_USE_SG = 0x02, | ||
421 | _DRM_DMA_USE_FB = 0x04, | ||
422 | _DRM_DMA_USE_PCI_RO = 0x08 | ||
423 | } flags; | ||
424 | |||
425 | }; | ||
426 | |||
427 | /** | ||
428 | * Scatter-gather memory. | ||
429 | */ | ||
430 | struct drm_sg_mem { | ||
431 | unsigned long handle; | ||
432 | void *virtual; | ||
433 | int pages; | ||
434 | struct page **pagelist; | ||
435 | dma_addr_t *busaddr; | ||
436 | }; | ||
437 | |||
438 | /** | ||
439 | * Kernel side of a mapping | ||
440 | */ | ||
441 | struct drm_local_map { | ||
442 | resource_size_t offset; /**< Requested physical address (0 for SAREA)*/ | ||
443 | unsigned long size; /**< Requested physical size (bytes) */ | ||
444 | enum drm_map_type type; /**< Type of memory to map */ | ||
445 | enum drm_map_flags flags; /**< Flags */ | ||
446 | void *handle; /**< User-space: "Handle" to pass to mmap() */ | ||
447 | /**< Kernel-space: kernel-virtual address */ | ||
448 | int mtrr; /**< MTRR slot used */ | ||
449 | }; | ||
450 | |||
451 | typedef struct drm_local_map drm_local_map_t; | ||
452 | |||
453 | /** | ||
454 | * Mappings list | ||
455 | */ | ||
456 | struct drm_map_list { | ||
457 | struct list_head head; /**< list head */ | ||
458 | struct drm_hash_item hash; | ||
459 | struct drm_local_map *map; /**< mapping */ | ||
460 | uint64_t user_token; | ||
461 | struct drm_master *master; | ||
462 | }; | ||
463 | |||
464 | |||
465 | /** | ||
466 | * This structure defines the drm_mm memory object, which will be used by the | 359 | * This structure defines the drm_mm memory object, which will be used by the |
467 | * DRM for its buffer objects. | 360 | * DRM for its buffer objects. |
468 | */ | 361 | */ |
@@ -1246,9 +1139,9 @@ int drm_gem_dumb_destroy(struct drm_file *file, | |||
1246 | uint32_t handle); | 1139 | uint32_t handle); |
1247 | 1140 | ||
1248 | 1141 | ||
1249 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, | 1142 | extern struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size, |
1250 | size_t align); | 1143 | size_t align); |
1251 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); | 1144 | extern void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah); |
1252 | 1145 | ||
1253 | /* sysfs support (drm_sysfs.c) */ | 1146 | /* sysfs support (drm_sysfs.c) */ |
1254 | extern void drm_sysfs_hotplug_event(struct drm_device *dev); | 1147 | extern void drm_sysfs_hotplug_event(struct drm_device *dev); |