drmP.h (183573) | drmP.h (183833) |
---|---|
1/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*- 2 * Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com 3 */ 4/*- 5 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 6 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 7 * All rights reserved. 8 * --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: 29 * Rickard E. (Rik) Faith <faith@valinux.com> 30 * Gareth Hughes <gareth@valinux.com> 31 * 32 */ 33 34#include <sys/cdefs.h> | 1/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*- 2 * Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com 3 */ 4/*- 5 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 6 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 7 * All rights reserved. 8 * --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: 29 * Rickard E. (Rik) Faith <faith@valinux.com> 30 * Gareth Hughes <gareth@valinux.com> 31 * 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/dev/drm/drmP.h 183573 2008-10-03 16:59:11Z rnoland $"); | 35__FBSDID("$FreeBSD: head/sys/dev/drm/drmP.h 183833 2008-10-13 18:03:27Z rnoland $"); |
36 37#ifndef _DRM_P_H_ 38#define _DRM_P_H_ 39 40#if defined(_KERNEL) || defined(__KERNEL__) 41 42struct drm_device; 43struct drm_file; --- 80 unchanged lines hidden (view full) --- 124#define DRIVER_HAVE_IRQ 0x40 125#define DRIVER_DMA_QUEUE 0x100 126 127 128#define DRM_HASH_SIZE 16 /* Size of key hash table */ 129#define DRM_KERNEL_CONTEXT 0 /* Change drm_resctx if changed */ 130#define DRM_RESERVED_CONTEXTS 1 /* Change drm_resctx if changed */ 131 | 36 37#ifndef _DRM_P_H_ 38#define _DRM_P_H_ 39 40#if defined(_KERNEL) || defined(__KERNEL__) 41 42struct drm_device; 43struct drm_file; --- 80 unchanged lines hidden (view full) --- 124#define DRIVER_HAVE_IRQ 0x40 125#define DRIVER_DMA_QUEUE 0x100 126 127 128#define DRM_HASH_SIZE 16 /* Size of key hash table */ 129#define DRM_KERNEL_CONTEXT 0 /* Change drm_resctx if changed */ 130#define DRM_RESERVED_CONTEXTS 1 /* Change drm_resctx if changed */ 131 |
132#define DRM_MEM_DMA 0 133#define DRM_MEM_SAREA 1 134#define DRM_MEM_DRIVER 2 135#define DRM_MEM_MAGIC 3 136#define DRM_MEM_IOCTLS 4 137#define DRM_MEM_MAPS 5 138#define DRM_MEM_BUFS 6 139#define DRM_MEM_SEGS 7 140#define DRM_MEM_PAGES 8 141#define DRM_MEM_FILES 9 142#define DRM_MEM_QUEUES 10 143#define DRM_MEM_CMDS 11 144#define DRM_MEM_MAPPINGS 12 145#define DRM_MEM_BUFLISTS 13 146#define DRM_MEM_AGPLISTS 14 147#define DRM_MEM_TOTALAGP 15 148#define DRM_MEM_BOUNDAGP 16 149#define DRM_MEM_CTXBITMAP 17 150#define DRM_MEM_STUB 18 151#define DRM_MEM_SGLISTS 19 152#define DRM_MEM_DRAWABLE 20 | 132MALLOC_DECLARE(DRM_MEM_DMA); 133MALLOC_DECLARE(DRM_MEM_SAREA); 134MALLOC_DECLARE(DRM_MEM_DRIVER); 135MALLOC_DECLARE(DRM_MEM_MAGIC); 136MALLOC_DECLARE(DRM_MEM_IOCTLS); 137MALLOC_DECLARE(DRM_MEM_MAPS); 138MALLOC_DECLARE(DRM_MEM_BUFS); 139MALLOC_DECLARE(DRM_MEM_SEGS); 140MALLOC_DECLARE(DRM_MEM_PAGES); 141MALLOC_DECLARE(DRM_MEM_FILES); 142MALLOC_DECLARE(DRM_MEM_QUEUES); 143MALLOC_DECLARE(DRM_MEM_CMDS); 144MALLOC_DECLARE(DRM_MEM_MAPPINGS); 145MALLOC_DECLARE(DRM_MEM_BUFLISTS); 146MALLOC_DECLARE(DRM_MEM_AGPLISTS); 147MALLOC_DECLARE(DRM_MEM_CTXBITMAP); 148MALLOC_DECLARE(DRM_MEM_SGLISTS); 149MALLOC_DECLARE(DRM_MEM_DRAWABLE); |
153 154#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8) 155 156 /* Internal types and structures */ 157#define DRM_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) 158#define DRM_MIN(a,b) ((a)<(b)?(a):(b)) 159#define DRM_MAX(a,b) ((a)>(b)?(a):(b)) 160 161#define DRM_IF_VERSION(maj, min) (maj << 16 | min) 162 | 150 151#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8) 152 153 /* Internal types and structures */ 154#define DRM_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) 155#define DRM_MIN(a,b) ((a)<(b)?(a):(b)) 156#define DRM_MAX(a,b) ((a)>(b)?(a):(b)) 157 158#define DRM_IF_VERSION(maj, min) (maj << 16 | min) 159 |
163MALLOC_DECLARE(M_DRM); 164 | |
165#define __OS_HAS_AGP 1 166 167#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) 168#define DRM_DEV_UID 0 169#define DRM_DEV_GID 0 170 171#define wait_queue_head_t atomic_t 172#define DRM_WAKEUP(w) wakeup((void *)w) --- 570 unchanged lines hidden (view full) --- 743/* File operations helpers (drm_fops.c) */ 744extern int drm_open_helper(struct cdev *kdev, int flags, int fmt, 745 DRM_STRUCTPROC *p, 746 struct drm_device *dev); 747 748/* Memory management support (drm_memory.c) */ 749void drm_mem_init(void); 750void drm_mem_uninit(void); | 160#define __OS_HAS_AGP 1 161 162#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) 163#define DRM_DEV_UID 0 164#define DRM_DEV_GID 0 165 166#define wait_queue_head_t atomic_t 167#define DRM_WAKEUP(w) wakeup((void *)w) --- 570 unchanged lines hidden (view full) --- 738/* File operations helpers (drm_fops.c) */ 739extern int drm_open_helper(struct cdev *kdev, int flags, int fmt, 740 DRM_STRUCTPROC *p, 741 struct drm_device *dev); 742 743/* Memory management support (drm_memory.c) */ 744void drm_mem_init(void); 745void drm_mem_uninit(void); |
751void *drm_alloc(size_t size, int area); 752void *drm_calloc(size_t nmemb, size_t size, int area); 753void *drm_realloc(void *oldpt, size_t oldsize, size_t size, 754 int area); 755void drm_free(void *pt, size_t size, int area); | |
756void *drm_ioremap_wc(struct drm_device *dev, drm_local_map_t *map); 757void *drm_ioremap(struct drm_device *dev, drm_local_map_t *map); 758void drm_ioremapfree(drm_local_map_t *map); 759int drm_mtrr_add(unsigned long offset, size_t size, int flags); 760int drm_mtrr_del(int handle, unsigned long offset, size_t size, int flags); 761 762int drm_context_switch(struct drm_device *dev, int old, int new); 763int drm_context_switch_complete(struct drm_device *dev, int new); --- 197 unchanged lines hidden (view full) --- 961int drm_sg_free(struct drm_device *dev, void *data, 962 struct drm_file *file_priv); 963 964/* consistent PCI memory functions (drm_pci.c) */ 965drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, 966 size_t align, dma_addr_t maxaddr); 967void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah); 968 | 746void *drm_ioremap_wc(struct drm_device *dev, drm_local_map_t *map); 747void *drm_ioremap(struct drm_device *dev, drm_local_map_t *map); 748void drm_ioremapfree(drm_local_map_t *map); 749int drm_mtrr_add(unsigned long offset, size_t size, int flags); 750int drm_mtrr_del(int handle, unsigned long offset, size_t size, int flags); 751 752int drm_context_switch(struct drm_device *dev, int old, int new); 753int drm_context_switch_complete(struct drm_device *dev, int new); --- 197 unchanged lines hidden (view full) --- 951int drm_sg_free(struct drm_device *dev, void *data, 952 struct drm_file *file_priv); 953 954/* consistent PCI memory functions (drm_pci.c) */ 955drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, 956 size_t align, dma_addr_t maxaddr); 957void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah); 958 |
959/* Inline replacements for drm_alloc and friends */ 960static __inline__ void * 961drm_alloc(size_t size, struct malloc_type *area) 962{ 963 return malloc(size, area, M_NOWAIT); 964} 965 966static __inline__ void * 967drm_calloc(size_t nmemb, size_t size, struct malloc_type *area) 968{ 969 return malloc(size * nmemb, area, M_NOWAIT | M_ZERO); 970} 971 972static __inline__ void * 973drm_realloc(void *oldpt, size_t oldsize, size_t size, 974 struct malloc_type *area) 975{ 976 return reallocf(oldpt, size, area, M_NOWAIT); 977} 978 979static __inline__ void 980drm_free(void *pt, size_t size, struct malloc_type *area) 981{ 982 free(pt, area); 983} 984 |
|
969/* Inline replacements for DRM_IOREMAP macros */ 970static __inline__ void 971drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev) 972{ 973 map->handle = drm_ioremap_wc(dev, map); 974} 975static __inline__ void 976drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) --- 29 unchanged lines hidden --- | 985/* Inline replacements for DRM_IOREMAP macros */ 986static __inline__ void 987drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev) 988{ 989 map->handle = drm_ioremap_wc(dev, map); 990} 991static __inline__ void 992drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) --- 29 unchanged lines hidden --- |