OSDN Git Service

tomoyo/tomoyo-test1.git
11 months agodrm/amdgpu: Clean up errors in uvd_v7_0.c
Ran Sun [Wed, 2 Aug 2023 06:58:04 +0000 (06:58 +0000)]
drm/amdgpu: Clean up errors in uvd_v7_0.c

Fix the following errors reported by checkpatch:

ERROR: spaces required around that ':' (ctx:VxE)
that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/atomfirmware: Clean up errors in amdgpu_atomfirmware.c
Ran Sun [Wed, 2 Aug 2023 06:51:27 +0000 (06:51 +0000)]
drm/amdgpu/atomfirmware: Clean up errors in amdgpu_atomfirmware.c

Fix the following errors reported by checkpatch:

ERROR: spaces required around that '>=' (ctx:WxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: code indent should use tabs where possible

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in mmhub_v9_4.c
Ran Sun [Wed, 2 Aug 2023 06:48:22 +0000 (06:48 +0000)]
drm/amdgpu: Clean up errors in mmhub_v9_4.c

Fix the following errors reported by checkpatch:

ERROR: code indent should use tabs where possible
ERROR: space required before the open parenthesis '('

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in vega20_ih.c
Ran Sun [Wed, 2 Aug 2023 06:46:06 +0000 (06:46 +0000)]
drm/amdgpu: Clean up errors in vega20_ih.c

Fix the following errors reported by checkpatch:

ERROR: trailing statements should be on next line
ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in ih_v6_0.c
Ran Sun [Wed, 2 Aug 2023 06:43:33 +0000 (06:43 +0000)]
drm/amdgpu: Clean up errors in ih_v6_0.c

Fix the following errors reported by checkpatch:

ERROR: trailing statements should be on next line
ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in amdgpu_psp.h
Ran Sun [Wed, 2 Aug 2023 06:40:24 +0000 (06:40 +0000)]
drm/amdgpu: Clean up errors in amdgpu_psp.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: open brace '{' following enum go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in vce_v3_0.c
Ran Sun [Wed, 2 Aug 2023 06:37:42 +0000 (06:37 +0000)]
drm/amdgpu: Clean up errors in vce_v3_0.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in cik_ih.c
Ran Sun [Wed, 2 Aug 2023 06:35:29 +0000 (06:35 +0000)]
drm/amdgpu: Clean up errors in cik_ih.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dce_clk_mgr.c
Ran Sun [Wed, 2 Aug 2023 06:25:59 +0000 (06:25 +0000)]
drm/amd/display: Clean up errors in dce_clk_mgr.c

Fix the following errors reported by checkpatch:

ERROR: spaces required around that '?' (ctx:VxE)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in display_mode_vba_30.c
Ran Sun [Wed, 2 Aug 2023 06:20:25 +0000 (06:20 +0000)]
drm/amd/display: Clean up errors in display_mode_vba_30.c

Fix the following errors reported by checkpatch:

ERROR: else should follow close brace '}'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dcn10_dpp_dscl.c
Ran Sun [Wed, 2 Aug 2023 06:16:35 +0000 (06:16 +0000)]
drm/amd/display: Clean up errors in dcn10_dpp_dscl.c

Fix the following errors reported by checkpatch:

ERROR: else should follow close brace '}'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dc_stream.c
Ran Sun [Wed, 2 Aug 2023 06:14:23 +0000 (06:14 +0000)]
drm/amd/display: Clean up errors in dc_stream.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in bios_parser2.c
Ran Sun [Wed, 2 Aug 2023 03:22:56 +0000 (03:22 +0000)]
drm/amd/display: Clean up errors in bios_parser2.c

Fix the following errors reported by checkpatch:

ERROR: switch and case should be at the same indent
ERROR: code indent should use tabs where possible

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dcn316_smu.c
Ran Sun [Wed, 2 Aug 2023 03:03:11 +0000 (03:03 +0000)]
drm/amd/display: Clean up errors in dcn316_smu.c

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: code indent should use tabs where possible

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dcn316_clk_mgr.c
Ran Sun [Wed, 2 Aug 2023 03:01:11 +0000 (03:01 +0000)]
drm/amd/display: Clean up errors in dcn316_clk_mgr.c

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dcn315_smu.c
Ran Sun [Wed, 2 Aug 2023 02:58:14 +0000 (02:58 +0000)]
drm/amd/display: Clean up errors in dcn315_smu.c

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: code indent should use tabs where possible

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dce112_hw_sequencer.c
Ran Sun [Wed, 2 Aug 2023 02:54:43 +0000 (02:54 +0000)]
drm/amd/display: Clean up errors in dce112_hw_sequencer.c

Fix the following errors reported by checkpatch:

ERROR: space required before the open brace '{'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dce110_hw_sequencer.c
Ran Sun [Wed, 2 Aug 2023 02:53:27 +0000 (02:53 +0000)]
drm/amd/display: Clean up errors in dce110_hw_sequencer.c

Fix the following errors reported by checkpatch:

ERROR: space required before the open brace '{'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in dce110_timing_generator.c
Ran Sun [Wed, 2 Aug 2023 02:52:02 +0000 (02:52 +0000)]
drm/amd/display: Clean up errors in dce110_timing_generator.c

Fix the following errors reported by checkpatch:

ERROR: spaces required around that '=' (ctx:WxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/dc: Clean up errors in hpd_regs.h
Ran Sun [Wed, 2 Aug 2023 02:47:25 +0000 (02:47 +0000)]
drm/amd/dc: Clean up errors in hpd_regs.h

Fix the following errors reported by checkpatch:

ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in ddc_regs.h
Ran Sun [Wed, 2 Aug 2023 02:43:46 +0000 (02:43 +0000)]
drm/amd/display: Clean up errors in ddc_regs.h

Fix the following errors reported by checkpatch:

ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Clean up errors in color_gamma.c
Ran Sun [Wed, 2 Aug 2023 02:39:55 +0000 (02:39 +0000)]
drm/amd/display: Clean up errors in color_gamma.c

Fix the following errors reported by checkpatch:

ERROR: trailing whitespace
ERROR: else should follow close brace '}'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in amdgpu_pm.c
Ran Sun [Wed, 2 Aug 2023 02:31:09 +0000 (02:31 +0000)]
drm/amd/pm: Clean up errors in amdgpu_pm.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: space required before the open parenthesis '('

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in sislands_smc.h
Ran Sun [Wed, 2 Aug 2023 02:25:25 +0000 (02:25 +0000)]
drm/amd/pm: Clean up errors in sislands_smc.h

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in r600_dpm.h
Ran Sun [Wed, 2 Aug 2023 02:15:04 +0000 (02:15 +0000)]
drm/amd/pm: Clean up errors in r600_dpm.h

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrivers/amd/pm: Clean up errors in smu8_smumgr.h
Ran Sun [Wed, 2 Aug 2023 02:09:43 +0000 (02:09 +0000)]
drivers/amd/pm: Clean up errors in smu8_smumgr.h

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: space prohibited before that ',' (ctx:WxW)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu75.h
Ran Sun [Wed, 2 Aug 2023 01:59:41 +0000 (01:59 +0000)]
drm/amd/pm: Clean up errors in smu75.h

Fix the following errors reported by checkpatch:

ERROR: space prohibited before open square bracket '['
ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu73.h
Ran Sun [Wed, 2 Aug 2023 01:55:57 +0000 (01:55 +0000)]
drm/amd/pm: Clean up errors in smu73.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: space prohibited before open square bracket '['
ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in hwmgr.h
Ran Sun [Wed, 2 Aug 2023 01:48:00 +0000 (01:48 +0000)]
drm/amd/pm: Clean up errors in hwmgr.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: Use C99 flexible arrays

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in hardwaremanager.h
Ran Sun [Wed, 2 Aug 2023 01:39:39 +0000 (01:39 +0000)]
drm/amd/pm: Clean up errors in hardwaremanager.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in pp_thermal.h
Ran Sun [Wed, 2 Aug 2023 01:38:18 +0000 (01:38 +0000)]
drm/amd/pm: Clean up errors in pp_thermal.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu7.h
Ran Sun [Wed, 2 Aug 2023 01:31:18 +0000 (01:31 +0000)]
drm/amd/pm: Clean up errors in smu7.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu7_fusion.h
Ran Sun [Wed, 2 Aug 2023 01:29:03 +0000 (01:29 +0000)]
drm/amd/pm: Clean up errors in smu7_fusion.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: space prohibited before open square bracket '['

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu71.h
Ran Sun [Wed, 2 Aug 2023 01:23:02 +0000 (01:23 +0000)]
drm/amd/pm: Clean up errors in smu71.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: space prohibited before open square bracket '['

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Remove many unnecessary NULL values
Ruan Jinjie [Tue, 1 Aug 2023 12:55:14 +0000 (20:55 +0800)]
drm/amd/pm: Remove many unnecessary NULL values

Ther are many pointers assigned first, which need not to be initialized, so
remove the NULL assignment.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Fix a regression on Polaris cards
Mario Limonciello [Fri, 28 Jul 2023 22:04:01 +0000 (17:04 -0500)]
drm/amd/display: Fix a regression on Polaris cards

DCE products don't define a `remove_stream_from_ctx` like DCN ones
do. This means that when compute_mst_dsc_configs_for_state() is called
it always returns -EINVAL which causes MST to fail to setup.

Cc: stable@vger.kernel.org # 6.4.y
Cc: Harry Wentland <Harry.Wentland@amd.com>
Reported-by: Klaus.Kusche@computerix.info
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2671
Fixes: efa4c4df864e ("drm/amd/display: call remove_stream_from_ctx from res_pool funcs")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu9_driver_if.h
Ran Sun [Tue, 1 Aug 2023 09:50:56 +0000 (09:50 +0000)]
drm/amd/pm: Clean up errors in smu9_driver_if.h

Fix the following errors reported by checkpatch:

ERROR: space prohibited before open square bracket '['

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in polaris_baco.c
Ran Sun [Tue, 1 Aug 2023 09:47:42 +0000 (09:47 +0000)]
drm/amd/pm: Clean up errors in polaris_baco.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega20_pptable.h
Ran Sun [Tue, 1 Aug 2023 09:44:43 +0000 (09:44 +0000)]
drm/amd/pm: Clean up errors in vega20_pptable.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: space prohibited before open square bracket '['

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega12_hwmgr.h
Ran Sun [Tue, 1 Aug 2023 09:38:32 +0000 (09:38 +0000)]
drm/amd/pm: Clean up errors in vega12_hwmgr.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following enum go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm/powerplay/hwmgr/hwmgr: Clean up errors in hwmgr.c
Ran Sun [Tue, 1 Aug 2023 09:36:56 +0000 (09:36 +0000)]
drm/amd/pm/powerplay/hwmgr/hwmgr: Clean up errors in hwmgr.c

Fix the following errors reported by checkpatch:

ERROR: space prohibited after that '~' (ctx:WxW)
ERROR: spaces required around that '||' (ctx:VxW)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in tonga_baco.c
Ran Sun [Tue, 1 Aug 2023 09:34:14 +0000 (09:34 +0000)]
drm/amd/pm: Clean up errors in tonga_baco.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agogpu: amd: Clean up errors in ppatomfwctrl.h
Ran Sun [Tue, 1 Aug 2023 09:30:23 +0000 (09:30 +0000)]
gpu: amd: Clean up errors in ppatomfwctrl.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/powerplay: Clean up errors in vega20_hwmgr.c
Ran Sun [Tue, 1 Aug 2023 09:28:21 +0000 (09:28 +0000)]
drm/amdgpu/powerplay: Clean up errors in vega20_hwmgr.c

Fix the following errors reported by checkpatch:

ERROR: code indent should use tabs where possible
ERROR: space required before the open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in vega20_baco.c
Ran Sun [Tue, 1 Aug 2023 08:02:46 +0000 (08:02 +0000)]
drm/amdgpu: Clean up errors in vega20_baco.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: space required before the open parenthesis '('

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega20_hwmgr.h
Ran Sun [Tue, 1 Aug 2023 02:39:15 +0000 (02:39 +0000)]
drm/amd/pm: Clean up errors in vega20_hwmgr.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following enum go on the same line

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/powerplay: Clean up errors in smu_helper.h
Ran Sun [Tue, 1 Aug 2023 09:22:13 +0000 (09:22 +0000)]
drm/amdgpu/powerplay: Clean up errors in smu_helper.h

Fix the following errors reported by checkpatch:

ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Clean up errors in vega10_processpptables.c
Ran Sun [Tue, 1 Aug 2023 09:19:06 +0000 (09:19 +0000)]
drm/amd: Clean up errors in vega10_processpptables.c

Fix the following errors reported by checkpatch:

ERROR: "foo* bar" should be "foo *bar"
ERROR: space required before the open brace '{'
ERROR: space required before the open parenthesis '('

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Clean up errors in pptable_v1_0.h
Ran Sun [Tue, 1 Aug 2023 09:02:37 +0000 (09:02 +0000)]
drm/amd: Clean up errors in pptable_v1_0.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Clean up errors in smu7_hwmgr.c
Ran Sun [Tue, 1 Aug 2023 09:00:22 +0000 (09:00 +0000)]
drm/amd: Clean up errors in smu7_hwmgr.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega10_pptable.h
Ran Sun [Tue, 1 Aug 2023 08:40:24 +0000 (08:40 +0000)]
drm/amd/pm: Clean up errors in vega10_pptable.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in ppatomctrl.h
Ran Sun [Tue, 1 Aug 2023 08:37:10 +0000 (08:37 +0000)]
drm/amdgpu: Clean up errors in ppatomctrl.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in ci_baco.c
Ran Sun [Tue, 1 Aug 2023 08:05:50 +0000 (08:05 +0000)]
drm/amdgpu: Clean up errors in ci_baco.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in smu_helper.c
Ran Sun [Tue, 1 Aug 2023 07:59:51 +0000 (07:59 +0000)]
drm/amdgpu: Clean up errors in smu_helper.c

Fix the following errors reported by checkpatch:

ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in common_baco.c
Ran Sun [Tue, 1 Aug 2023 07:55:07 +0000 (07:55 +0000)]
drm/amdgpu: Clean up errors in common_baco.c

Fix the following errors reported by checkpatch:

ERROR: code indent should use tabs where possible

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Clean up errors in smu7_powertune.c
Ran Sun [Tue, 1 Aug 2023 06:15:29 +0000 (06:15 +0000)]
drm/amdgpu: Clean up errors in smu7_powertune.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega12_baco.c
Ran Sun [Tue, 1 Aug 2023 06:09:37 +0000 (06:09 +0000)]
drm/amd/pm: Clean up errors in vega12_baco.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega12_pptable.h
Ran Sun [Tue, 1 Aug 2023 06:04:43 +0000 (06:04 +0000)]
drm/amd/pm: Clean up errors in vega12_pptable.h

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: space prohibited before open square bracket '['

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega10_powertune.c
Ran Sun [Tue, 1 Aug 2023 03:37:41 +0000 (03:37 +0000)]
drm/amd/pm: Clean up errors in vega10_powertune.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in fiji_baco.c
Ran Sun [Tue, 1 Aug 2023 03:16:03 +0000 (03:16 +0000)]
drm/amd/pm: Clean up errors in fiji_baco.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu10_hwmgr.c
Ran Sun [Tue, 1 Aug 2023 03:08:51 +0000 (03:08 +0000)]
drm/amd/pm: Clean up errors in smu10_hwmgr.c

Fix the following errors reported by checkpatch:

ERROR: spaces required around that '=' (ctx:VxW)
ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm/powerplay/hwmgr/ppevvmath: Clean up errors in ppevvmath.h
Ran Sun [Tue, 1 Aug 2023 03:03:34 +0000 (03:03 +0000)]
drm/amd/pm/powerplay/hwmgr/ppevvmath: Clean up errors in ppevvmath.h

Fix the following errors reported by checkpatch:

ERROR: return is not a function, parentheses are not required
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open parenthesis '('
ERROR: need consistent spacing around '-' (ctx:WxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega12_hwmgr.c
Ran Sun [Tue, 1 Aug 2023 02:57:03 +0000 (02:57 +0000)]
drm/amd/pm: Clean up errors in vega12_hwmgr.c

Fix the following errors reported by checkpatch:

ERROR: need consistent spacing around '/' (ctx:WxV)
ERROR: code indent should use tabs where possible

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in vega10_baco.c
Ran Sun [Tue, 1 Aug 2023 02:44:48 +0000 (02:44 +0000)]
drm/amd/pm: Clean up errors in vega10_baco.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: space required after that ',' (ctx:VxV)
ERROR: space prohibited before that ',' (ctx:WxV)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in amd_powerplay.c
Ran Sun [Tue, 1 Aug 2023 02:36:58 +0000 (02:36 +0000)]
drm/amd/pm: Clean up errors in amd_powerplay.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: spaces required around that '||' (ctx:WxO)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in amdgpu_smu.c
Ran Sun [Tue, 1 Aug 2023 02:28:14 +0000 (02:28 +0000)]
drm/amd/pm: Clean up errors in amdgpu_smu.c

Fix the following errors reported by checkpatch:

ERROR: spaces required around that '=' (ctx:WxV)
ERROR: spaces required around that '&&' (ctx:VxW)
ERROR: that open brace { should be on the previous line
ERROR: space required before the open parenthesis '('
ERROR: space required before the open brace '{'
ERROR: spaces required around that ':' (ctx:VxW)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Clean up errors in smu_v13_0_5_ppt.c
Ran Sun [Tue, 1 Aug 2023 02:11:29 +0000 (02:11 +0000)]
drm/amd: Clean up errors in smu_v13_0_5_ppt.c

Fix the following errors reported by checkpatch:

ERROR: space prohibited before that ',' (ctx:WxW)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu_v13_0_5_ppt.c
Ran Sun [Tue, 1 Aug 2023 02:08:39 +0000 (02:08 +0000)]
drm/amd/pm: Clean up errors in smu_v13_0_5_ppt.c

Fix the following errors reported by checkpatch:

ERROR: space prohibited before that ',' (ctx:WxW)

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu_v13_0_6_ppt.c
Ran Sun [Tue, 1 Aug 2023 02:06:25 +0000 (02:06 +0000)]
drm/amd/pm: Clean up errors in smu_v13_0_6_ppt.c

Fix the following errors reported by checkpatch:

ERROR: code indent should use tabs where possible
ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in aldebaran_ppt.c
Ran Sun [Tue, 1 Aug 2023 02:00:52 +0000 (02:00 +0000)]
drm/amd/pm: Clean up errors in aldebaran_ppt.c

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: else should follow close brace '}'

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu_v13_0.c
Ran Sun [Tue, 1 Aug 2023 01:43:18 +0000 (01:43 +0000)]
drm/amd/pm: Clean up errors in smu_v13_0.c

Fix the following errors reported by checkpatch:

ERROR: space required before the open parenthesis '('
ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu_v13_0_7_ppt.c
Ran Sun [Tue, 1 Aug 2023 01:26:08 +0000 (01:26 +0000)]
drm/amd/pm: Clean up errors in smu_v13_0_7_ppt.c

Fix the following errors reported by checkpatch:

ERROR: open brace '{' following struct go on the same line
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: that open brace { should be on the previous line

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Clean up errors in smu_v11_0.h
Ran Sun [Tue, 1 Aug 2023 01:12:37 +0000 (01:12 +0000)]
drm/amd/pm: Clean up errors in smu_v11_0.h

Fix the following errors reported by checkpatch:

ERROR: that open brace { should be on the previous line
ERROR: code indent should use tabs where possible

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Remove a lot of unnecessary ternary operators
Ruan Jinjie [Fri, 4 Aug 2023 02:46:48 +0000 (10:46 +0800)]
drm/amdgpu: Remove a lot of unnecessary ternary operators

There are many ternary operators, the true or false judgement
of which is unnecessary in C language semantics.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Return value of function
Denis Arefev [Thu, 3 Aug 2023 14:11:16 +0000 (17:11 +0300)]
drm/amd/display: Return value of function

Added return value check hpd_enable

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Denis Arefev <arefev@swemel.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: fix possible UAF in amdgpu_cs_pass1()
Alex Deucher [Fri, 28 Jul 2023 15:14:05 +0000 (11:14 -0400)]
drm/amdgpu: fix possible UAF in amdgpu_cs_pass1()

Since the gang_size check is outside of chunk parsing
loop, we need to reset i before we free the chunk data.

Suggested by Ye Zhang (@VAR10CK) of Baidu Security.

Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Report vbios version instead of PN
Lijo Lazar [Wed, 2 Aug 2023 05:11:54 +0000 (10:41 +0530)]
drm/amdgpu: Report vbios version instead of PN

Report VBIOS version in vbios_version sysfs node instead of part number.
Part number remains constant for a SKU type.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Promote DAL to 3.2.246
Martin Leung [Mon, 31 Jul 2023 02:11:24 +0000 (22:11 -0400)]
drm/amd/display: Promote DAL to 3.2.246

This version brings along following fixes:
- Fix a regression in blank pixel data caused by coding mistake
- Fix a bug when searching for insert_above_mpcc
- Update add plane to context logic with a new algorithm
- Adjust visual confirm dpp height offset to be 1/240 of v addressable
- Add interface to enable DPIA trace
- Support plane clip with zero recout size
- Blocking invalid 420 modes on HDMI TMDS for DCN31 and DCN314
- Make mpc32 functions available to future DCNs
- Change HDCP update sequence for DM

Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Martin Leung <martin.leung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Change HDCP update sequence for DM
Bhawanpreet Lakha [Mon, 24 Jul 2023 20:32:47 +0000 (16:32 -0400)]
drm/amd/display: Change HDCP update sequence for DM

Refactor the sequence in hdcp_update_display() to use
mod_hdcp_update_display().

Previous sequence:
- remove()->add()

This Sequence was used to update the display, (mod_hdcp_update_display
didn't exist at the time). This meant for any hdcp updates (type changes,
enable/disable) we would remove, reconstruct, and add. This leads to
unnecessary calls to psp eventually

New Sequence using mod_hdcp_update_display():
- add() once when stream is enabled
- use update() for all updates

The update function checks for prev == new states and will not
unnecessarily end up calling psp via add/remove.

Reviewed-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: rename acquire_idle_pipe_for_layer to acquire_free_pipe_as_sec_dpp_pipe
Wenjing Liu [Wed, 26 Jul 2023 19:35:25 +0000 (15:35 -0400)]
drm/amd/display: rename acquire_idle_pipe_for_layer to acquire_free_pipe_as_sec_dpp_pipe

[why]
Secondary DPP pipes are used for rendering secondary layers of planes.
The name "for layer" doesn't make it obvious. The function is acquiring
a free pipe as secondary dpp pipe only. We rename it so it is more obvious.
In a future follow up change, we want to add functions to acquire free pipe as
opp head pipe or otg master pipe as well. They will have their separate
allocation priority.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: move idle pipe allocation logic into dcn specific layer
Wenjing Liu [Wed, 26 Jul 2023 19:22:01 +0000 (15:22 -0400)]
drm/amd/display: move idle pipe allocation logic into dcn specific layer

[why]
generic dc resource file should not know what an optimal idle pipe is
because this is dcn hardware dependent.

[how]
We move the optimial pipe searching logic in dcn specific layer.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: Use max memclk variable when setting max memclk
Alvin Lee [Thu, 27 Jul 2023 18:23:13 +0000 (14:23 -0400)]
drm/amd/display: Use max memclk variable when setting max memclk

[Description]
In overclocking scenarios the max memclk could be higher
than the DC mode limit. However, for configs that don't
support MCLK switching we need to set the max memclk to
the overclocked max instead of the DC mode max or we
could result in underflow.

Reviewed-by: Samson Tam <samson.tam@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: Add vendor Id for reference
Mike Hsieh [Mon, 22 May 2023 02:38:50 +0000 (10:38 +0800)]
drm/amd/display: Add vendor Id for reference

Add a new vendor ID code for reference

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Mike Hsieh <mike.hsieh@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN314
Leo Chen [Thu, 27 Jul 2023 02:44:13 +0000 (22:44 -0400)]
drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN314

[Why & How]
HDMI TMDS does not have ODM support. Filtering 420 modes that
exceed the 4096 FMT limitation on DCN314 will resolve
intermittent corruptions issues.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Leo Chen <sancchen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN31
Leo Chen [Mon, 24 Jul 2023 20:57:36 +0000 (16:57 -0400)]
drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN31

[Why & How]
HDMI TMDS does not have ODM support. Filtering 420 modes that
exceed the 4096 FMT limitation on DCN31 will resolve
intermittent corruptions issues.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Leo Chen <sancchen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Revert "drm/amd/display: Read down-spread percentage from lut to...
Leo Chen [Wed, 26 Jul 2023 17:57:11 +0000 (13:57 -0400)]
drm/amd/display: Revert "drm/amd/display: Read down-spread percentage from lut to adjust dprefclk."

[Why & How]
Revert commit 6917b0b71171 ("drm/amd/display: Read down-spread percentage from lut to adjust dprefclk.")
This change was causing 240hz display to not light up after s0i3.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Leo Chen <sancchen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: do not treat clip_rect size change as a scaling change
Wenjing Liu [Tue, 25 Jul 2023 23:26:55 +0000 (19:26 -0400)]
drm/amd/display: do not treat clip_rect size change as a scaling change

[why]
With previous ODM + MPO policy we will only allocate pipes when MPO plane
has intersection with current ODM slice. With this policy we have to indicate
scaling change when plane clip is updated in case plane clip change causes
MPO plane to go in or out current ODM slice.
With new ODM + MPO policy we allocate pipe independent from plane clip size
so we no longer treat it as a scaling change. There no need to do a full update
due to clip size change anymore.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: adjust visual confirm dpp height offset to be 1/240 of v addressable
Wenjing Liu [Tue, 25 Jul 2023 23:20:00 +0000 (19:20 -0400)]
drm/amd/display: adjust visual confirm dpp height offset to be 1/240 of v addressable

[why]
For timing with large v addressable visual confirm is just too small. It is difficult
to tell visually which DPP we are using. On the other hand with timing with small
v addressable visual confirm is too large and covers the UI area.

[how]
We calculate visual confirm dpp height offset based on v addressable so it stays
relatively the same height i.e. 1/240 verticle portion of the screen.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: update add plane to context logic with a new algorithm
Wenjing Liu [Sat, 22 Jul 2023 19:45:00 +0000 (15:45 -0400)]
drm/amd/display: update add plane to context logic with a new algorithm

[why]
Preivous algorithm for finding an optimal idle pipe for a new plane was
implemented to handle dynamic pipe allocation when MPO plane moves
from one ODM slice to the other. Now pipe allocation is more static so
it no longer depends on the MPO plane's position. We are simplifying
our logic and remove unnecessary handling in our code.

[how]
Apply a new simplified version of pipe resource allocation logic to reduce
unnecessary flip delay caused by swapping secondary dpp pipe to other
MPC blending tree.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: always acquire MPO pipe for every blending tree
Wenjing Liu [Thu, 20 Jul 2023 16:30:29 +0000 (12:30 -0400)]
drm/amd/display: always acquire MPO pipe for every blending tree

[why]
We only acquire MPO pipe for blending tree where the plane clip will
be rendered. If an MPO plane is outside current ODM slice rect, we will
skip pipe allocation. With new programming policy we want to allocate
pipes for every ODM slice blending tree even for those whose ODM slice
rect doesn't intersect with plane clip. This is aligned with DML validation
so the pipe topology is programmed independently from the plane's
position and dst plane size.

[how]
- Remove the logic to allocate pipe only when the MPO plane intersects
with ODM slice and replace with the new logic to always allocate pipes.
- Remove the logic to tear down ODM configuration in favor for supporting
secondary MPO planes.
- Remove the logic to use full update when MPO goes accross ODM slice
boundary.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: support plane clip with zero recout size
Wenjing Liu [Thu, 20 Jul 2023 15:47:55 +0000 (11:47 -0400)]
drm/amd/display: support plane clip with zero recout size

[why]
If plane clip is outside current pipe's ODM slice rect, our logic will
fail validation because we assume that when a pipe is acquired
to support a plane clip, it must blend some portion of the plane
on the screen. This assumption needs to be changed.
When a pipe is acquired to render the plane, we are now allowing
it to support a case where it can take minimum viewport and draw
with zero recout size when the plane clip is outside current ODM
slice rect. The reason is that we want to allocate and get the pipe
pre-programmed so it is ready to be rendered when user moves
the plane over to the current ODM slice with a fast update.
Whereas with the existing solution when user moves the plane
over, we will need to allocate a pipe as needed and power it up
and program it through a full update. This not only impacts the
user experience with unnecessary delay of a frame but also
doesn't generate any benefit to the user because DML doesn't
support it. DML will invalidate based on worst case scenario and
it doesn't depend on the plane location. So having our
programming sequence support such dynamic pipe allocation is
not meaningful anyway.

[how]
In build scaler params allow recout to be zero size and if viewport
is smaller than minimum, set minimum viewport size.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: Use DTBCLK as refclk instead of DPREFCLK
Austin Zheng [Wed, 26 Jul 2023 14:40:48 +0000 (10:40 -0400)]
drm/amd/display: Use DTBCLK as refclk instead of DPREFCLK

[Why]
Flash of corruption observed when UCLK switching after transitioning
from DTBCLK to DPREFCLK on subVP(DP) + subVP(HDMI) config
Scenario where DPREFCLK is required instead of DTBCLK is not expected

[How]
Always set the DTBCLK source as DTBCLK0

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Austin Zheng <austin.zheng@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Set Stream Update Flags in commit_state_no_check
Austin Zheng [Wed, 26 Jul 2023 14:18:39 +0000 (10:18 -0400)]
drm/amd/display: Set Stream Update Flags in commit_state_no_check

[Why]
Front-end would be programmed using the stream update flags set
from the previous update and the full update should be triggered
whenever commit_state_no_check gets called.

[How]
Set all stream update flags before programming the front-end
Clear all flags that got set to avoid redundant programming

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Austin Zheng <austin.zheng@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Make mpc32 functions available to future DCNs
Wesley Chalmers [Thu, 22 Jun 2023 23:03:43 +0000 (19:03 -0400)]
drm/amd/display: Make mpc32 functions available to future DCNs

Make the mpc32 functions available for future DCNs to use

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wesley Chalmers <wesley.chalmers@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Fix a bug when searching for insert_above_mpcc
Wesley Chalmers [Wed, 21 Jun 2023 23:13:26 +0000 (19:13 -0400)]
drm/amd/display: Fix a bug when searching for insert_above_mpcc

[WHY]
Currently, when insert_plane is called with insert_above_mpcc
parameter that is equal to tree->opp_list, the function returns NULL.

[HOW]
Instead, the function should insert the plane at the top of the tree.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wesley Chalmers <wesley.chalmers@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Enable DPIA trace with DC debug mask
Stylon Wang [Fri, 30 Jun 2023 08:46:09 +0000 (16:46 +0800)]
drm/amd/display: Enable DPIA trace with DC debug mask

[Why]
DPIA traces from DMUB is not enabled by default, which is
less convenient to debug DPIA related issues because we have
to resort to other means to enable DPIA trace.

[How]
Reuse existing DC debug mask to enable DPIA trace log from
kernel command line. This makes debugging DPIA issues easier
especially when system power state (suspend/reboot) is involved.

To turn on DPIA trace, simply add "amdgpu.dcdebugmask=0x80" to
kernel command line.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: Add interface to enable DPIA trace
Stylon Wang [Fri, 30 Jun 2023 08:31:58 +0000 (16:31 +0800)]
drm/amd/display: Add interface to enable DPIA trace

[Why]
DPIA traces from DMUB is not enabled by default, which is
less convenient to debug DPIA related issues because we have
to resort to other debug tools to enable DPIA trace.

[How]
Exposes interfaces to update trace mask from the DMUB GPINT commands.
Also provides DC implementations to enable DPIA trace.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amd/display: fix a regression in blank pixel data caused by coding mistake
Wenjing Liu [Mon, 24 Jul 2023 17:12:58 +0000 (13:12 -0400)]
drm/amd/display: fix a regression in blank pixel data caused by coding mistake

[why]
There was unfortunately a coding mistake. It gets caught with an ultrawide monitor
that requires ODM 4:1 combine. We are blanking or unblanking pixel data we
are supposed to enumerate through all ODM pipes and program DPG for each
of those pipes. However the coding mistake causes us to program only the
first and last ODM pipes.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Martin Leung <martin.leung@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
11 months agodrm/amdgpu: cleanup MES process level doorbells
Shashank Sharma [Tue, 21 Mar 2023 16:25:47 +0000 (17:25 +0100)]
drm/amdgpu: cleanup MES process level doorbells

MES allocates process level doorbells, but there is no userspace
client to consume it. It was only being used for the MES ring
tests (in kernel), and was written by kernel doorbell write.

The previous patch of this series has changed the MES ring test code to
use kernel level MES doorbells. This patch now cleans up the process level
doorbell allocation code which is not required.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Arvind Yadav <arvind.yadav@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: use doorbell mgr for MES kernel doorbells
Shashank Sharma [Fri, 14 Jul 2023 14:22:38 +0000 (16:22 +0200)]
drm/amdgpu: use doorbell mgr for MES kernel doorbells

This patch:
- Removes the existing doorbell management code, and its variables
  from the doorbell_init function, it will be done in doorbell
  manager now.
- uses the doorbell page created for MES kernel level needs (doorbells
  for MES self tests)
- current MES code was allocating MES doorbells in MES process context,
  but those were getting written using kernel doorbell calls. This patch
  instead allocates a MES kernel doorbell for this (in add_hw_queue).

V2: Create an extra page of doorbells for MES during kernel doorbell
    creation (Alex)
V4: Move MES doorbell size and page offset objects in this patch from
    patch 6.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Christian Koenig <christian.koenig@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Arvind Yadav <arvind.yadav@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>