From: Christopher James Halse Rogers <christopher.halse.rogers@xxxxxxxxxxxxx> Attempting to migrate the bo will break the sharing of the buffer. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@xxxxxxxxxxxxx> CC: amd-gfx@xxxxxxxxxxxxxxxxxxxxx --- drivers/gpu/drm/radeon/radeon_prime.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c index f3609c97496b..2dbbb4bd47b1 100644 --- a/drivers/gpu/drm/radeon/radeon_prime.c +++ b/drivers/gpu/drm/radeon/radeon_prime.c @@ -73,6 +73,16 @@ struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev, if (ret) return ERR_PTR(ret); + ret = radeon_bo_reserve(bo, false); + if (ret) + return ERR_PTR(ret); + + ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL); + radeon_bo_unreserve(bo); + + if (ret) + return ERR_PTR(ret); + mutex_lock(&rdev->gem.mutex); list_add_tail(&bo->list, &rdev->gem.objects); mutex_unlock(&rdev->gem.mutex); -- 2.11.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel