summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorNirmoy Das <nirmoy.das@amd.com>2021-03-15 16:02:37 +0100
committerAlex Deucher <alexander.deucher@amd.com>2021-04-09 16:45:37 -0400
commit030bb4addb36ee94e286eb51486f990cac433825 (patch)
tree0e3a59593cf49f0b98df423bd9ffed38bb931697 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentcc1bcf85b0112ad660e70464d00d3e36e103cedd (diff)
downloadlwn-030bb4addb36ee94e286eb51486f990cac433825.tar.gz
lwn-030bb4addb36ee94e286eb51486f990cac433825.zip
drm/amdgpu: make BO type check less restrictive
BO with ttm_bo_type_sg type can also have tiling_flag and metadata. So so BO type check for only ttm_bo_type_kernel. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> Reported-by: Tom StDenis <Tom.StDenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index fd50e48e009a..d2265d457854 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -1164,7 +1164,7 @@ int amdgpu_bo_set_tiling_flags(struct amdgpu_bo *bo, u64 tiling_flags)
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
struct amdgpu_bo_user *ubo;
- BUG_ON(bo->tbo.type != ttm_bo_type_device);
+ BUG_ON(bo->tbo.type == ttm_bo_type_kernel);
if (adev->family <= AMDGPU_FAMILY_CZ &&
AMDGPU_TILING_GET(tiling_flags, TILE_SPLIT) > 6)
return -EINVAL;
@@ -1186,7 +1186,7 @@ void amdgpu_bo_get_tiling_flags(struct amdgpu_bo *bo, u64 *tiling_flags)
{
struct amdgpu_bo_user *ubo;
- BUG_ON(bo->tbo.type != ttm_bo_type_device);
+ BUG_ON(bo->tbo.type == ttm_bo_type_kernel);
dma_resv_assert_held(bo->tbo.base.resv);
ubo = to_amdgpu_bo_user(bo);
@@ -1213,7 +1213,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
struct amdgpu_bo_user *ubo;
void *buffer;
- BUG_ON(bo->tbo.type != ttm_bo_type_device);
+ BUG_ON(bo->tbo.type == ttm_bo_type_kernel);
ubo = to_amdgpu_bo_user(bo);
if (!metadata_size) {
if (ubo->metadata_size) {
@@ -1263,7 +1263,7 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
if (!buffer && !metadata_size)
return -EINVAL;
- BUG_ON(bo->tbo.type != ttm_bo_type_device);
+ BUG_ON(bo->tbo.type == ttm_bo_type_kernel);
ubo = to_amdgpu_bo_user(bo);
if (buffer) {
if (buffer_size < ubo->metadata_size)