Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
[cascardo/linux.git] / drivers / gpu / drm / radeon / uvd_v4_2.c
index d04d507..91613b8 100644 (file)
@@ -41,18 +41,25 @@ int uvd_v4_2_resume(struct radeon_device *rdev)
        uint32_t size;
 
        /* programm the VCPU memory controller bits 0-27 */
-       addr = rdev->uvd.gpu_addr >> 3;
+
+       /* skip over the header of the new firmware format */
+       if (rdev->uvd.fw_header_present)
+               addr = (rdev->uvd.gpu_addr + 0x200) >> 3;
+       else
+               addr = rdev->uvd.gpu_addr >> 3;
+
        size = RADEON_GPU_PAGE_ALIGN(rdev->uvd_fw->size + 4) >> 3;
        WREG32(UVD_VCPU_CACHE_OFFSET0, addr);
        WREG32(UVD_VCPU_CACHE_SIZE0, size);
 
        addr += size;
-       size = RADEON_UVD_STACK_SIZE >> 3;
+       size = RADEON_UVD_HEAP_SIZE >> 3;
        WREG32(UVD_VCPU_CACHE_OFFSET1, addr);
        WREG32(UVD_VCPU_CACHE_SIZE1, size);
 
        addr += size;
-       size = RADEON_UVD_HEAP_SIZE >> 3;
+       size = (RADEON_UVD_STACK_SIZE +
+              (RADEON_UVD_SESSION_SIZE * rdev->uvd.max_handles)) >> 3;
        WREG32(UVD_VCPU_CACHE_OFFSET2, addr);
        WREG32(UVD_VCPU_CACHE_SIZE2, size);
 
@@ -64,5 +71,8 @@ int uvd_v4_2_resume(struct radeon_device *rdev)
        addr = (rdev->uvd.gpu_addr >> 32) & 0xFF;
        WREG32(UVD_LMI_EXT40_ADDR, addr | (0x9 << 16) | (0x1 << 31));
 
+       if (rdev->uvd.fw_header_present)
+               WREG32(UVD_GP_SCRATCH4, rdev->uvd.max_handles);
+
        return 0;
 }