aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_stub.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas@tungstengraphics.com>2006-08-07 08:36:47 -0400
committerDave Airlie <airlied@linux.ie>2006-09-21 15:32:31 -0400
commit8d153f7107ff2c5d6e32053ae377c961187ab6b9 (patch)
treec90cdf1bf8e04237e840b37033fc0f57b74ab292 /drivers/char/drm/drm_stub.c
parent8669cbc5e651bf4effa20e8c244a5a7d67da6fe9 (diff)
drm: update user token hashing and map handles
Keep hashed user tokens, with the following changes: 32-bit physical device addresses are mapped directly to user-tokens. No duplicate maps are allowed, and the addresses are assumed to be outside of the range 0x10000000 through 0x30000000. The user-token is identical to the 32-bit physical start-address of the map. 64-bit physical device addressed are mapped to user-tokens in the range 0x10000000 to 0x30000000 with page-size increments. The user_token should not be interpreted as an address. Other map types, like upcoming TTM maps are mapped to user-tokens in the range 0x10000000 to 0x30000000 with page-size increments. The user_token should not be interpreted as an address. Implement hashed map lookups. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_stub.c')
-rw-r--r--drivers/char/drm/drm_stub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c
index b1ead37c51d6..a9bb18ac3a2b 100644
--- a/drivers/char/drm/drm_stub.c
+++ b/drivers/char/drm/drm_stub.c
@@ -75,6 +75,10 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
75 if (dev->maplist == NULL) 75 if (dev->maplist == NULL)
76 return -ENOMEM; 76 return -ENOMEM;
77 INIT_LIST_HEAD(&dev->maplist->head); 77 INIT_LIST_HEAD(&dev->maplist->head);
78 if (drm_ht_create(&dev->map_hash, 12)) {
79 drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS);
80 return -ENOMEM;
81 }
78 82
79 /* the DRM has 6 basic counters */ 83 /* the DRM has 6 basic counters */
80 dev->counters = 6; 84 dev->counters = 6;