aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drmP.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-08-05 08:11:22 -0400
committerDave Airlie <airlied@linux.ie>2005-08-05 08:11:22 -0400
commitd1f2b55ad2c11f46e30547a9f7754e99b478348e (patch)
treecabf9060c4f6cb419c7ed7fdcbcc6b6a91a83ac1 /drivers/char/drm/drmP.h
parentc73681e77b40697d16ada777adf2c6dc4db05917 (diff)
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.h14
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 {
539typedef struct drm_map_list { 539typedef struct drm_map_list {
540 struct list_head head; /**< list head */ 540 struct list_head head; /**< list head */
541 drm_map_t *map; /**< mapping */ 541 drm_map_t *map; /**< mapping */
542 unsigned int user_token;
542} drm_map_list_t; 543} drm_map_list_t;
543 544
544typedef drm_map_t drm_local_map_t; 545typedef drm_map_t drm_local_map_t;
@@ -759,6 +760,7 @@ typedef struct drm_device {
759 760
760 struct drm_driver *driver; 761 struct drm_driver *driver;
761 drm_local_map_t *agp_buffer_map; 762 drm_local_map_t *agp_buffer_map;
763 unsigned int agp_buffer_token;
762 drm_head_t primary; /**< primary screen head */ 764 drm_head_t primary; /**< primary screen head */
763} drm_device_t; 765} drm_device_t;
764 766
@@ -1048,16 +1050,12 @@ static __inline__ void drm_core_ioremapfree(struct drm_map *map, struct drm_devi
1048 drm_ioremapfree( map->handle, map->size, dev ); 1050 drm_ioremapfree( map->handle, map->size, dev );
1049} 1051}
1050 1052
1051static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsigned long offset) 1053static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsigned int token)
1052{ 1054{
1053 struct list_head *_list; 1055 drm_map_list_t *_entry;
1054 list_for_each( _list, &dev->maplist->head ) { 1056 list_for_each_entry(_entry, &dev->maplist->head, head)
1055 drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head ); 1057 if (_entry->user_token == token)
1056 if ( _entry->map &&
1057 _entry->map->offset == offset ) {
1058 return _entry->map; 1058 return _entry->map;
1059 }
1060 }
1061 return NULL; 1059 return NULL;
1062} 1060}
1063 1061