aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
Commit message (Collapse)AuthorAgeFilesLines
* drm/amdgpu/vcn: add a helper framework for engine resetsAlex Deucher2025-07-161-1/+5
| | | | | | | | | | With engine resets we reset all queues on the engine rather than just a single queue. Add a framework to handle this similar to SDMA. Reviewed-by: Sathishkumar S <[email protected]> Tested-by: Sathishkumar S <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: using separate VCN1_AON_SOC offsetRuijing Dong2025-05-071-1/+0
| | | | | | | | | | | | | | | | | | | VCN1_AON_SOC_ADDRESS_3_0 offset varies on different VCN generations, the issue in vcn4.0.5 is caused by a different VCN1_AON_SOC_ADDRESS_3_0 offset. This patch does the following: 1. use the same offset for other VCN generations. 2. use the vcn4.0.5 special offset 3. update vcn_4_0 and vcn_5_0 Acked-by: Saleemkhan Jamadar <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 5c89ceda9984498b28716944633a9a01cbb2c90d) Cc: [email protected]
* drm/amdgpu/vcn: fix ref counting for ring based profile handlingAlex Deucher2025-03-191-0/+3
| | | | | | | | | | | | | | | | | We need to make sure the workload profile ref counts are balanced. This isn't currently the case because we can increment the count on submissions, but the decrement may be delayed as work comes in. Track when we enable the workload profile so the references are balanced. v2: switch to a mutex and active flag v3: fix mutex init Fixes: 1443dd3c67f6 ("drm/amd/pm: fix and simplify workload handling") Cc: Yang Wang <[email protected]> Cc: Kenneth Feng <[email protected]> Reviewed-by: Kenneth Feng <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: optimize firmware storageAlex Deucher2025-02-271-1/+3
| | | | | | | | If each instance uses the same fw image, only store one copy in the driver. Acked-by: Boyuan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: add a generic helper for set_power_gating_stateAlex Deucher2025-02-271-0/+3
| | | | | | | It's common for all VCN variants. Reviewed-by: Boyuan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: add new per instance callback for powergatingAlex Deucher2025-02-271-0/+2
| | | | | | | This is per instance so add a new function pointer for it. Reviewed-by: Boyuan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: adjust pause_dpg_mode function signatureAlex Deucher2025-02-271-2/+1
| | | | | | | | | | | Change it to take a vcn instance rather than adev to align with the vcn instance changes. TODO: clean up the function internals to use the vinst state directly rather than accessing it indirectly via adev->vcn.inst[]. Reviewed-by: Boyuan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: switch vcn helpers to be instance basedAlex Deucher2025-02-271-6/+6
| | | | | | | Pass the instance to the helpers. Reviewed-by: Boyuan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: move more instanced data to vcn_instanceAlex Deucher2025-02-271-8/+9
| | | | | | | | | | | Move more per instance data into the per instance structure. v2: index instances directly on vcn1.0 and 2.0 to make it clear that they only support a single instance (Lijo) v3: fix typo on vcn 2.5 Reviewed-by: Boyuan Zhang <[email protected]> (v2) Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: make powergating status per instanceAlex Deucher2025-02-271-1/+1
| | | | | | | | | | Store it per instance so we can track it per instance. v2: index instances directly on vcn1.0 and 2.0 to make it clear that they only support a single instance (Lijo) Reviewed-by: Boyuan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: switch work handler to be per instanceAlex Deucher2025-02-271-3/+5
| | | | | | | | | | | Have a separate work handler for each VCN instance. This paves the way for per instance VCN power gating at runtime. v2: index instances directly on vcn1.0 and 2.0 to make it clear that they only support a single instance (Lijo) Reviewed-by: Boyuan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Check RRMT status for VCN v4.0.3Lijo Lazar2025-02-131-0/+7
| | | | | | | | | | RRMT could get dynamically enabled/disabled by PSP firmware. Read the status from register for reading RRMT status. For VFs, this is not accessible, hence assume that it's always disabled for now. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Sathishkumar S <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Add VCN_5_0_1 supportSonny Jiang2024-12-101-2/+12
| | | | | | | | | | Add vcn support for VCN_5_0_1 v2: rebase, squash in fixes (Alex) Signed-off-by: Sonny Jiang <[email protected]> Acked-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Add amdgpu_vcn_sched_mask debugfsSathishkumar S2024-12-101-0/+1
| | | | | | | | | | Add debugfs entry to enable or disable job submission to specific vcn instances. The entry is created only when there is more than an instance and is unified queue type. Signed-off-by: Sathishkumar S <[email protected]> Reviewed-by: Jesse Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move per inst variables to amdgpu_vcn_instBoyuan Zhang2024-12-101-3/+3
| | | | | | | | | | | | | Move all per instance variables from amdgpu_vcn to amdgpu_vcn_inst. Move adev->vcn.fw[i] from amdgpu_vcn to amdgpu_vcn_inst. Move adev->vcn.vcn_config[i] from amdgpu_vcn to amdgpu_vcn_inst. Move adev->vcn.vcn_codec_disable_mask[i] from amdgpu_vcn to amdgpu_vcn_inst. Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Add sysfs interface for vcn reset mask[email protected]2024-11-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Add the sysfs interface for vcn: vcn_reset_mask The interface is read-only and show the resets supported by the IP. For example, full adapter reset (mode1/mode2/BACO/etc), soft reset, queue reset, and pipe reset. V2: the sysfs node returns a text string instead of some flags (Christian) V2: the sysfs node returns a text string instead of some flags (Christian) v3: add a generic helper which takes the ring as parameter and print the strings in the order they are applied (Christian) check amdgpu_gpu_recovery before creating sysfs file itself, and initialize supported_reset_types in IP version files (Lijo) v4: s/sdma/vcn/ in the reset mask setup Acked-by: Christian König <[email protected]> Signed-off-by: Jesse Zhang <[email protected]> Suggested-by: Alex Deucher <[email protected]> Reviewed-by: Tim Huang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Save VCN shared memory with init resetLijo Lazar2024-10-221-0/+1
| | | | | | | | | | | | | | | VCN shared memory is in framebuffer and there are some flags initialized during sw_init. Ideally, such programming should be during hw_init. Make sure the flags are saved during reset on initialization since that reset will affect frame buffer region. For clarity, separate it out to another function. Fixes: 1e4acf4d93cd ("drm/amdgpu: Add reset on init handler for XGMI") Signed-off-by: Lijo Lazar <[email protected]> Reported-by: Hao Zhou <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add vcn ip dump ptr in vcn global structSunil Khatri2024-08-161-0/+3
| | | | | | | | | Add pointer to the vcn ip dump in the vcn global structure to be accessible for all vcn version via global adev. Signed-off-by: Sunil Khatri <[email protected]> Acked-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Update kmd_fw_shared for VCN5Yinjie Yao2024-08-131-1/+4
| | | | | | | | | kmd_fw_shared changed in VCN5 Signed-off-by: Yinjie Yao <[email protected]> Reviewed-by: Ruijing Dong <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* Revert "drm/amdgpu: add vcn ip dump ptr in vcn global struct"Sunil Khatri2024-08-131-3/+0
| | | | | | | | This reverts commit f3392e662efdc095f10109f588aa4f3be86f7eb5. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Sunil Khatri <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add vcn ip dump ptr in vcn global structSunil Khatri2024-07-271-0/+3
| | | | | | | | | Add pointer to the vcn ip dump in the vcn global structure to be accessible for all vcn version via global adev. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Sunil Khatri <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: identify unified queue in sw initBoyuan Zhang2024-07-161-0/+1
| | | | | | | | | | | | Determine whether VCN using unified queue in sw_init, instead of calling functions later on. v2: fix coding style Signed-off-by: Boyuan Zhang <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: update fw_share for VCN5Sonny Jiang2024-04-261-0/+10
| | | | | | | | kmd_fw_shared changed in VCN5 Signed-off-by: Sonny Jiang <[email protected]> Reviewed-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: enable vcn1 fw load for VCN 4_0_6Saleemkhan Jamadar2024-03-201-1/+1
| | | | | | | | | | | | v1 - update the fw header for each vcn instance (Veera) VCN1 has different FW binary in VCN v4_0_6. Add changes to load the VCN1 fw binary Signed-off-by: Saleemkhan Jamadar <[email protected]> Reviewed-by: Veerabadhran Gopalakrishnan <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add VCN_5_0_0 IP block supportSonny Jiang2024-02-121-0/+42
| | | | | | | | | | | | Add VCN_5_0_0 IP init, ring functions, DPG support. v2: squash in warning fixes (Alex) v3: squash in block and ring init, boot, doorbell enablement, DPG support (Alex) Signed-off-by: Sonny Jiang <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P3Bokun Zhang2023-10-201-7/+41
| | | | | | | | | - Update VCN header for RB decouple feature - Add metadata struct, metadata will be placed after each RB Signed-off-by: Bokun Zhang <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Fix complex macros errorSrinivasan Shanmugam2023-10-051-1/+1
| | | | | | | | | | | | | | | | Fixes the below: ERROR: Macros with complex values should be enclosed in parentheses WARNING: macros should not use a trailing semicolon +#define amdgpu_inc_vram_lost(adev) atomic_inc(&((adev)->vram_lost_counter)); Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "Pan, Xinhui" <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Enabling FW workaround through shared memory for VCN4_0_2sguttula2023-07-251-0/+9
| | | | | | | | | | This patch will enable VCN FW workaround using DRM KEY INJECT WORKAROUND method, which is helping in fixing the secure playback. Signed-off-by: sguttula <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* Revert "drm/amdgpu:update kernel vcn ring test"Saleemkhan Jamadar2023-07-181-4/+1
| | | | | | | | | | VCN FW depncencies revert it to unblock others This reverts commit f3fa86f5c778e258cd5c01bb420d4639bb393bd0. Signed-off-by: Saleemkhan Jamadar <[email protected]> Acked-by: Veerabadhran Gopalakrishnan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu:update kernel vcn ring testSaleemkhan Jamadar2023-07-121-1/+4
| | | | | | | | | | | | | | add session context buffer to decoder ring test. v5 - clear the session ct buffer (Christian) v4 - data type, explain change of ib size change (Christian) v3 - indent and v2 changes correction. (Christian) v2 - put the buffer at the end of the IB (Christian) Signed-off-by: Saleemkhan Jamadar <[email protected]> Acked-by: Leo Liu <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: use psp_execute_load_ip_fw insteadLang Yu2023-07-121-0/+3
| | | | | | | | | Replace the old ones with psp_execute_load_ip_fw. Suggested-by: Lijo Lazar <[email protected]> Signed-off-by: Lang Yu <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: separate ras irq from vcn instance irq for UVD_POISONHoratio Zhang2023-06-091-0/+3
| | | | | | | | | | | | | | | | | | Separate vcn RAS poison consumption handling from the instance irq, and register dedicated ras_poison_irq src and funcs for UVD_POISON. v2: - Separate ras irq from vcn instance irq - Improve the subject and code comments v3: - Split the patch into three parts - Improve the code comments Suggested-by: Hawking Zhang <[email protected]> Signed-off-by: Horatio Zhang <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Use logical ids for VCN/JPEG v4.0.3Lijo Lazar2023-06-091-12/+17
| | | | | | | | | | Address VCN/JPEG instances using logical ids. Whenever register access is required, get the physical instance using GET_INST. Signed-off-by: Lijo Lazar <[email protected]> Acked-by: Leo Liu <[email protected]> Tested-by: James Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Add instance mask for VCN and JPEGLijo Lazar2023-06-091-0/+1
| | | | | | | | | | Keep an instance mask formed by physical instance numbers for VCN and JPEG IPs. Populate the mask from discovery table information. Signed-off-by: Lijo Lazar <[email protected]> Acked-by: Leo Liu <[email protected]> Tested-by: James Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: extend max instancesLe Ma2023-06-091-1/+1
| | | | | | | | Number of instances is extended. Signed-off-by: Le Ma <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: update vcn header to support multiple AIDsJames Zhu2023-06-091-0/+3
| | | | | | | | Add aid_id in vcn header to support multiple AIDs Signed-off-by: James Zhu <[email protected]> Acked-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Move vcn ras block init to ras sw_initHawking Zhang2023-03-131-1/+1
| | | | | | | | | | | | Initialize vcn ras block only when vcn ip block supports ras features. Driver queries ras capabilities after early_init, ras block init needs to be moved to sw_int. Signed-off-by: Hawking Zhang <[email protected]> Reviewed-by: Stanley Yang <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd: Load VCN microcode during early_initMario Limonciello2023-01-091-0/+1
| | | | | | | | | | | Simplifies the code so that all VCN versions will get the firmware name from `amdgpu_ucode_ip_version_decode` and then use this filename to load microcode as part of the early_init process. Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: define common vcn_set_ras_funcsTao Zhou2022-11-171-0/+1
| | | | | | | | So the code can be reused. Signed-off-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: update vcn4 fw shared data structureRuijing Dong2022-09-291-1/+7
| | | | | | | | | update VF_RB_SETUP_FLAG, add SMU_DPM_INTERFACE_FLAG, and corresponding change in VCN4. Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: Add sriov VCN v4_0 unified queue supportJane Jian2022-09-011-0/+13
| | | | | | | | | | Enable unified queue support for sriov, abandon all previous multi-queue settings Acked-by: Christian König <[email protected]> Signed-off-by: Jane Jian <[email protected]> Reviewed-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: add unified queue ib testRuijing Dong2022-06-211-0/+1
| | | | | | | | | - add unified queue headers - add unified queue ib tests Acked-by: Leo Liu <[email protected]> Signed-off-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: Add vcn ras poison consumption event handlingMohammad Zafar Ziya2022-05-101-0/+5
| | | | | | | | | | | | Add vcn ras poison consumption event handling V2: Removed default poison consumption handling function cb Signed-off-by: Mohammad Zafar Ziya <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add VCN4 ip block supportLeo Liu2022-05-041-0/+16
| | | | | | | | | Add VCN 4.0 initialization and decoder/encoder ring functions. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: James Zhu <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move out asic specific definition from common headerJames Zhu2022-05-041-2/+0
| | | | | | | | | | Move out asic specific definition from common header. Acked-by: Alex Deucher <[email protected]> Reviewed-by: Leo Liu <[email protected]> Reviewed-by: Sonny Jiang <[email protected]> Signed-off-by: James Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/discovery: add a function to parse the vcn info tableAlex Deucher2022-04-281-0/+6
| | | | | | | To get the codec disable fuse mask. Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: Add vcn ras supportMohammad Zafar Ziya2022-03-281-0/+9
| | | | | | | | | | | VCN block ras feature support addition V2: default ras callback removed Signed-off-by: Mohammad Zafar Ziya <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn3: send smu interface typeBoyuan Zhang2022-03-281-0/+7
| | | | | | | | | | For VCN FW to detect ASIC type, in order to use different mailbox registers. V2: simplify codes and fix format issue. Signed-off-by: Boyuan Zhang <[email protected]> Acked-by Huang Rui <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: Add vcn firmware logRuijing Dong2022-03-041-0/+4
| | | | | | | | | vcn fwlog is for debugging purpose only, by default, it is disabled. Signed-off-by: Ruijing Dong <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/vcn: Update fw shared data structureRuijing Dong2022-03-041-2/+24
| | | | | | | | Add fw log in fw shared data structure. Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>