drm/radeon: Test for imported buffers with drm_gem_is_imported()
Subsystems (2)
PATCH 9/11 drm/radeon: Test for imported buffers with drm_gem_is_imported()
Instead of testing import_attach for imported GEM buffers, invoke drm_gem_is_imported() to do the test. The helper tests the dma_buf itself while import_attach is just an artifact of the import. Prepares to make import_attach optional.
Signed-off-by Thomas Zimmermann <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
--- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/gpu/drm/radeon/radeon_object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_display.c +1 -1
@@ -1328,7 +1328,7 @@ radeon_user_framebuffer_create(struct drm_device *dev, }/* Handle is imported dma-buf, so cannot be migrated to VRAM for scanout */ -if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {DRM_DEBUG_KMS ("Cannot create framebuffer from imported dma_buf\n" );drm_gem_object_put (obj);return ERR_PTR (-EINVAL );
drivers/gpu/drm/radeon/radeon_object.c +1 -1
@@ -60,7 +60,7 @@ static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo)mutex_unlock (&bo->rdev->gem.mutex);radeon_bo_clear_surface_reg (bo);WARN_ON_ONCE (!list_empty (&bo->va)); -if (bo->tbo.base.import_attach) +if (drm_gem_is_imported (&bo->tbo.base))drm_prime_gem_destroy (&bo->tbo.base, bo->tbo.sg);drm_gem_object_release (&bo->tbo.base);kfree (bo);
Signature · 1 line
2.49.0