OSDN Git Service

tomoyo/tomoyo-test1.git
18 months agoamdgpu: fix build on non-DCN platforms.
Dave Airlie [Fri, 27 Jan 2023 02:15:13 +0000 (12:15 +1000)]
amdgpu: fix build on non-DCN platforms.

This fixes the build here locally on my 32-bit arm build.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f439a959dcfb6b39d6fd4b85ca1110a1d1de1587)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/vcn4: add missing encoder cap
Alex Deucher [Tue, 10 Jan 2023 22:44:26 +0000 (17:44 -0500)]
drm/amdgpu/vcn4: add missing encoder cap

VCN4.x supports AV1 encode.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: 3.2.220
Aric Cyr [Mon, 16 Jan 2023 04:21:20 +0000 (23:21 -0500)]
drm/amd/display: 3.2.220

This version brings along following fixes:
- Fix timing not changning when freesync video is enabled
- avoid disable otg when dig was disabled
- Properly reuse completion structure
- Pass DSC slice height to PSR FW
- merge dc_link_dp into dc_link
- move dp cts functions from dc_link_dp to link_dp_cts
- move dp irq handler functions from dc_link_dp to link_dp_irq_handler
- Enable AdaptiveSync in DC interface
- adjust MALL size available for DCN32 and DCN321
- Set init freq for DCFCLK DS
- Use |= when assigning wm_optimized_required
- move eDP panel control logic to link_edp_panel_control
- create accessories, hwss and protocols sub folders in link
- Disable SubVP for PSR panels

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Fix timing not changning when freesync video is enabled
Aurabindo Pillai [Wed, 11 Jan 2023 19:56:22 +0000 (14:56 -0500)]
drm/amd/display: Fix timing not changning when freesync video is enabled

[Why&How]
Switching between certain modes that are freesync video modes and those
are not freesync video modes result in timing not changing as seen by
the monitor due to incorrect timing being driven.

The issue is fixed by ensuring that when a non freesync video mode is
set, we reset the freesync status on the crtc.

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: avoid disable otg when dig was disabled
Jingwen Zhu [Fri, 13 Jan 2023 16:06:00 +0000 (00:06 +0800)]
drm/amd/display: avoid disable otg when dig was disabled

[Why]
This is a workaround for an dcn3.1 hang that happens if otg dispclk
is ramped while otg is on and stream enc is off.
But this w/a should not trigger when we have a dig active.

[How]
Avoid disable otg when dig was disabled.

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Jingwen Zhu <Jingwen.Zhu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Properly reuse completion structure
Stylon Wang [Tue, 10 Jan 2023 06:38:33 +0000 (14:38 +0800)]
drm/amd/display: Properly reuse completion structure

[Why]
Connecting displays to TBT3 docks often produces invalid
replies for DPIA AUX requests. It turns out the completion
structure was not re-initialized before reusing it, resulting
in immature wake up to completion.

[How]
Properly call reinit_completion() on reused completion structure.

Cc: stable@vger.kernel.org
Reviewed-by: Solomon Chiu <solomon.chiu@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Pass DSC slice height to PSR FW
Robin Chen [Tue, 10 Jan 2023 08:53:55 +0000 (16:53 +0800)]
drm/amd/display: Pass DSC slice height to PSR FW

[Why]
When DSC is enabled, the PSRSU seletive update region
must be multiple number of DSC slice height number.
The original solution is to overwrite the SU Y granularity
by DSC slice height in DAL driver. However, the size
of the SU Y granularity variable only has 8 bytes
and the DSC slice height may over the 8 bytes size.

[How]
Instead of overwriting the SU Y granularity value,
add a new DSC slice height pararmeter and pass it
to DMUB PSRSU FW. The PSRSU FW will refer to the
DSC slice height value and extend the SU region.

Reviewed-by: Dennis Chan <dennis.chan@amd.com>
Reviewed-by: ChunTao Tso <chuntao.tso@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Robin Chen <robin.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: merge dc_link_dp into dc_link
Wenjing Liu [Mon, 9 Jan 2023 21:52:39 +0000 (16:52 -0500)]
drm/amd/display: merge dc_link_dp into dc_link

[why]
Temporarly merge dc_link_dp functions into dc_link for the
purpose of removing dc_link_dp files. This is a transitional
change for later commits where we will further refactor dc_link
file.

Reviewed-by: George Shen <George.Shen@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: move dp cts functions from dc_link_dp to link_dp_cts
Wenjing Liu [Mon, 9 Jan 2023 20:25:43 +0000 (15:25 -0500)]
drm/amd/display: move dp cts functions from dc_link_dp to link_dp_cts

Create new files link_dp_cts.c and link_dp_cts.h, and move DP cts
functions into them.

Reviewed-by: George Shen <George.Shen@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: move dp irq handler functions from dc_link_dp to link_dp_irq_handler
Wenjing Liu [Mon, 9 Jan 2023 19:38:35 +0000 (14:38 -0500)]
drm/amd/display: move dp irq handler functions from dc_link_dp to link_dp_irq_handler

Create new files link_dp_irq_handler.c and link_dp_irq_handler.h, and
move DP irq handler functions into them.

Reviewed-by: George Shen <George.Shen@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Enable AdaptiveSync in DC interface
Sung Joon Kim [Wed, 11 Jan 2023 18:12:21 +0000 (13:12 -0500)]
drm/amd/display: Enable AdaptiveSync in DC interface

[why]
Start enabling AdaptiveSync feature on Linux environment.

[how]
Adding AdaptiveSync support in DC layer
- building AdaptiveSync info_packets
- adjusting the v_startup parameter

Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Sung Joon Kim <sungjoon.kim@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: adjust MALL size available for DCN32 and DCN321
Samson Tam [Wed, 11 Jan 2023 18:31:31 +0000 (13:31 -0500)]
drm/amd/display: adjust MALL size available for DCN32 and DCN321

[Why]
MALL size available can vary for different SKUs.
Use num_chans read from VBIOS to determine the available MALL size we can use

[How]
Define max_chans for DCN32 and DCN321.
If num_chans is max_chans, then return max_chans as we can access the
 entire MALL space.
Otherwise, define avail_chans as the number of available channels we are
 allowed instead.
Return corresponding number of channels back and use this to calculate
 available MALL size.

Reviewed-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Set init freq for DCFCLK DS
Alvin Lee [Wed, 11 Jan 2023 22:31:13 +0000 (17:31 -0500)]
drm/amd/display: Set init freq for DCFCLK DS

[Description]
- Set init frequency for DCFCLK DS
- For now choose 10Mhz after turning off all pipes on init
- DCN32 spreadsheet shows 8Mhz is min for any display config

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Use |= when assigning wm_optimized_required
Alvin Lee [Wed, 11 Jan 2023 15:33:44 +0000 (10:33 -0500)]
drm/amd/display: Use |= when assigning wm_optimized_required

[Description]
Use |= when assigning to wm_optimized required because
we don't want to overwrite the flag in case the optimize
did not happen yet

Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: move eDP panel control logic to link_edp_panel_control
Wenjing Liu [Mon, 19 Dec 2022 19:54:31 +0000 (14:54 -0500)]
drm/amd/display: move eDP panel control logic to link_edp_panel_control

Create new file link_edp_panel_control.c and link_edp_panel_control.h,
and move eDP panel control logic into them.

Reviewed-by: George Shen <George.Shen@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: create accessories, hwss and protocols sub folders in link
Wenjing Liu [Fri, 16 Dec 2022 22:16:19 +0000 (17:16 -0500)]
drm/amd/display: create accessories, hwss and protocols sub folders in link

[why]
link component contains three sub folders:

accessories - utilities for improving testability, logging or tracing, doesn't impact
end user use cases.

protocols - specs defined protocols used in end user use cases

hwss - hwss owned link_hwss object, served as an abstraction layer in hwss to
access various types of encoder/phy/dpia endpoints in a unified interface.

sooner we will have files directly under link folder one for the implementation of
each major link behavior such as link_create, link_detect, link_validate
and link_set_dpms.

Reviewed-by: George Shen <George.Shen@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Disable SubVP for PSR panels
Alvin Lee [Tue, 10 Jan 2023 16:27:59 +0000 (11:27 -0500)]
drm/amd/display: Disable SubVP for PSR panels

[Description]
- We cannot enable subvp on PSR panels because when
  PSR is active, HUBP is turned off and we cannot rely
  on the HUBP vline interrupt
- When in PSR, surface data also cannot be prefetched to MALL
  because the main HUBP will be off

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Reviewed-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: 3.2.219
Aric Cyr [Mon, 9 Jan 2023 03:33:21 +0000 (22:33 -0500)]
drm/amd/display: 3.2.219

This version brings along following fixes:
- [FW Promotion] Release 0.0.150.0
- Correcting prefetch mode for fast validate
- Set hvm_enabled flag for S/G mode
- set allow_freesync parameter in DM
- Revert "ignore msa parameter only if freesync is enabled"
- Allow idle optimization after turning off all pipes
- Guard Freesync HDMI parsing with dc_lock
- Speed up DML fast_validate path
- Disable MALL SS and messages for PSR supported configs
- force connector state when bpc changes during compliance

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: [FW Promotion] Release 0.0.150.0
Anthony Koo [Sun, 8 Jan 2023 04:20:48 +0000 (23:20 -0500)]
drm/amd/display: [FW Promotion] Release 0.0.150.0

 - Add comments to reserved bit

Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: limit AV1 to the first instance on VCN4 encode
David (Ming Qiang) Wu [Fri, 13 Jan 2023 18:44:26 +0000 (13:44 -0500)]
drm/amdgpu: limit AV1 to the first instance on VCN4 encode

AV1 is only supported on the first instance.
Added vcn_v4_0_enc_find_ib_param() to help search for an IB param.

Signed-off-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Correcting prefetch mode for fast validate
Saaem Rizvi [Thu, 5 Jan 2023 23:28:34 +0000 (18:28 -0500)]
drm/amd/display: Correcting prefetch mode for fast validate

[WHY and HOW]
When fast validating, we should be agnostic to any sort of optimizations
such as supporting Pstate or stutter in Vblank. We should change our
prefetch mode for fast validate to support none of these optimizations.
For example, Valve Index running at 144Hz can only be validated without
any support these optimizations.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Saaem Rizvi <SyedSaaem.Rizvi@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Set hvm_enabled flag for S/G mode
Roman Li [Thu, 5 Jan 2023 22:44:10 +0000 (17:44 -0500)]
drm/amd/display: Set hvm_enabled flag for S/G mode

[Why]
After enabling S/G on dcn314 a screen corruption may be observed.
HostVM flag should be set in S/G mode to be included in DML calculations.

[How]
In S/G mode gpu_vm_support flag is set.
Use its value to init is_hvm_enabled.

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/display/mst: adjust the logic in 2nd phase of updating payload
Wayne Lin [Wed, 18 Jan 2023 10:01:15 +0000 (18:01 +0800)]
drm/amdgpu/display/mst: adjust the logic in 2nd phase of updating payload

[why & how]
adjust the coding in dm_helpers_dp_mst_send_payload_allocation()
for reading easily.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/display/mst: adjust the naming of mst_port and port of aconnector
Wayne Lin [Wed, 28 Dec 2022 11:47:12 +0000 (19:47 +0800)]
drm/amdgpu/display/mst: adjust the naming of mst_port and port of aconnector

[why & how]
The term (i.e. port & mst_port) that we used to use in amdgpu is a bit
confusing. Rename them to mst_output_port & mst_root respectively.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/display/dp_mst: Correct the kref of port.
Wayne Lin [Wed, 28 Dec 2022 06:50:43 +0000 (14:50 +0800)]
drm/display/dp_mst: Correct the kref of port.

[why & how]
We still need to refer to port while removing payload at commit_tail.
we should keep the kref till then to release.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Fixes: 4d07b0bc4034 ("drm/display/dp_mst: Move all payload info into the atomic state")
Cc: stable@vger.kernel.org # 6.1
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Tested-by: Didier Raboud <odyx@debian.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/drm_print: correct format problem
Wayne Lin [Fri, 23 Dec 2022 01:57:02 +0000 (09:57 +0800)]
drm/drm_print: correct format problem

[why & how]
__drm_dbg() parameter set format is wrong and not aligned with the
format under CONFIG_DRM_USE_DYNAMIC_DEBUG is on. Fix it.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/display/mst: update mst_mgr relevant variable when long HPD
Wayne Lin [Mon, 12 Dec 2022 07:41:18 +0000 (15:41 +0800)]
drm/amdgpu/display/mst: update mst_mgr relevant variable when long HPD

