diff options
author | Jerome Glisse <jglisse@redhat.com> | 2009-12-14 15:02:09 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-16 00:38:55 -0500 |
commit | d03d858970a158fa82d9ba0d502bdea0bdb3ad33 (patch) | |
tree | 95c0372e6ab373b2383cf19f7febcb77ecfc9a05 /drivers/gpu/drm/radeon/radeon_ttm.c | |
parent | 9fb03e63511cc20d413c2896396ba77df3db8411 (diff) |
drm/radeon/kms: Check if bo we got from ttm are radeon object or not
If they are not radeon object don't do anythings special for them,
this avoid rare oops than can happen in a complex use case.
[airlied: additional fixups]
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ttm.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_ttm.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index d2ed896cca01..7bed4122528c 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
@@ -200,7 +200,19 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, | |||
200 | static void radeon_evict_flags(struct ttm_buffer_object *bo, | 200 | static void radeon_evict_flags(struct ttm_buffer_object *bo, |
201 | struct ttm_placement *placement) | 201 | struct ttm_placement *placement) |
202 | { | 202 | { |
203 | struct radeon_bo *rbo = container_of(bo, struct radeon_bo, tbo); | 203 | struct radeon_bo *rbo; |
204 | static u32 placements = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; | ||
205 | |||
206 | if (!radeon_ttm_bo_is_radeon_bo(bo)) { | ||
207 | placement->fpfn = 0; | ||
208 | placement->lpfn = 0; | ||
209 | placement->placement = &placements; | ||
210 | placement->busy_placement = &placements; | ||
211 | placement->num_placement = 1; | ||
212 | placement->num_busy_placement = 1; | ||
213 | return; | ||
214 | } | ||
215 | rbo = container_of(bo, struct radeon_bo, tbo); | ||
204 | switch (bo->mem.mem_type) { | 216 | switch (bo->mem.mem_type) { |
205 | case TTM_PL_VRAM: | 217 | case TTM_PL_VRAM: |
206 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT); | 218 | radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT); |