Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -5
+10 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
··· 712 712 int r; 713 713 714 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 717 return -EINVAL; 718 + } 717 719 718 720 start = amdgpu_bo_gpu_offset(bo); 719 721 ··· 899 897 ctx.buf_sizes = buf_sizes; 900 898 ctx.ib_idx = ib_idx; 901 899 902 - /* first round, make sure the buffers are actually in the UVD segment */ 903 - r = amdgpu_uvd_cs_packets(&ctx, amdgpu_uvd_cs_pass1); 904 - if (r) 905 - return r; 900 + /* first round only required on chips without UVD 64 bit address support */ 901 + if (!parser->adev->uvd.address_64_bit) { 902 + /* first round, make sure the buffers are actually in the UVD segment */ 903 + r = amdgpu_uvd_cs_packets(&ctx, amdgpu_uvd_cs_pass1); 904 + if (r) 905 + return r; 906 + } 906 907 907 908 /* second round, patch buffer addresses into the command stream */ 908 909 r = amdgpu_uvd_cs_packets(&ctx, amdgpu_uvd_cs_pass2);