aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-09-06 10:15:28 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-12 14:27:22 -0400
commit9cca0b8e5df0ac438c65eec5044bfa089d16fbbe (patch)
treede96700a32acb9d5844842a649fd5931a93f5278 /drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
parentf5683f8b3794f9496877fb9e20305433c6575b81 (diff)
drm/amdgpu: move amdgpu_cs_sysvm_access_required into find_mapping
When we need to find the mapping we need sysvm access anyway. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index e19928dae8e3..331e34ac61fd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -410,10 +410,10 @@ static int amdgpu_uvd_cs_pass1(struct amdgpu_uvd_cs_ctx *ctx)
410 uint64_t addr = amdgpu_uvd_get_addr_from_ctx(ctx); 410 uint64_t addr = amdgpu_uvd_get_addr_from_ctx(ctx);
411 int r = 0; 411 int r = 0;
412 412
413 mapping = amdgpu_cs_find_mapping(ctx->parser, addr, &bo); 413 r = amdgpu_cs_find_mapping(ctx->parser, addr, &bo, &mapping);
414 if (mapping == NULL) { 414 if (r) {
415 DRM_ERROR("Can't find BO for addr 0x%08Lx\n", addr); 415 DRM_ERROR("Can't find BO for addr 0x%08Lx\n", addr);
416 return -EINVAL; 416 return r;
417 } 417 }
418 418
419 if (!ctx->parser->adev->uvd.address_64_bit) { 419 if (!ctx->parser->adev->uvd.address_64_bit) {
@@ -737,10 +737,10 @@ static int amdgpu_uvd_cs_pass2(struct amdgpu_uvd_cs_ctx *ctx)
737 uint64_t addr = amdgpu_uvd_get_addr_from_ctx(ctx); 737 uint64_t addr = amdgpu_uvd_get_addr_from_ctx(ctx);
738 int r; 738 int r;
739 739
740 mapping = amdgpu_cs_find_mapping(ctx->parser, addr, &bo); 740 r = amdgpu_cs_find_mapping(ctx->parser, addr, &bo, &mapping);
741 if (mapping == NULL) { 741 if (r) {
742 DRM_ERROR("Can't find BO for addr 0x%08Lx\n", addr); 742 DRM_ERROR("Can't find BO for addr 0x%08Lx\n", addr);
743 return -EINVAL; 743 return r;
744 } 744 }
745 745
746 start = amdgpu_bo_gpu_offset(bo); 746 start = amdgpu_bo_gpu_offset(bo);
@@ -917,10 +917,6 @@ int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx)
917 return -EINVAL; 917 return -EINVAL;
918 } 918 }
919 919
920 r = amdgpu_cs_sysvm_access_required(parser);
921 if (r)
922 return r;
923
924 ctx.parser = parser; 920 ctx.parser = parser;
925 ctx.buf_sizes = buf_sizes; 921 ctx.buf_sizes = buf_sizes;
926 ctx.ib_idx = ib_idx; 922 ctx.ib_idx = ib_idx;