[Why & How]
Now the vc_start_slot is controlled at drm side. When we
service a long HPD, we still need to run
dm_helpers_dp_mst_write_payload_allocation_table() to update
drm mst_mgr's relevant variable. Otherwise, on the next plug-in,
payload will get assigned with a wrong start slot.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Fixes: 4d07b0bc4034 ("drm/display/dp_mst: Move all payload info into the atomic state")
Cc: stable@vger.kernel.org # 6.1
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Tested-by: Didier Raboud <odyx@debian.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/display/mst: limit payload to be updated one by one
Wayne Lin [Fri, 9 Dec 2022 11:05:33 +0000 (19:05 +0800)]
drm/amdgpu/display/mst: limit payload to be updated one by one

[Why]
amdgpu expects to update payload table for one stream one time
by calling dm_helpers_dp_mst_write_payload_allocation_table().
Currently, it get modified to try to update HW payload table
at once by referring mst_state.

[How]
This is just a quick workaround. Should find way to remove the
temporary struct dc_dp_mst_stream_allocation_table later if set
struct link_mst_stream_allocatio directly is possible.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Fixes: 4d07b0bc4034 ("drm/display/dp_mst: Move all payload info into the atomic state")
Cc: stable@vger.kernel.org # 6.1
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Tested-by: Didier Raboud <odyx@debian.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/display/mst: Fix mst_state->pbn_div and slot count assignments
Lyude Paul [Wed, 23 Nov 2022 19:50:16 +0000 (14:50 -0500)]
drm/amdgpu/display/mst: Fix mst_state->pbn_div and slot count assignments

Looks like I made a pretty big mistake here without noticing: it seems when
I moved the assignments of mst_state->pbn_div I completely missed the fact
that the reason for us calling drm_dp_mst_update_slots() earlier was to
account for the fact that we need to call this function using info from the
root MST connector, instead of just trying to do this from each MST
encoder's atomic check function. Otherwise, we end up filling out all of
DC's link information with zeroes.

So, let's restore that and hopefully fix this DSC regression.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Signed-off-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Fixes: 4d07b0bc4034 ("drm/display/dp_mst: Move all payload info into the atomic state")
Cc: stable@vger.kernel.org # 6.1
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Tested-by: Didier Raboud <odyx@debian.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: skip psp suspend for IMU enabled ASICs mode2 reset
Tim Huang [Fri, 20 Jan 2023 14:27:32 +0000 (22:27 +0800)]
drm/amdgpu: skip psp suspend for IMU enabled ASICs mode2 reset

The psp suspend & resume should be skipped to avoid destroy
the TMR and reload FWs again for IMU enabled APU ASICs.

Signed-off-by: Tim Huang <tim.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: set allow_freesync parameter in DM
Aurabindo Pillai [Thu, 5 Jan 2023 19:21:45 +0000 (14:21 -0500)]
drm/amd/display: set allow_freesync parameter in DM

[Why&how]
There are cases where VRR is possible but not enabled. If allow_freesync
parameter is not set, SubVP logic defaults to checking only the ignore MSA
parameter that is always set if display is DRR capable, which breaks the system
while trying to enable SubVP on multi monitor configs where freesync
does not work due to Xorg limitation.

SubVP uses allow_freesync parameter to check if SubVP + DRR case can be executed.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Revert "ignore msa parameter only if freesync is enabled"
Aurabindo Pillai [Thu, 5 Jan 2023 19:18:09 +0000 (14:18 -0500)]
drm/amd/display: Revert "ignore msa parameter only if freesync is enabled"

This reverts commit 6ffa679916474b26c9b6c81003b42f2e1f0feda1.

This commit introduced a regression in Unigine Heaven benchmark where
the display would turn off due to incorrect handling of the parameter to
ignore MSA packets.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Allow idle optimization after turning off all pipes
Alvin Lee [Thu, 5 Jan 2023 15:46:47 +0000 (10:46 -0500)]
drm/amd/display: Allow idle optimization after turning off all pipes

[Why]
In certain D3 cases (BOCO / BOMACO) the hardware is reset but
software state still has idle_optimizations = true. This prevents
us from entering idle optimizations again if no display is connected.

[How]
In hw init, reset the idle optimization state, and allow idle
optimizations after all pipes have been turned off.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Guard Freesync HDMI parsing with dc_lock
Stylon Wang [Wed, 21 Dec 2022 11:28:16 +0000 (19:28 +0800)]
drm/amd/display: Guard Freesync HDMI parsing with dc_lock

[Why]
All calls into DC must be guarded by dc_lock because DC code
is not safe against multi-thread or re-entry.

[How]
Hold dc_lock when calling DC interfaces to parse Freesync HDMI.

Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Speed up DML fast_validate path
Ilya Bakoulin [Thu, 24 Nov 2022 18:58:49 +0000 (13:58 -0500)]
drm/amd/display: Speed up DML fast_validate path

[Why]
Iterating over every voltage state when we need to validate thousands of
configurations all at once (i.e. display hotplug) can take a significant
amount of time.

[How]
Check just the highest voltage state when fast_validate is true to
verify whether the configuration can work at all, then do a proper
validation including all voltage states later when fast_validate is false.

Reviewed-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Disable MALL SS and messages for PSR supported configs
Dillon Varone [Wed, 4 Jan 2023 16:00:31 +0000 (11:00 -0500)]
drm/amd/display: Disable MALL SS and messages for PSR supported configs

[Description]
The two features are not supported at the same time in driver at this time,
so disable it.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: force connector state when bpc changes during compliance
Qingqing Zhuo [Mon, 3 Oct 2022 21:14:13 +0000 (17:14 -0400)]
drm/amd/display: force connector state when bpc changes during compliance

[Why]
During DP DSC compliance tests, bpc requested would
change between sub-tests, which requires stream
to be recommited.

[How]
Force connector to disconnect and reconnect whenever
there is a bpc change in automated test.

Reviewed-by: Jerry Zuo <Jerry.Zuo@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: hersen wu <hersenxs.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: use a more appropriate return value in dp_retrieve_lttpr_cap()
Hamza Mahfooz [Fri, 20 Jan 2023 17:22:21 +0000 (12:22 -0500)]
drm/amd/display: use a more appropriate return value in dp_retrieve_lttpr_cap()

Not all ASICs support LTTPR, however if they don't it doesn't mean that
we have encountered unexpected behaviour. So, use DC_NOT_SUPPORTED
instead of DC_ERROR_UNEXPECTED.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: declare firmware for new MES 11.0.4
Li Ma [Fri, 20 Jan 2023 07:41:22 +0000 (15:41 +0800)]
drm/amdgpu: declare firmware for new MES 11.0.4

To support new mes ip block

Signed-off-by: Li Ma <li.ma@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: enable imu firmware for GC 11.0.4
Li Ma [Fri, 20 Jan 2023 07:38:33 +0000 (15:38 +0800)]
drm/amdgpu: enable imu firmware for GC 11.0.4

The GC 11.0.4 needs load IMU to power up GFX before loads GFX firmware.

Signed-off-by: Li Ma <li.ma@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/pm: add missing AllowIHInterrupt message mapping for SMU13.0.0
Evan Quan [Fri, 20 Jan 2023 03:21:53 +0000 (11:21 +0800)]
drm/amd/pm: add missing AllowIHInterrupt message mapping for SMU13.0.0

Add SMU13.0.0 AllowIHInterrupt message mapping.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: remove unconditional trap enable on add gfx11 queues
Jonathan Kim [Thu, 19 Jan 2023 23:42:03 +0000 (18:42 -0500)]
drm/amdgpu: remove unconditional trap enable on add gfx11 queues

Rebase of driver has incorrect unconditional trap enablement
for GFX11 when adding mes queues.

Reported-by: Graham Sider <graham.sider@amd.com>
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Graham Sider <graham.sider@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agoDocumentation/gpu: update dGPU asic info table
Alex Deucher [Wed, 18 Jan 2023 21:07:10 +0000 (16:07 -0500)]
Documentation/gpu: update dGPU asic info table

Update to the latest launched dGPUs.

Link: https://www.amd.com/en/graphics/radeon-rx-graphics
Link: https://www.amd.com/en/graphics/amd-radeon-rx-laptops
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: remove duplicate included header files
ye xingchen [Wed, 18 Jan 2023 07:39:00 +0000 (15:39 +0800)]
drm/amd/display: remove duplicate included header files

resource.h is included more than once.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: return the PCIe gen and lanes from the INFO ioctl
Marek Olšák [Sat, 24 Dec 2022 22:44:26 +0000 (17:44 -0500)]
drm/amdgpu: return the PCIe gen and lanes from the INFO ioctl

For computing PCIe bandwidth in userspace and troubleshooting PCIe
bandwidth issues. Note that this intentionally fills holes and padding
in drm_amdgpu_info_device.

Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20790

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: print bo inode number instead of ptr
Pierre-Eric Pelloux-Prayer [Thu, 12 Jan 2023 16:53:35 +0000 (17:53 +0100)]
drm/amdgpu: print bo inode number instead of ptr

This allows to correlate the infos printed by
/sys/kernel/debug/dri/n/amdgpu_gem_info to the ones found
in /proc/.../fdinfo and /sys/kernel/debug/dma_buf/bufinfo.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: retire unused get_umc_v6_7_channel_index
Tao Zhou [Thu, 19 Jan 2023 03:07:40 +0000 (11:07 +0800)]
drm/amdgpu: retire unused get_umc_v6_7_channel_index

Fix the following compile warning:

drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:53:24: warning: unused function 'get_umc_v6_7_channel_index' [-Wunused-function]
static inline uint32_t get_umc_v6_7_channel_index(struct amdgpu_device *adev,
                          ^
1 warning generated.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Optimize sdma ras block initialization code for sdma v4_0
YiPeng Chai [Tue, 17 Jan 2023 08:06:49 +0000 (16:06 +0800)]
drm/amdgpu: Optimize sdma ras block initialization code for sdma v4_0

Optimize sdma ras block initialization code for sdma v4_0.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: fix hdmi_encoded_link_bw definition
Arnd Bergmann [Wed, 18 Jan 2023 16:06:27 +0000 (17:06 +0100)]
drm/amd/display: fix hdmi_encoded_link_bw definition

Some of the data structures are hidden when CONFIG_DRM_AMD_DC_DCN is
disabled, which leads to a link failure:

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c:234:21: error: 'union hdmi_encoded_link_bw' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  234 |         const union hdmi_encoded_link_bw hdmi_encoded_link_bw)
      |                     ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c:234:42: error: parameter 2 ('hdmi_encoded_link_bw') has incomplete type
  234 |         const union hdmi_encoded_link_bw hdmi_encoded_link_bw)
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c:232:17: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  232 | static uint32_t intersect_frl_link_bw_support(
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c: In function 'get_active_converter_info':
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c:1126:76: error: storage size of 'hdmi_encoded_link_bw' isn't known
 1126 |                                                 union hdmi_encoded_link_bw hdmi_encoded_link_bw;
      |                                                                            ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c:1130:101: error: 'struct <anonymous>' has no member named 'MAX_ENCODED_LINK_BW_SUPPORT'
 1130 |                                                                                 hdmi_color_caps.bits.MAX_ENCODED_LINK_BW_SUPPORT);

There is probably no need to hide the data structure, and removing
the #ifdef makes it build cleanly.

Fixes: d5a43956b73b ("drm/amd/display: move dp capability related logic to link_dp_capability")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: fix dp_retrieve_lttpr_cap() return value
Arnd Bergmann [Wed, 18 Jan 2023 09:29:56 +0000 (10:29 +0100)]
drm/amd/display: fix dp_retrieve_lttpr_cap() return value

gcc-13 notices a mismatch between the return type of dp_retrieve_lttpr_cap()
and the returned value:

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c: In function 'dp_retrieve_lttpr_cap':
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c:1465:24: error: implicit conversion from 'enum <anonymous>' to 'enum dc_status' [-Werror=enum-conversion]
 1465 |                 return false;
      |                        ^~~~~

Change the value to an actual dc_status code and remove the bogus
initialization that was apparently meant to get returned here.

Fixes: b473bd5fc333 ("drm/amd/display: refine wake up aux in retrieve link caps")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Add sdma ras function on sdma v6_0_3
YiPeng Chai [Tue, 17 Jan 2023 07:44:25 +0000 (15:44 +0800)]
drm/amdgpu: Add sdma ras function on sdma v6_0_3

