drm/radeon: Test for imported buffers with drm_gem_is_imported()
Subsystems (2)
PATCH 1/1 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 test itself does not change.
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
@@ -1340,7 +1340,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.52.0
Quoted 7 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The test itself does not change.Signed-off-by Thomas Zimmermann <[email protected]>Cc Alex Deucher <[email protected]>Cc "Christian König" <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 31 lines
--- 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@@ -1340,7 +1340,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);