aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-11-21 16:34:29 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-11-23 15:08:47 -0500
commit042eb9106000adbbc6960b9dbdd30a67acf5a2ed (patch)
treed35590c4dd13895c2c2d0b8d093a4aeece55b0db
parent80983e4df7196b0f300242bcd8e9df6370869438 (diff)
drm/amdgpu/uvd: reduce IB parsing overhead on UVD5+ (v2)
UVD 5 and newer do not have the same placement limitations as older chips, so skip the first pass since it's just overhead on chips where we don't have to force placement. v2: fix inverted logic Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 330c4749b32c..a81dfaeeb8c0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -712,8 +712,10 @@ static int amdgpu_uvd_cs_pass2(struct amdgpu_uvd_cs_ctx *ctx)
712 int r; 712 int r;
713 713
714 mapping = amdgpu_cs_find_mapping(ctx->parser, addr, &bo); 714 mapping = amdgpu_cs_find_mapping(ctx->parser, addr, &bo);
715 if (mapping == NULL) 715 if (mapping == NULL) {
716 DRM_ERROR("Can't find BO for addr 0x%08Lx\n", addr);
716 return -EINVAL; 717 return -EINVAL;
718 }
717 719
718 start = amdgpu_bo_gpu_offset(bo); 720 start = amdgpu_bo_gpu_offset(bo);
719 721
@@ -897,10 +899,13 @@ int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx)
897 ctx.buf_sizes = buf_sizes; 899 ctx.buf_sizes = buf_sizes;
898 ctx.ib_idx = ib_idx; 900 ctx.ib_idx = ib_idx;
899 901
900 /* first round, make sure the buffers are actually in the UVD segment */ 902 /* first round only required on chips without UVD 64 bit address support */
901 r = amdgpu_uvd_cs_packets(&ctx, amdgpu_uvd_cs_pass1); 903 if (!parser->adev->uvd.address_64_bit) {
902 if (r) 904 /* first round, make sure the buffers are actually in the UVD segment */
903 return r; 905 r = amdgpu_uvd_cs_packets(&ctx, amdgpu_uvd_cs_pass1);
906 if (r)
907 return r;
908 }
904 909
905 /* second round, patch buffer addresses into the command stream */ 910 /* second round, patch buffer addresses into the command stream */
906 r = amdgpu_uvd_cs_packets(&ctx, amdgpu_uvd_cs_pass2); 911 r = amdgpu_uvd_cs_packets(&ctx, amdgpu_uvd_cs_pass2);