diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-08-05 22:11:22 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-08-05 22:11:22 +1000 |
commit | d1f2b55ad2c11f46e30547a9f7754e99b478348e (patch) | |
tree | cabf9060c4f6cb419c7ed7fdcbcc6b6a91a83ac1 /drivers/char/drm/drmP.h | |
parent | c73681e77b40697d16ada777adf2c6dc4db05917 (diff) | |
download | lwn-d1f2b55ad2c11f46e30547a9f7754e99b478348e.tar.gz lwn-d1f2b55ad2c11f46e30547a9f7754e99b478348e.zip |
drm: updated DRM map patch for 32/64 bit systems
I basically combined Paul's patches with additions that I had made
for PCI scatter gather.
I also tried more carefully to avoid problems with the same token
assigned multiple times while trying to use the base address in the
token if possible to gain as much backward compatibility as possible
for broken DRI clients.
From: Paul Mackerras <paulus@samba.org> and Egbert Eich <eich@suse.de>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drmP.h')
-rw-r--r-- | drivers/char/drm/drmP.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h index fb2af9279148..0a4358996970 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/char/drm/drmP.h @@ -539,6 +539,7 @@ typedef struct drm_dma_handle { typedef struct drm_map_list { struct list_head head; /**< list head */ drm_map_t *map; /**< mapping */ + unsigned int user_token; } drm_map_list_t; typedef drm_map_t drm_local_map_t; @@ -759,6 +760,7 @@ typedef struct drm_device { struct drm_driver *driver; drm_local_map_t *agp_buffer_map; + unsigned int agp_buffer_token; drm_head_t primary; /**< primary screen head */ } drm_device_t; @@ -1048,16 +1050,12 @@ static __inline__ void drm_core_ioremapfree(struct drm_map *map, struct drm_devi drm_ioremapfree( map->handle, map->size, dev ); } -static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsigned long offset) +static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsigned int token) { - struct list_head *_list; - list_for_each( _list, &dev->maplist->head ) { - drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head ); - if ( _entry->map && - _entry->map->offset == offset ) { + drm_map_list_t *_entry; + list_for_each_entry(_entry, &dev->maplist->head, head) + if (_entry->user_token == token) return _entry->map; - } - } return NULL; } |