aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
Commit message (Collapse)AuthorAgeFilesLines
...
* drm/amdgpu: fix incorrect VCN revision in SRIOVLeslie Shi2021-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | Guest OS will setup VCN instance 1 which is disabled as an enabled instance and execute initialization work on it, but this causes VCN ib ring test failure on the disabled VCN instance during modprobe: amdgpu 0000:00:08.0: amdgpu: ring vcn_enc_1.0 uses VM inv eng 5 on hub 1 amdgpu 0000:00:08.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on vcn_dec_0 (-110). amdgpu 0000:00:08.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on vcn_enc_0.0 (-110). [drm:amdgpu_device_delayed_init_work_handler [amdgpu]] *ERROR* ib ring test failed (-110). v2: drop amdgpu_discovery_get_vcn_version and rename sriov_config to vcn_config v3: modify VCN's revision in SR-IOV and bare-metal Fixes: baf3f8f3740625 ("drm/amdgpu: handle SRIOV VCN revision parsing") Signed-off-by: Leslie Shi <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Guchun Chen <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: handle SRIOV VCN revision parsingAlex Deucher2021-12-021-0/+1
| | | | | | | | | | | For SR-IOV, the IP discovery revision number encodes additional information. Handle that case here. v2: drop additional IP versions Reviewed-by: Guchun Chen <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Consolidate VCN firmware setup codeAlex Deucher2021-10-221-0/+2
| | | | | | | | | | | Roughly the same code was present in all VCN versions. Consolidate it into a single function. v2: use AMDGPU_UCODE_ID_VCN + i, check if num_inst >= 2 Signed-off-by: Alex Deucher <[email protected]> Reviewed-by: Leo Liu <[email protected]> Reviewed-by: James Zhu <[email protected]>
* drm/amdgpu/vcn: set the priority for each encode ringSatyajit Sahu2021-09-011-0/+2
| | | | | | | | | VCN has multiple rings. Set the proper priority level for each encode ring while initializing. Signed-off-by: Satyajit Sahu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/amdgpu: Use IP discovery data to determine VCN enablement instead of ↵Bokun Zhang2021-06-181-0/+13
| | | | | | | | | | | | | | MMSCH In the past, we use MMSCH to determine whether a VCN is enabled or not. This is not reliable since after a FLR, MMSCH may report junk data. It is better to use IP discovery data. Signed-off-by: Bokun Zhang <[email protected]> Signed-off-by: Peng Ju Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: share scheduler score on VCN3 instancesChristian König2021-04-091-0/+1
| | | | | | | | | | | The VCN3 instances can do both decode as well as encode. Share the scheduler load balancing score and remove fixing encode to only the second instance. Signed-off-by: Christian König <[email protected]> Reviewed-and-Tested-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn3.0: add wptr/rptr reset/update for share memorySonny Jiang2021-02-241-2/+11
| | | | | | | | | Because of dpg, the rptr/wptr need to be saved on fw shared memory, and restore them back in RBC_RB_RPTR/WPTR in kernel at power up. Signed-off-by: Sonny Jiang <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: update header to support dec software ringJames Zhu2020-11-241-0/+30
| | | | | | | | | Add macro, structure and function prototype to support vcn dec software ring. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: vcn and jpeg ring synchronizationVeerabadhran G2020-10-141-0/+1
| | | | | | | | | | Synchronize the ring usage for vcn1 and jpeg1 to workaround a hardware bug. Signed-off-by: Veerabadhran Gopalakrishnan <[email protected]> Acked-by: Christian König <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
* drm/amdgpu/vcn: merge shared memory into vcpuJames Zhu2020-07-211-1/+0
| | | | | | | | Merge vcn firmware shared memory bo into vcn vcpu bo. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* Revert "drm/amdgpu/vcn: add shared memory restore after wake up from sleep."James Zhu2020-07-211-1/+0
| | | | | | | | | This reverts commit 21b704d78352c289d31697824ceea7ad0ff4ce59. To merge vcn firmware shared memory bo into vcn vcpu bo. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: rename macro for VCN2.0 2.5 and 3.0Boyuan Zhang2020-07-011-3/+3
| | | | | | | | | | | | Rename SOC15_DPG_MODE_OFFSET_2_0, RREG32_SOC15_DPG_MODE_2_0 and WREG32_SOC15_DPG_MODE_2_0 for VCN2.0, VCN2.5 and VCN3.0. These three macros are used VCN2.0, VCN2.5 and VCN3.0, therefore rename it to be a general name. Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: James Zhu <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: rename macro for VCN1.0Boyuan Zhang2020-07-011-2/+2
| | | | | | | | | | | Rename RREG32_SOC15_DPG_MODE and WREG32_SOC15_DPG_MODE for VCN1.0 These two macros are used specifically for VCN1.0, therefore rename it from general name to VCN1.0 specific name. Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: James Zhu <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add internal reg offset translation for VCN inst 1Boyuan Zhang2020-07-011-1/+13
| | | | | | | | | | | | Add range for vcn instance 1 for translation for internal register offset, which is needed for VCN3.0 V2: update description. Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: James Zhu <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add VCN3.0 support for Sienna_CichlidLeo Liu2020-07-011-0/+1
| | | | | | | | | With basic IP block functions and ring functions Signed-off-by: Leo Liu <[email protected]> Reviewed-by: James Zhu <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: add shared memory restore after wake up from sleep.James Zhu2020-04-091-0/+1
| | | | | | | | | | VCN shared memory needs restore after wake up during S3 test. v2: Allocate shared memory saved_bo at sw_init and free it in sw_fini. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Feifei Xu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: rework sched_list generationNirmoy Das2020-04-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Generate HW IP's sched_list in amdgpu_ring_init() instead of amdgpu_ctx.c. This makes amdgpu_ctx_init_compute_sched(), ring.has_high_prio and amdgpu_ctx_init_sched() unnecessary. This patch also stores sched_list for all HW IPs in one big array in struct amdgpu_device which makes amdgpu_ctx_init_entity() much more leaner. v2: fix a coding style issue do not use drm hw_ip const to populate amdgpu_ring_type enum v3: remove ctx reference and move sched array and num_sched to a struct use num_scheds to detect uninitialized scheduler list v4: use array_index_nospec for user space controlled variables fix possible checkpatch.pl warnings Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: Add firmware share memory supportJames Zhu2020-04-011-0/+24
| | | | | | | | | Added firmware share memory support for VCN. Current multiple queue mode is enabled only. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: fix race condition issue for dpg unpause mode switchJames Zhu2020-04-011-0/+1
| | | | | | | | | | | | | | | | Couldn't only rely on enc fence to decide switching to dpg unpaude mode. Since a enc thread may not schedule a fence in time during multiple threads running situation. v3: 1. Rename enc_submission_cnt to dpg_enc_submission_cnt 2. Add dpg_enc_submission_cnt check in idle_work_handler v4: Remove extra counter check, and reduce counter before idle work schedule Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: fix race condition issue for vcn startJames Zhu2020-04-011-0/+2
| | | | | | | | | | | | | | | | Fix race condition issue when multiple vcn starts are called. v2: Removed checking the return value of cancel_delayed_work_sync() to prevent possible races here. v3: Add total_submission_cnt to avoid gate power unexpectedly. v4: Remove extra counter check, and reduce counter before idle work schedule Signed-off-by: James Zhu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn2.5: fix DPG mode power off issue on instance 1James Zhu2020-02-111-2/+1
| | | | | | | | | Support pause_state for multiple instance, and it will fix vcn2.5 DPG mode power off issue on instance 1. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: use inst_idx relacing instJames Zhu2020-01-271-12/+12
| | | | | | | | Use inst_idx relacing inst in SOC15_DPG_MODE macro to avoid confusion. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: fix typo errorJames Zhu2020-01-271-1/+1
| | | | | | | | Fix typo error, should be inst_idx instead of inst. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: move macro from vcn2.0 to share amdgpu_vcn (v2)James Zhu2020-01-161-0/+5
| | | | | | | | | | Move macro from vcn2.0 to amdgpu_vcn to share with vcn2.5 v2: squash in macro fix Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: support multiple instance direct SRAM read and write (v2)James Zhu2020-01-161-23/+23
| | | | | | | | | | Add multiple instance direct SRAM read and write support for vcn2.5 v2: squash in indexing fix Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: support multiple-instance dpg pause modeJames Zhu2020-01-161-1/+1
| | | | | | | | Add multiple-instance dpg pause mode support for VCN2.5 Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* amd/amdgpu: add sched array to IPs with multiple run-queuesNirmoy Das2019-12-181-2/+7
| | | | | | | | | | | This sched array can be passed on to entity creation routine instead of manually creating such sched array on every context creation. v2: squash in missing break fix Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn1.0: use its own idle handler and begin use funcsLeo Liu2019-12-181-0/+3
| | | | | | | | | | | | | | Because VCN1.0 power management and DPG mode are managed together with JPEG1.0 under both HW and FW, so separated them from general VCN code. Also the multiple instances case got removed, since VCN1.0 HW just have a single instance. v2: override work func with vcn1.0's own Signed-off-by: Leo Liu <[email protected]> Reviewed-by: James Zhu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move JPEG2.5 out from VCN2.5Leo Liu2019-11-191-5/+0
| | | | | | | | And clean up the duplicated stuff Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/amdgpu/vcn_v2_0: Mark RB commands as KMD commandsThong Thai2019-07-311-0/+1
| | | | | | | | | | | Sets the CMD_SOURCE bit for VCN 2.0 Decoder Ring Buffer commands. This bit was previously set by the RBC HW on older firmware. Newer firmware uses a SW RBC and this bit has to be set by the driver. Signed-off-by: Thong Thai <[email protected]> Reviewed-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add harvest support for ArcturusJames Zhu2019-07-181-0/+4
| | | | | | | | Add VCN harvest support for Arcturus Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: modify amdgpu_vcn to support multiple instancesJames Zhu2019-07-181-7/+17
| | | | | | | | | Arcturus has dual-VCN. Need Restruct amdgpu_device::vcn to support multiple vcns. There are no any logical changes here Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/VCN2: put IB internal registers offset to structureLeo Liu2019-07-181-0/+6
| | | | | | | | | So the ring functions can be shared with different VCN versions with different internal registers offsets Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/VCN: implement indirect DPG SRAM modeLeo Liu2019-06-211-0/+3
| | | | | | | | SRAM will be programmed by PSP Signed-off-by: Leo Liu <[email protected]> Reviewed-by: James Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/VCN: add buffer for indirect SRAM usageLeo Liu2019-06-211-0/+6
| | | | | | | | This will be used later for indirect SRAM mode Signed-off-by: Leo Liu <[email protected]> Reviewed-by: James Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/VCN2.0: add direct SRAM read and writeLeo Liu2019-06-211-0/+48
| | | | | | | | | This will be the basic and used for DPG mode Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: James Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/VCN2.0: remove powergating for UVDW tileLeo Liu2019-06-211-0/+1
| | | | | | | | | | | No UVDW tile any more from VCN2.0, so mark out related fields. It fixes error: "[drm] Register(0) [mmUVD_PGFSM_STATUS] failed to reach value 0x002aaaaa != 0x00aaaaaa" Signed-off-by: Leo Liu <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add initial VCN2.0 support (v2)Leo Liu2019-06-211-0/+1
| | | | | | | | | | | | | VCN (Video Core Next) is the video encode/decode block. Porting over the same functions from VCN1.0 v2: squash in updates (Alex) Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: James Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add JPEG2.0 decode ring testLeo Liu2019-06-211-0/+1
| | | | | | | | Use register from JPEG tile, the UVD tile reg won't work for JPEG Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add VCN2.0 decode ib testLeo Liu2019-06-211-1/+5
| | | | | | | | Add internal register offset for registers involving in ib tests Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add VCN2.0 decode ring testLeo Liu2019-06-211-0/+5
| | | | | | | | Add internal register offset for registers involving in ring tests Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: make VCN DPG pause mode detached from general VCNLeo Liu2019-05-241-0/+2
| | | | | | | | It should be attached to VCN 1.0 Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move the VCN DPG mode read and write to VCNLeo Liu2019-05-241-0/+21
| | | | | | | | Since this is VCN specific and only used by VCN Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn:Correct VCN cache window definitionJames Zhu2018-10-091-3/+3
| | | | | | | | | Correct VCN cache window definition. The old one is reused from UVD, and it is not fully correct. Signed-off-by: James Zhu <[email protected]> Acked-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu:Add DPG pause stateJames Zhu2018-09-271-0/+11
| | | | | | | | | | Add DPG pause state to support VCN DPG mode. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Huang Rui <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu:No action when VCN PG state is unchangedJames Zhu2018-09-271-0/+1
| | | | | | | | | | When VCN PG state is unchanged, it is unnecessary to reset power gate state Signed-off-by: James Zhu <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add vcn jpeg ib testBoyuan Zhang2018-06-151-0/+1
| | | | | | | | Add an ib test for vcn jpeg. Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add vcn jpeg ring testBoyuan Zhang2018-06-151-0/+2
| | | | | | | | Add a ring test for vcn jpeg. Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add vcn jpeg ringBoyuan Zhang2018-06-151-0/+1
| | | | | | | | | | Add jpeg to amdgpu_vcn v2: remove unnecessary scheduler entity Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove unnecessary scheduler entity for VCNLeo Liu2018-05-291-2/+0
| | | | | | | | It should be stateless, and no need for scheduler to take care specially. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>