Merge branch 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
Just two small fixes for radeon, both destined for stable. * 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux: drm/radeon: fix wait in radeon_mn_invalidate_range_start drm/radeon: add extra check in radeon_ttm_tt_unpin_userptr
This commit is contained in:
commit
51b52fac9b
2 changed files with 8 additions and 7 deletions
|
@ -122,7 +122,6 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
|
||||||
it = interval_tree_iter_first(&rmn->objects, start, end);
|
it = interval_tree_iter_first(&rmn->objects, start, end);
|
||||||
while (it) {
|
while (it) {
|
||||||
struct radeon_bo *bo;
|
struct radeon_bo *bo;
|
||||||
struct fence *fence;
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
bo = container_of(it, struct radeon_bo, mn_it);
|
bo = container_of(it, struct radeon_bo, mn_it);
|
||||||
|
@ -134,12 +133,10 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fence = reservation_object_get_excl(bo->tbo.resv);
|
r = reservation_object_wait_timeout_rcu(bo->tbo.resv, true,
|
||||||
if (fence) {
|
false, MAX_SCHEDULE_TIMEOUT);
|
||||||
r = radeon_fence_wait((struct radeon_fence *)fence, false);
|
if (r)
|
||||||
if (r)
|
DRM_ERROR("(%d) failed to wait for user bo\n", r);
|
||||||
DRM_ERROR("(%d) failed to wait for user bo\n", r);
|
|
||||||
}
|
|
||||||
|
|
||||||
radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU);
|
radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU);
|
||||||
r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
|
r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
|
||||||
|
|
|
@ -598,6 +598,10 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
|
||||||
enum dma_data_direction direction = write ?
|
enum dma_data_direction direction = write ?
|
||||||
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
|
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
|
||||||
|
|
||||||
|
/* double check that we don't free the table twice */
|
||||||
|
if (!ttm->sg->sgl)
|
||||||
|
return;
|
||||||
|
|
||||||
/* free the sg table and pages again */
|
/* free the sg table and pages again */
|
||||||
dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
|
dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue