diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_object.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 132130fcd991..d9ffe1f56e8f 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c | |||
@@ -56,6 +56,13 @@ static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo) | |||
56 | kfree(bo); | 56 | kfree(bo); |
57 | } | 57 | } |
58 | 58 | ||
59 | bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo) | ||
60 | { | ||
61 | if (bo->destroy == &radeon_ttm_bo_destroy) | ||
62 | return true; | ||
63 | return false; | ||
64 | } | ||
65 | |||
59 | void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) | 66 | void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) |
60 | { | 67 | { |
61 | u32 c = 0; | 68 | u32 c = 0; |
@@ -483,14 +490,20 @@ int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, | |||
483 | } | 490 | } |
484 | 491 | ||
485 | void radeon_bo_move_notify(struct ttm_buffer_object *bo, | 492 | void radeon_bo_move_notify(struct ttm_buffer_object *bo, |
486 | struct ttm_mem_reg *mem) | 493 | struct ttm_mem_reg *mem) |
487 | { | 494 | { |
488 | struct radeon_bo *rbo = container_of(bo, struct radeon_bo, tbo); | 495 | struct radeon_bo *rbo; |
496 | if (!radeon_ttm_bo_is_radeon_bo(bo)) | ||
497 | return; | ||
498 | rbo = container_of(bo, struct radeon_bo, tbo); | ||
489 | radeon_bo_check_tiling(rbo, 0, 1); | 499 | radeon_bo_check_tiling(rbo, 0, 1); |
490 | } | 500 | } |
491 | 501 | ||
492 | void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo) | 502 | void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo) |
493 | { | 503 | { |
494 | struct radeon_bo *rbo = container_of(bo, struct radeon_bo, tbo); | 504 | struct radeon_bo *rbo; |
505 | if (!radeon_ttm_bo_is_radeon_bo(bo)) | ||
506 | return; | ||
507 | rbo = container_of(bo, struct radeon_bo, tbo); | ||
495 | radeon_bo_check_tiling(rbo, 0, 0); | 508 | radeon_bo_check_tiling(rbo, 0, 0); |
496 | } | 509 | } |