platform/kernel/linux-starfive.git
4 years agoRevert "drm/amdgpu/vcn: add shared memory restore after wake up from sleep."
James Zhu [Thu, 16 Jul 2020 13:47:35 +0000 (09:47 -0400)]
Revert "drm/amdgpu/vcn: add shared memory restore after wake up from sleep."

This reverts commit 21b704d78352c289d31697824ceea7ad0ff4ce59.
To merge vcn firmware shared memory bo into vcn vcpu bo.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: 3.2.95
Aric Cyr [Mon, 13 Jul 2020 14:07:51 +0000 (10:07 -0400)]
drm/amd/display: 3.2.95

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: interface to obtain minimum plane size caps
Igor Kravchenko [Fri, 10 Jul 2020 20:24:30 +0000 (16:24 -0400)]
drm/amd/display: interface to obtain minimum plane size caps

[Why]
Implement an interface to obtain plane size caps

[How]
Add min_width, min_height fields to dc_plane_cap structure.
Set values to 16x16 for discrete ASICs, and 64x64 for others.

Signed-off-by: Igor Kravchenko <Igor.Kravchenko@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add additional config guards for DCN
Aurabindo Pillai [Fri, 3 Jul 2020 16:37:35 +0000 (12:37 -0400)]
drm/amd/display: Add additional config guards for DCN

[Why&How]

Fix build error by protecting code with config guard
to enable building amdgpu without CONFIG_DRM_AMD_DC_DCN
enabled. This option is disabled by default for allmodconfig.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Call dsc related functions indirectly via dc interface
Aurabindo Pillai [Fri, 19 Jun 2020 19:31:19 +0000 (15:31 -0400)]
drm/amd/display: Call dsc related functions indirectly via dc interface

[Why&How]
Accessing dcn20_add_dsc_to_stream_resource directly
causes build failure for configuration which has
CONFIG_DRM_AMD_DC_DCN disabled. Fix this by
calling the corresponding function exposed via dc
resource functions.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Improve compatibility by re-ordering info-packets
Naveed Ashfaq [Fri, 10 Jul 2020 20:50:50 +0000 (16:50 -0400)]
drm/amd/display: Improve compatibility by re-ordering info-packets

[why]
On DCN20, Some features would not be activated when ALLM was turned on.
TV seemed to activate only the latest info packet sent, and the ALLM
info packet was sent after the VSIF info packet.

The packet indices was also inconsistent between DCN10 and DCN20.

[how]
Change the packet indices of DCN20 to match those of DCN10.
This makes them consistent and also makes the vendor info packet
be sent after the hfvsif info packet.

Signed-off-by: Naveed Ashfaq <Naveed.Ashfaq@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: [FW Promotion] Release 0.0.25
Anthony Koo [Fri, 10 Jul 2020 22:17:20 +0000 (18:17 -0400)]
drm/amd/display: [FW Promotion] Release 0.0.25

Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Make new dc interface for adding dsc resource
Aurabindo Pillai [Mon, 6 Jul 2020 18:53:57 +0000 (14:53 -0400)]
drm/amd/display: Make new dc interface for adding dsc resource

[Why]
dcn20_add_dsc_to_stream_resource is accessed in amdgpu_dm directly.
This creates build error for configuration with DCN disabled.

[How]
Make the function available through a resource pool function so
that dcn20 function need not be called directly.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: rename dsc extended caps as dsc branch decoder caps
Wenjing Liu [Tue, 7 Jul 2020 20:59:31 +0000 (16:59 -0400)]
drm/amd/display: rename dsc extended caps as dsc branch decoder caps

[why]
The capability fields are reserved for DSC branch
only to report the capability related to the
branch's DSC decoder.

Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Decouple ABM init from dmcu
Roman Li [Fri, 10 Jul 2020 14:33:05 +0000 (10:33 -0400)]
drm/amd/display: Decouple ABM init from dmcu

[Why]
With ABM implemented on DMUB the ABM enablement
shoudn't be solely rely on dmcu. Otherwise it won't work
if dmcu is disabled.

[How]
1. Decouple dmcub config copy from dmcu iram copy.
2. Set abm connector property if either dmcu or dmub enabled.

Signed-off-by: Roman Li <roman.li@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Implement AMD VSIF V3
Reza Amini [Thu, 2 Jul 2020 20:10:31 +0000 (16:10 -0400)]
drm/amd/display: Implement AMD VSIF V3

[Why]
To support V3

