summaryrefslogtreecommitdiff
path: root/bsd/drmP.h
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2002-10-31 04:23:09 +0000
committerEric Anholt <anholt@freebsd.org>2002-10-31 04:23:09 +0000
commit9a6b59db39c79369aa849280c0a8b8301876ec93 (patch)
tree102f51d0a3f2c1f24993de323d4d4b1a27d66871 /bsd/drmP.h
parente656655a361acf73c5652fcef8cf6ba61dfe7a50 (diff)
Inaugurate bsd-4-0-0-branch with Erik Reid's NetBSD patches (with enough
modifications on my part to have probably broken them thoroughly).
Diffstat (limited to 'bsd/drmP.h')
-rw-r--r--bsd/drmP.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/bsd/drmP.h b/bsd/drmP.h
index b7b21da4..ad23fc6f 100644
--- a/bsd/drmP.h
+++ b/bsd/drmP.h
@@ -121,15 +121,15 @@ typedef struct drm_file drm_file_t;
/* Mapping helper macros */
#define DRM_IOREMAP(map) \
- (map)->handle = DRM(ioremap)( (map)->offset, (map)->size )
+ (map)->handle = DRM(ioremap)( dev, map )
#define DRM_IOREMAP_NOCACHE(map) \
- (map)->handle = DRM(ioremap_nocache)((map)->offset, (map)->size)
+ (map)->handle = DRM(ioremap_nocache)( dev, map )
#define DRM_IOREMAPFREE(map) \
do { \
if ( (map)->handle && (map)->size ) \
- DRM(ioremapfree)( (map)->handle, (map)->size ); \
+ DRM(ioremapfree)( map ); \
} while (0)
/* Internal types and structures */
@@ -386,10 +386,23 @@ typedef struct drm_sigdata {
drm_hw_lock_t *lock;
} drm_sigdata_t;
+typedef struct drm_local_map {
+ unsigned long offset; /* Physical address (0 for SAREA)*/
+ unsigned long size; /* Physical size (bytes) */
+ drm_map_type_t type; /* Type of memory mapped */
+ drm_map_flags_t flags; /* Flags */
+ void *handle; /* User-space: "Handle" to pass to mmap */
+ /* Kernel-space: kernel-virtual address */
+ int mtrr; /* MTRR slot used */
+ /* Private data */
+ bus_space_tag_t iot;
+ bus_space_handle_t ioh;
+} drm_local_map_t;
+
typedef TAILQ_HEAD(drm_map_list, drm_map_list_entry) drm_map_list_t;
typedef struct drm_map_list_entry {
TAILQ_ENTRY(drm_map_list_entry) link;
- drm_map_t *map;
+ drm_local_map_t *map;
} drm_map_list_entry_t;
struct drm_device {
@@ -432,7 +445,7 @@ struct drm_device {
drm_map_list_t *maplist; /* Linked list of regions */
int map_count; /* Number of mappable regions */
- drm_map_t **context_sareas;
+ drm_local_map_t **context_sareas;
int max_context;
drm_vma_entry_t *vmalist; /* List of vmas (for debugging) */
@@ -526,9 +539,9 @@ extern void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size,
extern char *DRM(strdup)(const char *s, int area);
extern void DRM(strfree)(char *s, int area);
extern void DRM(free)(void *pt, size_t size, int area);
-extern void *DRM(ioremap)(unsigned long offset, unsigned long size);
-extern void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size);
-extern void DRM(ioremapfree)(void *pt, unsigned long size);
+extern void *DRM(ioremap)(drm_device_t *dev, drm_local_map_t *map);
+extern void *DRM(ioremap_nocache)(drm_device_t *dev, drm_local_map_t *map);
+extern void DRM(ioremapfree)(drm_local_map_t *map);
#if __REALLY_HAVE_AGP
extern agp_memory *DRM(alloc_agp)(int pages, u32 type);