Add sdma ras function on sdma v6_0_3.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: disable S/G display on DCN 3.1.4
Alex Deucher [Wed, 18 Jan 2023 14:21:22 +0000 (09:21 -0500)]
drm/amd/display: disable S/G display on DCN 3.1.4

Causes flickering or white screens in some configurations.
Disable it for now until we can fix the issue.

Cc: roman.li@amd.com
Cc: yifan1.zhang@amd.com
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: disable S/G display on DCN 3.1.5
Alex Deucher [Wed, 18 Jan 2023 14:19:21 +0000 (09:19 -0500)]
drm/amd/display: disable S/G display on DCN 3.1.5

Causes flickering or white screens in some configurations.
Disable it for now until we can fix the issue.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2354
Cc: roman.li@amd.com
Cc: yifan1.zhang@amd.com
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd: decrease message about missing PSP runtime database to debug
Mario Limonciello [Wed, 18 Jan 2023 22:47:11 +0000 (16:47 -0600)]
drm/amd: decrease message about missing PSP runtime database to debug

Laptops with APUs from a variety of manufacturers and generations
show a warning about a missing PSP runtime database.

As it's not required for PSP to dump this database into framebuffer,
decrease messages about it missing to debug.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Decrease messaging about DP alt mode state to debug
Mario Limonciello [Wed, 18 Jan 2023 22:47:09 +0000 (16:47 -0600)]
drm/amd/display: Decrease messaging about DP alt mode state to debug

Currently plugging in a USB-C device that issues an HPD will emit
a warning level message `DP Alt mode state on HPD: %d`.

This is needlessly noisy for most people, decrease it to debug so
that it can be turned on by dynamic debug as needed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/vcn4: fail to schedule IB for AV1 if VCN0 is harvested
Alex Deucher [Fri, 13 Jan 2023 15:56:58 +0000 (10:56 -0500)]
drm/amdgpu/vcn4: fail to schedule IB for AV1 if VCN0 is harvested

Only VCN0 supports AV1.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/soc21: don't expose AV1 if VCN0 is harvested
Alex Deucher [Fri, 13 Jan 2023 15:45:59 +0000 (10:45 -0500)]
drm/amdgpu/soc21: don't expose AV1 if VCN0 is harvested

Only VCN0 supports AV1.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/vcn3: fail to schedule IB for AV1 if VCN0 is harvested
Alex Deucher [Fri, 13 Jan 2023 15:55:41 +0000 (10:55 -0500)]
drm/amdgpu/vcn3: fail to schedule IB for AV1 if VCN0 is harvested

Only VCN0 supports AV1.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/nv: don't expose AV1 if VCN0 is harvested
Alex Deucher [Fri, 13 Jan 2023 15:40:42 +0000 (10:40 -0500)]
drm/amdgpu/nv: don't expose AV1 if VCN0 is harvested

Only VCN0 supports AV1.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agoDocumentation/gpu: Add Raphael to apu-asic-info-table
Mario Limonciello [Wed, 18 Jan 2023 13:40:57 +0000 (07:40 -0600)]
Documentation/gpu: Add Raphael to apu-asic-info-table

Raphael launched in 2022 but was missed to add to this table.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agoDocumentation/gpu: Add Mendocino to apu-asic-info-table
Mario Limonciello [Wed, 18 Jan 2023 13:34:09 +0000 (07:34 -0600)]
Documentation/gpu: Add Mendocino to apu-asic-info-table

Mendocino launched in 2023 and uses the new naming scheme for APU
processors.

Link: https://community.amd.com/t5/corporate/announcing-new-model-numbers-for-2023-mobile-processors/ba-p/543985
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agoDocumentation/gpu: Update lines for GREEN_SARDINE and YELLOW_CARP
Mario Limonciello [Wed, 18 Jan 2023 13:31:13 +0000 (07:31 -0600)]
Documentation/gpu: Update lines for GREEN_SARDINE and YELLOW_CARP

These products have launched, so add matching codenames.

Also AMD has announced that both of these products have new refresh
variants that launch in 2023 using the new naming scheme, so add
that information.

Link: https://community.amd.com/t5/corporate/announcing-new-model-numbers-for-2023-mobile-processors/ba-p/543985
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agoDocumentation/gpu: Add MP0 version to apu-asic-info-table
Mario Limonciello [Wed, 18 Jan 2023 13:27:02 +0000 (07:27 -0600)]
Documentation/gpu: Add MP0 version to apu-asic-info-table

MP0 version is useful to know to figure out which firmware is intended
for a platform.  Add a column for all supported APUs.

v2: squash in column fix (Mario)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: allow multipipe policy on ASICs with one MEC
Lang Yu [Wed, 11 Jan 2023 01:32:15 +0000 (09:32 +0800)]
drm/amdgpu: allow multipipe policy on ASICs with one MEC

Always enable multipipe policy on ASICs with GC VERSION > 9.0.0
instead of MEC number > 1.

This will allow multipipe policy on ASICs with one MEC,
e.g., gfx11 APUs.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: correct MEC number for gfx11 APUs
Lang Yu [Wed, 11 Jan 2023 01:52:11 +0000 (09:52 +0800)]
drm/amdgpu: correct MEC number for gfx11 APUs

There is only one MEC on these APUs.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: fix issues with driver unload
Hamza Mahfooz [Tue, 17 Jan 2023 20:12:49 +0000 (15:12 -0500)]
drm/amd/display: fix issues with driver unload

Currently, we run into a number of WARN()s when attempting to unload the
amdgpu driver (e.g. using "modprobe -r amdgpu"). These all stem from
calling drm_encoder_cleanup() too early. So, to fix this we can stop
calling drm_encoder_cleanup() from amdgpu_dm_fini() and instead have it
be called from amdgpu_dm_encoder_destroy(). Also, we don't need to free
in amdgpu_dm_encoder_destroy() since mst_encoders[] isn't explicitly
allocated by the slab allocator.

Fixes: f74367e492ba ("drm/amdgpu/display: create fake mst encoders ahead of time (v4)")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/vcn: Remove redundant indirect SRAM HW model check
Guilherme G. Piccoli [Tue, 17 Jan 2023 18:15:24 +0000 (15:15 -0300)]
drm/amdgpu/vcn: Remove redundant indirect SRAM HW model check

The HW model validation that guards the indirect SRAM checking in the
VCN code path is redundant - there's no model that's not included in the
switch, making it useless in practice [0].

So, let's remove this switch statement for good.

[0] lore.kernel.org/amd-gfx/MN0PR12MB61013D20B8A2263B22AE1BCFE2C19@MN0PR12MB6101.namprd12.prod.outlook.com

Suggested-by: Alex Deucher <Alexander.Deucher@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Cc: James Zhu <James.Zhu@amd.com>
Cc: Lazar Lijo <Lijo.Lazar@amd.com>
Cc: Leo Liu <leo.liu@amd.com>
Cc: Sonny Jiang <sonny.jiang@amd.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/vcn: Adjust firmware names indentation
Guilherme G. Piccoli [Tue, 17 Jan 2023 18:15:23 +0000 (15:15 -0300)]
drm/amdgpu/vcn: Adjust firmware names indentation

This is an incredibly trivial fix, just for the sake of
"aesthetical" organization of the defines. Some were space based,
most were tab based and there was a lack of "alignment", now it's
all the same and aligned.

Cc: James Zhu <James.Zhu@amd.com>
Cc: Lazar Lijo <Lijo.Lazar@amd.com>
Cc: Leo Liu <leo.liu@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Use the sched from entity for amdgpu_cs trace
Leo Liu [Mon, 16 Jan 2023 14:55:57 +0000 (09:55 -0500)]
drm/amdgpu: Use the sched from entity for amdgpu_cs trace

The problem is that base sched hasn't been assigned yet at this moment,
causing something like "ring=0" all the time from trace.

mpv:cs0-3473    [002] ..... 129.047431: amdgpu_cs: ring=0, dw=48, fences=0
mpv:cs0-3473    [002] ..... 129.089125: amdgpu_cs: ring=0, dw=48, fences=0
mpv:cs0-3473    [002] ..... 129.130987: amdgpu_cs: ring=0, dw=48, fences=0
mpv:cs0-3473    [002] ..... 129.172478: amdgpu_cs: ring=0, dw=48, fences=0

Fixes: 4624459c84d7 ("drm/amdgpu: add gang submit frontend v6")
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: correct query xgmi3x16 pcs error status
Stanley.Yang [Mon, 16 Jan 2023 07:42:36 +0000 (15:42 +0800)]
drm/amdgpu: correct query xgmi3x16 pcs error status

There is xgmi3x16 pcs error status for aldebaran, driver should
check xgmi3x16 pcs error status field instead of gopx16 pcs error
status field.

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: support check xgmi/walf error mask bit for aldebaran
Stanley.Yang [Thu, 12 Jan 2023 06:27:26 +0000 (14:27 +0800)]
drm/amdgpu: support check xgmi/walf error mask bit for aldebaran

The pcs error count should be determined by PCS ERROR status and
PCS ERROR MASK registers, only PCS ERROR status register can not
refect error counts accurately.

Changed from V1:
remove clean noncorrectable mask registers
optimize query pcs error status

Changed from V2:
remove check mask_value bits
correct set value corresponding bit

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: fix amdgpu_job_free_resources v2
Christian König [Thu, 12 Jan 2023 13:46:00 +0000 (14:46 +0100)]
drm/amdgpu: fix amdgpu_job_free_resources v2

It can be that neither fence were initialized when we run out of UVD
streams for example.

v2: fix typo breaking compile

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2324
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Optimize gfx ras block initialization code for gfx v9_0
YiPeng Chai [Wed, 11 Jan 2023 02:40:14 +0000 (10:40 +0800)]
drm/amdgpu: Optimize gfx ras block initialization code for gfx v9_0

  Use gfx ras common initialization interface to
initialize gfx ras block.

V2:
  Update function call due to amdgpu_gfx_ras_sw_init
interface changes.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Fix coding style
Thomas Zimmermann [Mon, 16 Jan 2023 13:12:14 +0000 (14:12 +0100)]
drm/amdgpu: Fix coding style

Align a closing brace and remove trailing whitespaces. No functional
changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix
Joshua Ashton [Tue, 10 Jan 2023 22:50:42 +0000 (22:50 +0000)]
drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix

The YCC conversion matrix for RGB -> COLOR_SPACE_YCBCR2020_TYPE is
missing the values for the fourth column of the matrix.

The fourth column of the matrix is essentially just a value that is
added given that the color is 3 components in size.
These values are needed to bias the chroma from the [-1, 1] -> [0, 1]
range.

This fixes color being very green when using Gamescope HDR on HDMI
output which prefers YCC 4:4:4.

Fixes: 40df2f809e8f ("drm/amd/display: color space ycbcr709 support")
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Calculate output_color_space after pixel encoding adjustment
Joshua Ashton [Tue, 10 Jan 2023 20:12:21 +0000 (20:12 +0000)]
drm/amd/display: Calculate output_color_space after pixel encoding adjustment

Code in get_output_color_space depends on knowing the pixel encoding to
determine whether to pick between eg. COLOR_SPACE_SRGB or
COLOR_SPACE_YCBCR709 for transparent RGB -> YCbCr 4:4:4 in the driver.

v2: Fixed patch being accidentally based on a personal feature branch, oops!

Fixes: ea117312ea9f ("drm/amd/display: Reduce HDMI pixel encoding if max clock is exceeded")
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: use swap() helper macro in bios_parser
Deepak R Varma [Sun, 15 Jan 2023 09:26:14 +0000 (14:56 +0530)]
drm/amd/display: use swap() helper macro in bios_parser

Use swap() helper macro instead of open coded swap instructions. The
change also facilitates code cleanup and realignment for improved
readability.  Issue identified using swap.cocci Coccinelle semantic
patch script.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/pm/powerplay/smumgr/ci: use bitwise or for bitmasks addition
Deepak R Varma [Sun, 15 Jan 2023 07:17:37 +0000 (12:47 +0530)]
drm/amd/pm/powerplay/smumgr/ci: use bitwise or for bitmasks addition

