diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-02-02 00:55:46 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-13 00:23:56 -0400 |
commit | f77d390c9779c496aa5b99ec832996fb76bb1d13 (patch) | |
tree | 3e3cccc4ac9416457a944d13b31ef942432717f2 | |
parent | d883f7f1b75c8dcafa891f7b9e69c5a2f0ff6d66 (diff) |
drm: Split drm_map and drm_local_map
Once upon a time, the DRM made the distinction between the drm_map
data structure exchanged with user space and the drm_local_map used
in the kernel.
For some reasons, while the BSD port still has that "feature", the
linux part abused drm_map for kernel internal usage as the local
map only existed as a typedef of the struct drm_map.
This patch fixes it by declaring struct drm_local_map separately
(though its content is currently identical to the userspace variant),
and changing the kernel code to only use that, except when it's a
user<->kernel interface (ie. ioctl).
This allows subsequent changes to the in-kernel format
I've also replaced the use of drm_local_map_t with struct drm_local_map
in a couple of places. Mostly by accident but they are the same (the
former is a typedef of the later) and I have some remote plans and
half finished patch to completely kill the drm_local_map_t typedef
so I left those bits in.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
-rw-r--r-- | drivers/gpu/drm/drm_bufs.c | 46 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_context.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_memory.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_proc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_vm.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/i810/i810_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i830/i830_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 | ||||
-rw-r--r-- | include/drm/drmP.h | 47 |
11 files changed, 75 insertions, 56 deletions
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index fab899eec051..1b8dbd5961bc 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c | |||
@@ -50,7 +50,7 @@ resource_size_t drm_get_resource_len(struct drm_device *dev, unsigned int resour | |||
50 | EXPORT_SYMBOL(drm_get_resource_len); | 50 | EXPORT_SYMBOL(drm_get_resource_len); |
51 | 51 | ||
52 | static struct drm_map_list *drm_find_matching_map(struct drm_device *dev, | 52 | static struct drm_map_list *drm_find_matching_map(struct drm_device *dev, |
53 | drm_local_map_t *map) | 53 | struct drm_local_map *map) |
54 | { | 54 | { |
55 | struct drm_map_list *entry; | 55 | struct drm_map_list *entry; |
56 | list_for_each_entry(entry, &dev->maplist, head) { | 56 | list_for_each_entry(entry, &dev->maplist, head) { |
@@ -89,13 +89,8 @@ static int drm_map_handle(struct drm_device *dev, struct drm_hash_item *hash, | |||
89 | } | 89 | } |
90 | 90 | ||
91 | /** | 91 | /** |
92 | * Ioctl to specify a range of memory that is available for mapping by a non-root process. | 92 | * Core function to create a range of memory available for mapping by a |
93 | * | 93 | * non-root process. |
94 | * \param inode device inode. | ||
95 | * \param file_priv DRM file private. | ||
96 | * \param cmd command. | ||
97 | * \param arg pointer to a drm_map structure. | ||
98 | * \return zero on success or a negative value on error. | ||
99 | * | 94 | * |
100 | * Adjusts the memory offset to its absolute value according to the mapping | 95 | * Adjusts the memory offset to its absolute value according to the mapping |
101 | * type. Adds the map to the map list drm_device::maplist. Adds MTRR's where | 96 | * type. Adds the map to the map list drm_device::maplist. Adds MTRR's where |
@@ -106,7 +101,7 @@ static int drm_addmap_core(struct drm_device * dev, unsigned int offset, | |||
106 | enum drm_map_flags flags, | 101 | enum drm_map_flags flags, |
107 | struct drm_map_list ** maplist) | 102 | struct drm_map_list ** maplist) |
108 | { | 103 | { |
109 | struct drm_map *map; | 104 | struct drm_local_map *map; |
110 | struct drm_map_list *list; | 105 | struct drm_map_list *list; |
111 | drm_dma_handle_t *dmah; | 106 | drm_dma_handle_t *dmah; |
112 | unsigned long user_token; | 107 | unsigned long user_token; |
@@ -329,7 +324,7 @@ static int drm_addmap_core(struct drm_device * dev, unsigned int offset, | |||
329 | 324 | ||
330 | int drm_addmap(struct drm_device * dev, unsigned int offset, | 325 | int drm_addmap(struct drm_device * dev, unsigned int offset, |
331 | unsigned int size, enum drm_map_type type, | 326 | unsigned int size, enum drm_map_type type, |
332 | enum drm_map_flags flags, drm_local_map_t ** map_ptr) | 327 | enum drm_map_flags flags, struct drm_local_map ** map_ptr) |
333 | { | 328 | { |
334 | struct drm_map_list *list; | 329 | struct drm_map_list *list; |
335 | int rc; | 330 | int rc; |
@@ -342,6 +337,17 @@ int drm_addmap(struct drm_device * dev, unsigned int offset, | |||
342 | 337 | ||
343 | EXPORT_SYMBOL(drm_addmap); | 338 | EXPORT_SYMBOL(drm_addmap); |
344 | 339 | ||
340 | /** | ||
341 | * Ioctl to specify a range of memory that is available for mapping by a | ||
342 | * non-root process. | ||
343 | * | ||
344 | * \param inode device inode. | ||
345 | * \param file_priv DRM file private. | ||
346 | * \param cmd command. | ||
347 | * \param arg pointer to a drm_map structure. | ||
348 | * \return zero on success or a negative value on error. | ||
349 | * | ||
350 | */ | ||
345 | int drm_addmap_ioctl(struct drm_device *dev, void *data, | 351 | int drm_addmap_ioctl(struct drm_device *dev, void *data, |
346 | struct drm_file *file_priv) | 352 | struct drm_file *file_priv) |
347 | { | 353 | { |
@@ -367,19 +373,13 @@ int drm_addmap_ioctl(struct drm_device *dev, void *data, | |||
367 | * Remove a map private from list and deallocate resources if the mapping | 373 | * Remove a map private from list and deallocate resources if the mapping |
368 | * isn't in use. | 374 | * isn't in use. |
369 | * | 375 | * |
370 | * \param inode device inode. | ||
371 | * \param file_priv DRM file private. | ||
372 | * \param cmd command. | ||
373 | * \param arg pointer to a struct drm_map structure. | ||
374 | * \return zero on success or a negative value on error. | ||
375 | * | ||
376 | * Searches the map on drm_device::maplist, removes it from the list, see if | 376 | * Searches the map on drm_device::maplist, removes it from the list, see if |
377 | * its being used, and free any associate resource (such as MTRR's) if it's not | 377 | * its being used, and free any associate resource (such as MTRR's) if it's not |
378 | * being on use. | 378 | * being on use. |
379 | * | 379 | * |
380 | * \sa drm_addmap | 380 | * \sa drm_addmap |
381 | */ | 381 | */ |
382 | int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map) | 382 | int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map) |
383 | { | 383 | { |
384 | struct drm_map_list *r_list = NULL, *list_t; | 384 | struct drm_map_list *r_list = NULL, *list_t; |
385 | drm_dma_handle_t dmah; | 385 | drm_dma_handle_t dmah; |
@@ -442,7 +442,7 @@ int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map) | |||
442 | } | 442 | } |
443 | EXPORT_SYMBOL(drm_rmmap_locked); | 443 | EXPORT_SYMBOL(drm_rmmap_locked); |
444 | 444 | ||
445 | int drm_rmmap(struct drm_device *dev, drm_local_map_t *map) | 445 | int drm_rmmap(struct drm_device *dev, struct drm_local_map *map) |
446 | { | 446 | { |
447 | int ret; | 447 | int ret; |
448 | 448 | ||
@@ -462,12 +462,18 @@ EXPORT_SYMBOL(drm_rmmap); | |||
462 | * One use case might be after addmap is allowed for normal users for SHM and | 462 | * One use case might be after addmap is allowed for normal users for SHM and |
463 | * gets used by drivers that the server doesn't need to care about. This seems | 463 | * gets used by drivers that the server doesn't need to care about. This seems |
464 | * unlikely. | 464 | * unlikely. |
465 | * | ||
466 | * \param inode device inode. | ||
467 | * \param file_priv DRM file private. | ||
468 | * \param cmd command. | ||
469 | * \param arg pointer to a struct drm_map structure. | ||
470 | * \return zero on success or a negative value on error. | ||
465 | */ | 471 | */ |
466 | int drm_rmmap_ioctl(struct drm_device *dev, void *data, | 472 | int drm_rmmap_ioctl(struct drm_device *dev, void *data, |
467 | struct drm_file *file_priv) | 473 | struct drm_file *file_priv) |
468 | { | 474 | { |
469 | struct drm_map *request = data; | 475 | struct drm_map *request = data; |
470 | drm_local_map_t *map = NULL; | 476 | struct drm_local_map *map = NULL; |
471 | struct drm_map_list *r_list; | 477 | struct drm_map_list *r_list; |
472 | int ret; | 478 | int ret; |
473 | 479 | ||
@@ -1534,7 +1540,7 @@ int drm_mapbufs(struct drm_device *dev, void *data, | |||
1534 | && (dma->flags & _DRM_DMA_USE_SG)) | 1540 | && (dma->flags & _DRM_DMA_USE_SG)) |
1535 | || (drm_core_check_feature(dev, DRIVER_FB_DMA) | 1541 | || (drm_core_check_feature(dev, DRIVER_FB_DMA) |
1536 | && (dma->flags & _DRM_DMA_USE_FB))) { | 1542 | && (dma->flags & _DRM_DMA_USE_FB))) { |
1537 | struct drm_map *map = dev->agp_buffer_map; | 1543 | struct drm_local_map *map = dev->agp_buffer_map; |
1538 | unsigned long token = dev->agp_buffer_token; | 1544 | unsigned long token = dev->agp_buffer_token; |
1539 | 1545 | ||
1540 | if (!map) { | 1546 | if (!map) { |
diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index 809ec0f03452..7d1e53c10d4b 100644 --- a/drivers/gpu/drm/drm_context.c +++ b/drivers/gpu/drm/drm_context.c | |||
@@ -143,7 +143,7 @@ int drm_getsareactx(struct drm_device *dev, void *data, | |||
143 | struct drm_file *file_priv) | 143 | struct drm_file *file_priv) |
144 | { | 144 | { |
145 | struct drm_ctx_priv_map *request = data; | 145 | struct drm_ctx_priv_map *request = data; |
146 | struct drm_map *map; | 146 | struct drm_local_map *map; |
147 | struct drm_map_list *_entry; | 147 | struct drm_map_list *_entry; |
148 | 148 | ||
149 | mutex_lock(&dev->struct_mutex); | 149 | mutex_lock(&dev->struct_mutex); |
@@ -186,7 +186,7 @@ int drm_setsareactx(struct drm_device *dev, void *data, | |||
186 | struct drm_file *file_priv) | 186 | struct drm_file *file_priv) |
187 | { | 187 | { |
188 | struct drm_ctx_priv_map *request = data; | 188 | struct drm_ctx_priv_map *request = data; |
189 | struct drm_map *map = NULL; | 189 | struct drm_local_map *map = NULL; |
190 | struct drm_map_list *r_list = NULL; | 190 | struct drm_map_list *r_list = NULL; |
191 | 191 | ||
192 | mutex_lock(&dev->struct_mutex); | 192 | mutex_lock(&dev->struct_mutex); |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 14c7a23dc157..6394c2b67658 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -530,7 +530,7 @@ int drm_ioctl(struct inode *inode, struct file *filp, | |||
530 | 530 | ||
531 | EXPORT_SYMBOL(drm_ioctl); | 531 | EXPORT_SYMBOL(drm_ioctl); |
532 | 532 | ||
533 | drm_local_map_t *drm_getsarea(struct drm_device *dev) | 533 | struct drm_local_map *drm_getsarea(struct drm_device *dev) |
534 | { | 534 | { |
535 | struct drm_map_list *entry; | 535 | struct drm_map_list *entry; |
536 | 536 | ||
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 88d3368ffddd..c1173d8c4588 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c | |||
@@ -502,7 +502,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) | |||
502 | struct drm_file *priv = filp->private_data; | 502 | struct drm_file *priv = filp->private_data; |
503 | struct drm_device *dev = priv->minor->dev; | 503 | struct drm_device *dev = priv->minor->dev; |
504 | struct drm_gem_mm *mm = dev->mm_private; | 504 | struct drm_gem_mm *mm = dev->mm_private; |
505 | struct drm_map *map = NULL; | 505 | struct drm_local_map *map = NULL; |
506 | struct drm_gem_object *obj; | 506 | struct drm_gem_object *obj; |
507 | struct drm_hash_item *hash; | 507 | struct drm_hash_item *hash; |
508 | unsigned long prot; | 508 | unsigned long prot; |
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c index bcc869bc4092..0c707f533eab 100644 --- a/drivers/gpu/drm/drm_memory.c +++ b/drivers/gpu/drm/drm_memory.c | |||
@@ -159,7 +159,7 @@ static inline void *agp_remap(unsigned long offset, unsigned long size, | |||
159 | 159 | ||
160 | #endif /* debug_memory */ | 160 | #endif /* debug_memory */ |
161 | 161 | ||
162 | void drm_core_ioremap(struct drm_map *map, struct drm_device *dev) | 162 | void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) |
163 | { | 163 | { |
164 | if (drm_core_has_AGP(dev) && | 164 | if (drm_core_has_AGP(dev) && |
165 | dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) | 165 | dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) |
@@ -169,7 +169,7 @@ void drm_core_ioremap(struct drm_map *map, struct drm_device *dev) | |||
169 | } | 169 | } |
170 | EXPORT_SYMBOL(drm_core_ioremap); | 170 | EXPORT_SYMBOL(drm_core_ioremap); |
171 | 171 | ||
172 | void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev) | 172 | void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev) |
173 | { | 173 | { |
174 | if (drm_core_has_AGP(dev) && | 174 | if (drm_core_has_AGP(dev) && |
175 | dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) | 175 | dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) |
@@ -179,7 +179,7 @@ void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev) | |||
179 | } | 179 | } |
180 | EXPORT_SYMBOL(drm_core_ioremap_wc); | 180 | EXPORT_SYMBOL(drm_core_ioremap_wc); |
181 | 181 | ||
182 | void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev) | 182 | void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev) |
183 | { | 183 | { |
184 | if (!map->handle || !map->size) | 184 | if (!map->handle || !map->size) |
185 | return; | 185 | return; |
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c index 8df849f66830..c1959badf11f 100644 --- a/drivers/gpu/drm/drm_proc.c +++ b/drivers/gpu/drm/drm_proc.c | |||
@@ -247,7 +247,7 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request, | |||
247 | struct drm_minor *minor = (struct drm_minor *) data; | 247 | struct drm_minor *minor = (struct drm_minor *) data; |
248 | struct drm_device *dev = minor->dev; | 248 | struct drm_device *dev = minor->dev; |
249 | int len = 0; | 249 | int len = 0; |
250 | struct drm_map *map; | 250 | struct drm_local_map *map; |
251 | struct drm_map_list *r_list; | 251 | struct drm_map_list *r_list; |
252 | 252 | ||
253 | /* Hardcoded from _DRM_FRAME_BUFFER, | 253 | /* Hardcoded from _DRM_FRAME_BUFFER, |
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index 3ffae021d280..0d8bbd72ec55 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c | |||
@@ -91,7 +91,7 @@ static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
91 | { | 91 | { |
92 | struct drm_file *priv = vma->vm_file->private_data; | 92 | struct drm_file *priv = vma->vm_file->private_data; |
93 | struct drm_device *dev = priv->minor->dev; | 93 | struct drm_device *dev = priv->minor->dev; |
94 | struct drm_map *map = NULL; | 94 | struct drm_local_map *map = NULL; |
95 | struct drm_map_list *r_list; | 95 | struct drm_map_list *r_list; |
96 | struct drm_hash_item *hash; | 96 | struct drm_hash_item *hash; |
97 | 97 | ||
@@ -176,7 +176,7 @@ static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
176 | */ | 176 | */ |
177 | static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | 177 | static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) |
178 | { | 178 | { |
179 | struct drm_map *map = (struct drm_map *) vma->vm_private_data; | 179 | struct drm_local_map *map = vma->vm_private_data; |
180 | unsigned long offset; | 180 | unsigned long offset; |
181 | unsigned long i; | 181 | unsigned long i; |
182 | struct page *page; | 182 | struct page *page; |
@@ -209,7 +209,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma) | |||
209 | struct drm_file *priv = vma->vm_file->private_data; | 209 | struct drm_file *priv = vma->vm_file->private_data; |
210 | struct drm_device *dev = priv->minor->dev; | 210 | struct drm_device *dev = priv->minor->dev; |
211 | struct drm_vma_entry *pt, *temp; | 211 | struct drm_vma_entry *pt, *temp; |
212 | struct drm_map *map; | 212 | struct drm_local_map *map; |
213 | struct drm_map_list *r_list; | 213 | struct drm_map_list *r_list; |
214 | int found_maps = 0; | 214 | int found_maps = 0; |
215 | 215 | ||
@@ -322,7 +322,7 @@ static int drm_do_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
322 | */ | 322 | */ |
323 | static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | 323 | static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf) |
324 | { | 324 | { |
325 | struct drm_map *map = (struct drm_map *) vma->vm_private_data; | 325 | struct drm_local_map *map = vma->vm_private_data; |
326 | struct drm_file *priv = vma->vm_file->private_data; | 326 | struct drm_file *priv = vma->vm_file->private_data; |
327 | struct drm_device *dev = priv->minor->dev; | 327 | struct drm_device *dev = priv->minor->dev; |
328 | struct drm_sg_mem *entry = dev->sg; | 328 | struct drm_sg_mem *entry = dev->sg; |
@@ -512,7 +512,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) | |||
512 | return 0; | 512 | return 0; |
513 | } | 513 | } |
514 | 514 | ||
515 | unsigned long drm_core_get_map_ofs(struct drm_map * map) | 515 | unsigned long drm_core_get_map_ofs(struct drm_local_map * map) |
516 | { | 516 | { |
517 | return map->offset; | 517 | return map->offset; |
518 | } | 518 | } |
@@ -547,7 +547,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) | |||
547 | { | 547 | { |
548 | struct drm_file *priv = filp->private_data; | 548 | struct drm_file *priv = filp->private_data; |
549 | struct drm_device *dev = priv->minor->dev; | 549 | struct drm_device *dev = priv->minor->dev; |
550 | struct drm_map *map = NULL; | 550 | struct drm_local_map *map = NULL; |
551 | unsigned long offset = 0; | 551 | unsigned long offset = 0; |
552 | struct drm_hash_item *hash; | 552 | struct drm_hash_item *hash; |
553 | 553 | ||
diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h index 0118849a5672..21e2691f28f9 100644 --- a/drivers/gpu/drm/i810/i810_drv.h +++ b/drivers/gpu/drm/i810/i810_drv.h | |||
@@ -77,8 +77,8 @@ typedef struct _drm_i810_ring_buffer { | |||
77 | } drm_i810_ring_buffer_t; | 77 | } drm_i810_ring_buffer_t; |
78 | 78 | ||
79 | typedef struct drm_i810_private { | 79 | typedef struct drm_i810_private { |
80 | struct drm_map *sarea_map; | 80 | struct drm_local_map *sarea_map; |
81 | struct drm_map *mmio_map; | 81 | struct drm_local_map *mmio_map; |
82 | 82 | ||
83 | drm_i810_sarea_t *sarea_priv; | 83 | drm_i810_sarea_t *sarea_priv; |
84 | drm_i810_ring_buffer_t ring; | 84 | drm_i810_ring_buffer_t ring; |
diff --git a/drivers/gpu/drm/i830/i830_drv.h b/drivers/gpu/drm/i830/i830_drv.h index b5bf8cc0fdaa..da82afe4ded5 100644 --- a/drivers/gpu/drm/i830/i830_drv.h +++ b/drivers/gpu/drm/i830/i830_drv.h | |||
@@ -84,8 +84,8 @@ typedef struct _drm_i830_ring_buffer { | |||
84 | } drm_i830_ring_buffer_t; | 84 | } drm_i830_ring_buffer_t; |
85 | 85 | ||
86 | typedef struct drm_i830_private { | 86 | typedef struct drm_i830_private { |
87 | struct drm_map *sarea_map; | 87 | struct drm_local_map *sarea_map; |
88 | struct drm_map *mmio_map; | 88 | struct drm_local_map *mmio_map; |
89 | 89 | ||
90 | drm_i830_sarea_t *sarea_priv; | 90 | drm_i830_sarea_t *sarea_priv; |
91 | drm_i830_ring_buffer_t ring; | 91 | drm_i830_ring_buffer_t ring; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 37427e4016cb..592b24efeb48 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -627,7 +627,7 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj) | |||
627 | struct drm_gem_mm *mm = dev->mm_private; | 627 | struct drm_gem_mm *mm = dev->mm_private; |
628 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | 628 | struct drm_i915_gem_object *obj_priv = obj->driver_private; |
629 | struct drm_map_list *list; | 629 | struct drm_map_list *list; |
630 | struct drm_map *map; | 630 | struct drm_local_map *map; |
631 | int ret = 0; | 631 | int ret = 0; |
632 | 632 | ||
633 | /* Set the object up for mmap'ing */ | 633 | /* Set the object up for mmap'ing */ |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 34e1676b53d1..03a7c11cb24d 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -523,19 +523,32 @@ struct drm_mm { | |||
523 | 523 | ||
524 | 524 | ||
525 | /** | 525 | /** |
526 | * Kernel side of a mapping | ||
527 | */ | ||
528 | struct drm_local_map { | ||
529 | unsigned long offset; /**< Requested physical address (0 for SAREA)*/ | ||
530 | unsigned long size; /**< Requested physical size (bytes) */ | ||
531 | enum drm_map_type type; /**< Type of memory to map */ | ||
532 | enum drm_map_flags flags; /**< Flags */ | ||
533 | void *handle; /**< User-space: "Handle" to pass to mmap() */ | ||
534 | /**< Kernel-space: kernel-virtual address */ | ||
535 | int mtrr; /**< MTRR slot used */ | ||
536 | }; | ||
537 | |||
538 | typedef struct drm_local_map drm_local_map_t; | ||
539 | |||
540 | /** | ||
526 | * Mappings list | 541 | * Mappings list |
527 | */ | 542 | */ |
528 | struct drm_map_list { | 543 | struct drm_map_list { |
529 | struct list_head head; /**< list head */ | 544 | struct list_head head; /**< list head */ |
530 | struct drm_hash_item hash; | 545 | struct drm_hash_item hash; |
531 | struct drm_map *map; /**< mapping */ | 546 | struct drm_local_map *map; /**< mapping */ |
532 | uint64_t user_token; | 547 | uint64_t user_token; |
533 | struct drm_master *master; | 548 | struct drm_master *master; |
534 | struct drm_mm_node *file_offset_node; /**< fake offset */ | 549 | struct drm_mm_node *file_offset_node; /**< fake offset */ |
535 | }; | 550 | }; |
536 | 551 | ||
537 | typedef struct drm_map drm_local_map_t; | ||
538 | |||
539 | /** | 552 | /** |
540 | * Context handle list | 553 | * Context handle list |
541 | */ | 554 | */ |
@@ -560,7 +573,7 @@ struct drm_ati_pcigart_info { | |||
560 | dma_addr_t bus_addr; | 573 | dma_addr_t bus_addr; |
561 | dma_addr_t table_mask; | 574 | dma_addr_t table_mask; |
562 | struct drm_dma_handle *table_handle; | 575 | struct drm_dma_handle *table_handle; |
563 | drm_local_map_t mapping; | 576 | struct drm_local_map mapping; |
564 | int table_size; | 577 | int table_size; |
565 | }; | 578 | }; |
566 | 579 | ||
@@ -747,7 +760,7 @@ struct drm_driver { | |||
747 | struct drm_file *file_priv); | 760 | struct drm_file *file_priv); |
748 | void (*reclaim_buffers_idlelocked) (struct drm_device *dev, | 761 | void (*reclaim_buffers_idlelocked) (struct drm_device *dev, |
749 | struct drm_file *file_priv); | 762 | struct drm_file *file_priv); |
750 | unsigned long (*get_map_ofs) (struct drm_map * map); | 763 | unsigned long (*get_map_ofs) (struct drm_local_map * map); |
751 | unsigned long (*get_reg_ofs) (struct drm_device *dev); | 764 | unsigned long (*get_reg_ofs) (struct drm_device *dev); |
752 | void (*set_version) (struct drm_device *dev, | 765 | void (*set_version) (struct drm_device *dev, |
753 | struct drm_set_version *sv); | 766 | struct drm_set_version *sv); |
@@ -932,7 +945,7 @@ struct drm_device { | |||
932 | sigset_t sigmask; | 945 | sigset_t sigmask; |
933 | 946 | ||
934 | struct drm_driver *driver; | 947 | struct drm_driver *driver; |
935 | drm_local_map_t *agp_buffer_map; | 948 | struct drm_local_map *agp_buffer_map; |
936 | unsigned int agp_buffer_token; | 949 | unsigned int agp_buffer_token; |
937 | struct drm_minor *control; /**< Control node for card */ | 950 | struct drm_minor *control; /**< Control node for card */ |
938 | struct drm_minor *primary; /**< render type primary screen head */ | 951 | struct drm_minor *primary; /**< render type primary screen head */ |
@@ -1049,7 +1062,7 @@ extern int drm_release(struct inode *inode, struct file *filp); | |||
1049 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); | 1062 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); |
1050 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); | 1063 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); |
1051 | extern void drm_vm_open_locked(struct vm_area_struct *vma); | 1064 | extern void drm_vm_open_locked(struct vm_area_struct *vma); |
1052 | extern unsigned long drm_core_get_map_ofs(struct drm_map * map); | 1065 | extern unsigned long drm_core_get_map_ofs(struct drm_local_map * map); |
1053 | extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev); | 1066 | extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev); |
1054 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); | 1067 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
1055 | 1068 | ||
@@ -1155,11 +1168,11 @@ extern int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request | |||
1155 | extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request); | 1168 | extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request); |
1156 | extern int drm_addmap(struct drm_device *dev, unsigned int offset, | 1169 | extern int drm_addmap(struct drm_device *dev, unsigned int offset, |
1157 | unsigned int size, enum drm_map_type type, | 1170 | unsigned int size, enum drm_map_type type, |
1158 | enum drm_map_flags flags, drm_local_map_t ** map_ptr); | 1171 | enum drm_map_flags flags, struct drm_local_map **map_ptr); |
1159 | extern int drm_addmap_ioctl(struct drm_device *dev, void *data, | 1172 | extern int drm_addmap_ioctl(struct drm_device *dev, void *data, |
1160 | struct drm_file *file_priv); | 1173 | struct drm_file *file_priv); |
1161 | extern int drm_rmmap(struct drm_device *dev, drm_local_map_t *map); | 1174 | extern int drm_rmmap(struct drm_device *dev, struct drm_local_map *map); |
1162 | extern int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map); | 1175 | extern int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map); |
1163 | extern int drm_rmmap_ioctl(struct drm_device *dev, void *data, | 1176 | extern int drm_rmmap_ioctl(struct drm_device *dev, void *data, |
1164 | struct drm_file *file_priv); | 1177 | struct drm_file *file_priv); |
1165 | extern int drm_addbufs(struct drm_device *dev, void *data, | 1178 | extern int drm_addbufs(struct drm_device *dev, void *data, |
@@ -1261,7 +1274,7 @@ extern struct proc_dir_entry *drm_proc_root; | |||
1261 | 1274 | ||
1262 | extern struct idr drm_minors_idr; | 1275 | extern struct idr drm_minors_idr; |
1263 | 1276 | ||
1264 | extern drm_local_map_t *drm_getsarea(struct drm_device *dev); | 1277 | extern struct drm_local_map *drm_getsarea(struct drm_device *dev); |
1265 | 1278 | ||
1266 | /* Proc support (drm_proc.h) */ | 1279 | /* Proc support (drm_proc.h) */ |
1267 | extern int drm_proc_init(struct drm_minor *minor, int minor_id, | 1280 | extern int drm_proc_init(struct drm_minor *minor, int minor_id, |
@@ -1378,12 +1391,12 @@ int drm_gem_open_ioctl(struct drm_device *dev, void *data, | |||
1378 | void drm_gem_open(struct drm_device *dev, struct drm_file *file_private); | 1391 | void drm_gem_open(struct drm_device *dev, struct drm_file *file_private); |
1379 | void drm_gem_release(struct drm_device *dev, struct drm_file *file_private); | 1392 | void drm_gem_release(struct drm_device *dev, struct drm_file *file_private); |
1380 | 1393 | ||
1381 | extern void drm_core_ioremap(struct drm_map *map, struct drm_device *dev); | 1394 | extern void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev); |
1382 | extern void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev); | 1395 | extern void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev); |
1383 | extern void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev); | 1396 | extern void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev); |
1384 | 1397 | ||
1385 | static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, | 1398 | static __inline__ struct drm_local_map *drm_core_findmap(struct drm_device *dev, |
1386 | unsigned int token) | 1399 | unsigned int token) |
1387 | { | 1400 | { |
1388 | struct drm_map_list *_entry; | 1401 | struct drm_map_list *_entry; |
1389 | list_for_each_entry(_entry, &dev->maplist, head) | 1402 | list_for_each_entry(_entry, &dev->maplist, head) |
@@ -1410,7 +1423,7 @@ static __inline__ int drm_device_is_pcie(struct drm_device *dev) | |||
1410 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); | 1423 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); |
1411 | } | 1424 | } |
1412 | 1425 | ||
1413 | static __inline__ void drm_core_dropmap(struct drm_map *map) | 1426 | static __inline__ void drm_core_dropmap(struct drm_local_map *map) |
1414 | { | 1427 | { |
1415 | } | 1428 | } |
1416 | 1429 | ||