Merge tag 'for-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power...
[linux-2.6-microblaze.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_uvd.c
index e5a6db6..4e5d13e 100644 (file)
@@ -692,6 +692,8 @@ static int amdgpu_uvd_cs_msg_decode(struct amdgpu_device *adev, uint32_t *msg,
        buf_sizes[0x1] = dpb_size;
        buf_sizes[0x2] = image_size;
        buf_sizes[0x4] = min_ctx_size;
+       /* store image width to adjust nb memory pstate */
+       adev->uvd.decode_image_width = width;
        return 0;
 }
 
@@ -1243,30 +1245,20 @@ int amdgpu_uvd_ring_test_ib(struct amdgpu_ring *ring, long timeout)
 {
        struct dma_fence *fence;
        long r;
-       uint32_t ip_instance = ring->me;
 
        r = amdgpu_uvd_get_create_msg(ring, 1, NULL);
-       if (r) {
-               DRM_ERROR("amdgpu: (%d)failed to get create msg (%ld).\n", ip_instance, r);
+       if (r)
                goto error;
-       }
 
        r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence);
-       if (r) {
-               DRM_ERROR("amdgpu: (%d)failed to get destroy ib (%ld).\n", ip_instance, r);
+       if (r)
                goto error;
-       }
 
        r = dma_fence_wait_timeout(fence, false, timeout);
-       if (r == 0) {
-               DRM_ERROR("amdgpu: (%d)IB test timed out.\n", ip_instance);
+       if (r == 0)
                r = -ETIMEDOUT;
-       } else if (r < 0) {
-               DRM_ERROR("amdgpu: (%d)fence wait failed (%ld).\n", ip_instance, r);
-       } else {
-               DRM_DEBUG("ib test on (%d)ring %d succeeded\n", ip_instance, ring->idx);
+       else if (r > 0)
                r = 0;
-       }
 
        dma_fence_put(fence);