For bit mask addition, it is recommended to use or operator "|" instead
of numerical addition as the former is quicker and cleaner. Change
suggested by orplus.cocci Coccinelle semantic patch.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/pm/powerplay/hwmgr: use bitwise or for bitmasks addition
Deepak R Varma [Sun, 15 Jan 2023 07:17:11 +0000 (12:47 +0530)]
drm/amd/pm/powerplay/hwmgr: use bitwise or for bitmasks addition

For bit mask addition, it is recommended to use or operator "|" instead
of numerical addition as the former is quicker and cleaner. Change
suggested by orplus.cocci Coccinelle semantic patch.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/pm/powerplay/smumgr: use bitwise or for addition
Deepak R Varma [Sun, 15 Jan 2023 07:16:43 +0000 (12:46 +0530)]
drm/amd/pm/powerplay/smumgr: use bitwise or for addition

For bit mask addition, it is recommended to use or operator "|" instead
of numerical addition as the former is quicker and cleaner. Change
suggested by orplus.cocci Coccinelle semantic patch.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu/pm: update hwmon power documentation
Alex Deucher [Thu, 12 Jan 2023 16:18:52 +0000 (11:18 -0500)]
drm/amdgpu/pm: update hwmon power documentation

Power reporting is socket power.  On APUs this includes
the CPU.  Update the documentation to clarify this.

Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdkfd: Support process XNACK mode dynamic change
Philip Yang [Thu, 12 Jan 2023 19:08:36 +0000 (14:08 -0500)]
drm/amdkfd: Support process XNACK mode dynamic change

Update queue qpd is done for the first queue creation of the process,
if the device support XNACK mode per process, update qpd setup
sh_mem_config based on the process XNACK mode, to support the process
destroy all queues, change XNACK mode, and then create queues.

Add helper macro KFD_SUPPORT_XNACK_PER_PROCESS to remove duplicate code
and add new ASICs support in future.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd: Evaluate early init for all IP blocks even if one fails
Mario Limonciello [Sun, 15 Jan 2023 19:05:31 +0000 (13:05 -0600)]
drm/amd: Evaluate early init for all IP blocks even if one fails

If early init fails for a single IP block, then no further IP blocks
are evaluated.  This means that if a user was missing more than one
firmware binary they would have to keep adding binaries and re-probing
until they discovered the ones missing.

To make this easier, run early init for each IP block and report a single
failure if not all passed.

Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd: Remove needless break for legacy IP discovery MP0 9.0.0
Mario Limonciello [Sun, 15 Jan 2023 19:01:56 +0000 (13:01 -0600)]
drm/amd: Remove needless break for legacy IP discovery MP0 9.0.0

There is already a "default" case in the switch block, so there is
no need to have a break after the switch block.

Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: fix cleaning up reserved VMID on release
Christian König [Fri, 13 Jan 2023 16:32:45 +0000 (17:32 +0100)]
drm/amdgpu: fix cleaning up reserved VMID on release

We need to reset this or otherwise run into list corruption later on.

Fixes: e44a0fe630c5 ("drm/amdgpu: rework reserved VMID handling")
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Candice Li <candice.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Adjust ras support check condition for special asic
YiPeng Chai [Fri, 6 Jan 2023 12:16:53 +0000 (20:16 +0800)]
drm/amdgpu: Adjust ras support check condition for special asic

[Why]:
     Amdgpu ras uses amdgpu_ras_is_supported to check whether
  the ras block supports the ras function. amdgpu_ras_is_supported
  uses .ras_enabled to determine whether the ras function of the
  block is enabled.
     But for special asic with mem ecc enabled but sram ecc not
  enabled, some ras blocks support poison mode but their ras function
  is not enabled on .ras_enabled, these ras blocks will run abnormally.

[How]:
    If the ras block is not supported on .ras_enabled but the asic
  supports poison mode and the ras block has ras configuration, it
  can be considered that the ras block supports ras function.

Signed-off-by: YiPeng Chai <YiPeng.Chai@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>
19 months agodrm/amdgpu: Remove unnecessary ras block support check
YiPeng Chai [Fri, 6 Jan 2023 12:54:05 +0000 (20:54 +0800)]
drm/amdgpu: Remove unnecessary ras block support check

[Why]:
   For special asic with mem ecc enabled but sram ecc
not enabled, some ras blocks can register their ras
configuration to ras list, but these ras blocks are not
enabled on .ras_enabled, so it can not get ras block
object using amdgpu_ras_get_ras_block.

[How]:
   Remove ras block support check. Even if the ras block
checked is not in the ras list, it will return a null
pointer and will have no effect.

Signed-off-by: YiPeng Chai <YiPeng.Chai@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>
19 months agodrm/amdgpu: Perform gpu reset after gfx finishes processing ras poison consumption...
YiPeng Chai [Wed, 4 Jan 2023 05:13:21 +0000 (13:13 +0800)]
drm/amdgpu: Perform gpu reset after gfx finishes processing ras poison consumption on gfx_v11_0_3

Perform gpu reset after gfx finishes processing
ras poison consumption on gfx_v11_0_3.

V2:
 Move gfx poison consumption handler from hw_ops to ip
 function level.

V3:
 Adjust the calling position of amdgpu_gfx_poison_consumation_handler.

V4:
   Since gfx v11_0_3 does not have .hw_ops instance, the .hw_ops null
 pointer check in amdgpu_ras_interrupt_poison_consumption_handler
 needs to be adjusted.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Add gfx cp ecc error irq handling on gfx v11_0_3
YiPeng Chai [Thu, 12 Jan 2023 02:43:47 +0000 (10:43 +0800)]
drm/amdgpu: Add gfx cp ecc error irq handling on gfx v11_0_3

V2:
  Optimize gfx_v11_0_set_cp_ecc_error_state function.

V3:
  Define macro constant for me pipe instance address interval.

V5:
  Register and handle gfx cp ecc error irq on gfx v11_0_3.

V6:
  Remove invalid intermediate function call.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Add gfx ras poison consumption irq handling on gfx v11_0_3
YiPeng Chai [Thu, 5 Jan 2023 06:53:59 +0000 (14:53 +0800)]
drm/amdgpu: Add gfx ras poison consumption irq handling on gfx v11_0_3

Add gfx ras poison consumption irq handling on gfx v11_0_3.

V2:
  Move ras poison consumption irq handling code of gfx
     v11_0_3 to gfx_v11_0_3.c.
