| .. | .. |
|---|
| 26 | 26 | */ |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | #include <linux/firmware.h> |
|---|
| 29 | | -#include <drm/drmP.h> |
|---|
| 29 | + |
|---|
| 30 | 30 | #include "amdgpu.h" |
|---|
| 31 | 31 | #include "amdgpu_vce.h" |
|---|
| 32 | 32 | #include "vid.h" |
|---|
| .. | .. |
|---|
| 37 | 37 | #include "gca/gfx_8_0_d.h" |
|---|
| 38 | 38 | #include "smu/smu_7_1_2_d.h" |
|---|
| 39 | 39 | #include "smu/smu_7_1_2_sh_mask.h" |
|---|
| 40 | | -#include "gca/gfx_8_0_d.h" |
|---|
| 41 | 40 | #include "gca/gfx_8_0_sh_mask.h" |
|---|
| 42 | 41 | #include "ivsrcid/ivsrcid_vislands30.h" |
|---|
| 43 | 42 | |
|---|
| .. | .. |
|---|
| 423 | 422 | int r, i; |
|---|
| 424 | 423 | |
|---|
| 425 | 424 | /* VCE */ |
|---|
| 426 | | - r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_VCE_TRAP, &adev->vce.irq); |
|---|
| 425 | + r = amdgpu_irq_add_id(adev, AMDGPU_IRQ_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_VCE_TRAP, &adev->vce.irq); |
|---|
| 427 | 426 | if (r) |
|---|
| 428 | 427 | return r; |
|---|
| 429 | 428 | |
|---|
| .. | .. |
|---|
| 443 | 442 | for (i = 0; i < adev->vce.num_rings; i++) { |
|---|
| 444 | 443 | ring = &adev->vce.ring[i]; |
|---|
| 445 | 444 | sprintf(ring->name, "vce%d", i); |
|---|
| 446 | | - r = amdgpu_ring_init(adev, ring, 512, &adev->vce.irq, 0); |
|---|
| 445 | + r = amdgpu_ring_init(adev, ring, 512, &adev->vce.irq, 0, |
|---|
| 446 | + AMDGPU_RING_PRIO_DEFAULT); |
|---|
| 447 | 447 | if (r) |
|---|
| 448 | 448 | return r; |
|---|
| 449 | 449 | } |
|---|
| .. | .. |
|---|
| 474 | 474 | |
|---|
| 475 | 475 | amdgpu_asic_set_vce_clocks(adev, 10000, 10000); |
|---|
| 476 | 476 | |
|---|
| 477 | | - for (i = 0; i < adev->vce.num_rings; i++) |
|---|
| 478 | | - adev->vce.ring[i].ready = false; |
|---|
| 479 | | - |
|---|
| 480 | 477 | for (i = 0; i < adev->vce.num_rings; i++) { |
|---|
| 481 | | - r = amdgpu_ring_test_ring(&adev->vce.ring[i]); |
|---|
| 478 | + r = amdgpu_ring_test_helper(&adev->vce.ring[i]); |
|---|
| 482 | 479 | if (r) |
|---|
| 483 | 480 | return r; |
|---|
| 484 | | - else |
|---|
| 485 | | - adev->vce.ring[i].ready = true; |
|---|
| 486 | 481 | } |
|---|
| 487 | 482 | |
|---|
| 488 | 483 | DRM_INFO("VCE initialized successfully.\n"); |
|---|
| .. | .. |
|---|
| 745 | 740 | enum amd_clockgating_state state) |
|---|
| 746 | 741 | { |
|---|
| 747 | 742 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
|---|
| 748 | | - bool enable = (state == AMD_CG_STATE_GATE) ? true : false; |
|---|
| 743 | + bool enable = (state == AMD_CG_STATE_GATE); |
|---|
| 749 | 744 | int i; |
|---|
| 750 | 745 | |
|---|
| 751 | 746 | if (!(adev->cg_flags & AMD_CG_SUPPORT_VCE_MGCG)) |
|---|
| .. | .. |
|---|
| 838 | 833 | } |
|---|
| 839 | 834 | |
|---|
| 840 | 835 | static void vce_v3_0_ring_emit_ib(struct amdgpu_ring *ring, |
|---|
| 841 | | - struct amdgpu_ib *ib, unsigned int vmid, bool ctx_switch) |
|---|
| 836 | + struct amdgpu_job *job, |
|---|
| 837 | + struct amdgpu_ib *ib, |
|---|
| 838 | + uint32_t flags) |
|---|
| 842 | 839 | { |
|---|
| 840 | + unsigned vmid = AMDGPU_JOB_GET_VMID(job); |
|---|
| 841 | + |
|---|
| 843 | 842 | amdgpu_ring_write(ring, VCE_CMD_IB_VM); |
|---|
| 844 | 843 | amdgpu_ring_write(ring, vmid); |
|---|
| 845 | 844 | amdgpu_ring_write(ring, lower_32_bits(ib->gpu_addr)); |
|---|
| .. | .. |
|---|
| 896 | 895 | .align_mask = 0xf, |
|---|
| 897 | 896 | .nop = VCE_CMD_NO_OP, |
|---|
| 898 | 897 | .support_64bit_ptrs = false, |
|---|
| 898 | + .no_user_fence = true, |
|---|
| 899 | 899 | .get_rptr = vce_v3_0_ring_get_rptr, |
|---|
| 900 | 900 | .get_wptr = vce_v3_0_ring_get_wptr, |
|---|
| 901 | 901 | .set_wptr = vce_v3_0_ring_set_wptr, |
|---|
| .. | .. |
|---|
| 919 | 919 | .align_mask = 0xf, |
|---|
| 920 | 920 | .nop = VCE_CMD_NO_OP, |
|---|
| 921 | 921 | .support_64bit_ptrs = false, |
|---|
| 922 | + .no_user_fence = true, |
|---|
| 922 | 923 | .get_rptr = vce_v3_0_ring_get_rptr, |
|---|
| 923 | 924 | .get_wptr = vce_v3_0_ring_get_wptr, |
|---|
| 924 | 925 | .set_wptr = vce_v3_0_ring_set_wptr, |
|---|