This patch allow object creation to fallback to system memory if the proposed domains doesn't have room yet to accomodate for the buffer. Will be usefull when creating big buffer on small memory configuration when we need to evict first old buffer (old buffer being possibly pinned).
Signed-off-by: Jerome Glisse <[email protected]> --- drivers/gpu/drm/radeon/radeon_object.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 544e18f..43d63b5 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -101,6 +101,12 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, INIT_LIST_HEAD(&bo->list); radeon_ttm_placement_from_domain(bo, domain); + if ((domain & RADEON_GEM_DOMAIN_CPU) == 0) { + bo->placements[bo->placement.num_placement++] = + TTM_PL_MASK_CACHING | + TTM_PL_FLAG_SYSTEM; + bo->placement.num_busy_placement = bo->placement.num_placement; + } /* Kernel allocation are uninterruptible */ r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type, &bo->placement, 0, 0, !kernel, NULL, size, -- 1.6.5.2 ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
