aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/cik.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-14 03:39:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-14 03:39:08 -0400
commit2d65a9f48fcdf7866aab6457bc707ca233e0c791 (patch)
treef93e5838d6ac2e59434367f4ff905f7d9c45fc2b /drivers/gpu/drm/radeon/cik.c
parentda92da3638a04894afdca8b99e973ddd20268471 (diff)
parentdfda0df3426483cf5fc7441f23f318edbabecb03 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie: "This is the main git pull for the drm, I pretty much froze major pulls at -rc5/6 time, and haven't had much fallout, so will probably continue doing that. Lots of changes all over, big internal header cleanup to make it clear drm features are legacy things and what are things that modern KMS drivers should be using. Also big move to use the new generic fences in all the TTM drivers. core: atomic prep work, vblank rework changes, allows immediate vblank disables major header reworking and cleanups to better delinate legacy interfaces from what KMS drivers should be using. cursor planes locking fixes ttm: move to generic fences (affects all TTM drivers) ppc64 caching fixes radeon: userptr support, uvd for old asics, reset rework for fence changes better buffer placement changes, dpm feature enablement hdmi audio support fixes intel: Cherryview work, 180 degree rotation, skylake prep work, execlist command submission full ppgtt prep work cursor improvements edid caching, vdd handling improvements nouveau: fence reworking kepler memory clock work gt21x clock work fan control improvements hdmi infoframe fixes DP audio ast: ppc64 fixes caching fix rcar: rcar-du DT support ipuv3: prep work for capture support msm: LVDS support for mdp4, new panel, gpu refactoring exynos: exynos3250 SoC support, drop bad mmap interface, mipi dsi changes, and component match support" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (640 commits) drm/mst: rework payload table allocation to conform better. drm/ast: Fix HW cursor image drm/radeon/kv: add uvd/vce info to dpm debugfs output drm/radeon/ci: add uvd/vce info to dpm debugfs output drm/radeon: export reservation_object from dmabuf to ttm drm/radeon: cope with foreign fences inside the reservation object drm/radeon: cope with foreign fences inside display drm/core: use helper to check driver features drm/radeon/cik: write gfx ucode version to ucode addr reg drm/radeon/si: print full CS when we hit a packet 0 drm/radeon: remove unecessary includes drm/radeon/combios: declare legacy_connector_convert as static drm/radeon/atombios: declare connector convert tables as static drm/radeon: drop btc_get_max_clock_from_voltage_dependency_table drm/radeon/dpm: drop clk/voltage dependency filters for BTC drm/radeon/dpm: drop clk/voltage dependency filters for CI drm/radeon/dpm: drop clk/voltage dependency filters for SI drm/radeon/dpm: drop clk/voltage dependency filters for NI drm/radeon: disable audio when we disable hdmi (v2) drm/radeon: split audio enable between eg and r600 (v2) ...
Diffstat (limited to 'drivers/gpu/drm/radeon/cik.c')
-rw-r--r--drivers/gpu/drm/radeon/cik.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 3d546c606b43..377afa504d2b 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -3959,18 +3959,19 @@ bool cik_semaphore_ring_emit(struct radeon_device *rdev,
3959 * @src_offset: src GPU address 3959 * @src_offset: src GPU address
3960 * @dst_offset: dst GPU address 3960 * @dst_offset: dst GPU address
3961 * @num_gpu_pages: number of GPU pages to xfer 3961 * @num_gpu_pages: number of GPU pages to xfer
3962 * @fence: radeon fence object 3962 * @resv: reservation object to sync to
3963 * 3963 *
3964 * Copy GPU paging using the CP DMA engine (CIK+). 3964 * Copy GPU paging using the CP DMA engine (CIK+).
3965 * Used by the radeon ttm implementation to move pages if 3965 * Used by the radeon ttm implementation to move pages if
3966 * registered as the asic copy callback. 3966 * registered as the asic copy callback.
3967 */ 3967 */
3968int cik_copy_cpdma(struct radeon_device *rdev, 3968struct radeon_fence *cik_copy_cpdma(struct radeon_device *rdev,
3969 uint64_t src_offset, uint64_t dst_offset, 3969 uint64_t src_offset, uint64_t dst_offset,
3970 unsigned num_gpu_pages, 3970 unsigned num_gpu_pages,
3971 struct radeon_fence **fence) 3971 struct reservation_object *resv)
3972{ 3972{
3973 struct radeon_semaphore *sem = NULL; 3973 struct radeon_semaphore *sem = NULL;
3974 struct radeon_fence *fence;
3974 int ring_index = rdev->asic->copy.blit_ring_index; 3975 int ring_index = rdev->asic->copy.blit_ring_index;
3975 struct radeon_ring *ring = &rdev->ring[ring_index]; 3976 struct radeon_ring *ring = &rdev->ring[ring_index];
3976 u32 size_in_bytes, cur_size_in_bytes, control; 3977 u32 size_in_bytes, cur_size_in_bytes, control;
@@ -3980,7 +3981,7 @@ int cik_copy_cpdma(struct radeon_device *rdev,
3980 r = radeon_semaphore_create(rdev, &sem); 3981 r = radeon_semaphore_create(rdev, &sem);
3981 if (r) { 3982 if (r) {
3982 DRM_ERROR("radeon: moving bo (%d).\n", r); 3983 DRM_ERROR("radeon: moving bo (%d).\n", r);
3983 return r; 3984 return ERR_PTR(r);
3984 } 3985 }
3985 3986
3986 size_in_bytes = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT); 3987 size_in_bytes = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT);
@@ -3989,10 +3990,10 @@ int cik_copy_cpdma(struct radeon_device *rdev,
3989 if (r) { 3990 if (r) {
3990 DRM_ERROR("radeon: moving bo (%d).\n", r); 3991 DRM_ERROR("radeon: moving bo (%d).\n", r);
3991 radeon_semaphore_free(rdev, &sem, NULL); 3992 radeon_semaphore_free(rdev, &sem, NULL);
3992 return r; 3993 return ERR_PTR(r);
3993 } 3994 }
3994 3995
3995 radeon_semaphore_sync_to(sem, *fence); 3996 radeon_semaphore_sync_resv(rdev, sem, resv, false);
3996 radeon_semaphore_sync_rings(rdev, sem, ring->idx); 3997 radeon_semaphore_sync_rings(rdev, sem, ring->idx);
3997 3998
3998 for (i = 0; i < num_loops; i++) { 3999 for (i = 0; i < num_loops; i++) {
@@ -4014,17 +4015,17 @@ int cik_copy_cpdma(struct radeon_device *rdev,
4014 dst_offset += cur_size_in_bytes; 4015 dst_offset += cur_size_in_bytes;
4015 } 4016 }
4016 4017
4017 r = radeon_fence_emit(rdev, fence, ring->idx); 4018 r = radeon_fence_emit(rdev, &fence, ring->idx);
4018 if (r) { 4019 if (r) {
4019 radeon_ring_unlock_undo(rdev, ring); 4020 radeon_ring_unlock_undo(rdev, ring);
4020 radeon_semaphore_free(rdev, &sem, NULL); 4021 radeon_semaphore_free(rdev, &sem, NULL);
4021 return r; 4022 return ERR_PTR(r);
4022 } 4023 }
4023 4024
4024 radeon_ring_unlock_commit(rdev, ring, false); 4025 radeon_ring_unlock_commit(rdev, ring, false);
4025 radeon_semaphore_free(rdev, &sem, *fence); 4026 radeon_semaphore_free(rdev, &sem, fence);
4026 4027
4027 return r; 4028 return fence;
4028} 4029}
4029 4030
4030/* 4031/*
@@ -4234,7 +4235,7 @@ static int cik_cp_gfx_load_microcode(struct radeon_device *rdev)
4234 WREG32(CP_PFP_UCODE_ADDR, 0); 4235 WREG32(CP_PFP_UCODE_ADDR, 0);
4235 for (i = 0; i < fw_size; i++) 4236 for (i = 0; i < fw_size; i++)
4236 WREG32(CP_PFP_UCODE_DATA, le32_to_cpup(fw_data++)); 4237 WREG32(CP_PFP_UCODE_DATA, le32_to_cpup(fw_data++));
4237 WREG32(CP_PFP_UCODE_ADDR, 0); 4238 WREG32(CP_PFP_UCODE_ADDR, le32_to_cpu(pfp_hdr->header.ucode_version));
4238 4239
4239 /* CE */ 4240 /* CE */
4240 fw_data = (const __le32 *) 4241 fw_data = (const __le32 *)
@@ -4243,7 +4244,7 @@ static int cik_cp_gfx_load_microcode(struct radeon_device *rdev)
4243 WREG32(CP_CE_UCODE_ADDR, 0); 4244 WREG32(CP_CE_UCODE_ADDR, 0);
4244 for (i = 0; i < fw_size; i++) 4245 for (i = 0; i < fw_size; i++)
4245 WREG32(CP_CE_UCODE_DATA, le32_to_cpup(fw_data++)); 4246 WREG32(CP_CE_UCODE_DATA, le32_to_cpup(fw_data++));
4246 WREG32(CP_CE_UCODE_ADDR, 0); 4247 WREG32(CP_CE_UCODE_ADDR, le32_to_cpu(ce_hdr->header.ucode_version));
4247 4248
4248 /* ME */ 4249 /* ME */
4249 fw_data = (const __be32 *) 4250 fw_data = (const __be32 *)
@@ -4252,7 +4253,8 @@ static int cik_cp_gfx_load_microcode(struct radeon_device *rdev)
4252 WREG32(CP_ME_RAM_WADDR, 0); 4253 WREG32(CP_ME_RAM_WADDR, 0);
4253 for (i = 0; i < fw_size; i++) 4254 for (i = 0; i < fw_size; i++)
4254 WREG32(CP_ME_RAM_DATA, le32_to_cpup(fw_data++)); 4255 WREG32(CP_ME_RAM_DATA, le32_to_cpup(fw_data++));
4255 WREG32(CP_ME_RAM_WADDR, 0); 4256 WREG32(CP_ME_RAM_WADDR, le32_to_cpu(me_hdr->header.ucode_version));
4257 WREG32(CP_ME_RAM_RADDR, le32_to_cpu(me_hdr->header.ucode_version));
4256 } else { 4258 } else {
4257 const __be32 *fw_data; 4259 const __be32 *fw_data;
4258 4260
@@ -4278,10 +4280,6 @@ static int cik_cp_gfx_load_microcode(struct radeon_device *rdev)
4278 WREG32(CP_ME_RAM_WADDR, 0); 4280 WREG32(CP_ME_RAM_WADDR, 0);
4279 } 4281 }
4280 4282
4281 WREG32(CP_PFP_UCODE_ADDR, 0);
4282 WREG32(CP_CE_UCODE_ADDR, 0);
4283 WREG32(CP_ME_RAM_WADDR, 0);
4284 WREG32(CP_ME_RAM_RADDR, 0);
4285 return 0; 4283 return 0;
4286} 4284}
4287 4285
@@ -4563,7 +4561,7 @@ static int cik_cp_compute_load_microcode(struct radeon_device *rdev)
4563 WREG32(CP_MEC_ME1_UCODE_ADDR, 0); 4561 WREG32(CP_MEC_ME1_UCODE_ADDR, 0);
4564 for (i = 0; i < fw_size; i++) 4562 for (i = 0; i < fw_size; i++)
4565 WREG32(CP_MEC_ME1_UCODE_DATA, le32_to_cpup(fw_data++)); 4563 WREG32(CP_MEC_ME1_UCODE_DATA, le32_to_cpup(fw_data++));
4566 WREG32(CP_MEC_ME1_UCODE_ADDR, 0); 4564 WREG32(CP_MEC_ME1_UCODE_ADDR, le32_to_cpu(mec_hdr->header.ucode_version));
4567 4565
4568 /* MEC2 */ 4566 /* MEC2 */
4569 if (rdev->family == CHIP_KAVERI) { 4567 if (rdev->family == CHIP_KAVERI) {
@@ -4577,7 +4575,7 @@ static int cik_cp_compute_load_microcode(struct radeon_device *rdev)
4577 WREG32(CP_MEC_ME2_UCODE_ADDR, 0); 4575 WREG32(CP_MEC_ME2_UCODE_ADDR, 0);
4578 for (i = 0; i < fw_size; i++) 4576 for (i = 0; i < fw_size; i++)
4579 WREG32(CP_MEC_ME2_UCODE_DATA, le32_to_cpup(fw_data++)); 4577 WREG32(CP_MEC_ME2_UCODE_DATA, le32_to_cpup(fw_data++));
4580 WREG32(CP_MEC_ME2_UCODE_ADDR, 0); 4578 WREG32(CP_MEC_ME2_UCODE_ADDR, le32_to_cpu(mec2_hdr->header.ucode_version));
4581 } 4579 }
4582 } else { 4580 } else {
4583 const __be32 *fw_data; 4581 const __be32 *fw_data;
@@ -4689,7 +4687,7 @@ static int cik_mec_init(struct radeon_device *rdev)
4689 r = radeon_bo_create(rdev, 4687 r = radeon_bo_create(rdev,
4690 rdev->mec.num_mec *rdev->mec.num_pipe * MEC_HPD_SIZE * 2, 4688 rdev->mec.num_mec *rdev->mec.num_pipe * MEC_HPD_SIZE * 2,
4691 PAGE_SIZE, true, 4689 PAGE_SIZE, true,
4692 RADEON_GEM_DOMAIN_GTT, 0, NULL, 4690 RADEON_GEM_DOMAIN_GTT, 0, NULL, NULL,
4693 &rdev->mec.hpd_eop_obj); 4691 &rdev->mec.hpd_eop_obj);
4694 if (r) { 4692 if (r) {
4695 dev_warn(rdev->dev, "(%d) create HDP EOP bo failed\n", r); 4693 dev_warn(rdev->dev, "(%d) create HDP EOP bo failed\n", r);
@@ -4860,7 +4858,7 @@ static int cik_cp_compute_resume(struct radeon_device *rdev)
4860 sizeof(struct bonaire_mqd), 4858 sizeof(struct bonaire_mqd),
4861 PAGE_SIZE, true, 4859 PAGE_SIZE, true,
4862 RADEON_GEM_DOMAIN_GTT, 0, NULL, 4860 RADEON_GEM_DOMAIN_GTT, 0, NULL,
4863 &rdev->ring[idx].mqd_obj); 4861 NULL, &rdev->ring[idx].mqd_obj);
4864 if (r) { 4862 if (r) {
4865 dev_warn(rdev->dev, "(%d) create MQD bo failed\n", r); 4863 dev_warn(rdev->dev, "(%d) create MQD bo failed\n", r);
4866 return r; 4864 return r;
@@ -6226,7 +6224,7 @@ static int cik_rlc_resume(struct radeon_device *rdev)
6226 WREG32(RLC_GPM_UCODE_ADDR, 0); 6224 WREG32(RLC_GPM_UCODE_ADDR, 0);
6227 for (i = 0; i < size; i++) 6225 for (i = 0; i < size; i++)
6228 WREG32(RLC_GPM_UCODE_DATA, le32_to_cpup(fw_data++)); 6226 WREG32(RLC_GPM_UCODE_DATA, le32_to_cpup(fw_data++));
6229 WREG32(RLC_GPM_UCODE_ADDR, 0); 6227 WREG32(RLC_GPM_UCODE_ADDR, le32_to_cpu(hdr->header.ucode_version));
6230 } else { 6228 } else {
6231 const __be32 *fw_data; 6229 const __be32 *fw_data;
6232 6230
@@ -8255,8 +8253,10 @@ restart_ih:
8255 } 8253 }
8256 if (queue_hotplug) 8254 if (queue_hotplug)
8257 schedule_work(&rdev->hotplug_work); 8255 schedule_work(&rdev->hotplug_work);
8258 if (queue_reset) 8256 if (queue_reset) {
8259 schedule_work(&rdev->reset_work); 8257 rdev->needs_reset = true;
8258 wake_up_all(&rdev->fence_queue);
8259 }
8260 if (queue_thermal) 8260 if (queue_thermal)
8261 schedule_work(&rdev->pm.dpm.thermal.work); 8261 schedule_work(&rdev->pm.dpm.thermal.work);
8262 rdev->ih.rptr = rptr; 8262 rdev->ih.rptr = rptr;