Commit 1df0d523 authored by Alex Deucher's avatar Alex Deucher

drm/radeon: sun/hainan chips do not have UVD (v2)

Skip UVD handling on them.

v2: split has_uvd tracking into separate patch
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 948bee3f
...@@ -2635,9 +2635,11 @@ static void si_gpu_init(struct radeon_device *rdev) ...@@ -2635,9 +2635,11 @@ static void si_gpu_init(struct radeon_device *rdev)
WREG32(HDP_ADDR_CONFIG, gb_addr_config); WREG32(HDP_ADDR_CONFIG, gb_addr_config);
WREG32(DMA_TILING_CONFIG + DMA0_REGISTER_OFFSET, gb_addr_config); WREG32(DMA_TILING_CONFIG + DMA0_REGISTER_OFFSET, gb_addr_config);
WREG32(DMA_TILING_CONFIG + DMA1_REGISTER_OFFSET, gb_addr_config); WREG32(DMA_TILING_CONFIG + DMA1_REGISTER_OFFSET, gb_addr_config);
WREG32(UVD_UDEC_ADDR_CONFIG, gb_addr_config); if (rdev->has_uvd) {
WREG32(UVD_UDEC_DB_ADDR_CONFIG, gb_addr_config); WREG32(UVD_UDEC_ADDR_CONFIG, gb_addr_config);
WREG32(UVD_UDEC_DBW_ADDR_CONFIG, gb_addr_config); WREG32(UVD_UDEC_DB_ADDR_CONFIG, gb_addr_config);
WREG32(UVD_UDEC_DBW_ADDR_CONFIG, gb_addr_config);
}
si_tiling_mode_table_init(rdev); si_tiling_mode_table_init(rdev);
...@@ -5213,15 +5215,17 @@ static int si_startup(struct radeon_device *rdev) ...@@ -5213,15 +5215,17 @@ static int si_startup(struct radeon_device *rdev)
return r; return r;
} }
r = rv770_uvd_resume(rdev); if (rdev->has_uvd) {
if (!r) { r = rv770_uvd_resume(rdev);
r = radeon_fence_driver_start_ring(rdev, if (!r) {
R600_RING_TYPE_UVD_INDEX); r = radeon_fence_driver_start_ring(rdev,
R600_RING_TYPE_UVD_INDEX);
if (r)
dev_err(rdev->dev, "UVD fences init error (%d).\n", r);
}
if (r) if (r)
dev_err(rdev->dev, "UVD fences init error (%d).\n", r); rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0;
} }
if (r)
rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0;
/* Enable IRQ */ /* Enable IRQ */
r = si_irq_init(rdev); r = si_irq_init(rdev);
...@@ -5280,16 +5284,18 @@ static int si_startup(struct radeon_device *rdev) ...@@ -5280,16 +5284,18 @@ static int si_startup(struct radeon_device *rdev)
if (r) if (r)
return r; return r;
ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX]; if (rdev->has_uvd) {
if (ring->ring_size) { ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
r = radeon_ring_init(rdev, ring, ring->ring_size, if (ring->ring_size) {
R600_WB_UVD_RPTR_OFFSET, r = radeon_ring_init(rdev, ring, ring->ring_size,
UVD_RBC_RB_RPTR, UVD_RBC_RB_WPTR, R600_WB_UVD_RPTR_OFFSET,
0, 0xfffff, RADEON_CP_PACKET2); UVD_RBC_RB_RPTR, UVD_RBC_RB_WPTR,
if (!r) 0, 0xfffff, RADEON_CP_PACKET2);
r = r600_uvd_init(rdev); if (!r)
if (r) r = r600_uvd_init(rdev);
DRM_ERROR("radeon: failed initializing UVD (%d).\n", r); if (r)
DRM_ERROR("radeon: failed initializing UVD (%d).\n", r);
}
} }
r = radeon_ib_pool_init(rdev); r = radeon_ib_pool_init(rdev);
...@@ -5338,8 +5344,10 @@ int si_suspend(struct radeon_device *rdev) ...@@ -5338,8 +5344,10 @@ int si_suspend(struct radeon_device *rdev)
radeon_vm_manager_fini(rdev); radeon_vm_manager_fini(rdev);
si_cp_enable(rdev, false); si_cp_enable(rdev, false);
cayman_dma_stop(rdev); cayman_dma_stop(rdev);
r600_uvd_rbc_stop(rdev); if (rdev->has_uvd) {
radeon_uvd_suspend(rdev); r600_uvd_rbc_stop(rdev);
radeon_uvd_suspend(rdev);
}
si_irq_suspend(rdev); si_irq_suspend(rdev);
radeon_wb_disable(rdev); radeon_wb_disable(rdev);
si_pcie_gart_disable(rdev); si_pcie_gart_disable(rdev);
...@@ -5427,11 +5435,13 @@ int si_init(struct radeon_device *rdev) ...@@ -5427,11 +5435,13 @@ int si_init(struct radeon_device *rdev)
ring->ring_obj = NULL; ring->ring_obj = NULL;
r600_ring_init(rdev, ring, 64 * 1024); r600_ring_init(rdev, ring, 64 * 1024);
r = radeon_uvd_init(rdev); if (rdev->has_uvd) {
if (!r) { r = radeon_uvd_init(rdev);
ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX]; if (!r) {
ring->ring_obj = NULL; ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
r600_ring_init(rdev, ring, 4096); ring->ring_obj = NULL;
r600_ring_init(rdev, ring, 4096);
}
} }
rdev->ih.ring_obj = NULL; rdev->ih.ring_obj = NULL;
...@@ -5479,7 +5489,8 @@ void si_fini(struct radeon_device *rdev) ...@@ -5479,7 +5489,8 @@ void si_fini(struct radeon_device *rdev)
radeon_vm_manager_fini(rdev); radeon_vm_manager_fini(rdev);
radeon_ib_pool_fini(rdev); radeon_ib_pool_fini(rdev);
radeon_irq_kms_fini(rdev); radeon_irq_kms_fini(rdev);
radeon_uvd_fini(rdev); if (rdev->has_uvd)
radeon_uvd_fini(rdev);
si_pcie_gart_fini(rdev); si_pcie_gart_fini(rdev);
r600_vram_scratch_fini(rdev); r600_vram_scratch_fini(rdev);
radeon_gem_fini(rdev); radeon_gem_fini(rdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment