aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_agpsupport.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2010-08-23 16:53:36 -0400
committerDave Airlie <airlied@redhat.com>2010-08-29 19:44:40 -0400
commit89c372647d1d698a96e2189ef4312a977b939839 (patch)
treea9ac9335b7c9079c6d119c4de318af3e83368512 /drivers/gpu/drm/drm_agpsupport.c
parent8f879194f88742d9c452f669482b6d6abdc1e1e7 (diff)
drm: kill agp indirection mess
There's no point in jumping through two indirections. So kill one and call the kernels agp functions directly. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_agpsupport.c')
-rw-r--r--drivers/gpu/drm/drm_agpsupport.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index ba38e0147220..252fdb98b73a 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -193,7 +193,7 @@ int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
193 * \return zero on success or a negative number on failure. 193 * \return zero on success or a negative number on failure.
194 * 194 *
195 * Verifies the AGP device is present and has been acquired, allocates the 195 * Verifies the AGP device is present and has been acquired, allocates the
196 * memory via alloc_agp() and creates a drm_agp_mem entry for it. 196 * memory via agp_allocate_memory() and creates a drm_agp_mem entry for it.
197 */ 197 */
198int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request) 198int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
199{ 199{
@@ -211,7 +211,7 @@ int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
211 211
212 pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE; 212 pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
213 type = (u32) request->type; 213 type = (u32) request->type;
214 if (!(memory = drm_alloc_agp(dev, pages, type))) { 214 if (!(memory = agp_allocate_memory(dev->agp->bridge, pages, type))) {
215 kfree(entry); 215 kfree(entry);
216 return -ENOMEM; 216 return -ENOMEM;
217 } 217 }
@@ -423,38 +423,6 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
423 return head; 423 return head;
424} 424}
425 425
426/** Calls agp_allocate_memory() */
427DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data * bridge,
428 size_t pages, u32 type)
429{
430 return agp_allocate_memory(bridge, pages, type);
431}
432
433/** Calls agp_free_memory() */
434int drm_agp_free_memory(DRM_AGP_MEM * handle)
435{
436 if (!handle)
437 return 0;
438 agp_free_memory(handle);
439 return 1;
440}
441
442/** Calls agp_bind_memory() */
443int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start)
444{
445 if (!handle)
446 return -EINVAL;
447 return agp_bind_memory(handle, start);
448}
449
450/** Calls agp_unbind_memory() */
451int drm_agp_unbind_memory(DRM_AGP_MEM * handle)
452{
453 if (!handle)
454 return -EINVAL;
455 return agp_unbind_memory(handle);
456}
457
458/** 426/**
459 * Binds a collection of pages into AGP memory at the given offset, returning 427 * Binds a collection of pages into AGP memory at the given offset, returning
460 * the AGP memory structure containing them. 428 * the AGP memory structure containing them.
@@ -474,7 +442,7 @@ drm_agp_bind_pages(struct drm_device *dev,
474 442
475 DRM_DEBUG("\n"); 443 DRM_DEBUG("\n");
476 444
477 mem = drm_agp_allocate_memory(dev->agp->bridge, num_pages, 445 mem = agp_allocate_memory(dev->agp->bridge, num_pages,
478 type); 446 type);
479 if (mem == NULL) { 447 if (mem == NULL) {
480 DRM_ERROR("Failed to allocate memory for %ld pages\n", 448 DRM_ERROR("Failed to allocate memory for %ld pages\n",
@@ -487,7 +455,7 @@ drm_agp_bind_pages(struct drm_device *dev,
487 mem->page_count = num_pages; 455 mem->page_count = num_pages;
488 456
489 mem->is_flushed = true; 457 mem->is_flushed = true;
490 ret = drm_agp_bind_memory(mem, gtt_offset / PAGE_SIZE); 458 ret = agp_bind_memory(mem, gtt_offset / PAGE_SIZE);
491 if (ret != 0) { 459 if (ret != 0) {
492 DRM_ERROR("Failed to bind AGP memory: %d\n", ret); 460 DRM_ERROR("Failed to bind AGP memory: %d\n", ret);
493 agp_free_memory(mem); 461 agp_free_memory(mem);