V5:
  Create dedicated irq handler for RLC_GC_FED_INTERRUPT.

V6:
  Remove invalid function call.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agoamd/amdgpu: Add RLC_RLCS_FED_STATUS_* to gc v11_0_3 ip headers
YiPeng Chai [Thu, 5 Jan 2023 06:52:51 +0000 (14:52 +0800)]
amd/amdgpu: Add RLC_RLCS_FED_STATUS_* to gc v11_0_3 ip headers

V2:
   Add RLC_RLCS_FED_STATUS_0 and RLC_RLCS_FED_STATUS_1 register
   offset and shift masks.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amdgpu: Add gfx ras function on gfx v11_0_3
YiPeng Chai [Wed, 2 Nov 2022 06:07:35 +0000 (14:07 +0800)]
drm/amdgpu: Add gfx ras function on gfx v11_0_3

Add gfx ras function on gfx v11_0_3.

V2:
 1. Add separate source files for gfx v11_0_3.
 2. Create a common function to initialize gfx ras block.

V3:
 1. Rename amdgpu_gfx_ras_block_init to amdgpu_gfx_ras_sw_init.
 2. Adjust the calling position of amdgpu_gfx_ras_sw_init.
 3. Remove gfx_v11_0_3_ras_ops.

V4:
 Revert changes in amdgpu_ras_interrupt_poison_consumption_handler.

V5:
 1. Remove invalid include file in gfx_v11_0_3.c.
 2. Reduce the number of parameters of amdgpu_gfx_ras_sw_init.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd: Fix renoir/green sardine MP0 IP version detection
Mario Limonciello [Sat, 14 Jan 2023 03:01:48 +0000 (21:01 -0600)]
drm/amd: Fix renoir/green sardine MP0 IP version detection

The existing codebase never had a case for detecting MP0 version on
Renoir and instead relied upon hardcoded chip name.  This was missed as
part of the changes to migrate all IP blocks to build filenames from
`amdgpu_ucode.c`.

Consequently, Renoir tries to fetch a binary with 11_0_3 in the filename
and since it's supposed to have "renoir" in the filename fails to probe.
The fbdev still works though so the series worked.

Add a case for Renoir into the legacy table to ensure the right ASD and
TA firmware load again.

Reported-by: Ekene Akuneme <Ekene.Akuneme@amd.com>
Reported-by: Nicholas Choi <Nicholas.Choi@amd.com>
Cc: Alex Hung <Alex.Hung@amd.com>
Fixes: 994a97447e38 ("drm/amd: Parse both v1 and v2 TA microcode headers using same function")
Fixes: 54a3e032340e ("drm/amd: Add a legacy mapping to "amdgpu_ucode_ip_version_decode"")
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>
19 months agodrm/amd/display: 3.2.218
Aric Cyr [Tue, 3 Jan 2023 15:23:28 +0000 (10:23 -0500)]
drm/amd/display: 3.2.218

This version brings along following fixes:

- Revert patches that caused regressions associated with audio and an
  old change that checks the DCN version.
- Refactor DDC and HDP.
- Move DPIA and DPCD logic to new files.
- Updates to DMUB.
- Optimization and bug fixes for SUBVP/DRR.
- Drop legacy code.

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: hdcp not enabled on connector 0
hersen wu [Fri, 23 Dec 2022 15:01:12 +0000 (10:01 -0500)]
drm/amd/display: hdcp not enabled on connector 0

[Why]
incorrect skip when drm_connector.index = 0 within
event_property_validate and update

[How] handle hdcp validate and update for connector 0

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: hersen wu <hersenxs.wu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: phase2 enable mst hdcp multiple displays
hersen wu [Mon, 14 Nov 2022 19:29:56 +0000 (14:29 -0500)]
drm/amd/display: phase2 enable mst hdcp multiple displays

[why]
For MST topology with 1 physical link and multiple connectors (>=2),
e.g. daisy cahined MST + SST, or 1-to-multi MST hub, if userspace
set to enable the HDCP simultaneously on all connected outputs, the
commit tail iteratively call the hdcp_update_display() for each
display (connector). However, the hdcp workqueue data structure for
each link has only one DM connector and encryption status members,
which means the work queue of property_validate/update() would only
be triggered for the last connector within this physical link, and
therefore the HDCP property value of other connectors would stay on
DESIRED instead of switching to ENABLED, which is NOT as expected.

[how]
Use array of AMDGPU_DM_MAX_DISPLAY_INDEX for both aconnector and
encryption status in hdcp workqueue data structure for each physical
link. For property validate/update work queue, we iterates over the
array and do similar operation/check for each connected display.

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Signed-off-by: hersen wu <hersenxs.wu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Account for MPO planes in dcn32 mall alloc calculations
Dillon Varone [Thu, 22 Dec 2022 01:28:56 +0000 (20:28 -0500)]
drm/amd/display: Account for MPO planes in dcn32 mall alloc calculations

[WHY?]
Cannot only consider the MALL required from top pipes because of the MPO
case.

[HOW?]
Only count a pipe if it fits the following criteria:
1) does not have a top pipe (is the topmost pipe for that plane)
2) it does have a top pipe, but that pipe is associated with a different
   plane

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Allow subvp on vactive pipes that are 2560x1440@60
Alvin Lee [Wed, 14 Dec 2022 15:12:55 +0000 (10:12 -0500)]
drm/amd/display: Allow subvp on vactive pipes that are 2560x1440@60

Enable subvp on specifically 1440p@60hz displays even though it can
switch in vactive.

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: Request min clocks after disabling pipes on init
Alvin Lee [Wed, 14 Dec 2022 20:43:55 +0000 (15:43 -0500)]
drm/amd/display: Request min clocks after disabling pipes on init

[Description]
- Request min clocks after disabling pipes on init
- This optimizes for power savings during init sequence
- Also handles the case where we boot up with no display connected

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
19 months agodrm/amd/display: fix mapping to non-allocated address
Brandon Syu [Thu, 22 Dec 2022 08:43:37 +0000 (16:43 +0800)]
drm/amd/display: fix mapping to non-allocated address

[Why]
There is an issue mapping non-allocated location of memory.
It would allocate gpio registers from an array out of bounds.

[How]
Patch correct numbers of bounds for using.

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Martin Leung <Martin.Leung@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Brandon Syu <Brandon.Syu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>