[How]
Generate new VSIF for V3

Signed-off-by: Reza Amini <Reza.Amini@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DSC parameters logging to debugfs
Eryk Brol [Tue, 16 Jun 2020 18:19:35 +0000 (14:19 -0400)]
drm/amd/display: Add DSC parameters logging to debugfs

[why]
Need to add new parameters to debugfs logging so
we will know what parameters DSC is using for
debug purposes. So we are adding a read function
in debugfs to read DSC status registers

Signed-off-by: Eryk Brol <eryk.brol@amd.com>
Reviewed-by: Mikita Lipski <Mikita.Lipski@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: remove unhelpful 5ms delay
Aric Cyr [Tue, 7 Jul 2020 02:07:46 +0000 (22:07 -0400)]
drm/amd/display: remove unhelpful 5ms delay

[Why]
Scaler vendor confirmed the 5ms was not helpful so no point in keeping
it.

[How]
Revert 5ms delay after setting training pattern.

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Ashley Thomas <Ashley.Thomas2@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: do not disable SMU on vm reboot
Nirmoy Das [Fri, 10 Jul 2020 14:15:40 +0000 (16:15 +0200)]
drm/amdgpu: do not disable SMU on vm reboot

For passthrough device,  we do baco reset after 1st vm boot so
if we disable SMU on 1st VM shutdown baco reset will fail for
2nd vm boot.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Acked-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add timeout flush mechanism to update wptr for self interrupt (v2)
Chengming Gui [Tue, 14 Jul 2020 08:25:04 +0000 (16:25 +0800)]
drm/amdgpu: add timeout flush mechanism to update wptr for self interrupt (v2)

outstanding log reaches threshold will trigger IH ring1/2's wptr
reported, that will avoid generating interrupts to ring0 too frequent.
But if ring1/2's wptr hasn't been increased for a long time, the outstanding log
can't reach threshold so that driver can't get latest wptr info and
miss some interrupts.

v2: squash in warning fix

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable xgmi support for sienna cichlid
John Clements [Fri, 17 Jul 2020 06:13:50 +0000 (14:13 +0800)]
drm/amdgpu: enable xgmi support for sienna cichlid

set xgmi support flag suring nv ip init sequence

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: load asd for sienna cichlid
John Clements [Fri, 17 Jul 2020 06:13:30 +0000 (14:13 +0800)]
drm/amdgpu: load asd for sienna cichlid

do not abort psp asd load sequence for sienna cichlid

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: tag swSMU code layers
Evan Quan [Wed, 8 Jul 2020 04:45:00 +0000 (12:45 +0800)]
drm/amd/powerplay: tag swSMU code layers

Per designs, the swSMU code is separated into four layers. And the typical
calling flow should be like: amdgpu_smu.c -> ${asic}_ppt.c -> smu_v11/12_0.c
-> smu_cmn.c. Compile errors will come out for any violations. This can
help to prevent cross callings(e.g. amdgpu_smu.c -> ${asic}_ppt.c ->
amdgpu_smu.c -> ${asic}_ppt.c) which were common in our code.

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>
4 years agodrm/amd/powerplay: revise the calling flow on OD table update
Evan Quan [Wed, 8 Jul 2020 05:06:04 +0000 (13:06 +0800)]
drm/amd/powerplay: revise the calling flow on OD table update

This can eliminate the cross callings and maintain clear
code layer.

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>
4 years agodrm/amd/powerplay: drop unnecessary message support check
Evan Quan [Wed, 8 Jul 2020 05:04:08 +0000 (13:04 +0800)]
drm/amd/powerplay: drop unnecessary message support check

These messages are known to be supported by all ASICs.

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>
4 years agodrm/amd/powerplay: move SMC message issuing APIs to smu_cmn.c
Evan Quan [Wed, 8 Jul 2020 04:11:59 +0000 (12:11 +0800)]
drm/amd/powerplay: move SMC message issuing APIs to smu_cmn.c

Considering they can be shared by all ASICs.

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>
4 years agodrm/amd/powerplay: update the tables init related
Evan Quan [Wed, 8 Jul 2020 03:17:02 +0000 (11:17 +0800)]
drm/amd/powerplay: update the tables init related

To avoid cross calling and maintain clear code layer.

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>
4 years agodrm/amd/powerplay: move table setting common code to smu_cmn.c
Evan Quan [Tue, 7 Jul 2020 08:18:55 +0000 (16:18 +0800)]
drm/amd/powerplay: move table setting common code to smu_cmn.c

As they are shared by all ASICs.

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>
4 years agodrm/amd/powerplay: maximum code sharing around watermarks setting
Evan Quan [Tue, 7 Jul 2020 07:52:39 +0000 (15:52 +0800)]
drm/amd/powerplay: maximum code sharing around watermarks setting

Maximum code sharing.

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>
4 years agodrm/amd/powerplay: move more APIs to smu_cmn.c
Evan Quan [Tue, 7 Jul 2020 06:49:45 +0000 (14:49 +0800)]
drm/amd/powerplay: move more APIs to smu_cmn.c

Considering they are shared by all ASICs.

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>
4 years agodrm/amd/powerplay: common API for disabling all features with exception
Evan Quan [Tue, 7 Jul 2020 03:41:29 +0000 (11:41 +0800)]
drm/amd/powerplay: common API for disabling all features with exception

We are moving to centralize all feature enablement/support checking and
setting APIs in smu_cmn.c.

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>
4 years agodrm/amd/powerplay: move ppfeature mask setting to smu_cmn.c
Evan Quan [Tue, 7 Jul 2020 06:06:40 +0000 (14:06 +0800)]
drm/amd/powerplay: move ppfeature mask setting to smu_cmn.c

Considering they are shared by all ASICs. And we are moving
to centralize all feature enablement/support checking and
setting APIs in smu_cmn.c.

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>
4 years agodrm/amd/powerplay: implement smu_cmn_get_enabled_mask() for all ASICs
Evan Quan [Tue, 7 Jul 2020 03:48:06 +0000 (11:48 +0800)]
drm/amd/powerplay: implement smu_cmn_get_enabled_mask() for all ASICs

Instead of having each for smu v11 and v12.

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>
4 years agodrm/amd/powerplay: move dpm feature enablement checking to smu_cmn.c
Evan Quan [Tue, 7 Jul 2020 03:10:39 +0000 (11:10 +0800)]
drm/amd/powerplay: move dpm feature enablement checking to smu_cmn.c

Considering it is shared by all ASICs and smu_cmn.c should be
the right place.

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>
4 years agodrm/amd/powerplay: move dpm feature support checking to smu_cmn.c
Evan Quan [Tue, 7 Jul 2020 02:18:02 +0000 (10:18 +0800)]
drm/amd/powerplay: move dpm feature support checking to smu_cmn.c

Considering it is shared by all ASICs and smu_cmn.c should be
the right place.

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>
4 years agodrm/amd/powerplay: move clock dpm enablement check to smu_v11/v12
Evan Quan [Tue, 7 Jul 2020 02:24:31 +0000 (10:24 +0800)]
drm/amd/powerplay: move clock dpm enablement check to smu_v11/v12

As those APIs of smu_v11/v12 are more widely called. And they
need this check also.

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>
4 years agodrm/amd/powerplay: drop unused code
Evan Quan [Mon, 6 Jul 2020 08:18:57 +0000 (16:18 +0800)]
drm/amd/powerplay: drop unused code

Those code were obsoleted by new common API
smu_cmn_to_asic_specific_index().

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>
4 years agodrm/amd/powerplay: unify swSMU index to asic specific index mapping
Evan Quan [Mon, 6 Jul 2020 08:11:31 +0000 (16:11 +0800)]
drm/amd/powerplay: unify swSMU index to asic specific index mapping

By this we can drop redundant code.

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>
4 years agodrm/amd/powerplay: widely share the API for data table retrieving
Evan Quan [Mon, 6 Jul 2020 03:03:00 +0000 (11:03 +0800)]
drm/amd/powerplay: widely share the API for data table retrieving

Considering the data table retrieving can be more widely shared,
amdgpu_atombios.c is the right place.

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>
4 years agodrm/amdgpu: add read amdgpu_gfxoff status in debugfs
Jinzhou.Su [Tue, 7 Jul 2020 10:52:18 +0000 (18:52 +0800)]
drm/amdgpu: add read amdgpu_gfxoff status in debugfs

 Add interface for SMU12 device, used by UMR.

v2: fix code style

Signed-off-by: Jinzhou.Su <Jinzhou.Su@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: load ta firmware for sienna cichlid
Bhawanpreet Lakha [Thu, 16 Jul 2020 17:44:08 +0000 (13:44 -0400)]
drm/amdgpu: load ta firmware for sienna cichlid

call psp_int_ta_microcode() to parse the ta firmware.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: John Clements <John.Clements@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: suppress compile error around BUG_ON
Evan Quan [Wed, 15 Jul 2020 06:01:29 +0000 (14:01 +0800)]
drm/amd/powerplay: suppress compile error around BUG_ON

To suppress the compile error below for "ARCH=arc".
   drivers/gpu/drm/amd/amdgpu/../powerplay/arcturus_ppt.c: In function 'arcturus_fill_eeprom_i2c_req':
>> arch/arc/include/asm/bug.h:22:2: error: implicit declaration of function 'pr_warn'; did you mean 'pci_warn'? [-Werror=implicit-function-declaration]
      22 |  pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
         |  ^~~~~~~
   include/asm-generic/bug.h:62:57: note: in expansion of macro 'BUG'
      62 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
         |                                                         ^~~
   drivers/gpu/drm/amd/amdgpu/../powerplay/arcturus_ppt.c:2157:2: note: in expansion of macro 'BUG_ON'
    2157 |  BUG_ON(numbytes > MAX_SW_I2C_COMMANDS);

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>
4 years agodrm/amdgpu/smu11: drop code chuck that got accidently re-added
Alex Deucher [Tue, 21 Jul 2020 19:31:52 +0000 (15:31 -0400)]
drm/amdgpu/smu11: drop code chuck that got accidently re-added

Seems to be due to a bad merge.  Code was originally added in
commit 5aaa8fff3aa950 ("drm/amd/powerplay: unload mp1 for Arcturus RAS baco reset")
but later removed in commit 7f70443fd83407 ("drm/amdgpu: set mp1 state before reload").
but is back again.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/amdkfd: Fix large framesize for kfd_smi_ev_read()
Aurabindo Pillai [Tue, 19 May 2020 20:48:43 +0000 (16:48 -0400)]
drm/amd/amdkfd: Fix large framesize for kfd_smi_ev_read()

The buffer allocated is of 1024 bytes. Allocate this from
heap instead of stack.

Also remove check for stack size since we're allocating from heap

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agoinclude/uapi/linux: Update KFD ioctl version
Amber Lin [Mon, 20 Apr 2020 23:42:46 +0000 (19:42 -0400)]
include/uapi/linux: Update KFD ioctl version

Bump KFD ioctl after adding SMI events support

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Provide SMI events watch
Amber Lin [Wed, 13 May 2020 12:19:29 +0000 (08:19 -0400)]
drm/amdkfd: Provide SMI events watch

When the compute is malfunctioning or performance drops, the system admin
will use SMI (System Management Interface) tool to monitor/diagnostic what
went wrong. This patch provides an event watch interface for the user
space to register devices and subscribe events they are interested. After
registered, the user can use annoymous file descriptor's poll function
with wait-time specified and wait for events to happen. Once an event
happens, the user can use read() to retrieve information related to the
event.

VM fault event is done in this patch.

v2: - remove UNREGISTER and add event ENABLE/DISABLE
    - correct kfifo usage
    - move event message API to kfd_ioctl.h
v3: send the event msg in text than in binary
v4: support multiple clients
v5: move events enablement from ioctl to fd write
v6: sparse fix

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable ih CG for navy_flounder
Jiansong Chen [Wed, 8 Jul 2020 11:02:14 +0000 (19:02 +0800)]
drm/amdgpu: enable ih CG for navy_flounder

Enable ih CG by setting the corresponding flag.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable hdp CG and LS for navy_flounder
Jiansong Chen [Wed, 8 Jul 2020 10:59:11 +0000 (18:59 +0800)]
drm/amdgpu: enable hdp CG and LS for navy_flounder

Enable hdp CG and LS by setting the corresponding flags.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable mc CG and LS for navy_flounder
Jiansong Chen [Wed, 8 Jul 2020 10:53:36 +0000 (18:53 +0800)]
drm/amdgpu: enable mc CG and LS for navy_flounder

Enable mc CG and LS by setting the corresponding flags.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable athub/mmhub PG for navy_flounder
Jiansong Chen [Wed, 8 Jul 2020 10:42:04 +0000 (18:42 +0800)]
drm/amdgpu: enable athub/mmhub PG for navy_flounder

Enable athub/mmhub PG by setting the corresponding flags.
Actually the enablement is exercised by PMFW.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: set VCN1 pg only for sienna_cichlid
Jiansong Chen [Tue, 7 Jul 2020 08:54:06 +0000 (16:54 +0800)]
drm/amd/powerplay: set VCN1 pg only for sienna_cichlid

navy_flounder has one VCN instance, and the work around
is to avoid smu reponse error when setting VCN1 pg for
the chip. It is preferred VCN0 and VCN1 are separated
for the pg setting so better power efficiency can be
achieved.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: add DC support for navy flounder
Bhawanpreet Lakha [Wed, 8 Jul 2020 21:11:12 +0000 (17:11 -0400)]
drm/amd/display: add DC support for navy flounder

Plumb DC support for navy flounder through.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: support athub cg setting for navy_flounder
Jiansong Chen [Thu, 2 Jul 2020 09:35:08 +0000 (17:35 +0800)]
drm/amdgpu: support athub cg setting for navy_flounder

navy_flounder has athub ip v2.1.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable GFX clock gating for navy_flounder
Jiansong Chen [Thu, 2 Jul 2020 07:34:37 +0000 (15:34 +0800)]
drm/amdgpu: enable GFX clock gating for navy_flounder

Enable GFX MGCG, CGCG and 3DCG for navy_flounder.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable JPEG3.0 PG and CG for navy_flounder
Boyuan Zhang [Wed, 1 Jul 2020 22:02:32 +0000 (18:02 -0400)]
drm/amdgpu: enable JPEG3.0 PG and CG for navy_flounder

Enable JPEG3.0 PG and CG for navy_flounder by setting up the flags to the ASIC

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable VCN3.0 DPG for navy_flounder
Boyuan Zhang [Wed, 1 Jul 2020 21:59:51 +0000 (17:59 -0400)]
drm/amdgpu: enable VCN3.0 DPG for navy_flounder

Enable VCN3.0 DPG for navy_flounder by setting up the flag to the ASIC

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable VCN3.0 PG and CG for navy_flounder
Boyuan Zhang [Wed, 1 Jul 2020 21:57:47 +0000 (17:57 -0400)]
drm/amdgpu: enable VCN3.0 PG and CG for navy_flounder

Enable VCN3.0 PG and CG for navy_flounder by setting up the flags to the ASIC

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable cp_fw_write_wait for navy_flounder
Jiansong Chen [Wed, 24 Jun 2020 04:47:54 +0000 (12:47 +0800)]
drm/amdgpu: enable cp_fw_write_wait for navy_flounder

It's the same with sienna_cichlid, cp fw for navy_flounder
can support WAIT_REG_MEM packet.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add vcn ip block for navy_flounder
Boyuan Zhang [Wed, 8 Jul 2020 20:48:26 +0000 (16:48 -0400)]
drm/amdgpu: add vcn ip block for navy_flounder

Add vcn3.0 and jpeg3.0 ip blocks for navy_flounder

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add navy_flounder vcn firmware support
Boyuan Zhang [Fri, 19 Jun 2020 21:24:35 +0000 (17:24 -0400)]
drm/amdgpu: add navy_flounder vcn firmware support

Add navy_flounder to vcn family

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/gfx10: add gc golden setting for navy_flounder
Jiansong Chen [Wed, 10 Jun 2020 08:45:48 +0000 (16:45 +0800)]
drm/amdgpu/gfx10: add gc golden setting for navy_flounder

Add gc golden setting for navy_flounder

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Add kfd2kgd_funcs for navy_flounder kfd support
Chengming Gui [Fri, 5 Jun 2020 02:59:58 +0000 (10:59 +0800)]
drm/amdkfd: Add kfd2kgd_funcs for navy_flounder kfd support

Add callbacks to KGD for navy flounder.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Support navy_flounder KFD
Chengming Gui [Tue, 2 Jun 2020 08:15:56 +0000 (16:15 +0800)]
drm/amdkfd: Support navy_flounder KFD

Add KFD support for Navy Flounder.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: use front door firmware loading for navy_flounder
Jiansong Chen [Wed, 29 Apr 2020 10:18:23 +0000 (18:18 +0800)]
drm/amdgpu: use front door firmware loading for navy_flounder

Same as other navi asics.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add psp block for navy_flounder
Jiansong Chen [Wed, 8 Jul 2020 21:07:26 +0000 (17:07 -0400)]
drm/amdgpu: add psp block for navy_flounder

Add psp and smu block for navy_flounder with
psp firmware load type.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add psp support for navy_flounder
Jiansong Chen [Wed, 15 Apr 2020 10:38:05 +0000 (18:38 +0800)]
drm/amdgpu: add psp support for navy_flounder

Currently skip ASD FW loading and ih reroute per
sienna_cichlid.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add smu block for navy_flounder
Jiansong Chen [Wed, 15 Apr 2020 03:20:19 +0000 (11:20 +0800)]
drm/amdgpu: add smu block for navy_flounder

Add SMU block for navy_flounder with direct
firmware load type.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/powerplay: add smu support for navy_flounder
Jiansong Chen [Tue, 14 Jul 2020 16:34:45 +0000 (12:34 -0400)]
drm/amdgpu/powerplay: add smu support for navy_flounder

Now navy_flounder will reuse the smu11 driver_if header and ppt
functions for sienna_cichlid. Later navy_flounder can maintain
its own version if the compatibility is broken.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add gmc cg support for navy_flounder
Jiansong Chen [Mon, 13 Apr 2020 09:26:30 +0000 (17:26 +0800)]
drm/amdgpu: add gmc cg support for navy_flounder

The athub version used for navy_flounder is v2.1.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: force pa_sc_tile_steering_override to 0 for navy_flounder
Jiansong Chen [Mon, 13 Apr 2020 08:11:27 +0000 (16:11 +0800)]
drm/amdgpu: force pa_sc_tile_steering_override to 0 for navy_flounder

pa_sc_tile_steering_override is only programmable for
gfx10.0/10.1/10.2, and navy_flounder has the same gfx10.3 IP
with sienna_cichlid.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: configure navy_flounder gfx according to gfx 10.3
Tao Zhou [Thu, 20 Feb 2020 08:22:31 +0000 (16:22 +0800)]
drm/amdgpu: configure navy_flounder gfx according to gfx 10.3

The gfx version of navy_flounder is 10.3, identical to
sienna_cichlid, follow the way of sienna_cichlid.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add virtual display support for navy_flounder.
Jiansong Chen [Mon, 24 Feb 2020 06:28:34 +0000 (14:28 +0800)]
drm/amdgpu: add virtual display support for navy_flounder.

Virtual display support for bring up and virtualization.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add sdma ip block for navy_flounder
Jiansong Chen [Fri, 14 Feb 2020 08:19:13 +0000 (16:19 +0800)]
drm/amdgpu: add sdma ip block for navy_flounder

Navy_Flounder has the same sdma IP version with
sienna_cichlid, and it has 2 sdma controllers.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add gfx ip block for navy_flounder
Jiansong Chen [Thu, 13 Feb 2020 07:43:15 +0000 (15:43 +0800)]
drm/amdgpu: add gfx ip block for navy_flounder

since navy_flounder has similar gc IP version with
sienna_cichlid, follow its setting for the moment.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add ih ip block for navy_flounder
Jiansong Chen [Wed, 12 Feb 2020 14:32:01 +0000 (22:32 +0800)]
drm/amdgpu: add ih ip block for navy_flounder

navy_flounder has the same osssys IP verison with
sienna_cichlid, follow its setting.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add gmc ip block for navy_flounder
Jiansong Chen [Wed, 12 Feb 2020 14:19:37 +0000 (22:19 +0800)]
drm/amdgpu: add gmc ip block for navy_flounder

navy_flounder has similar gc IP version with sienna_cichlid,
follow its setting for the moment.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add common ip block for navy_flounder
Jiansong Chen [Wed, 12 Feb 2020 13:47:47 +0000 (21:47 +0800)]
drm/amdgpu: add common ip block for navy_flounder

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add support on mmhub for navy_flounder
Jiansong Chen [Wed, 12 Feb 2020 13:12:56 +0000 (21:12 +0800)]
drm/amdgpu: add support on mmhub for navy_flounder

navy_flounder has the same mmhub IP version with sienna_cichlid,
follow its setting.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: initialize IP offset for navy_flounder
Jiansong Chen [Tue, 11 Feb 2020 06:00:39 +0000 (14:00 +0800)]
drm/amdgpu: initialize IP offset for navy_flounder

since navy_flounder has the same ip offset with sienna_cichlid,
follow sienna_cichlid setting for the moment.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/soc15: add support for navy_flounder
Jiansong Chen [Mon, 10 Feb 2020 09:00:28 +0000 (17:00 +0800)]
drm/amdgpu/soc15: add support for navy_flounder

