Commit f3f17692 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: take a BO reference for the user fence

No need for a GEM reference here.
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e9d951a8
...@@ -222,6 +222,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) ...@@ -222,6 +222,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
} }
p->uf.bo = gem_to_amdgpu_bo(gobj); p->uf.bo = gem_to_amdgpu_bo(gobj);
amdgpu_bo_ref(p->uf.bo);
drm_gem_object_unreference_unlocked(gobj);
p->uf.offset = fence_data->offset; p->uf.offset = fence_data->offset;
} else { } else {
ret = -EINVAL; ret = -EINVAL;
...@@ -487,7 +489,7 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bo ...@@ -487,7 +489,7 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bo
amdgpu_ib_free(parser->adev, &parser->ibs[i]); amdgpu_ib_free(parser->adev, &parser->ibs[i]);
kfree(parser->ibs); kfree(parser->ibs);
if (parser->uf.bo) if (parser->uf.bo)
drm_gem_object_unreference_unlocked(&parser->uf.bo->gem_base); amdgpu_bo_unref(&parser->uf.bo);
} }
static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p, static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p,
...@@ -776,7 +778,7 @@ static int amdgpu_cs_free_job(struct amdgpu_job *job) ...@@ -776,7 +778,7 @@ static int amdgpu_cs_free_job(struct amdgpu_job *job)
amdgpu_ib_free(job->adev, &job->ibs[i]); amdgpu_ib_free(job->adev, &job->ibs[i]);
kfree(job->ibs); kfree(job->ibs);
if (job->uf.bo) if (job->uf.bo)
drm_gem_object_unreference_unlocked(&job->uf.bo->gem_base); amdgpu_bo_unref(&job->uf.bo);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment