]> Git Repo - linux.git/log
linux.git
12 months agodrm/amd/display: Removed redundant @ symbol to fix kernel-doc warnings in -next repo
R SUNDAR [Wed, 6 Mar 2024 03:24:14 +0000 (08:54 +0530)]
drm/amd/display: Removed redundant @ symbol to fix kernel-doc warnings in -next repo

For linux-next repository.

./drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h:1: warning: no structured comments found
./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:132: warning: Incorrect use of kernel-doc format:          * @@overlap_only: Whether overlapping of different planes is allowed.
./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:132: warning: Incorrect use of kernel-doc format:          * @@overlap_only: Whether overlapping of different planes is allowed.
./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:1: warning: no structured comments found
./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:132: warning: Incorrect use of kernel-doc format:          * @@overlap_only: Whether overlapping of different planes is allowed.
./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:162: warning: Function parameter or struct member 'pre_multiplied_alpha' not described in 'mpcc_blnd_cfg'

Signed-off-by: R SUNDAR <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/pm: wait for completion of the EnableGfxImu message
Tim Huang [Tue, 30 Jan 2024 09:15:57 +0000 (17:15 +0800)]
drm/amd/pm: wait for completion of the EnableGfxImu message

Wait for completion of sending the EnableGfxImu message
when using the PSP FW loading for SMU ip v14.0.

Signed-off-by: Tim Huang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/soc21: add mode2 asic reset for SMU IP v14.0.1
lima1002 [Wed, 7 Feb 2024 06:48:29 +0000 (14:48 +0800)]
drm/amdgpu/soc21: add mode2 asic reset for SMU IP v14.0.1

Set the default reset method to mode2 for SMU IP v14.0.1

Signed-off-by: lima1002 <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add smu 14.0.1 support
Yifan Zhang [Fri, 5 Jan 2024 06:09:52 +0000 (14:09 +0800)]
drm/amdgpu: add smu 14.0.1 support

This patch to add smu 14.0.1 support.

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add VPE 6.1.1 discovery support
Alex Deucher [Tue, 13 Feb 2024 18:28:36 +0000 (13:28 -0500)]
drm/amdgpu: add VPE 6.1.1 discovery support

Enable VPE 6.1.1.

Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/vpe: add VPE 6.1.1 support
Lang Yu [Wed, 15 Nov 2023 03:56:14 +0000 (11:56 +0800)]
drm/amdgpu/vpe: add VPE 6.1.1 support

Add initial support for VPE 6.1.1.

v2: squash in updates (Alex)

Signed-off-by: Lang Yu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/vpe: don't emit cond exec command under collaborate mode
Lang Yu [Wed, 31 Jan 2024 07:40:42 +0000 (15:40 +0800)]
drm/amdgpu/vpe: don't emit cond exec command under collaborate mode

Not ready now.

Signed-off-by: Lang Yu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/vpe: add collaborate mode support for VPE
Lang Yu [Mon, 16 Jan 2023 05:11:59 +0000 (13:11 +0800)]
drm/amdgpu/vpe: add collaborate mode support for VPE

Under clollaborate mode, multiple VPE instances share a ring buferr
and work together to finish a job.

Signed-off-by: Lang Yu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/vpe: add PRED_EXE and COLLAB_SYNC OPCODE
Lang Yu [Wed, 31 Jan 2024 07:57:18 +0000 (15:57 +0800)]
drm/amdgpu/vpe: add PRED_EXE and COLLAB_SYNC OPCODE

To support multi VPE collaborate mode.

Signed-off-by: Lang Yu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/vpe: add multi instance VPE support
Lang Yu [Wed, 30 Nov 2022 08:09:35 +0000 (16:09 +0800)]
drm/amdgpu/vpe: add multi instance VPE support

Add support for multi instance VPE processing.

Signed-off-by: Lang Yu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/discovery: add nbif v6_3_1 ip block
Likun Gao [Thu, 9 Mar 2023 06:28:54 +0000 (14:28 +0800)]
drm/amdgpu/discovery: add nbif v6_3_1 ip block

Add nbif v6_3_1 ip block.

Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Add nbif v6_3_1 ip block support
Hawking Zhang [Wed, 8 Mar 2023 12:49:45 +0000 (20:49 +0800)]
drm/amdgpu: Add nbif v6_3_1 ip block support

Add nbif v6_3_1 ip block support.

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Add pcie v6_1_0 ip headers (v5)
Hawking Zhang [Mon, 3 Jul 2023 13:54:17 +0000 (21:54 +0800)]
drm/amdgpu: Add pcie v6_1_0 ip headers (v5)

v1: Add pcie v6_1_0 register offset and shift masks
    header files. (Hawking)
v2: Update pcie v6_1_0 register offset and shift masks
    header files to RE2. (Likun)
v3: Update pcie v6_1_0 register offset and shift masks
    header files to RE2.5. (Likun)
v4: Update pcie v6_1_0 register offset and shift masks
    header files to RE3. (Likun)
v5: Updates (Alex)

Signed-off-by: Hawking Zhang <[email protected]>
Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Add nbif v6_3_1 ip headers (v5)
Hawking Zhang [Mon, 3 Jul 2023 13:40:56 +0000 (21:40 +0800)]
drm/amdgpu: Add nbif v6_3_1 ip headers (v5)

v1: Add nbif v6_3_1 register offset and shift masks
    header files. (Hawking)
v2: Update nbif v6_3_1 register offset and shift masks
    header files to RE2. (Likun)
v3: Update nbif v6_3_1 register offset and shift masks
    header files to RE2.5. (Likun)
v4: Update nbif v6_3_1 register offset and shift masks
    header files to RE3. (Likun)
v5: Updates (Alex)

Signed-off-by: Hawking Zhang <[email protected]>
Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdkfd: make kfd_class constant
Ricardo B. Marliere [Tue, 5 Mar 2024 12:15:14 +0000 (09:15 -0300)]
drm/amdkfd: make kfd_class constant

Since commit 43a7206b0963 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the kfd_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Cc: Greg Kroah-Hartman <[email protected]>
Suggested-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>
Signed-off-by: Felix Kuehling <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add ring timeout information in devcoredump
Sunil Khatri [Fri, 1 Mar 2024 12:05:35 +0000 (17:35 +0530)]
drm/amdgpu: add ring timeout information in devcoredump

Add ring timeout related information in the amdgpu
devcoredump file for debugging purposes.

During the gpu recovery process the registered call
is triggered and add the debug information in data
file created by devcoredump framework under the
directory /sys/class/devcoredump/devcdx/

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add dcn3.5.1 support
Yifan Zhang [Tue, 5 Mar 2024 01:15:18 +0000 (09:15 +0800)]
drm/amdgpu: add dcn3.5.1 support

This patch to add dcn3.5.1 support.

Signed-off-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdkfd: Use SQC when TCP would fail in gfx10.1 context save
Laurent Morichetti [Sat, 17 Feb 2024 04:16:41 +0000 (20:16 -0800)]
drm/amdkfd: Use SQC when TCP would fail in gfx10.1 context save

Similarly to gfx9, gfx10.1 drops vector stores when an xnack error is
raised. To work around this issue, use scalar stores instead of vector
stores when trapsts.xnack_error == 1.

Signed-off-by: Laurent Morichetti <[email protected]>
Reviewed-by: Jay Cornwall <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdkfd: Increase the size of the memory reserved for the TBA
Laurent Morichetti [Thu, 22 Feb 2024 23:49:18 +0000 (15:49 -0800)]
drm/amdkfd: Increase the size of the memory reserved for the TBA

In a future commit, the cwsr trap handler code size for gfx10.1 will
increase to slightly above the one page mark. Since the TMA does not
need to be page aligned, and only 2 pointers are stored in it, push
the TMA offset by 2 KiB and keep the TBA+TMA reserved memory size
to two pages.

Signed-off-by: Laurent Morichetti <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: disable ring_muxer if mcbp is off
Pierre-Eric Pelloux-Prayer [Fri, 16 Feb 2024 15:20:44 +0000 (16:20 +0100)]
drm/amdgpu: disable ring_muxer if mcbp is off

Using the ring_muxer without preemption adds overhead for no
reason since mcbp cannot be triggered.

Moving back to a single queue in this case also helps when
high priority app are used: in this case the gpu_scheduler
priority handling will work as expected - much better than
ring_muxer with its 2 independant schedulers competing for
the same hardware queue.

This change requires moving amdgpu_device_set_mcbp above
amdgpu_device_ip_early_init because we use adev->gfx.mcbp.

Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Christian König <[email protected]>
Acked-by: Jiadong Zhu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/pm: disable pp_dpm_dcefclk node for gfx 11.0.3 sriov
Yang Wang [Mon, 4 Mar 2024 09:38:38 +0000 (17:38 +0800)]
drm/amd/pm: disable pp_dpm_dcefclk node for gfx 11.0.3 sriov

the dce dpm is not available on gfx 11.0.3 sriov device.

Signed-off-by: Yang Wang <[email protected]>
Reviewed-by: Kenneth Feng <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: remove unused code
Jesse Zhang [Tue, 5 Mar 2024 02:22:57 +0000 (10:22 +0800)]
drm/amdgpu: remove unused code

Remove the unused function - amdgpu_vm_pt_is_root_clean
and remove the impossible condition

v1: entries == 0 is not possible any more,
    so this condition could probably be removed (Felix)

Signed-off-by: Jesse Zhang <[email protected]>
Suggested-by:Felix Kuehling <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: workaround to avoid SET_Q_MODE packets v2
Christian König [Thu, 17 Aug 2023 09:33:34 +0000 (11:33 +0200)]
drm/amdgpu: workaround to avoid SET_Q_MODE packets v2

It turned out that executing the SET_Q_MODE packet on every submission
creates to much overhead.

Implement a workaround which allows skipping the SET_Q_MODE packet if
subsequent submissions all use the same parameters.

v2: add a NULL check for ring_obj

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: cleanup conditional execution
Christian König [Tue, 15 Aug 2023 06:34:27 +0000 (08:34 +0200)]
drm/amdgpu: cleanup conditional execution

First of all calculating the number of dw to patch into a
conditional execution is not something HW generation specific.
This is just standard ring buffer calculations. While at it also
reduce the BUG_ON() into WARN_ON().

Then instead of a random bit pattern use 0 as default value for
the number of dw skipped, this way it's not mandatory any more
to patch the conditional execution.

And last make the address to check a parameter of the
conditional execution instead of getting this from the ring.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Use rpm_mode flag instead of checking it again for rpm
Ma Jun [Wed, 28 Feb 2024 06:14:22 +0000 (14:14 +0800)]
drm/amdgpu: Use rpm_mode flag instead of checking it again for rpm

Because the rpm_mode flag is already set when the driver
is initialized, we use it directly for runtime suspend/resume
instead of checking it again

Signed-off-by: Ma Jun <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/pm: Fix the error of pwm1_enable setting
Ma Jun [Fri, 1 Mar 2024 07:36:58 +0000 (15:36 +0800)]
drm/amdgpu/pm: Fix the error of pwm1_enable setting

Fix the pwm_mode value error which used for
pwm1_enable setting

Signed-off-by: Ma Jun <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: change vm->task_info handling
Shashank Sharma [Thu, 18 Jan 2024 19:15:42 +0000 (20:15 +0100)]
drm/amdgpu: change vm->task_info handling

This patch changes the handling and lifecycle of vm->task_info object.
The major changes are:
- vm->task_info is a dynamically allocated ptr now, and its uasge is
  reference counted.
- introducing two new helper funcs for task_info lifecycle management
    - amdgpu_vm_get_task_info: reference counts up task_info before
      returning this info
    - amdgpu_vm_put_task_info: reference counts down task_info
- last put to task_info() frees task_info from the vm.

This patch also does logistical changes required for existing usage
of vm->task_info.

V2: Do not block all the prints when task_info not found (Felix)

V3: Fixed review comments from Felix
   - Fix wrong indentation
   - No debug message for -ENOMEM
   - Add NULL check for task_info
   - Do not duplicate the debug messages (ti vs no ti)
   - Get first reference of task_info in vm_init(), put last
     in vm_fini()

V4: Fixed review comments from Felix
   - fix double reference increment in create_task_info
   - change amdgpu_vm_get_task_info_pasid
   - additional changes in amdgpu_gem.c while porting

Cc: Christian Koenig <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Felix Kuehling <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Shashank Sharma <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: handle range offsets in VRR ranges
Alex Deucher [Wed, 28 Feb 2024 20:59:22 +0000 (15:59 -0500)]
drm/amd/display: handle range offsets in VRR ranges

Need to check the offset bits for values greater than 255.

v2: also update amdgpu_dm_connector values.

Suggested-by: Mano Ségransan <[email protected]>
Tested-by: Mano Ségransan <[email protected]>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3203
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: add amdgpu_dm support for DCN351
Hamza Mahfooz [Mon, 26 Feb 2024 14:11:00 +0000 (09:11 -0500)]
drm/amd/display: add amdgpu_dm support for DCN351

Add Display Manager specific changes for DCN3.5.1.

Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: add DC changes for DCN351
Hamza Mahfooz [Fri, 23 Feb 2024 14:40:25 +0000 (09:40 -0500)]
drm/amd/display: add DC changes for DCN351

Add DC support for DCN 3.5.1.

Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: add DCN351 IRQ changes
Hamza Mahfooz [Thu, 22 Feb 2024 18:00:37 +0000 (13:00 -0500)]
drm/amd/display: add DCN351 IRQ changes

Add DCN3.5.1 interrupt support.

Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: add DMUB source files and changes for DCN351
Hamza Mahfooz [Wed, 21 Feb 2024 17:13:49 +0000 (12:13 -0500)]
drm/amd/display: add DMUB source files and changes for DCN351

DMUB support is required to light-up displays.

Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd: add register headers for DCN351
Hamza Mahfooz [Mon, 19 Feb 2024 15:05:29 +0000 (10:05 -0500)]
drm/amd: add register headers for DCN351

Add register headers for DCN 3.5.1.

Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: add DCN351 version identifiers
Hamza Mahfooz [Fri, 16 Feb 2024 20:02:21 +0000 (15:02 -0500)]
drm/amd/display: add DCN351 version identifiers

Add DCN3.5.1 ASIC identifiers.

Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agoRevert "drm/amdgpu: remove vm sanity check from amdgpu_vm_make_compute" for Raven
Jesse Zhang [Thu, 29 Feb 2024 06:00:14 +0000 (14:00 +0800)]
Revert "drm/amdgpu: remove vm sanity check from amdgpu_vm_make_compute" for Raven

fix the issue:
"amdgpu: Failed to create process VM object".

[Why]when amdgpu initialized, seq64 do mampping and update bo mapping in vm page table.
But when clifo run. It also initializes a vm for a process device through the function kfd_process_device_init_vm and ensure the root PD is clean through the function amdgpu_vm_pt_is_root_clean.
So they have a conflict, and clinfo  always failed.

v1:
  - remove all the pte_supports_ats stuff from the amdgpu_vm code (Felix)

Signed-off-by: Jesse Zhang <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: remove misleading amdgpu_pmops_runtime_idle() comment
Bjorn Helgaas [Thu, 29 Feb 2024 18:11:06 +0000 (12:11 -0600)]
drm/amdgpu: remove misleading amdgpu_pmops_runtime_idle() comment

