Sunil Khatri
0016e87054
drm/amdgpu: Clean the functions pointer set as NULL
...
We dont need to set the functions to NULL which arent
needed as global structure members are by default
set to zero or NULL for pointers.
Cc: Leo Liu <leo.liu@amd.com >
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-22 17:50:39 -04:00
Sunil Khatri
8231e3af96
drm/amdgpu: clean the dummy soft_reset functions
...
Remove the dummy soft_reset functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-22 17:50:39 -04:00
Sunil Khatri
f13c7da118
drm/amdgpu: clean the dummy wait_for_idle functions
...
Remove the dummy wait_for_idle functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-22 17:50:39 -04:00
Lijo Lazar
ed3dac4bf9
drm/amdgpu: Check gmc requirement for reset on init
...
Add a callback to check if there is any condition detected by GMC block
for reset on init. One case is if a pending NPS change request is
detected. If reset is done because of NPS switch, refresh NPS info from
discovery table.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-15 11:16:32 -04:00
Sunil Khatri
692d2cd180
drm/amdgpu: update the handle ptr in hw_fini
...
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of hw_fini.
Also update the ip_block ptr where ever needed as
there were cyclic dependency of hw_fini on suspend
and some followed clean up.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-07 14:03:25 -04:00
Sunil Khatri
58608034ed
drm/amdgpu: update the handle ptr in hw_init
...
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of hw_init.
Also update the ip_block ptr where ever needed as
there were cyclic dependency of hw_init on resume.
v2: squash in isp fix
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-07 14:03:25 -04:00
Sunil Khatri
7feb4f3ad8
drm/amdgpu: update the handle ptr in resume
...
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of resume.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-07 14:02:50 -04:00
Sunil Khatri
982d7f9bfe
drm/amdgpu: update the handle ptr in suspend
...
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of suspend.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-07 14:02:45 -04:00
Sunil Khatri
82ae6619a4
drm/amdgpu: update the handle ptr in wait_for_idle
...
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of wait_for_idle.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-07 14:02:36 -04:00
Sunil Khatri
0ef2a1e7af
drm/amdgpu: update the handle ptr in soft_reset
...
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of soft_reset.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-01 17:45:44 -04:00
Sunil Khatri
36aa9ab9c0
drm/amdgpu: update the handle ptr in sw_fini
...
update the *handle to amdgpu_ip_block ptr for all
functions pointers of sw_fini.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-01 17:40:43 -04:00
Sunil Khatri
d5347e8d27
drm/amdgpu: update the handle ptr in sw_init
...
update the *handle to amdgpu_ip_block ptr for all
functions pointers of sw_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-01 17:40:37 -04:00
Sunil Khatri
3138ab2c5b
drm/amdgpu: update the handle ptr in late_init
...
Update the ptr handle to amdgpu_ip_block ptr in all
the functions of late_init function ptr.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-01 17:40:31 -04:00
Sunil Khatri
146b085ead
drm/amdgpu: update the handle ptr in early_init
...
update the handle ptr to amdgpu_ip_block ptr
for all functions pointers on early_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-10-01 17:40:22 -04:00
Lijo Lazar
c75c5285e5
drm/amdgpu: Add PSP reload case to reset-on-init
...
A reset on initialization will be needed if a new PSP TOS needs to be
loaded than the one currently active on the system. This is possible
only on SOCs which support a full device reset which results in unload
of active PSP TOS.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com >
Tested-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-09-26 17:07:16 -04:00
Lijo Lazar
631af731ee
drm/amdgpu: Refactor XGMI reset on init handling
...
Use XGMI hive information to rely on resetting XGMI devices on
initialization rather than using mgpu structure. mgpu structure may have
other devices as well.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Feifei Xu <feifxu@amd.com >
Acked-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com >
Tested-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-09-26 17:06:46 -04:00
Prike Liang
6704dbf719
drm/amdgpu: update suspend status for aborting from deeper suspend
...
There're some other suspend abort cases which can call the noirq
suspend except for executing _S3 method. In those cases need to
process as incomplete suspendsion.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-09-26 17:06:16 -04:00
Alex Deucher
c866201cdc
drm/amdgpu/soc15: use common nbio callback to set remap offset
...
This fixes HDP flushes on systems with non-4K pages.
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-05-08 15:17:06 -04:00
Hawking Zhang
5f571c61b9
drm/amdgpu: Add gfx v9_4_4 ip block
...
Add gfx v9_4_4 ip block support
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-05-02 15:49:16 -04:00
Hawking Zhang
a6bcffa596
drm/amdgpu: Add smu v13_0_14 ip block
...
Add smu v13_0_14 ip block support
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-05-02 15:49:11 -04:00
Hawking Zhang
1dbd59f3f4
drm/amdgpu: Add psp v13_0_14 ip block
...
Add psp v13_0_14 ip block support.
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-05-02 15:49:05 -04:00
Sathishkumar S
c551316e15
drm/amdgpu: update jpeg max decode resolution
...
jpeg ip version v2.1 and higher supports 16kx16k resolution decode
Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-04-26 17:22:40 -04:00
Sunil Khatri
40356542c3
drm/amdgpu: add protype for print ip state
...
Add the protoype for print ip state to be used
to print the registers in devcoredump during
a gpu reset.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-04-26 17:22:39 -04:00
Sunil Khatri
e21d253bd7
drm/amdgpu: add prototype for ip dump
...
Add the prototype to dump ip registers
for all ips of different asics and set
them to NULL for now. Based on the
requirement add a function pointer for
each of them.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-04-26 17:22:39 -04:00
Ma Jun
b2207dc698
drm/amdgpu/pm: Add support for MACO flag checking
...
Add support for MACO flag checking.
MACO mode only works if BACO is supported.
Signed-off-by: Ma Jun <Jun.Ma2@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-04-09 22:07:59 -04:00
Prike Liang
63fcd306c0
drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series
...
Currently, GPU resets can now be performed successfully on the Raven
series. While GPU reset is required for the S3 suspend abort case.
So now can enable gpu reset for S3 abort cases on the Raven series.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-02-26 11:15:25 -05:00
Asad Kamal
5fe4a8d3c6
drm/amdgpu: Remove pcie bw sys entry
...
Remove pcie bw sys entry for asics not supporting
such function
Signed-off-by: Asad Kamal <asad.kamal@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-02-22 10:23:45 -05:00
Asad Kamal
86a08f1af2
Revert "drm/amdgpu: Add pci usage to nbio v7.9"
...
Remove implementation to get pcie usage for nbio v7.9
as pcie usage is handled by fw
This reverts commit 59070fd9cc .
Signed-off-by: Asad Kamal <asad.kamal@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-02-22 10:15:26 -05:00
Hawking Zhang
5c07015619
drm/amdgpu: Do not toggle bif ras irq from guest
...
Only do this from host side.
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Tao Zhou <tao.zhou1@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-02-22 10:14:24 -05:00
Prike Liang
3f719cf22f
drm/amdgpu: reset gpu for s3 suspend abort case
...
In the s3 suspend abort case some type of gfx9 power
rail not turn off from FCH side and this will put the
GPU in an unknown power status, so let's reset the gpu
to a known good power state before reinitialize gpu
device.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-02-07 12:26:22 -05:00
Dave Airlie
c1ee197d64
Backmerge tag 'v6.7-rc5' into drm-next
...
Linux 6.7-rc5
Alex requested this for some amdkfd work relying on the symbols exports.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2023-12-12 11:32:33 +10:00
Lijo Lazar
27b024a88a
drm/amdgpu: Avoid querying DRM MGCG status
...
MP0 v13.0.6 SOCs don't support DRM MGCG.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-12-06 16:05:32 -05:00
Lijo Lazar
81577503ef
drm/amdgpu: Add NULL checks for function pointers
...
Check if function is implemented before making the call.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-12-06 16:05:32 -05:00
Lijo Lazar
ed6e4f0a27
drm/amdgpu: Use another offset for GC 9.4.3 remap
...
The legacy region at 0x7F000 maps to valid registers in GC 9.4.3 SOCs.
Use 0x1A000 offset instead as MMIO register remap region.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-11-29 18:13:35 -05:00
Lijo Lazar
36fd9969fa
drm/amdgpu: Use another offset for GC 9.4.3 remap
...
The legacy region at 0x7F000 maps to valid registers in GC 9.4.3 SOCs.
Use 0x1A000 offset instead as MMIO register remap region.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-11-29 16:49:35 -05:00
Lijo Lazar
081a6eda2b
drm/amdgpu: Read aquavanjaram PCIE register state
...
Add support to read aqua vanjaram PCIE register state
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-11-29 16:49:35 -05:00
Mario Limonciello
1a6513de49
drm/amd: Move AMD_IS_APU check for ASPM into top level function
...
There is no need for every ASIC driver to perform the same check.
Move the duplicated code into amdgpu_device_should_use_aspm().
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-26 18:41:23 -04:00
Lijo Lazar
4e8303cf2c
drm/amdgpu: Use function for IP version check
...
Use an inline function for version check. Gives more flexibility to
handle any format changes.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-20 12:23:28 -04:00
Lijo Lazar
6b7d211740
drm/amdgpu: Fix refclk reporting for SMU v13.0.6
...
SMU v13.0.6 SOCs have 100MHz reference clock.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-06 14:37:03 -04:00
Candice Li
a76b2870bd
drm/amdgpu: Add RREG64_PCIE_EXT/WREG64_PCIE_EXT functions
...
Add 64bits register access support on register whose address
is greater than 32bits.
Signed-off-by: Candice Li <candice.li@amd.com >
Reviewed-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-06 14:34:18 -04:00
Lijo Lazar
c4b9dc5313
drm/amdgpu: Add SMU v13.0.6 default reset methods
...
For APUs with SMU v13.0.6, mode-2 reset is kept as default and for
others mode-1 is the default reset method.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Asad Kamal <asad.kamal@amd.com >
Tested-by: Asad Kamal <asad.kamal@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-30 15:31:37 -04:00
Asad Kamal
59070fd9cc
drm/amdgpu: Add pci usage to nbio v7.9
...
Add implementation to get pcie usage for nbio v7.9.
Signed-off-by: Asad Kamal <asad.kamal@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Shiwu Zhang <shiwu.zhang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-09 09:46:05 -04:00
Lijo Lazar
50709d18f4
drm/amdgpu: Add pci replay count to nbio v7.9
...
Add implementation to get pcie replay count for nbio v7.9.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-07 17:14:06 -04:00
Alex Deucher
a15a77c8e6
Revert "drm/amdgpu: change the reference clock for raven/raven2"
...
This reverts commit fbc24293ca .
This results in inconsistent timing reported via asynchronous
GPU queries.
Link: https://lists.freedesktop.org/archives/amd-gfx/2023-May/093731.html
Cc: Jesse.Zhang@amd.com
Cc: michel@daenzer.net
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 12:40:01 -04:00
Likun Gao
20a29ac091
drm/amdgpu: retire set_vga_state for some ASIC
...
set_vga_state operation only allowed on SI generation
ASIC, retire the realted function on those ASIC which
did not do anything.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 10:41:50 -04:00
Lijo Lazar
01ef47477d
drm/amdgpu: Add FGCG for GFX v9.4.3
...
It's not fine grain, behaves similar to MGCG.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:55:33 -04:00
Lijo Lazar
8f2ccaaa37
drm/amdgpu: Add mode-2 reset in SMU v13.0.6
...
Modifications to mode-2 reset flow for SMU v13.0.6 ASICs.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Reviewed-by: Asad Kamal <asad.kamal@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:55:12 -04:00
Asad kamal
9faf929fbf
drm/amdgpu: Enable CG for IH v4.4.2
...
Enable clock gating on IH v4.4.2 versions.
Signed-off-by: Asad kamal <asad.kamal@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:53:49 -04:00
Lijo Lazar
cbf9e46ab0
drm/amdgpu: Enable MGCG on SDMAv4.4.2
...
Enable clock gating on SDMAv4.4.2 versions. Leave memory light sleep to
default.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:52:46 -04:00
Sonny Jiang
7b08b2e1ca
drm/amdgpu: add vcn_4_0_3 codec query
...
Add support for vcn_4_0_3 video codec query
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com >
Reviewed-by: James Zhu <James.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:52:39 -04:00