platform/kernel/linux-rpi.git
3 years agodrm/amd/display: Refactor surface tiling setup.
Bas Nieuwenhuizen [Tue, 2 Jun 2020 14:15:04 +0000 (16:15 +0200)]
drm/amd/display: Refactor surface tiling setup.

Prepare for inserting modifiers based configuration, while sharing
a bunch of DCC validation & initializing the device-based configuration.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Convert tiling_flags to modifiers.
Bas Nieuwenhuizen [Wed, 2 Sep 2020 16:57:45 +0000 (18:57 +0200)]
drm/amd/display: Convert tiling_flags to modifiers.

This way the modifier path gets exercised all the time, improving
testing. Furthermore, for modifiers this is required as getfb2
will always return the modifier if the driver sets allow_fb_modifiers.

This only triggers once allow_fb_modifiers is set.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Store tiling_flags in the framebuffer.
Bas Nieuwenhuizen [Wed, 2 Sep 2020 12:22:38 +0000 (14:22 +0200)]
drm/amd/display: Store tiling_flags in the framebuffer.

This moves the tiling_flags to the framebuffer creation.
This way the time of the "tiling" decision is the same as it
would be with modifiers.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/fourcc: Add AMD DRM modifiers.
Bas Nieuwenhuizen [Sat, 30 May 2020 10:58:17 +0000 (12:58 +0200)]
drm/fourcc: Add AMD DRM modifiers.

This adds modifiers for GFX9+ AMD GPUs.

As the modifiers need a lot of parameters I split things out in
getters and setters.
  - Advantage: simplifies the code a lot
  - Disadvantage: Makes it harder to check that you're setting all
                  the required fields.

The tiling modes seem to change every generation, but the structure
of what each tiling mode is good for stays really similar. As such
the core of the modifier is
 - the tiling mode
 - a version. Not explicitly a GPU generation, but splitting out
   a new set of tiling equations.

Sometimes one or two tiling modes stay the same and for those we
specify a canonical version.

Then we have a bunch of parameters on how the compression works.
Different HW units have different requirements for these and we
actually have some conflicts here.

e.g. the render backends need a specific alignment but the display
unit only works with unaligned compression surfaces. To work around
that we have a DCC_RETILE option where both an aligned and unaligned
compression surface are allocated and a writer has to sync the
aligned surface to the unaligned surface on handoff.

Finally there are some GPU parameters that participate in the tiling
equations. These are constant for each GPU on the rendering/texturing
side. The display unit is very flexible however and supports all
of them :|

Some estimates:
 - Single GPU, render+texture: ~10 modifiers
 - All possible configs in a gen, display: ~1000 modifiers
 - Configs of actually existing GPUs in a gen: ~100 modifiers

For formats with a single plane everything gets put in a separate
DRM plane. However, this doesn't fit for some YUV formats, so if
the format has >1 plane, we let the driver pack the surfaces into
1 DRM plane per format plane.

This way we avoid X11 rendering onto the frontbuffer with DCC, but
still fit into 4 DRM planes.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Honor the offset for plane 0.
Bas Nieuwenhuizen [Sat, 21 Dec 2019 18:05:37 +0000 (19:05 +0100)]
drm/amd/display: Honor the offset for plane 0.

With modifiers I'd like to support non-dedicated buffers for
images.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: stable@vger.kernel.org # 5.1.0
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd: Init modifier field of helper fb.
Bas Nieuwenhuizen [Wed, 16 May 2018 00:40:23 +0000 (02:40 +0200)]
drm/amd: Init modifier field of helper fb.

Otherwise the field ends up being used uninitialized when
enabling modifiers, failing validation with high likelyhood.