After 4020c2280233 ("drm/amdgpu: don't runtime suspend if there are
displays attached (v3)"), "ret" is unconditionally set later before being
used, so there's point in initializing it and the associated comment is no
longer meaningful.

Remove the comment and the unnecessary initialization.

Signed-off-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agoReapply "Revert drm/amd/display: Enable Freesync Video Mode by default"
Alex Deucher [Tue, 27 Feb 2024 18:08:12 +0000 (13:08 -0500)]
Reapply "Revert drm/amd/display: Enable Freesync Video Mode by default"

This reverts commit 11b92df8a2f7f4605ccc764ce6ae4a72760674df.

This conflicts with how compositors want to handle VRR.  Now
that compositors actually handle VRR, we probably don't need
freesync video.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2985
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agoRevert "drm/amd: Remove freesync video mode amdgpu parameter"
Alex Deucher [Tue, 27 Feb 2024 18:03:40 +0000 (13:03 -0500)]
Revert "drm/amd: Remove freesync video mode amdgpu parameter"

This reverts commit e94e787e37b99645e7c02d20d0a1ba0f8a18a82a.

This conflicts with how compositors want to handle VRR.  Now
that compositors actually handle VRR, we probably don't need
freesync video.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2985
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: check dc_link before dereferencing
Melissa Wen [Tue, 27 Feb 2024 19:08:25 +0000 (16:08 -0300)]
drm/amd/display: check dc_link before dereferencing

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6683 amdgpu_dm_connector_funcs_force()
warn: variable dereferenced before check 'dc_link' (see line 6663)

Fixes: 967176179215 ("drm/amd/display: fix null-pointer dereference on edid reading")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Melissa Wen <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add deferred error check for UMC v12 address query
Tao Zhou [Thu, 29 Feb 2024 03:41:25 +0000 (11:41 +0800)]
drm/amdgpu: add deferred error check for UMC v12 address query

Both RAS UE and deferred errors need page retirement.

Signed-off-by: Tao Zhou <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/swsmu: modify the gfx activity scaling
Li Ma [Wed, 28 Feb 2024 09:36:28 +0000 (17:36 +0800)]
drm/amd/swsmu: modify the gfx activity scaling

Add an if condition for gfx activity because the scaling has been changed after smu fw version 5d4600.
And remove a warning log.

Signed-off-by: Li Ma <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agoamd/amdkfd: remove unused parameter
Eric Huang [Wed, 28 Feb 2024 14:59:26 +0000 (09:59 -0500)]
amd/amdkfd: remove unused parameter

The adev can be found from bo by amdgpu_ttm_adev(bo->tbo.bdev),
and adev is also not used in the function
amdgpu_amdkfd_map_gtt_bo_to_gart().

Signed-off-by: Eric Huang <[email protected]>
Reviewed-by: Harish Kasiviswanathan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/pm: Fix esm reg mask use to get pcie speed
Asad Kamal [Wed, 28 Feb 2024 04:24:15 +0000 (12:24 +0800)]
drm/amd/pm: Fix esm reg mask use to get pcie speed

Fix mask used for esm ctrl register to get pcie link
speed on smu_v11_0_3, smu_v13_0_2 & smu_v13_0_6

Fixes: 511a95552ec8 ("drm/amd/pm: Add SMU 13.0.6 support")
Fixes: c05d1c401572 ("drm/amd/swsmu: add aldebaran smu13 ip support (v3)")
Fixes: f1c378593153 ("drm/amd/powerplay: add Arcturus support for gpu metrics export")
Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/pm: Skip reporting pcie width/speed on vfs
Asad Kamal [Tue, 27 Feb 2024 17:26:48 +0000 (01:26 +0800)]
drm/amd/pm: Skip reporting pcie width/speed on vfs

Skip reporting pcie link width/speed on vfs for
smu_v13_0_6 & smu_v13_0_2

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Yang Wang <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: enable pp_od_clk_voltage for gfx 9.4.3 SRIOV
Yang Wang [Wed, 28 Feb 2024 03:10:54 +0000 (11:10 +0800)]
drm/amdgpu: enable pp_od_clk_voltage for gfx 9.4.3 SRIOV

v1:
enabel pp_od_clk_voltage node for gfx 9.4.3 SRIOV and BM.

v2:
add onevf check for gfx 9.4.3

v3:
refine code check order to make function clearly.

Signed-off-by: Yang Wang <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agoRevert "drm/amd/pm: resolve reboot exception for si oland"
Alex Deucher [Wed, 9 Aug 2023 19:06:00 +0000 (15:06 -0400)]
Revert "drm/amd/pm: resolve reboot exception for si oland"

This reverts commit e490d60a2f76bff636c68ce4fe34c1b6c34bbd86.

This causes hangs on SI when DC is enabled and errors on driver
reboot and power off cycles.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3216
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2755
Reviewed-by: Yang Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()
Srinivasan Shanmugam [Fri, 23 Feb 2024 11:38:16 +0000 (17:08 +0530)]
drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()

This ensures that the memory mapped by ioremap for adev->rmmio, is
properly handled in amdgpu_device_init(). If the function exits early
due to an error, the memory is unmapped. If the function completes
successfully, the memory remains mapped.

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4337 amdgpu_device_init() warn: 'adev->rmmio' from ioremap() not released on lines: 4035,4045,4051,4058,4068,4337

Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Fix missing break in ATOM_ARG_IMM Case of atom_get_src_int()
Srinivasan Shanmugam [Sat, 24 Feb 2024 02:18:52 +0000 (07:48 +0530)]
drm/amdgpu: Fix missing break in ATOM_ARG_IMM Case of atom_get_src_int()

Missing break statement in the ATOM_ARG_IMM case of a switch statement,
adds the missing break statement, ensuring that the program's control
flow is as intended.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/atom.c:323 atom_get_src_int() warn: ignoring unreachable code.

Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
Cc: Jammy Zhou <[email protected]>
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/pm: Increase SMUv13.0.6 mode-2 reset time
Lijo Lazar [Mon, 26 Feb 2024 10:34:36 +0000 (16:04 +0530)]
drm/amd/pm: Increase SMUv13.0.6 mode-2 reset time

On SOCs with SMUv13.0.6, mode-2 reset takes a bit longer. Wait for 200ms
before trying to restore config space after mode-2 reset.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Asad Kamal <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd: Drop abm_level property
Mario Limonciello [Fri, 16 Feb 2024 15:33:34 +0000 (09:33 -0600)]
drm/amd: Drop abm_level property

This vendor specific property has never been used by userspace
software and conflicts with the panel_power_savings sysfs file.
That is a compositor and user could fight over the same data.

Fixes: 63d0b87213a0 ("drm/amd/display: add panel_power_savings sysfs entry to eDP connectors")
Suggested-by: Harry Wentland <[email protected]>
Cc: Hamza Mahfooz <[email protected]>
Cc: "Sun peng Li (Leo)" <[email protected]>
Reviewed-by: Harry Wentland <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdkfd: Add partition id field to location_id
Lijo Lazar [Mon, 22 Jan 2024 05:10:49 +0000 (10:40 +0530)]
drm/amdkfd: Add partition id field to location_id

On devices which have multi-partition nodes, keep partition id in
location_id[31:28].

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Jonathan Kim <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: reserve more memory for MES runtime DRAM
Tim Huang [Fri, 23 Feb 2024 02:54:45 +0000 (10:54 +0800)]
drm/amdgpu: reserve more memory for MES runtime DRAM

This patch fixes a MES firmware boot failure issue
when backdoor loading the MES firmware.

MES firmware runtime DRAM size is changed to 512k,
the driver needs to reserve this amount of memory in
FB, otherwise adjacent memory will be overwritten by
the MES firmware startup code.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Enable gpu reset for S3 abort cases on Raven series
Prike Liang [Thu, 22 Feb 2024 12:56:59 +0000 (20:56 +0800)]
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 <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/pm: Fix the power1_min_cap value
Ma Jun [Thu, 22 Feb 2024 09:08:42 +0000 (17:08 +0800)]
drm/amdgpu/pm: Fix the power1_min_cap value

It's unreasonable to use 0 as the power1_min_cap when
OD is disabled. So, use the same lower limit as the value
used when OD is enabled.

Fixes: 1958946858a6 ("drm/amd/pm: Support for getting power1_cap_min value")
Signed-off-by: Ma Jun <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Do not program SQ_TIMEOUT_CONFIG in SRIOV
Victor Lu [Tue, 19 Dec 2023 00:38:26 +0000 (19:38 -0500)]
drm/amdgpu: Do not program SQ_TIMEOUT_CONFIG in SRIOV

VF should not program this register.

Signed-off-by: Victor Lu <[email protected]>
Reviewed-by: Zhigang Luo <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Fix ineffective ras_mask settings
Stanley.Yang [Wed, 21 Feb 2024 09:42:20 +0000 (17:42 +0800)]
drm/amdgpu: Fix ineffective ras_mask settings

Check amdgpu_ras_mask to fix ineffective ras_mask setting
due to special asic without sram ecc enable but with poison
supported.

Signed-off-by: Stanley.Yang <[email protected]>
Reviewed-by: Tao Zhou <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdkfd: Skip packet submission on fatal error
Lijo Lazar [Thu, 22 Feb 2024 09:24:50 +0000 (14:54 +0530)]
drm/amdkfd: Skip packet submission on fatal error

If fatal error is detected, packet submission won't go through. Return
error in such cases. Also, avoid waiting for fence when fatal error is
detected.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Asad Kamal <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Add fatal error detected flag
Lijo Lazar [Thu, 22 Feb 2024 08:46:57 +0000 (14:16 +0530)]
drm/amdgpu: Add fatal error detected flag

For a RAS error that needs a full reset to recover, set the fatal error
status. Clear the status once the device is reset.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Asad Kamal <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Prevent potential buffer overflow in map_hw_resources
Srinivasan Shanmugam [Tue, 20 Feb 2024 03:44:25 +0000 (09:14 +0530)]
drm/amd/display: Prevent potential buffer overflow in map_hw_resources

Adds a check in the map_hw_resources function to prevent a potential
buffer overflow. The function was accessing arrays using an index that
could potentially be greater than the size of the arrays, leading to a
buffer overflow.

Adds a check to ensure that the index is within the bounds of the
arrays. If the index is out of bounds, an error message is printed and
break it will continue execution with just ignoring extra data early to
prevent the buffer overflow.

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_wrapper.c:79 map_hw_resources() error: buffer overflow 'dml2->v20.scratch.dml_to_dc_pipe_mapping.disp_cfg_to_stream_id' 6 <= 7
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_wrapper.c:81 map_hw_resources() error: buffer overflow 'dml2->v20.scratch.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id' 6 <= 7

Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2")
Cc: Rodrigo Siqueira <[email protected]>
Cc: Roman Li <[email protected]>
Cc: Qingqing Zhuo <[email protected]>
Cc: Aurabindo Pillai <[email protected]>
Cc: Tom Chung <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Suggested-by: Roman Li <[email protected]>
Reviewed-by: Roman Li <[email protected]>
Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Fix the runtime resume failure issue
Ma Jun [Wed, 21 Feb 2024 09:16:49 +0000 (17:16 +0800)]
drm/amdgpu: Fix the runtime resume failure issue

Don't set power state flag when system enter runtime suspend,
or it may cause runtime resume failure issue.

Fixes: 3a9626c816db ("drm/amd: Stop evicting resources on APUs in suspend")
Signed-off-by: Ma Jun <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: fix null-pointer dereference on edid reading
Melissa Wen [Fri, 16 Feb 2024 12:23:19 +0000 (09:23 -0300)]
drm/amd/display: fix null-pointer dereference on edid reading

Use i2c adapter when there isn't aux_mode in dc_link to fix a
null-pointer derefence that happens when running
igt@kms_force_connector_basic in a system with DCN2.1 and HDMI connector
detected as below:

[  +0.178146] BUG: kernel NULL pointer dereference, address: 00000000000004c0
[  +0.000010] #PF: supervisor read access in kernel mode
[  +0.000005] #PF: error_code(0x0000) - not-present page
[  +0.000004] PGD 0 P4D 0
[  +0.000006] Oops: 0000 [#1] PREEMPT SMP NOPTI
[  +0.000006] CPU: 15 PID: 2368 Comm: kms_force_conne Not tainted 6.5.0-asdn+ #152
[  +0.000005] Hardware name: HP HP ENVY x360 Convertible 13-ay1xxx/8929, BIOS F.01 07/14/2021
[  +0.000004] RIP: 0010:i2c_transfer+0xd/0x100
[  +0.000011] Code: ea fc ff ff 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 41 54 55 53 <48> 8b 47 10 48 89 fb 48 83 38 00 0f 84 b3 00 00 00 83 3d 2f 80 16
[  +0.000004] RSP: 0018:ffff9c4f89c0fad0 EFLAGS: 00010246
[  +0.000005] RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000000080
[  +0.000003] RDX: 0000000000000002 RSI: ffff9c4f89c0fb20 RDI: 00000000000004b0
[  +0.000003] RBP: ffff9c4f89c0fb80 R08: 0000000000000080 R09: ffff8d8e0b15b980
[  +0.000003] R10: 00000000000380e0 R11: 0000000000000000 R12: 0000000000000080
[  +0.000002] R13: 0000000000000002 R14: ffff9c4f89c0fb0e R15: ffff9c4f89c0fb0f
[  +0.000004] FS:  00007f9ad2176c40(0000) GS:ffff8d90fe9c0000(0000) knlGS:0000000000000000
[  +0.000003] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  +0.000004] CR2: 00000000000004c0 CR3: 0000000121bc4000 CR4: 0000000000750ee0
[  +0.000003] PKRU: 55555554
[  +0.000003] Call Trace:
[  +0.000006]  <TASK>
[  +0.000006]  ? __die+0x23/0x70
[  +0.000011]  ? page_fault_oops+0x17d/0x4c0
[  +0.000008]  ? preempt_count_add+0x6e/0xa0
[  +0.000008]  ? srso_alias_return_thunk+0x5/0x7f
[  +0.000011]  ? exc_page_fault+0x7f/0x180
[  +0.000009]  ? asm_exc_page_fault+0x26/0x30
[  +0.000013]  ? i2c_transfer+0xd/0x100
[  +0.000010]  drm_do_probe_ddc_edid+0xc2/0x140 [drm]
[  +0.000067]  ? srso_alias_return_thunk+0x5/0x7f
[  +0.000006]  ? _drm_do_get_edid+0x97/0x3c0 [drm]
[  +0.000043]  ? __pfx_drm_do_probe_ddc_edid+0x10/0x10 [drm]
[  +0.000042]  edid_block_read+0x3b/0xd0 [drm]
[  +0.000043]  _drm_do_get_edid+0xb6/0x3c0 [drm]
[  +0.000041]  ? __pfx_drm_do_probe_ddc_edid+0x10/0x10 [drm]
[  +0.000043]  drm_edid_read_custom+0x37/0xd0 [drm]
[  +0.000044]  amdgpu_dm_connector_mode_valid+0x129/0x1d0 [amdgpu]
[  +0.000153]  drm_connector_mode_valid+0x3b/0x60 [drm_kms_helper]
[  +0.000000]  __drm_helper_update_and_validate+0xfe/0x3c0 [drm_kms_helper]
[  +0.000000]  ? amdgpu_dm_connector_get_modes+0xb6/0x520 [amdgpu]
[  +0.000000]  ? srso_alias_return_thunk+0x5/0x7f
[  +0.000000]  drm_helper_probe_single_connector_modes+0x2ab/0x540 [drm_kms_helper]
[  +0.000000]  status_store+0xb2/0x1f0 [drm]
[  +0.000000]  kernfs_fop_write_iter+0x136/0x1d0
[  +0.000000]  vfs_write+0x24d/0x440
[  +0.000000]  ksys_write+0x6f/0xf0
[  +0.000000]  do_syscall_64+0x60/0xc0
[  +0.000000]  ? srso_alias_return_thunk+0x5/0x7f
[  +0.000000]  ? syscall_exit_to_user_mode+0x2b/0x40
[  +0.000000]  ? srso_alias_return_thunk+0x5/0x7f
[  +0.000000]  ? do_syscall_64+0x6c/0xc0
[  +0.000000]  ? do_syscall_64+0x6c/0xc0
[  +0.000000]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[  +0.000000] RIP: 0033:0x7f9ad46b4b00
[  +0.000000] Code: 40 00 48 8b 15 19 b3 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 80 3d e1 3a 0e 00 00 74 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 48 83 ec 28 48 89
[  +0.000000] RSP: 002b:00007ffcbd3bd6d8 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
[  +0.000000] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9ad46b4b00
[  +0.000000] RDX: 0000000000000002 RSI: 00007f9ad48a7417 RDI: 0000000000000009
[  +0.000000] RBP: 0000000000000002 R08: 0000000000000064 R09: 0000000000000000
[  +0.000000] R10: 0000000000000000 R11: 0000000000000202 R12: 00007f9ad48a7417
[  +0.000000] R13: 0000000000000009 R14: 00007ffcbd3bd760 R15: 0000000000000001
[  +0.000000]  </TASK>
[  +0.000000] Modules linked in: ctr ccm rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash algif_skcipher af_alg bnep btusb btrtl btbcm btintel btmtk bluetooth uvcvideo videobuf2_vmalloc sha3_generic videobuf2_memops uvc jitterentropy_rng videobuf2_v4l2 videodev drbg videobuf2_common ansi_cprng mc ecdh_generic ecc qrtr binfmt_misc hid_sensor_accel_3d hid_sensor_magn_3d hid_sensor_gyro_3d hid_sensor_trigger industrialio_triggered_buffer kfifo_buf industrialio snd_ctl_led joydev hid_sensor_iio_common rtw89_8852ae rtw89_8852a rtw89_pci snd_hda_codec_realtek rtw89_core snd_hda_codec_generic intel_rapl_msr ledtrig_audio intel_rapl_common snd_hda_codec_hdmi mac80211 snd_hda_intel snd_intel_dspcfg kvm_amd snd_hda_codec snd_soc_dmic snd_acp3x_rn snd_acp3x_pdm_dma libarc4 snd_hwdep snd_soc_core kvm snd_hda_core cfg80211 snd_pci_acp6x snd_pcm nls_ascii snd_timer hp_wmi snd_pci_acp5x nls_cp437 snd_rn_pci_acp3x ucsi_acpi sparse_keymap ccp snd platform_profile snd_acp_config typec_ucsi irqbypass vfat sp5100_tco
[  +0.000000]  snd_soc_acpi fat rapl pcspkr wmi_bmof roles rfkill rng_core snd_pci_acp3x soundcore k10temp watchdog typec battery ac amd_pmc acpi_tad button hid_sensor_hub hid_multitouch evdev serio_raw msr parport_pc ppdev lp parport fuse loop efi_pstore configfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 btrfs blake2b_generic dm_crypt dm_mod efivarfs raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx libcrc32c crc32c_generic xor raid6_pq raid1 raid0 multipath linear md_mod amdgpu amdxcp i2c_algo_bit drm_ttm_helper ttm crc32_pclmul crc32c_intel drm_exec gpu_sched drm_suballoc_helper nvme ghash_clmulni_intel drm_buddy drm_display_helper sha512_ssse3 nvme_core ahci xhci_pci sha512_generic hid_generic xhci_hcd libahci rtsx_pci_sdmmc t10_pi i2c_hid_acpi drm_kms_helper i2c_hid mmc_core libata aesni_intel crc64_rocksoft_generic crypto_simd amd_sfh crc64_rocksoft scsi_mod usbcore cryptd crc_t10dif cec drm crct10dif_generic hid rtsx_pci crct10dif_pclmul scsi_common rc_core crc64 i2c_piix4
[  +0.000000]  usb_common crct10dif_common video wmi
[  +0.000000] CR2: 00000000000004c0
[  +0.000000] ---[ end trace 0000000000000000 ]---

Fixes: 0e859faf8670 ("drm/amd/display: Remove unwanted drm edid references")
Signed-off-by: Melissa Wen <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add vcn 4.0.6 discovery support
Yifan Zhang [Tue, 26 Dec 2023 07:43:44 +0000 (15:43 +0800)]
drm/amdgpu: add vcn 4.0.6 discovery support

This patch is to add vcn 4.0.6 support

Reviewed-by: Leo Liu <[email protected]>
Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Use RMW accessors for changing LNKCTL2
Ilpo Järvinen [Thu, 15 Feb 2024 13:31:54 +0000 (15:31 +0200)]
drm/amdgpu: Use RMW accessors for changing LNKCTL2

Convert open coded RMW accesses for LNKCTL2 to use
pcie_capability_clear_and_set_word() which makes its easier to
understand what the code tries to do.

LNKCTL2 is not really owned by any driver because it is a collection of
control bits that PCI core might need to touch. RMW accessors already
have support for proper locking for a selected set of registers
(LNKCTL2 is not yet among them but likely will be in the future) to
avoid losing concurrent updates.

Acked-by: Alex Deucher <[email protected]>
Suggested-by: Lukas Wunner <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Simplify the allocation of sync slab caches
Kunwu Chan [Wed, 21 Feb 2024 09:59:07 +0000 (17:59 +0800)]
drm/amdgpu: Simplify the allocation of sync slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Kunwu Chan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/soc21: Enabling PG and CG flags for VCN 4.0.6
Veerabadhran Gopalakrishnan [Tue, 30 Jan 2024 13:40:12 +0000 (19:10 +0530)]
drm/amdgpu/soc21: Enabling PG and CG flags for VCN 4.0.6

Enabled the VCN Power Gating and Clock Gating flags for VCN 4.0.6.

Reviewed-by: Leo Liu <[email protected]>
Signed-off-by: Veerabadhran Gopalakrishnan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/display: Address kdoc for 'is_psr_su' in 'fill_dc_dirty_rects'
Srinivasan Shanmugam [Thu, 15 Feb 2024 12:55:40 +0000 (18:25 +0530)]
drm/amdgpu/display: Address kdoc for 'is_psr_su' in 'fill_dc_dirty_rects'

The is_psr_su parameter is a boolean flag indicating whether the Panel
Self Refresh Selective Update (PSR SU) feature is enabled which is a
power-saving feature that allows only the updated regions of the screen
to be refreshed, reducing the amount of data that needs to be sent to
the display.

Fixes the below with gcc W=1:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5257: warning: Function parameter or member 'is_psr_su' not described in 'fill_dc_dirty_rects'

Fixes: d16df040c8da ("drm/amdgpu: make damage clips support configurable")
Cc: [email protected]
Cc: Hamza Mahfooz <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Rodrigo Siqueira <[email protected]>
Cc: Aurabindo Pillai <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/radeon: Use RMW accessors for changing LNKCTL2
Ilpo Järvinen [Thu, 15 Feb 2024 13:31:53 +0000 (15:31 +0200)]
drm/radeon: Use RMW accessors for changing LNKCTL2

Convert open coded RMW accesses for LNKCTL2 to use
pcie_capability_clear_and_set_word() which makes its easier to
understand what the code tries to do.

LNKCTL2 is not really owned by any driver because it is a collection of
control bits that PCI core might need to touch. RMW accessors already
have support for proper locking for a selected set of registers
(LNKCTL2 is not yet among them but likely will be in the future) to
avoid losing concurrent updates.

Acked-by: Alex Deucher <[email protected]>
Suggested-by: Lukas Wunner <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Fix memory leak in dm_sw_fini()
Armin Wolf [Tue, 13 Feb 2024 00:50:50 +0000 (01:50 +0100)]
drm/amd/display: Fix memory leak in dm_sw_fini()

After destroying dmub_srv, the memory associated with it is
not freed, causing a memory leak:

unreferenced object 0xffff896302b45800 (size 1024):
  comm "(udev-worker)", pid 222, jiffies 4294894636
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace (crc 6265fd77):
    [<ffffffff993495ed>] kmalloc_trace+0x29d/0x340
    [<ffffffffc0ea4a94>] dm_dmub_sw_init+0xb4/0x450 [amdgpu]
    [<ffffffffc0ea4e55>] dm_sw_init+0x15/0x2b0 [amdgpu]
    [<ffffffffc0ba8557>] amdgpu_device_init+0x1417/0x24e0 [amdgpu]
    [<ffffffffc0bab285>] amdgpu_driver_load_kms+0x15/0x190 [amdgpu]
    [<ffffffffc0ba09c7>] amdgpu_pci_probe+0x187/0x4e0 [amdgpu]
    [<ffffffff9968fd1e>] local_pci_probe+0x3e/0x90
    [<ffffffff996918a3>] pci_device_probe+0xc3/0x230
    [<ffffffff99805872>] really_probe+0xe2/0x480
    [<ffffffff99805c98>] __driver_probe_device+0x78/0x160
    [<ffffffff99805daf>] driver_probe_device+0x1f/0x90
    [<ffffffff9980601e>] __driver_attach+0xce/0x1c0
    [<ffffffff99803170>] bus_for_each_dev+0x70/0xc0
    [<ffffffff99804822>] bus_add_driver+0x112/0x210
    [<ffffffff99807245>] driver_register+0x55/0x100
    [<ffffffff990012d1>] do_one_initcall+0x41/0x300

Fix this by freeing dmub_srv after destroying it.

Fixes: 743b9786b14a ("drm/amd/display: Hook up the DMUB service in DM")
Signed-off-by: Armin Wolf <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Use kcalloc() instead of kzalloc()
Lenko Donchev [Sun, 28 Jan 2024 09:04:38 +0000 (03:04 -0600)]
drm/amd/display: Use kcalloc() instead of kzalloc()

We are trying to get rid of all multiplications from allocation
functions to prevent integer overflows. Here the multiplication is
obviously safe, but using kcalloc() is more appropriate and improves
readability. This patch has no effect on runtime behavior.

Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Link: https://github.com/KSPP/linux/issues/162
Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Lenko Donchev <[email protected]>
Signed-off-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Simplify the allocation of mux_chunk slab caches
Kunwu Chan [Wed, 21 Feb 2024 09:59:06 +0000 (17:59 +0800)]
drm/amdgpu: Simplify the allocation of mux_chunk slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Kunwu Chan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Simplify the allocation of fence slab caches
Kunwu Chan [Wed, 21 Feb 2024 09:59:05 +0000 (17:59 +0800)]
drm/amdgpu: Simplify the allocation of fence slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Kunwu Chan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/soc21: Added Video Capabilities for VCN 406
Veerabadhran Gopalakrishnan [Mon, 12 Feb 2024 07:45:27 +0000 (13:15 +0530)]
drm/amdgpu/soc21: Added Video Capabilities for VCN 406

Updated Query Video codecs for VCN 406

Reviewed-by: Leo Liu <[email protected]>
Signed-off-by: Veerabadhran Gopalakrishnan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/vcn: Enable VCN 4.0.6 Support
Veerabadhran Gopalakrishnan [Thu, 1 Feb 2024 07:11:29 +0000 (12:41 +0530)]
drm/amdgpu/vcn: Enable VCN 4.0.6 Support

Modified driver to use the appropriate FW files and instance.

v2: squash in fixes (Alex)

Reviewed-by: Leo Liu <[email protected]>
Signed-off-by: Veerabadhran Gopalakrishnan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu/jpeg: add support for jpeg multi instance
Saleemkhan Jamadar [Thu, 25 Jan 2024 10:19:26 +0000 (15:49 +0530)]
drm/amdgpu/jpeg: add support for jpeg multi instance

Enable support for multi instance on JPEG 4.0.6.

v2: squash in fixes (Alex)

Signed-off-by: Saleemkhan Jamadar <[email protected]>
Reviewed-by: Veerabadhran Gopalakrishnan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdkfd: fix process reference drop on debug ioctl
Jonathan Kim [Wed, 21 Feb 2024 10:20:34 +0000 (05:20 -0500)]
drm/amdkfd: fix process reference drop on debug ioctl

Prevent dropping the KFD process reference at the end of a debug
IOCTL call where the acquired process value is an error.

Signed-off-by: Jonathan Kim <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Use correct SRIOV macro for gmc_v9_0_vm_fault_interrupt_state
Victor Lu [Tue, 19 Dec 2023 15:22:19 +0000 (10:22 -0500)]
drm/amdgpu: Use correct SRIOV macro for gmc_v9_0_vm_fault_interrupt_state

Under SRIOV, programming to VM_CONTEXT*_CNTL regs failed because the
current macro does not pass through the correct xcc instance.
Use the *REG32_XCC macro in this case.

The behaviour without SRIOV is the same without this patch.

Signed-off-by: Victor Lu <[email protected]>
Reviewed-by: Zhigang Luo <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Do not program IH_CHICKEN in vega20_ih.c under SRIOV
Victor Lu [Tue, 13 Feb 2024 22:28:40 +0000 (17:28 -0500)]
drm/amdgpu: Do not program IH_CHICKEN in vega20_ih.c under SRIOV

IH_CHICKEN is blocked for VF writes; this access should be skipped.

Signed-off-by: Victor Lu <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: Improve error checking in amdgpu_virt_rlcg_reg_rw (v2)
Victor Lu [Mon, 12 Feb 2024 22:33:45 +0000 (17:33 -0500)]
drm/amdgpu: Improve error checking in amdgpu_virt_rlcg_reg_rw (v2)

The current error detection only looks for a timeout.
This should be changed to also check scratch_reg1 for any errors
returned from RLCG.

v2: remove new error value

Signed-off-by: Victor Lu <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: enable MES discovery for GC 11.5.1
Yifan Zhang [Tue, 12 Dec 2023 09:18:18 +0000 (17:18 +0800)]
drm/amdgpu: enable MES discovery for GC 11.5.1

This patch to enable MES for GC 11.5.1

Reviewed-by: shaoyun.liu <[email protected]>
Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add GC 11.5.1 discovery support
Yifan Zhang [Tue, 12 Dec 2023 09:17:43 +0000 (17:17 +0800)]
drm/amdgpu: add GC 11.5.1 discovery support

This patch to add GC 11.5.1 support

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdkfd: add KFD support for GC 11.5.1
Yifan Zhang [Fri, 5 Jan 2024 05:16:03 +0000 (13:16 +0800)]
drm/amdkfd: add KFD support for GC 11.5.1

Enable KFD for GC 11.5.1.

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: enable CGPG for GFX ip v11.5.1
Tim Huang [Tue, 30 Jan 2024 03:01:39 +0000 (11:01 +0800)]
drm/amdgpu: enable CGPG for GFX ip v11.5.1

Enable CGPG support for GFX ip v11.5.1

Signed-off-by: Tim Huang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: initialize gfx11.5.1
Yifan Zhang [Fri, 5 Jan 2024 04:03:03 +0000 (12:03 +0800)]
drm/amdgpu: initialize gfx11.5.1

Initialize gfx 11.5.0 and set gfx hw configuration.

v2: squash in CG, PG, GFXOFF fixes (Alex)

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add mes firmware support for GC 11.5.1
Yifan Zhang [Thu, 4 Jan 2024 03:12:45 +0000 (11:12 +0800)]
drm/amdgpu: add mes firmware support for GC 11.5.1

This patch to add MES PIPE0 and PIPE1 firmware support for gc_11_5_1.

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add imu firmware support for GC 11.5.1
Yifan Zhang [Thu, 4 Jan 2024 03:10:59 +0000 (11:10 +0800)]
drm/amdgpu: add imu firmware support for GC 11.5.1

This patch is to add imu firmware support for GC 11.5.1

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add firmware for GC 11.5.1
Yifan Zhang [Thu, 4 Jan 2024 03:05:49 +0000 (11:05 +0800)]
drm/amdgpu: add firmware for GC 11.5.1

This patch is to add firmware for GC 11.5.1

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add GC 11.5.1 to GC 11.5.0 family
Yifan Zhang [Tue, 12 Dec 2023 09:09:18 +0000 (17:09 +0800)]
drm/amdgpu: add GC 11.5.1 to GC 11.5.0 family

This patch to add GC 11.5.1 to GC 11.5.0 family.

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: enable soc21 discovery support for GC 11.5.1
Yifan Zhang [Tue, 12 Dec 2023 09:11:04 +0000 (17:11 +0800)]
drm/amdgpu: enable soc21 discovery support for GC 11.5.1

This patch to enable soc21 support for GC 11.5.1

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: add initial GC 11.5.1 soc21 support
Yifan Zhang [Thu, 4 Jan 2024 03:30:26 +0000 (11:30 +0800)]
drm/amdgpu: add initial GC 11.5.1 soc21 support

Disable clock gating and power gating for now.

v2: squash in revision fix (Alex)

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amdgpu: enable gmc11 discovery support for GC 11.5.1
Yifan Zhang [Tue, 12 Dec 2023 09:12:06 +0000 (17:12 +0800)]
drm/amdgpu: enable gmc11 discovery support for GC 11.5.1

This patch to enable gmc11 for GC 11.5.1

Signed-off-by: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd: Update atomfirmware.h for DCN401
Aurabindo Pillai [Mon, 29 Jan 2024 22:20:53 +0000 (17:20 -0500)]
drm/amd: Update atomfirmware.h for DCN401

Add new firmware header definitions reqiured for DCN401

Signed-off-by: Aurabindo Pillai <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: 3.2.273
Aric Cyr [Mon, 12 Feb 2024 02:14:44 +0000 (21:14 -0500)]
drm/amd/display: 3.2.273

This version brings along the following:

- Re-enable windowed MPO support for DCN32/321
- Improvements in the subvp feature
- Code clean up
- USB4 fixes

Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Fix nanosec stat overflow
Aric Cyr [Thu, 29 Aug 2019 15:53:52 +0000 (11:53 -0400)]
drm/amd/display: Fix nanosec stat overflow

[Why]
Nanosec stats can overflow on long running systems potentially causing
statistic logging issues.

[How]
Use 64bit types for nanosec stats to ensure no overflow.

Reviewed-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Drop unnecessary header
Rodrigo Siqueira [Tue, 13 Feb 2024 21:35:55 +0000 (14:35 -0700)]
drm/amd/display: Drop unnecessary header

A long time ago, the slab header was added to multiple files in DC. We
also included it in the os_types.h, which is included in many of those
DC files. At this point, there is no need to insert the slab.h header in
multiple files, so this commit drops those includes.

Tested-by: Daniel Wheeler <[email protected]>
Reviewed-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: reenable windowed mpo odm support on dcn32 and dcn321
Wenjing Liu [Fri, 9 Feb 2024 19:00:27 +0000 (14:00 -0500)]
drm/amd/display: reenable windowed mpo odm support on dcn32 and dcn321

[why]
The feature was disabled due to regression found during testing. Now
that all the pending issues are addressed, we are reenabling the power
saving feature again.

The feature optimizes dispclk level when user is using MPO capable
broswers or watching MPO capable videos in windowed mode. The feature
achieves power optimization by utilizing free pipes to process incoming
pixels in parallel. So it reduces max dispclk requirements for each
pipe.

Previously ODM power optimization will be disabled when MPO plane is
present due to technical challeges. This is mainly because ODM divides
pixel workload with respect to stream but MPO plane position and size
are arbitrary with respect to stream. The pixel processing workload of
an MPO plane is not guarenteed to be evenly distributed across DCN pipes.
For example if a plane is moved inside single ODM slice, all the
processing for the plane is distributed to the pipe in the current ODM
slice, while the other ODM slices don't need to process this plane. If
the plane is then moved to the middle crosing two ODM slices, each ODM
slice gets half of the workload. This is especially difficult when the
plane itself has a large source rect which can't be processed by single
DCN pipe. In this case we can't enable ODM power optimization when the
plane is only within one ODM slice.

[how]
To overcome the challeges, new pipe resource management is in place to
make sure a plane is validated with ODM power optimization support if
it can be validated regardless of its position and the same pipe
topology can be used regardless of the plane's position. When the plane
is moved outside current ODM slice, we will set recout to 0 so the pipe
can be idling without the need to update pipe topology. When the user
resizes a plane, it may result in downscaling ratio changes. When the
downscaling ratio is above single pipe's threshold, we will seamlessly
exit ODM power optimization and applies MPC combine to support the plane.
when downscaling ratio becomes smaller, we will seamlessly enter ODM
power optimization again. All these pipe transitions happen
automatically and quietly when the conditions are met without any visual
impacts to the user.

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Remove pixle rate limit for subvp
Alvin Lee [Fri, 9 Feb 2024 15:40:36 +0000 (10:40 -0500)]
drm/amd/display: Remove pixle rate limit for subvp

Subvp bugs related to 8K60 have been fixed, so remove the limit that
blocks 8K60 timings from enabling SubVP.

Reviewed-by: Nevenko Stupar <[email protected]>
Reviewed-by: Chaitanya Dhere <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Only log during optimize_bandwidth call
Ethan Bitnun [Wed, 7 Feb 2024 23:06:59 +0000 (18:06 -0500)]
drm/amd/display: Only log during optimize_bandwidth call

Prevent logs during a prepare_bandwidth call to ensure log accuracy.

Reviewed-by: Alvin Lee <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Ethan Bitnun <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: fix input states translation error for dcn35 & dcn351
Swapnil Patel [Tue, 6 Feb 2024 16:40:20 +0000 (11:40 -0500)]
drm/amd/display: fix input states translation error for dcn35 & dcn351

[Why]
Currently there is an error while translating input clock sates into
output clock states. The highest fclk setting from output sates is
being dropped because of this error.

[How]
For dcn35 and dcn351, make output_states equal to input states.

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Swapnil Patel <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Generalize new minimal transition path
Alvin Lee [Wed, 7 Feb 2024 19:00:10 +0000 (14:00 -0500)]
drm/amd/display: Generalize new minimal transition path

Previously the new minimal transition path was only used for windowed
MPO + ODM for plane scaling updates. However, we want to generalize the
transition for all cases whenever a non-seamless transition is detected
(such as for MPO -> SubVP + MPC).

To make this change we add pointers in the plane state, stream, and
pointers in the stream state to the dc_scratch state and backup and
restore these so the minimal transition can take place successfully.

Reviewed-by: Wenjing Liu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
12 months agodrm/amd/display: Check DP Alt mode DPCS state via DMUB
George Shen [Tue, 6 Feb 2024 21:08:49 +0000 (16:08 -0500)]
drm/amd/display: Check DP Alt mode DPCS state via DMUB

[Why]
Currently, driver state for DCN3.2 is not strictly matching HW state for
the USBC port. To reduce inconsistencies while debugging, the driver
should match HW configuration.

[How]
Update link encoder flag to indicate USBC port. Call into DMUB to check
when DP Alt mode is entered, and also to check for 2-lane versuse 4-lane
mode.

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: George Shen <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
This page took 0.112372 seconds and 4 git commands to generate.