diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 14:32:30 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 14:32:30 -0800 |
commit | 9148bce4a7d7b532e49a3bc546f1703a58dfad45 (patch) | |
tree | a65ef51984b437034d76b639aafa8ca9c1df0db7 /drivers/gpu/drm/radeon | |
parent | aad3bf04dca5a2147a8406f7aef5703ee5259a52 (diff) | |
parent | d1ede145cea25c5b6d2ebb19b167af14e374bb45 (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/ttm: export some functions useful to drivers using ttm
drm/radeon/kms/avivo: fix typo in new_pll module description
drm/radeon/kms: Convert radeon to new ttm_bo_init
drm/ttm: Convert ttm_buffer_object_init to use ttm_placement
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.c | 39 |
2 files changed, 10 insertions, 31 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 28077247f4f..c5c45e626d7 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -121,7 +121,7 @@ module_param_named(connector_table, radeon_connector_table, int, 0444); MODULE_PARM_DESC(tv, "TV enable (0 = disable)"); module_param_named(tv, radeon_tv, int, 0444); -MODULE_PARM_DESC(r4xx_atom, "Select new PLL code for AVIVO chips"); +MODULE_PARM_DESC(new_pll, "Select new PLL code for AVIVO chips"); module_param_named(new_pll, radeon_new_pll, int, 0444); static int radeon_suspend(struct drm_device *dev, pm_message_t state) diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 2040937682f..544e18ffaf2 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -56,25 +56,6 @@ static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo) kfree(bo); } -static inline u32 radeon_ttm_flags_from_domain(u32 domain) -{ - u32 flags = 0; - - if (domain & RADEON_GEM_DOMAIN_VRAM) { - flags |= TTM_PL_FLAG_VRAM | TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED; - } - if (domain & RADEON_GEM_DOMAIN_GTT) { - flags |= TTM_PL_FLAG_TT | TTM_PL_MASK_CACHING; - } - if (domain & RADEON_GEM_DOMAIN_CPU) { - flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING; - } - if (!flags) { - flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING; - } - return flags; -} - void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) { u32 c = 0; @@ -100,7 +81,6 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, { struct radeon_bo *bo; enum ttm_bo_type type; - u32 flags; int r; if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) { @@ -120,16 +100,16 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, bo->surface_reg = -1; INIT_LIST_HEAD(&bo->list); - flags = radeon_ttm_flags_from_domain(domain); + radeon_ttm_placement_from_domain(bo, domain); /* Kernel allocation are uninterruptible */ - r = ttm_buffer_object_init(&rdev->mman.bdev, &bo->tbo, size, type, - flags, 0, 0, !kernel, NULL, size, - &radeon_ttm_bo_destroy); + r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type, + &bo->placement, 0, 0, !kernel, NULL, size, + &radeon_ttm_bo_destroy); if (unlikely(r != 0)) { if (r != -ERESTARTSYS) dev_err(rdev->dev, - "object_init failed for (%ld, 0x%08X)\n", - size, flags); + "object_init failed for (%lu, 0x%08X)\n", + size, domain); return r; } *bo_ptr = bo; @@ -199,7 +179,7 @@ int radeon_bo_pin(struct radeon_bo *bo, u32 domain, u64 *gpu_addr) radeon_ttm_placement_from_domain(bo, domain); for (i = 0; i < bo->placement.num_placement; i++) bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; - r = ttm_buffer_object_validate(&bo->tbo, &bo->placement, false, false); + r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); if (likely(r == 0)) { bo->pin_count = 1; if (gpu_addr != NULL) @@ -223,7 +203,7 @@ int radeon_bo_unpin(struct radeon_bo *bo) return 0; for (i = 0; i < bo->placement.num_placement; i++) bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT; - r = ttm_buffer_object_validate(&bo->tbo, &bo->placement, false, false); + r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); if (unlikely(r != 0)) dev_err(bo->rdev->dev, "%p validate failed for unpin\n", bo); return r; @@ -336,8 +316,7 @@ int radeon_bo_list_validate(struct list_head *head, void *fence) radeon_ttm_placement_from_domain(bo, lobj->rdomain); } - r = ttm_buffer_object_validate(&bo->tbo, - &bo->placement, + r = ttm_bo_validate(&bo->tbo, &bo->placement, true, false); if (unlikely(r)) return r; |