v4: Use memset

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(for v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Do not silently accept DCC for multiplane formats.
Bas Nieuwenhuizen [Thu, 2 Jan 2020 12:40:49 +0000 (13:40 +0100)]
drm/amd/display: Do not silently accept DCC for multiplane formats.

Silently accepting it could result in corruption.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: fix compile warnings about variable used uninitialized
Evan Quan [Wed, 28 Oct 2020 02:33:04 +0000 (10:33 +0800)]
drm/amd/pm: fix compile warnings about variable used uninitialized

Fix the compile warnings below:
>> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'min' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
>> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: warning: variable 'max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: fix compile warning about missing prototype for function
Evan Quan [Wed, 28 Oct 2020 02:20:30 +0000 (10:20 +0800)]
drm/amd/pm: fix compile warning about missing prototype for function

Fix the warning below:
>> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1234:29: warning: no previous prototype for function 'asic_internal_ss_get_ss_table' [-Wmissing-prototypes]
   ATOM_ASIC_INTERNAL_SS_INFO *asic_internal_ss_get_ss_table(void *device)
                               ^
   drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1234:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   ATOM_ASIC_INTERNAL_SS_INFO *asic_internal_ss_get_ss_table(void *device)
   ^
   static
   1 warning generated.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrivers: amdgpu: Correct spelling defalut to default in comment
Bhaskar Chowdhury [Thu, 29 Oct 2020 09:43:46 +0000 (15:13 +0530)]
drivers: amdgpu: Correct spelling defalut to default in comment

Correct spelling in one of the comment.

s/defalut/default/p

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: fix incorrect enum type
Arnd Bergmann [Mon, 26 Oct 2020 21:00:30 +0000 (22:00 +0100)]
drm/amdgpu: fix incorrect enum type

core_link_write_dpcd() returns enum dc_status, not ddc_result:

display/dc/core/dc_link_dp.c: In function 'dp_set_panel_mode':
display/dc/core/dc_link_dp.c:4237:11: warning: implicit conversion from 'enum dc_status' to 'enum ddc_result'
[-Wenum-conversion]

Avoid the warning by using the correct enum in the caller.

Fixes: 0b226322434c ("drm/amd/display: Synchronous DisplayPort Link Training")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 20:07:08 +0000 (13:07 -0700)]
drm/amd/display: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 19:07:26 +0000 (12:07 -0700)]
drm/amdgpu: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: fix out-of-bound read on pptable->SkuReserved
Colin Ian King [Wed, 28 Oct 2020 12:43:16 +0000 (12:43 +0000)]
drm/amd/pm: fix out-of-bound read on pptable->SkuReserved

A recent change added two uint16_t elements to PPTable_t and reduced the
uint32_t array down to 8 elements. This results in the dev_info printing
of pptable->SkuReserved[8] accessing a value that is out-of-range on
array SkuReserved.  The array has been shrunk by 1 element, so remove
this extraneous dev_info message.

Addresses-Coverity: ("Out-of-bounds read")
Fixes: 1dc3c5a95b08 ("drm/amd/pm: update driver if file for sienna cichlid")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: remove useless if/else
Zou Wei [Wed, 28 Oct 2020 08:36:11 +0000 (16:36 +0800)]
drm/amd/display: remove useless if/else

Fix the following coccinelle report:

./drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c:1367:3-5:
WARNING: possible condition with no effect (if == else)

Both branches are the same, so remove the if/else altogether.

Fixes: 81875979f0b2 ("drm/amd/display: Remove extra pairs of parentheses in dce_calcs.c")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: drop CONFIG_DRM_AMD_DC_DCN3_01 from atomfirmware.h
Alex Deucher [Fri, 16 Oct 2020 15:42:00 +0000 (11:42 -0400)]
drm/amdgpu: drop CONFIG_DRM_AMD_DC_DCN3_01 from atomfirmware.h

Not needed.

Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/display: remove dal_cmd_tbl_helper_dcn2_get_table2
Alex Deucher [Fri, 16 Oct 2020 15:28:40 +0000 (11:28 -0400)]
drm/amdgpu/display: remove dal_cmd_tbl_helper_dcn2_get_table2

It's unused and identical to dal_cmd_tbl_helper_dce112_get_table2.

Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/display: remove DRM_AMD_DC_GREEN_SARDINE
Alex Deucher [Fri, 16 Oct 2020 14:25:45 +0000 (10:25 -0400)]
drm/amdgpu/display: remove DRM_AMD_DC_GREEN_SARDINE

No need for a separate config option at this point.

Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/powerplay: Only apply optimized mclk dpm policy on polaris
Alex Deucher [Wed, 28 Oct 2020 14:57:50 +0000 (10:57 -0400)]
drm/amdgpu/powerplay: Only apply optimized mclk dpm policy on polaris

Leads to improper dpm on older parts.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1353
Fixes: 8d89b96fe797 ("drm/amd/powerplay: optimize the mclk dpm policy settings")
Reviewed-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agoMAINTAINERS: Update AMD POWERPLAY pattern
Joe Perches [Thu, 29 Oct 2020 21:45:16 +0000 (17:45 -0400)]
MAINTAINERS: Update AMD POWERPLAY pattern

