diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:30:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:30:17 -0500 |
commit | c5113e3d66d7c7140fe854c7638a27eb3a23fd7d (patch) | |
tree | 9247edfcfa87132e15a277d6f2359b303c24da29 /drivers/gpu/drm/radeon/radeon_object.c | |
parent | 9b2831704e9250269032e3b8c2ffdfca09fd2851 (diff) | |
parent | d785d78bbdb53580b12c40e820af5a3281ce2fc8 (diff) |
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm/radeon/kms: fix r100->r500 CS checker for compressed textures. (v2)
drm/radeon/kms: allow for texture tiling
drm/radeon/kms: init pm on all chipsets
drm/radeon/kms: HDMI support for R600 KMS
drm/radeon/kms: make sure mc is initialized before mapping blit bo
drm/radeon/kms: Return to userspace on ERESTARTSYS
drm/radeon/gem: don't leak a gem object if reserve fails on get tiling (v2)
drm/radeon/kms: don't report allocate failure on ERESTARTSYS
drm/radeon/kms: Check if bo we got from ttm are radeon object or not
drm/radeon/kms: If no placement is supplied fallback to system
drm/ttm: Fix memory type manager debug information printing
drm/ttm: Fix printk format & compute bo->mem.size at bo initialization
drm/ttm: Fix potential ttm_mem_evict_first races.
drm/ttm: Delayed delete fixes.
drm/ttm: fix two bugs in new placement routines.
drm/ttm: fix incorrect logic in ttm_bo_io path
drm/nouveau: remove use of -ERESTART
nouveau: Fix endianness with new context program loader
drm/nouveau: fix build with CONFIG_AGP=n
drm/nouveau: fix ch7006 build
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_object.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 544e18ffaf22..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; |
@@ -71,6 +78,8 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) | |||
71 | rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; | 78 | rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; |
72 | if (domain & RADEON_GEM_DOMAIN_CPU) | 79 | if (domain & RADEON_GEM_DOMAIN_CPU) |
73 | rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; | 80 | rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; |
81 | if (!c) | ||
82 | rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; | ||
74 | rbo->placement.num_placement = c; | 83 | rbo->placement.num_placement = c; |
75 | rbo->placement.num_busy_placement = c; | 84 | rbo->placement.num_busy_placement = c; |
76 | } | 85 | } |
@@ -481,14 +490,20 @@ int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, | |||
481 | } | 490 | } |
482 | 491 | ||
483 | void radeon_bo_move_notify(struct ttm_buffer_object *bo, | 492 | void radeon_bo_move_notify(struct ttm_buffer_object *bo, |
484 | struct ttm_mem_reg *mem) | 493 | struct ttm_mem_reg *mem) |
485 | { | 494 | { |
486 | 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); | ||
487 | radeon_bo_check_tiling(rbo, 0, 1); | 499 | radeon_bo_check_tiling(rbo, 0, 1); |
488 | } | 500 | } |
489 | 501 | ||
490 | void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo) | 502 | void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo) |
491 | { | 503 | { |
492 | 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); | ||
493 | radeon_bo_check_tiling(rbo, 0, 0); | 508 | radeon_bo_check_tiling(rbo, 0, 0); |
494 | } | 509 | } |