Add soc support.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/gfx10: add clockgating support for navy_flounder
Jiansong Chen [Mon, 10 Feb 2020 07:50:13 +0000 (15:50 +0800)]
drm/amdgpu/gfx10: add clockgating support for navy_flounder

Same as navi10.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/gmc10: add navy_flounder support
Jiansong Chen [Mon, 10 Feb 2020 07:34:56 +0000 (15:34 +0800)]
drm/amdgpu/gmc10: add navy_flounder support

Same as navi10.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/gfx10: add support for navy_flounder firmware
Jiansong Chen [Mon, 10 Feb 2020 07:21:09 +0000 (15:21 +0800)]
drm/amdgpu/gfx10: add support for navy_flounder firmware

Declare the gfx/compute firmwares.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: set asic family and ip blocks for navy_flounder
Jiansong Chen [Mon, 10 Feb 2020 07:08:53 +0000 (15:08 +0800)]
drm/amdgpu: set asic family and ip blocks for navy_flounder

Add the asic family and IP blocks for navy flounder.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: set fw load type for navy_flounder
Jiansong Chen [Mon, 10 Feb 2020 07:03:41 +0000 (15:03 +0800)]
drm/amdgpu: set fw load type for navy_flounder

Currently navy_flounder only supports backdoor loading type.
Will switch to psp load type when psp is ready.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add navy_flounder gpu info firmware
Jiansong Chen [Mon, 10 Feb 2020 07:00:33 +0000 (15:00 +0800)]
drm/amdgpu: add navy_flounder gpu info firmware

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add navy_flounder asic type
Jiansong Chen [Mon, 10 Feb 2020 06:25:57 +0000 (14:25 +0800)]
drm/amdgpu: add navy_flounder asic type

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: expand to add multiple trap event irq id
Huang Rui [Sat, 12 Oct 2019 11:55:48 +0000 (19:55 +0800)]
drm/amdgpu: expand to add multiple trap event irq id

Sienna_cichlid has four sdma instances, but other chips don't.
So we need expand to add multiple trap event irq id in sdma
v5.2.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/sriov skip vcn powergating and dec_ring_test
Jack Zhang [Mon, 29 Jun 2020 02:06:49 +0000 (10:06 +0800)]
drm/amd/sriov skip vcn powergating and dec_ring_test

1.Skip decode_ring test in VF, because VCN in SRIOV does not
support direct register read/write.

2.Skip powergating configuration in hw fini because
VCN3.0 SRIOV doesn't support powergating.

V2: delete unneccessary white lines and refine implementation.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: correct ta header v2 ucode init start address
John Clements [Wed, 15 Jul 2020 07:10:09 +0000 (15:10 +0800)]
drm/amdgpu: correct ta header v2 ucode init start address

resolve bug calculating fw start address within binary

Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/sriov porting sriov cap to vcn3.0
Jack Zhang [Mon, 29 Jun 2020 02:01:21 +0000 (10:01 +0800)]
drm/amd/sriov porting sriov cap to vcn3.0

1.In early_init and for sriov, hardcode
  harvest_config=0, enc_num=1

2.sw_init/fini
  alloc & free mm_table for sriov
  doorbell setting for sriov

3.hw_init/fini
  Under sriov, add start_sriov to config mmsch
  Skip ring_test to avoid mmio in VF, but need to initialize wptr for vcn rings.

4.Implementation for vcn_v3_0_start_sriov

V2:Clean-up some uneccessary funciton declaration.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/sriov add mmsch_v3 interface
Jack Zhang [Mon, 29 Jun 2020 01:55:26 +0000 (09:55 +0800)]
drm/amd/sriov add mmsch_v3 interface

For VCN3.0 SRIOV, Guest driver needs to communicate with mmsch
to set the World Switch for MM appropriately. This patch add
the interface for mmsch_v3.0.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
Reviewed-by: Dennis Li <Dennis.Li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: optimize rlcg write for gfx_v10
Jack Zhang [Wed, 24 Jun 2020 02:19:20 +0000 (10:19 +0800)]
drm/amdgpu: optimize rlcg write for gfx_v10

For gfx10 boards, except for nv12, other boards take mmio write
rather than rlcg write

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/sriov skip jped ip block and close pgcg flags
Jack Zhang [Tue, 23 Jun 2020 11:36:24 +0000 (19:36 +0800)]
drm/amd/sriov skip jped ip block and close pgcg flags