commit e098bc9612c2 ("drm/amd/pm: optimize the power related source code layout")
moved the directory, update the F: file pattern to match.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: do not use ixFEATURE_STATUS for checking smc running
Evan Quan [Tue, 27 Oct 2020 02:24:18 +0000 (10:24 +0800)]
drm/amd/pm: do not use ixFEATURE_STATUS for checking smc running

This reverts commit f87812284172a9809820d10143b573d833cd3f75 ("drm/amdgpu:
Fix bug where DPM is not enabled after hibernate and resume").
It was intended to fix Hawaii S4(hibernation) issue but break S3. As
ixFEATURE_STATUS is filled with garbage data on resume which can be
only cleared by reloading smc firmware(but that will involve many
changes). So, we will revert this S4 fix and seek a new way.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Tested-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: perform SMC reset on suspend/hibernation
Evan Quan [Fri, 16 Oct 2020 02:45:26 +0000 (10:45 +0800)]
drm/amd/pm: perform SMC reset on suspend/hibernation

So that the succeeding resume can be performed based on
a clean state.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Tested-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: enable baco reset for Hawaii
Evan Quan [Wed, 28 Oct 2020 07:37:00 +0000 (15:37 +0800)]
drm/amd/pm: enable baco reset for Hawaii

Which can be used for S4(hibernation) support.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Tested-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the baco reset sequence for CI ASICs
Evan Quan [Wed, 28 Oct 2020 07:34:29 +0000 (15:34 +0800)]
drm/amd/pm: correct the baco reset sequence for CI ASICs

Correct some registers bitmasks and add mmBIOS_SCRATCH_7
reset.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Tested-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: perform srbm soft reset always on SDMA resume
Evan Quan [Wed, 28 Oct 2020 07:29:59 +0000 (15:29 +0800)]
drm/amdgpu: perform srbm soft reset always on SDMA resume

This can address the random SDMA hang after pci config reset
seen on Hawaii.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Tested-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/amdgpu: simplify pa_sc_tile_steering_override check
Chengming Gui [Wed, 28 Oct 2020 09:40:34 +0000 (17:40 +0800)]
drm/amd/amdgpu:  simplify pa_sc_tile_steering_override check

Use ">= CHIP_SIENNA_CICHLID" to replace per asic check

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Hawking.Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agoamdgpu:Add flag for updating MGCG on GFX10
Jinzhou.Su [Wed, 28 Oct 2020 10:06:27 +0000 (18:06 +0800)]
amdgpu:Add flag for updating MGCG on GFX10

Add RLC_CGTT_MGCG_OVERRIDE__RLC_CGTT_SCLK_OVERRIDE_MASK

Signed-off-by: Jinzhou.Su <Jinzhou.Su@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: cleanup gmc_v9_0_process_interrupt
Christian König [Wed, 28 Oct 2020 13:46:56 +0000 (14:46 +0100)]
drm/amdgpu: cleanup gmc_v9_0_process_interrupt

First of all don't snprintf into a char buffer allocated on the stack with
a constant hubname.

Then cleanup to exit the function early in case of a ratelimit or SRIOV.

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>
3 years agodrm/amd/display: allow 18 bit dp output on DCN3
Dmytro Laktyushkin [Tue, 5 May 2020 18:32:33 +0000 (14:32 -0400)]
drm/amd/display: allow 18 bit dp output on DCN3

We need this to pass dp compliance.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Nikola Cornij <nikola.cornij@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdkfd: Fix getting unique_id in topology
Kent Russell [Wed, 28 Oct 2020 12:03:31 +0000 (08:03 -0400)]
drm/amdkfd: Fix getting unique_id in topology

Since the unique_id is now obtained in amdgpu in smu_late_init,
topology misses getting the value during KFD device initialization.
To work around this, we use amdgpu_amdkfd_get_unique_id to get
the unique_id at read time. Due to this, we can remove unique_id from
the kfd_dev structure, since we only need it in the KFD node properties
struct

Signed-off-by: Kent Russell <kent.russell@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agoamdgpu: Add GFX MGCG and MGLS for vangogh
Jinzhou.Su [Tue, 27 Oct 2020 13:37:49 +0000 (21:37 +0800)]
amdgpu: Add GFX MGCG and MGLS for vangogh

add GFX Medium Grain Light Sleep support for vangogh

add AMD_CG_SUPPORT_GFX_CP_LS and AMD_CG_SUPPORT_GFX_RLC_LS

v2:
  add GFX Medium Grain Clock Gating

Signed-off-by: Jinzhou.Su <Jinzhou.Su@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: enable the rest functions of swSMU for vangogh.
Xiaojian Du [Mon, 26 Oct 2020 11:39:29 +0000 (19:39 +0800)]
drm/amd/pm: enable the rest functions of swSMU for vangogh.

This patch is to enable the rest functions of swSMU for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add some swSMU functions for vangogh.
Xiaojian Du [Mon, 26 Oct 2020 11:36:07 +0000 (19:36 +0800)]
drm/amd/pm: add some swSMU functions for vangogh.

This patch is to add some swSMU functions for vangogh, to support the
sensor info on "hwmon" and pm info.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add one new function to get 32 bit feature mask for vangogh
Xiaojian Du [Mon, 26 Oct 2020 11:33:30 +0000 (19:33 +0800)]
drm/amd/pm: add one new function to get 32 bit feature mask for vangogh

This patch is to add one new function to get 32 bit feature mask for
vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: remove some redundant smu message mapping for vangogh
Xiaojian Du [Mon, 26 Oct 2020 11:30:52 +0000 (19:30 +0800)]
drm/amd/pm: remove some redundant smu message mapping for vangogh

This patch is to remove some redundant smu message mapping for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: set the initial value of pm info to zero
Xiaojian Du [Tue, 13 Oct 2020 08:43:25 +0000 (16:43 +0800)]
drm/amd/pm: set the initial value of pm info to zero

This patch is to set the initial value of pm info to zero.
The "value64" is ported to the hwmon and debugfs node, it is a uint64 type.
When it is used for NV10/VEGA10/VEGA20, its word size is appropriate,
because NV10/VEGA10/VEGA20 has a 64bit smu feature mask, which is separated to high 32bit and low 32bit.
But some asic has only 32bit smu feature mask,and this 32bit mask will fill the low 32bit of "value64".
So if this "value64" is not initialized to zero, the high 32bit will be
filled by a meaningless value, when the whole "value64" is ported to the
"SMC Feature Mask" in the "amdgpu_pm_info" on some specific asic, it
will be a wrong value.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: update the smu v11.5 driver interface header for vangogh
Xiaojian Du [Tue, 13 Oct 2020 08:40:59 +0000 (16:40 +0800)]
drm/amd/pm: update the smu v11.5 driver interface header for vangogh

This patch is to update the smu v11.5 driver interface header for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add UMD Pstate Msg Parameters for vangogh temporarily
Xiaojian Du [Tue, 13 Oct 2020 08:31:37 +0000 (16:31 +0800)]
drm/amd/pm: add UMD Pstate Msg Parameters for vangogh temporarily

This patch is to add UMD Pstate Msg Parameters for vangogh temporarily,
     the values refer to renoir.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add new smc message mapping for vangogh
Xiaojian Du [Tue, 13 Oct 2020 07:10:38 +0000 (15:10 +0800)]
drm/amd/pm: add new smc message mapping for vangogh

This patch is to add new smc message mapping for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: update the smu v11.5 firmware header for vangogh
Xiaojian Du [Tue, 13 Oct 2020 07:05:42 +0000 (15:05 +0800)]
drm/amd/pm: update the smu v11.5 firmware header for vangogh

This patch is to update the smu v11.5 firmware header for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: update the smu v11.5 smc header for vangogh
Xiaojian Du [Tue, 13 Oct 2020 07:02:35 +0000 (15:02 +0800)]
drm/amd/pm: update the smu v11.5 smc header for vangogh

This patch is to update the smu v11.5 smc header for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: fix the issue of reserving bad pages failed
Dennis Li [Thu, 22 Oct 2020 09:44:55 +0000 (17:44 +0800)]
drm/amdgpu: fix the issue of reserving bad pages failed

In amdgpu_ras_reset_gpu, because bad pages may not be freed,
it has high probability to reserve bad pages failed.

Change to reserve bad pages when freeing VRAM.

v2:
1. avoid allocating the drm_mm node outside of amdgpu_vram_mgr.c
2. move bad page reserving into amdgpu_ras_add_bad_pages, if vram mgr
   reserve bad page failed, it will put it into pending list, otherwise
   put it into processed list;
3. remove amdgpu_ras_release_bad_pages, because retired page's info has
   been moved into amdgpu_vram_mgr

v3:
1. formate code style;
2. rename amdgpu_vram_reserve_scope as amdgpu_vram_reservation;
3. rename scope_pending as reservations_pending;
4. rename scope_processed as reserved_pages;
5. change to iterate over all the pending ones and try to insert them
   with drm_mm_reserve_node();

v4:
1. rename amdgpu_vram_mgr_reserve_scope as
amdgpu_vram_mgr_reserve_range;
2. remove unused include "amdgpu_ras.h";
3. rename amdgpu_vram_mgr_check_and_reserve as
amdgpu_vram_mgr_do_reserve;
4. refine amdgpu_vram_mgr_reserve_range to call
amdgpu_vram_mgr_do_reserve.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Hawking Zhang <hawking.zhang@amd.com>
Signed-off-by: Dennis Li <Dennis.Li@amd.com>
Signed-off-by: Wenhui Sheng <Wenhui.Sheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: remove redundant GPU reset
Dennis Li [Mon, 19 Oct 2020 06:49:00 +0000 (14:49 +0800)]
drm/amdgpu: remove redundant GPU reset

Because bad pages saving has been moved to UMC error interrupt callback,
which will trigger a new GPU reset after saving.

Signed-off-by: Dennis Li <Dennis.Li@amd.com>
Reviewed-by: Hawking Zhang <hawking.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: change to save bad pages in UMC error interrupt callback
Dennis Li [Mon, 19 Oct 2020 06:19:57 +0000 (14:19 +0800)]
drm/amdgpu: change to save bad pages in UMC error interrupt callback

Instead of saving bad pages in amdgpu_ras_reset_gpu, it will reduce
the unnecessary calling of amdgpu_ras_save_bad_pages.

Signed-off-by: Dennis Li <Dennis.Li@amd.com>
Reviewed-by: Hawking Zhang <hawking.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: rename nv_is_headless_sku()
Flora Cui [Wed, 28 Oct 2020 06:04:29 +0000 (14:04 +0800)]
drm/amdgpu: rename nv_is_headless_sku()

for headless NAVI ASICs

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: disable DCN and VCN for Navi14 0x7340/C9 SKU
Flora Cui [Tue, 27 Oct 2020 06:58:19 +0000 (14:58 +0800)]
drm/amdgpu: disable DCN and VCN for Navi14 0x7340/C9 SKU

Navi14 0x7340/C9 SKU has no display and video support, remove them.

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/display: fix indentation in defer_delay_converter_wa()
Alex Deucher [Mon, 26 Oct 2020 17:42:12 +0000 (13:42 -0400)]
drm/amdgpu/display: fix indentation in defer_delay_converter_wa()

Fixes this warning:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_ddc.c: In function ‘defer_delay_converter_wa’:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_ddc.c:285:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  285 |  if (link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_0080E1 &&
      |  ^~
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_ddc.c:291:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  291 |   if (link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_006037 &&
      |   ^~

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/display: re-add surface size calculation in dcn30_hwseq.c
Alex Deucher [Mon, 26 Oct 2020 16:11:29 +0000 (12:11 -0400)]
drm/amdgpu/display: re-add surface size calculation in dcn30_hwseq.c

This is required for MALL.  Was accidently removed in PSR update.

Fixes: 48e48e598478 ("drm/amd/display: Disable idle optimization when PSR is enabled")
Fixes: 52f2e83e2fe5 ("drm/amdgpu/display: add MALL support (v2)")
Acked-by: Slava Abramov <slava.abramov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon: Expose vddc through hwmon
Sandeep Raghuraman [Fri, 9 Oct 2020 07:49:19 +0000 (13:19 +0530)]
drm/radeon: Expose vddc through hwmon

Create hwmon attribute for vddc, that uses previously declared get_current_vddc() callback if there's an implementation available.

Also hides vddc, if there is no implementation for the current chipset (as per Alexander Deucher's suggestion).

Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon: Add implementation of get_current_vddc for Sumo
Sandeep Raghuraman [Fri, 9 Oct 2020 07:46:09 +0000 (13:16 +0530)]
drm/radeon: Add implementation of get_current_vddc for Sumo

Add implementation of get_current_vddc() callback for Sumo.

Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon: Add new callback that exposes vddc
Sandeep Raghuraman [Fri, 9 Oct 2020 07:43:59 +0000 (13:13 +0530)]
drm/radeon: Add new callback that exposes vddc

This patch adds a callback for reporting vddc, to the dpm field of the radeon_asic structure.

Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: fix the fan speed in fan1_input in manual mode for navi1x
Alex Deucher [Mon, 26 Oct 2020 21:40:42 +0000 (17:40 -0400)]
drm/amdgpu/pm: fix the fan speed in fan1_input in manual mode for navi1x

It has been confirmed that the SMU metrics table should always reflect
the current fan speed even in manual mode.

Fixes: f6eb433954bf ("drm/amdgpu/swsmu: handle manual fan readback on SMU11")
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/swsmu: drop smu i2c bus on navi1x
Alex Deucher [Mon, 26 Oct 2020 21:30:28 +0000 (17:30 -0400)]
drm/amdgpu/swsmu: drop smu i2c bus on navi1x

Stop registering the SMU i2c bus on navi1x.  This leads to instability
issues when userspace processes mess with the bus and also seems to
cause display stability issues in some cases.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1314
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1341
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: drop mem_global_referenced
Christian König [Mon, 19 Oct 2020 12:18:19 +0000 (14:18 +0200)]
drm/amdgpu: drop mem_global_referenced

Not used any more.

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>
3 years agodrm/amdgpu: add vangogh apu flag
Huang Rui [Mon, 26 Oct 2020 12:43:41 +0000 (20:43 +0800)]
drm/amdgpu: add vangogh apu flag

This patch is to add vangogh apu flag to support more kickers that
belongs vangogh series.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: enable MULTI_MON_PP_MCLK_SWITCH DC feature at default
Evan Quan [Wed, 30 Sep 2020 06:48:11 +0000 (14:48 +0800)]
drm/amdgpu: enable MULTI_MON_PP_MCLK_SWITCH DC feature at default

With this, for multiple monitors in sync(e.g. with the same model),
mclk switching will be allowed. That helps saving some idle power on
some ASICs(e.g. Polaris).

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: correct asic type check V2
Evan Quan [Wed, 30 Sep 2020 06:20:38 +0000 (14:20 +0800)]
drm/amd/display: correct asic type check V2

Check chip family also to avoid wrong identification.

V2: use the correct macro without AMDGPU prefix

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: drop redundant display setting
Evan Quan [Tue, 29 Sep 2020 08:51:54 +0000 (16:51 +0800)]
drm/amd/pm: drop redundant display setting

As this is already performed in smu7_set_power_state_tasks().

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: reconfigure smc on display vbitimeout setting change
Evan Quan [Tue, 29 Sep 2020 08:47:41 +0000 (16:47 +0800)]
drm/amd/pm: reconfigure smc on display vbitimeout setting change

Reconfigure smc display settings on vbitimeout change.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the mclk switching setting
Evan Quan [Thu, 18 Jun 2020 07:18:56 +0000 (15:18 +0800)]
drm/amd/pm: correct the mclk switching setting

Correct the mclk switching setting for multiple displays.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: enable Polaris watermark table setting
Evan Quan [Mon, 28 Sep 2020 09:20:55 +0000 (17:20 +0800)]
drm/amd/pm: enable Polaris watermark table setting

Enable watermark table setting for Polaris.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: fulfill the Polaris implementation for get_clock_by_type_with_latency()
Evan Quan [Mon, 28 Sep 2020 09:17:56 +0000 (17:17 +0800)]
drm/amd/pm: fulfill the Polaris implementation for get_clock_by_type_with_latency()

Fulfill Polaris get_clock_by_type_with_latency().

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct vddc_dep_on_dal_pwrl setup
Evan Quan [Fri, 25 Sep 2020 06:38:11 +0000 (14:38 +0800)]
drm/amd/pm: correct vddc_dep_on_dal_pwrl setup

Correct Polaris10 setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct SMC sclk/mclk boot level setup
Evan Quan [Fri, 25 Sep 2020 06:36:09 +0000 (14:36 +0800)]
drm/amd/pm: correct SMC sclk/mclk boot level setup

Correct Polaris smc boot level setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct pcie spc cap setup
Evan Quan [Fri, 25 Sep 2020 06:34:40 +0000 (14:34 +0800)]
drm/amd/pm: correct pcie spc cap setup

Correct Polaris10 pcie spc cap setting.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct clk/voltage dependence setup
Evan Quan [Fri, 25 Sep 2020 06:28:47 +0000 (14:28 +0800)]
drm/amd/pm: correct clk/voltage dependence setup

Correct Polaris10 clk/voltage dependence setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the way to get the highest vddc
Evan Quan [Fri, 25 Sep 2020 06:27:16 +0000 (14:27 +0800)]
drm/amd/pm: correct the way to get the highest vddc

Populate the correct highest vddc setting on Polaris.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct sclk/mclk dpm enablement
Evan Quan [Fri, 25 Sep 2020 06:24:04 +0000 (14:24 +0800)]
drm/amd/pm: correct sclk/mclk dpm enablement

Correct Polaris10 sclk/mclk dpm enablement.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct smc voltage controller setup
Evan Quan [Fri, 25 Sep 2020 06:20:56 +0000 (14:20 +0800)]
drm/amd/pm: correct smc voltage controller setup

Correct Polaris10 smc voltage controller setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct platformcaps setup
Evan Quan [Fri, 25 Sep 2020 06:17:01 +0000 (14:17 +0800)]
drm/amd/pm: correct platformcaps setup

Correct Polaris10 platformcaps setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct VRconfig setting
Evan Quan [Fri, 25 Sep 2020 06:10:21 +0000 (14:10 +0800)]
drm/amd/pm: correct VRconfig setting

Correct Polaris VRconfig setting.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct vddc phase control setting
Evan Quan [Fri, 25 Sep 2020 06:06:48 +0000 (14:06 +0800)]
drm/amd/pm: correct vddc phase control setting

Correct Polaris10 vddc phase control.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct avfs fuse settings
Evan Quan [Fri, 25 Sep 2020 05:17:48 +0000 (13:17 +0800)]
drm/amd/pm: correct avfs fuse settings

Correct Polaris10 avfs fuse setting.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct Polaris DIDT configurations
Evan Quan [Fri, 25 Sep 2020 05:11:02 +0000 (13:11 +0800)]
drm/amd/pm: correct Polaris DIDT configurations

Correct Polaris DIDT enablement.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct Polaris powertune table setup
Evan Quan [Fri, 25 Sep 2020 05:02:40 +0000 (13:02 +0800)]
drm/amd/pm: correct Polaris powertune table setup

Correct powertune table setup for Polaris.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the checks for sclk/mclk SS support
Evan Quan [Fri, 25 Sep 2020 04:59:45 +0000 (12:59 +0800)]
drm/amd/pm: correct the checks for sclk/mclk SS support

Correct sclk/mclk SS support checks.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct VR shared rail info
Evan Quan [Fri, 25 Sep 2020 04:47:41 +0000 (12:47 +0800)]
drm/amd/pm: correct VR shared rail info

Add VR shared rail info.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add mc register table initialization
Evan Quan [Fri, 25 Sep 2020 04:41:25 +0000 (12:41 +0800)]
drm/amd/pm: add mc register table initialization

Add mc register table initialization.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add edc leakage controller setting
Evan Quan [Fri, 25 Sep 2020 04:30:22 +0000 (12:30 +0800)]
drm/amd/pm: add edc leakage controller setting

Enable edc controller table setting.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: setup zero rpm parameters for polaris10
Evan Quan [Fri, 11 Sep 2020 08:21:34 +0000 (16:21 +0800)]
drm/amd/pm: setup zero rpm parameters for polaris10

Only if the ZeroRPM feature is supported.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct polaris10 clock stretcher data table setting
Evan Quan [Thu, 18 Jun 2020 08:15:13 +0000 (16:15 +0800)]
drm/amd/pm: correct polaris10 clock stretcher data table setting

By using the saved copy of ro_range_maximum and ro_range_minimum.
Correct the setting for "LdoRefSel".

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the settings for ro range minimum and maximum
Evan Quan [Fri, 11 Sep 2020 06:44:17 +0000 (14:44 +0800)]
drm/amd/pm: correct the settings for ro range minimum and maximum

Make the settings more precise.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: drop redundant efuse mask calculations
Evan Quan [Fri, 11 Sep 2020 06:22:12 +0000 (14:22 +0800)]
drm/amd/pm: drop redundant efuse mask calculations

By moving that in atomfw_read_efuse().

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: optimize AC timing programming
Evan Quan [Thu, 18 Jun 2020 08:42:36 +0000 (16:42 +0800)]
drm/amd/pm: optimize AC timing programming

Programming AC Timing Parameters is only dependent on MCLK.
No need to nest loop for each SCLK DPM level.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/powerplay: separate Polaris fan table setup from Tonga
Evan Quan [Thu, 18 Jun 2020 08:39:03 +0000 (16:39 +0800)]
drm/amd/powerplay: separate Polaris fan table setup from Tonga

Instead of sharing the fan table setup with Tonga, Polaris has
its own fan table setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add PWR_CKS_CNTL setting
Evan Quan [Thu, 18 Jun 2020 08:28:02 +0000 (16:28 +0800)]
drm/amd/pm: add PWR_CKS_CNTL setting

This is for some special Polaris10 ASICs.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: correct CG_ACLK_CNTL setting
Evan Quan [Thu, 18 Jun 2020 08:26:27 +0000 (16:26 +0800)]
drm/amdgpu: correct CG_ACLK_CNTL setting

Correct polaris CG_ACLK_CNTL setting.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: drop arb table first byte workaround
Evan Quan [Thu, 18 Jun 2020 08:23:52 +0000 (16:23 +0800)]
drm/amd/pm: drop arb table first byte workaround

As this is not needed for polaris.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add pptable VRHotLevel setting
Evan Quan [Thu, 18 Jun 2020 08:20:07 +0000 (16:20 +0800)]
drm/amd/pm: add pptable VRHotLevel setting

Add missing VRHotLevel setting.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the BootLinkLevel setup
Evan Quan [Thu, 18 Jun 2020 08:16:51 +0000 (16:16 +0800)]
drm/amd/pm: correct the BootLinkLevel setup

Set the BootLinkLevel as the max level.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the ACPI table setup V2
Evan Quan [Thu, 18 Jun 2020 08:13:26 +0000 (16:13 +0800)]
drm/amd/pm: correct the ACPI table setup V2

Correct the setting for "ActivityLevel".

V2: rich the comment

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct mclk table setup
Evan Quan [Thu, 18 Jun 2020 08:10:11 +0000 (16:10 +0800)]
drm/amd/pm: correct mclk table setup

Correct the settings for "StutterEnable" and "EnabledForActivity".

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct sclk table setup
Evan Quan [Thu, 18 Jun 2020 08:06:43 +0000 (16:06 +0800)]
drm/amd/pm: correct sclk table setup

Correct Polaris10 sclk table setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct vddci table setup
Evan Quan [Thu, 18 Jun 2020 07:53:05 +0000 (15:53 +0800)]
drm/amd/pm: correct vddci table setup

Make sure the settings are applied only when voltage
controlled by gpio.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: populate smc samu table
Evan Quan [Thu, 18 Jun 2020 07:42:07 +0000 (15:42 +0800)]
drm/amd/pm: populate smc samu table

Add missing smc samu table setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: populate smc vddc table
Evan Quan [Thu, 18 Jun 2020 07:30:10 +0000 (15:30 +0800)]
drm/amd/pm: populate smc vddc table

Add missing vddc table setup.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct the checks for polaris kickers
Evan Quan [Fri, 25 Sep 2020 03:54:19 +0000 (11:54 +0800)]
drm/amd/pm: correct the checks for polaris kickers

By defining new Macros.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Clean up debug macros
Takashi Iwai [Fri, 23 Oct 2020 07:46:56 +0000 (09:46 +0200)]
drm/amd/display: Clean up debug macros

This patch simplifies the ASSERT*() and BREAK_TO_DEBUGGER() macros:
- Move the dependency check of CONFIG_KGDB into Kconfig
- Unify the kgdb_breakpoint() call
- Drop the non-existing CONFIG_HAVE_KGDB

Also align the behavior of ASSERT() macro in both cases with and
without CONFIG_DEBUG_KERNEL_DC.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Don't invoke kgdb_breakpoint() unconditionally
Takashi Iwai [Fri, 23 Oct 2020 07:46:55 +0000 (09:46 +0200)]
drm/amd/display: Don't invoke kgdb_breakpoint() unconditionally

ASSERT_CRITICAL() invokes kgdb_breakpoint() whenever either
CONFIG_KGDB or CONFIG_HAVE_KGDB is set.  This, however, may lead to a
kernel panic when no kdb stuff is attached, since the
kgdb_breakpoint() call issues INT3.  It's nothing but a surprise for
normal end-users.

For avoiding the pitfall, make the kgdb_breakpoint() call only when
CONFIG_DEBUG_KERNEL_DC is set.

https://bugzilla.opensuse.org/show_bug.cgi?id=1177973
Cc: <stable@vger.kernel.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Fix kernel panic by dal_gpio_open() error
Takashi Iwai [Fri, 23 Oct 2020 07:46:54 +0000 (09:46 +0200)]
drm/amd/display: Fix kernel panic by dal_gpio_open() error

Currently both error code paths handled in dal_gpio_open_ex() issues
ASSERT_CRITICAL(), and this leads to a kernel panic unnecessarily if
CONFIG_KGDB is enabled.  Since basically both are non-critical errors
and can be recovered, drop those assert calls and use a safer one,
BREAK_TO_DEBUGGER(), for allowing the debugging, instead.

BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1177973
Cc: <stable@vger.kernel.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>