aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_agp_backend.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2012-01-03 17:37:37 -0500
committerDave Airlie <airlied@redhat.com>2012-01-06 04:34:03 -0500
commitdea7e0ac45fd28f90bbc38ff226d36a9f788efbf (patch)
tree1130a3d51f0f8aa8ab462f1735423e3dc37835b6 /drivers/gpu/drm/ttm/ttm_agp_backend.c
parente11d0b87cde80745afe4712a19cd37bca9924a5b (diff)
ttm: fix agp since ttm tt rework
ttm tt rework modified the way we allocate and populate the ttm_tt structure, the AGP side was missing some bit to properly work. Fix those and fix radeon and nouveau AGP support. Tested on radeon only so far. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_agp_backend.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_agp_backend.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
index 14ebd3650aa..747c1413fc9 100644
--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
@@ -31,6 +31,7 @@
31 31
32#include "ttm/ttm_module.h" 32#include "ttm/ttm_module.h"
33#include "ttm/ttm_bo_driver.h" 33#include "ttm/ttm_bo_driver.h"
34#include "ttm/ttm_page_alloc.h"
34#ifdef TTM_HAS_AGP 35#ifdef TTM_HAS_AGP
35#include "ttm/ttm_placement.h" 36#include "ttm/ttm_placement.h"
36#include <linux/agp_backend.h> 37#include <linux/agp_backend.h>
@@ -97,6 +98,7 @@ static void ttm_agp_destroy(struct ttm_tt *ttm)
97 98
98 if (agp_be->mem) 99 if (agp_be->mem)
99 ttm_agp_unbind(ttm); 100 ttm_agp_unbind(ttm);
101 ttm_tt_fini(ttm);
100 kfree(agp_be); 102 kfree(agp_be);
101} 103}
102 104
@@ -129,4 +131,19 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
129} 131}
130EXPORT_SYMBOL(ttm_agp_tt_create); 132EXPORT_SYMBOL(ttm_agp_tt_create);
131 133
134int ttm_agp_tt_populate(struct ttm_tt *ttm)
135{
136 if (ttm->state != tt_unpopulated)
137 return 0;
138
139 return ttm_pool_populate(ttm);
140}
141EXPORT_SYMBOL(ttm_agp_tt_populate);
142
143void ttm_agp_tt_unpopulate(struct ttm_tt *ttm)
144{
145 ttm_pool_unpopulate(ttm);
146}
147EXPORT_SYMBOL(ttm_agp_tt_unpopulate);
148
132#endif 149#endif