For SIENNA_CICHLID SRIOV, jpeg and pgcp is not supported.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: drop unused code around thermal range setting
Evan Quan [Thu, 2 Jul 2020 08:06:55 +0000 (16:06 +0800)]
drm/amd/powerplay: drop unused code around thermal range setting

Leftover of previous cleanups.

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>
4 years agodrm/amd/powerplay: maximum the code sharing on thermal irq setting
Evan Quan [Thu, 2 Jul 2020 07:59:03 +0000 (15:59 +0800)]
drm/amd/powerplay: maximum the code sharing on thermal irq setting

Put the common code in smu_v11_0.c instead of having one copy each.

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>
4 years agodrm/amd/powerplay: sort the call flow on temperature ranges retrieving
Evan Quan [Thu, 2 Jul 2020 07:38:53 +0000 (15:38 +0800)]
drm/amd/powerplay: sort the call flow on temperature ranges retrieving

This can help to maintain clear code layer.

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>
4 years agodrm/amd/powerplay: cache the software_shutdown_temp
Evan Quan [Thu, 2 Jul 2020 07:13:02 +0000 (15:13 +0800)]
drm/amd/powerplay: cache the software_shutdown_temp

As it's needed in the succeeding thermal irq setting.

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>
4 years agodrm/amd/powerplay: correct Sienna Cichlid temperature limit settings
Evan Quan [Thu, 2 Jul 2020 06:56:34 +0000 (14:56 +0800)]
drm/amd/powerplay: correct Sienna Cichlid temperature limit settings

These are needed for temp1/2/3 related hwmon interfaces.

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>
4 years agodrm/amd/powerplay: correct Navi1X temperature limit settings
Evan Quan [Thu, 2 Jul 2020 06:48:03 +0000 (14:48 +0800)]
drm/amd/powerplay: correct Navi1X temperature limit settings

These are needed for temp1/2/3 related hwmon interfaces.

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>
4 years agodrm/amd/powerplay: correct the supported pcie GenSpeed and LaneCount
Evan Quan [Fri, 3 Jul 2020 06:53:06 +0000 (14:53 +0800)]
drm/amd/powerplay: correct the supported pcie GenSpeed and LaneCount

The LCLK dpm table setup should be performed in .update_pcie_parameters().
Otherwise, the updated GenSpeed and LaneCount information will be lost.

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>
4 years agodrm/amd/powerplay: drop unnecessary wrapper around pcie parameters setting
Evan Quan [Thu, 2 Jul 2020 06:09:18 +0000 (14:09 +0800)]
drm/amd/powerplay: drop unnecessary wrapper around pcie parameters setting

This can also help to maintain clear code layer.

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>
4 years agodrm/amd/powerplay: drop unused APIs and parameters
Evan Quan [Thu, 2 Jul 2020 04:42:06 +0000 (12:42 +0800)]
drm/amd/powerplay: drop unused APIs and parameters

Leftover of previous performance level setting cleanups.

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>
4 years agodrm/amd/powerplay: drop smu_v12_0.c unnecessary wrapper V2
Evan Quan [Thu, 2 Jul 2020 04:26:26 +0000 (12:26 +0800)]
drm/amd/powerplay: drop smu_v12_0.c unnecessary wrapper V2

By moving the implemention to renoir_ppt.c considering
it's really ASIC specific.

V2: fix compile warnings below
drivers/gpu/drm/amd/amdgpu/../powerplay/renoir_ppt.h:40:25: warning: array subscript is above array bounds [-Warray-bounds]
    freq = table->FClocks[dpm_level].Freq; \
drivers/gpu/drm/amd/amdgpu/../powerplay/renoir_ppt.c:195:2: note: in expansion of macro ‘GET_DPM_CUR_FREQ’
  GET_DPM_CUR_FREQ(clk_table, clk_type, dpm_level, *freq);
  ^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../powerplay/renoir_ppt.h:46:25: warning: array subscript is above array bounds [-Warray-bounds]
    freq = table->FClocks[dpm_level].Freq;  \
drivers/gpu/drm/amd/amdgpu/../powerplay/renoir_ppt.c:195:2: note: in expansion of macro ‘GET_DPM_CUR_FREQ’
  GET_DPM_CUR_FREQ(clk_table, clk_type, dpm_level, *freq);

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>
4 years agodrm/amd/powerplay: drop unnecessary wrappers
Evan Quan [Thu, 2 Jul 2020 04:12:22 +0000 (12:12 +0800)]
drm/amd/powerplay: drop unnecessary wrappers

By calling the target APIs directly.

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>