]> git.proxmox.com Git - mirror_ubuntu-kernels.git/log
mirror_ubuntu-kernels.git
3 years agodrm/amd/display: Add DCN3.1 HDCP support
Nicholas Kazlauskas [Wed, 19 May 2021 16:37:16 +0000 (12:37 -0400)]
drm/amd/display: Add DCN3.1 HDCP support

New DTM interface is V3 and we need to extend our existing support
to enable HDCP on DCN3.1.

Version the helpers and fallback to the older versions on failure
in the new interfaces.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 PANEL
Nicholas Kazlauskas [Wed, 19 May 2021 16:33:22 +0000 (12:33 -0400)]
drm/amd/display: Add DCN3.1 PANEL

The PANEL block handles embedded panel power and backlight programming.

This programming and sequencing is now owned by DMCUB and driver will
call into the interface for backlight status and programming.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 DMCUB
Nicholas Kazlauskas [Wed, 2 Jun 2021 15:28:22 +0000 (11:28 -0400)]
drm/amd/display: Add DCN3.1 DMCUB

DMCU-B (Display Micro-Controller Unit B) is a display microcontroller
used for shared display functionality with BIOS and for advanced
power saving display features.

Extends the command header to include new DCN3.1 functionality.

Adds new interfaces to DC dmub interface as well for z-state support.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 GPIO support
Nicholas Kazlauskas [Wed, 19 May 2021 16:28:11 +0000 (12:28 -0400)]
drm/amd/display: Add DCN3.1 GPIO support

Extends off of DCN3.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 IRQ manager
Nicholas Kazlauskas [Wed, 19 May 2021 16:27:17 +0000 (12:27 -0400)]
drm/amd/display: Add DCN3.1 IRQ manager

Add IRQ services for DCN3.1 to handle hardware generated interrupts.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 DML calculation support
Nicholas Kazlauskas [Wed, 19 May 2021 16:22:47 +0000 (12:22 -0400)]
drm/amd/display: Add DCN3.1 DML calculation support

DML (Display mode library) is used for calculating watermarks, bandwidth
and for validating display configurations.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 DCHHUB
Nicholas Kazlauskas [Wed, 19 May 2021 15:28:27 +0000 (11:28 -0400)]
drm/amd/display: Add DCN3.1 DCHHUB

Adds DCN3.1 DCHHUB programming and modifies DCN20/DCN30 shared
hardware sequencer helpers to use these hooks.

HW Blocks:

 +--------++------+       +----------+
 |DCHUBBUB|| HUBP |  <--  | MMHUBBUB |
 +--------++------+       +----------+
        |                      ^
        v                      |
    +--------+             +--------+
    |  DPP   | <---------> |  DWB   |
    +--------+             +--------+
        |                      ^
        v                      |
    +--------+                 |
    |  MPC   |                 |
    +--------+                 |
        |                      |
        v                      |
    +-------+                  |
    |  OPP  |                  |
    +-------+                  |
        |                      |
        v                      |
    +--------+                /
    |  OPTC  |  --------------
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

No changes to MMHUBBUB or DWB programming, added to diagram for clarity.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 OPTC
Nicholas Kazlauskas [Wed, 19 May 2021 15:01:50 +0000 (11:01 -0400)]
drm/amd/display: Add DCN3.1 OPTC

Add support for programming the DCN3.1 OPTC (Output Timing Controller)

HW Blocks:

    +--------+
    |  MPC   |
    +--------+
        |
        v
    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

There are no changes to OPP or MPC for DCN3.1, so the diagram will
include them in this patch.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 DIO
Nicholas Kazlauskas [Wed, 19 May 2021 14:58:19 +0000 (10:58 -0400)]
drm/amd/display: Add DCN3.1 DIO

Add support for the DIO (Display IO) block of DCN3.1 which controls
legacy HDMI/DP stream/link encoding.

HW Blocks:

    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Includes some updates to core logic for link encoder assignment and
future support for new high bandwidth output.

v2: squash in unused variable fix (Alex)

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 DCCG
Nicholas Kazlauskas [Wed, 19 May 2021 14:51:45 +0000 (10:51 -0400)]
drm/amd/display: Add DCN3.1 DCCG

Add programming of the DCCG (Display Controller Clock Generator) block:

HW Blocks:

    +--------+
    |  DCCG  |
    +--------+

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 clock manager support
Nicholas Kazlauskas [Wed, 19 May 2021 14:47:22 +0000 (10:47 -0400)]
drm/amd/display: Add DCN3.1 clock manager support

Adds support for clock requests for the various parts of the DCN3.1 IP
and the interfaces and definitions for sending messages to SMU/PMFW.

Includes new support for z9/10, detecting SMU timeout and p-state
support enablement.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add DCN3.1 yellow carp asic family IDs
Nicholas Kazlauskas [Wed, 19 May 2021 14:36:07 +0000 (10:36 -0400)]
drm/amd/display: Add DCN3.1 yellow carp asic family IDs

[Why & How]
To determine whether the chip is yellow carp or not and which revision
it is.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: Update atomfirmware for DCN3.1 phy tuning and eDP caps
Nicholas Kazlauskas [Wed, 19 May 2021 14:38:47 +0000 (10:38 -0400)]
drm/amdgpu: Update atomfirmware for DCN3.1 phy tuning and eDP caps

[Why & How]
We'll need these in driver for phy tuning in DCN3.1.

Multiple eDP support also requires understanding which LCD the backlight
curve in atombios is for.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add video_codecs query support for yellow carp
James Zhu [Wed, 28 Apr 2021 18:15:02 +0000 (14:15 -0400)]
drm/amdgpu: add video_codecs query support for yellow carp

Add video_codecs query support for yellow carp.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: James Zhu <James.Zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: disable manually setting MCLK power level on yellow carp
Xiaomeng Hou [Wed, 14 Apr 2021 08:56:28 +0000 (16:56 +0800)]
drm/amd/pm: disable manually setting MCLK power level on yellow carp

PMFW provides specific messages for setting fclk freq range thus adjust
the power level. There's misusing of these messages when setting
dpm mclk. Since actually mclk could adjust automatically complying with
fclk, remove standalone support for mclk dpm level setting.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add mode2 reset support for yellow carp
Aaron Liu [Wed, 14 Apr 2021 07:05:00 +0000 (15:05 +0800)]
drm/amdgpu: add mode2 reset support for yellow carp

This patch adds mode2 reset support for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add set_performance_level function for yellow carp
Xiaomeng Hou [Thu, 8 Apr 2021 01:44:02 +0000 (09:44 +0800)]
drm/amd/pm: add set_performance_level function for yellow carp

This patch enables editing sysfs file power_dpm_force_performance_level
for yellow carp. User could thus adjust the dpm forced level.

v2: enable fine grain control of GFXCLK only when in manual performance
level mode. In other mode, the min/max range of GFXCLK will be reset to
corresponding values.

Ex: To enable min 300MHz / max 600MHz gfx clocks

1) echo manual > /sys/bus/pci/devices/.../power_dpm_force_performance_level
2) echo s 0 300 > /sys/bus/pci/devices/.../pp_od_clk_voltage
3) echo s 1 600 > /sys/bus/pci/devices/.../pp_od_clk_voltage
4) echo c > /sys/bus/pci/devices/.../pp_od_clk_voltage

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: correct the cu and rb info for yellow carp
Xiaomeng Hou [Tue, 6 Apr 2021 01:35:13 +0000 (09:35 +0800)]
drm/amdgpu: correct the cu and rb info for yellow carp

Skip disabled sa to correct the cu_info and active_rbs for yellow carp.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Suggested-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add gpu harvest support for yellow carp (v2)
Xiaomeng Hou [Tue, 6 Apr 2021 01:33:16 +0000 (09:33 +0800)]
drm/amdgpu: add gpu harvest support for yellow carp (v2)

Register callback in gfxhub functions to program the bypass groups in
gc_utcl2 corresponding to harvested SA.

v2: update comments (Alex)

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add the interface to dump smu metrics table for yellow carp
Xiaomeng Hou [Tue, 30 Mar 2021 11:06:12 +0000 (19:06 +0800)]
drm/amd/pm: add the interface to dump smu metrics table for yellow carp

This patch is to add the interface to dump smu metrics table for yellow
carp.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add callbacks to read/write sysfs file pp_power_profile_mode
Xiaomeng Hou [Mon, 29 Mar 2021 13:27:49 +0000 (21:27 +0800)]
drm/amd/pm: add callbacks to read/write sysfs file pp_power_profile_mode

Implement the sysfs API for getting/setting pp_power_profile_mode for
yellow carp.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add callback get_dpm_ultimate_freq for yellow carp
Xiaomeng Hou [Sun, 28 Mar 2021 12:59:34 +0000 (20:59 +0800)]
drm/amd/pm: add callback get_dpm_ultimate_freq for yellow carp

Add callback function to get the hard frequency range of a clock domain
for yellow carp.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add callback to get bootup values for yellow carp
Xiaomeng Hou [Sun, 4 Apr 2021 03:10:02 +0000 (11:10 +0800)]
drm/amd/pm: add callback to get bootup values for yellow carp

Add get_vbios_bootup_values function to get the bootup values for yellow
carp.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: Load TA firmware for yellow carp
Nicholas Kazlauskas [Thu, 18 Mar 2021 15:03:22 +0000 (11:03 -0400)]
drm/amdgpu: Load TA firmware for yellow carp

Add TA firmware to module firmware list for yellow carp and call
psp_init_ta_microcode to parse the TA firmware for HDCP support.

Cc: Aaron Liu <aaron.liu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add PrepareMp1ForUnload support for yellow carp
Aaron Liu [Wed, 17 Mar 2021 09:14:11 +0000 (17:14 +0800)]
drm/amd/pm: add PrepareMp1ForUnload support for yellow carp

Driver needs to notify the PMFW when the RLC is disabled.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add callback force_clk_levels for yellow carp
Xiaomeng Hou [Sun, 7 Mar 2021 09:30:06 +0000 (17:30 +0800)]
drm/amd/pm: add callback force_clk_levels for yellow carp

Implement the sysfs API to set a range of allowed DPM levels for
specific clock domain.

v2: return error directly if the specified clock type not supported

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: initialize feature_enabled/feature_support bitmap for yellow carp
Xiaomeng Hou [Mon, 8 Mar 2021 23:19:39 +0000 (07:19 +0800)]
drm/amd/pm: initialize feature_enabled/feature_support bitmap for yellow carp

Initialize the feature_enabled and feature_supported bitmap for yellow
carp.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: implement is_dpm_running() callback for yellow carp
Xiaomeng Hou [Mon, 8 Mar 2021 23:11:15 +0000 (07:11 +0800)]
drm/amd/pm: implement is_dpm_running() callback for yellow carp

Implement function to check if DPM is running for yellow carp.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add feature map for yellow carp
Xiaomeng Hou [Mon, 8 Mar 2021 22:58:08 +0000 (06:58 +0800)]
drm/amd/pm: add feature map for yellow carp

Add feature map for yellow carp.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add support to get dpm clock value for yellow carp
Xiaomeng Hou [Fri, 5 Mar 2021 07:26:24 +0000 (15:26 +0800)]
drm/amd/pm: add support to get dpm clock value for yellow carp

Implement the sysfs API for getting values of pp dpm
clocks(pp_dpm_socclk/mclk/fclk/vclk/dclk) for yellow carp.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add the fine grain tuning function for yellow carp
Xiaomeng Hou [Mon, 22 Feb 2021 08:44:30 +0000 (16:44 +0800)]
drm/amd/pm: add the fine grain tuning function for yellow carp

Use the pp_od_clk_voltage sysfs file to configure the min and max value
of gfx clock frequency or to restore the default values.

Command guide:
echo "s level value" > pp_od_clk_voltage
        "s" - set the sclk frequency
        "level" - 0 or 1, "0" represents the min value, "1" represents
        the max value
        "value" - the target value of sclk frequency, it should be
        limited in the safe range
echo "r" > pp_od_clk_voltage
        "r" - reset the sclk frequency, restore the default value
echo "c" > pp_od_clk_voltage
        "c" - commit the min and max value of sclk frequency to the
        system only after the commit command, the setting target values
        by "s" command will take effect

Example:
1) check the default sclk frequency
        $ cat pp_od_clk_voltage
        OD_SCLK:
        0:        200Mhz
        1:        600Mhz
        OD_RANGE:
        SCLK:     200MHz       600MHz
2) use "s" -- set command to configure the min or max sclk frequency
        $ echo "s 0 300" > pp_od_clk_voltage
        $ echo "s 1 500" > pp_od_clk_voltage
        $ echo "c" > pp_od_clk_voltage
        $ cat pp_od_clk_voltage
        OD_SCLK:
        0:        300Mhz
        1:        500Mhz
        OD_RANGE:
        SCLK:     200MHz       600MHz
3) use "r" -- reset command to restore the min and max sclk frequency
        $ echo "r" > pp_od_clk_voltage
        $ echo "c" > pp_od_clk_voltage
        $ cat pp_od_clk_voltage
        OD_SCLK:
        0:        200Mhz
        1:        600Mhz
        OD_RANGE:
        SCLK:     200MHz       600MHz

v2: modify the description of reset command usage - need to do "commit"
    after set the restore command

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add set_watermarks_table function for yellow carp
Xiaomeng Hou [Tue, 9 Feb 2021 08:36:40 +0000 (16:36 +0800)]
drm/amd/pm: add set_watermarks_table function for yellow carp

Add callback function set_watermarks_table for yellow carp.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add read_sensor function for yellow carp
Xiaomeng Hou [Wed, 27 Jan 2021 05:22:23 +0000 (13:22 +0800)]
drm/amd/pm: add read_sensor function for yellow carp

Add callback function read_sensor for yellow carp.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add timestamp counter query support for yellow carp
Aaron Liu [Tue, 26 Jan 2021 02:46:34 +0000 (10:46 +0800)]
drm/amdgpu: add timestamp counter query support for yellow carp

Allows software to query HW counters to timestamp submissions.
This patch can address KFDPerfCountersTest.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: chen gong <curry.gong@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add RLC_PG_DELAY_3 for yellow carp
Aaron Liu [Mon, 25 Jan 2021 08:08:55 +0000 (16:08 +0800)]
drm/amdgpu: add RLC_PG_DELAY_3 for yellow carp

RLC_PG_DELAY_3 is to make RLC in safe mode to
prevent any misalignment or conflict in middle of any power
feature entry/exit sequence when CGPG feature is enabled.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: support smu_post_init for yellow carp
Aaron Liu [Mon, 25 Jan 2021 08:00:00 +0000 (16:00 +0800)]
drm/amdgpu/pm: support smu_post_init for yellow carp

Add smu_post_init support for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: enable VCN PG and CG for yellow carp
Aaron Liu [Wed, 20 Jan 2021 07:48:47 +0000 (15:48 +0800)]
drm/amdgpu: enable VCN PG and CG for yellow carp

Enable VCN 3.0 PG and CG for Yellow Carp by setting up flags.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: enable vcn dpg mode on yellow carp
James Zhu [Wed, 13 Jan 2021 19:36:36 +0000 (14:36 -0500)]
drm/amdgpu: enable vcn dpg mode on yellow carp

Enable vcn dpg mode on yellow carp.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: enable vcn/jpeg on yellow carp
James Zhu [Wed, 13 Jan 2021 19:35:45 +0000 (14:35 -0500)]
drm/amdgpu: enable vcn/jpeg on yellow carp

Enable vcn/jpeg IP on yellow carp.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/vcn: add vcn support for yellow carp
James Zhu [Wed, 13 Jan 2021 19:32:34 +0000 (14:32 -0500)]
drm/amdgpu/vcn: add vcn support for yellow carp

Add vcn firmware support for yellow carp

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/jpeg: Remove harvest checking on CHIP_YELLOW_CARP
James Zhu [Wed, 13 Jan 2021 19:39:13 +0000 (14:39 -0500)]
drm/amdgpu/jpeg: Remove harvest checking on CHIP_YELLOW_CARP

Register CC_UVD_HARVESTING is obsolete on CHIP_YELLOW_CARP.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add vcn/jepg enable functions for yellow carp
Huang Rui [Wed, 13 Jan 2021 15:52:41 +0000 (23:52 +0800)]
drm/amd/pm: add vcn/jepg enable functions for yellow carp

This patch is to add vcn/jepg enable functions to power up/down them
with smu messages. VCN/JEPG are poweroff by default.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Tested-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add IH Clock Gating support for yellow carp
Aaron Liu [Tue, 12 Jan 2021 08:51:59 +0000 (16:51 +0800)]
drm/amdgpu: add IH Clock Gating support for yellow carp

IH CG need to be enabled by driver.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add ATHUB Clock Gating support for yellow carp
Aaron Liu [Tue, 12 Jan 2021 08:48:09 +0000 (16:48 +0800)]
drm/amdgpu: add ATHUB Clock Gating support for yellow carp

ATHUB MGCG/MGLS is enabled by default.
Adding ATHUB MGCG/MGLS flag to ensure athub mgcg/ls enabled.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add HDP Clock Gating support for yellow carp
Aaron Liu [Tue, 12 Jan 2021 08:42:29 +0000 (16:42 +0800)]
drm/amdgpu: add HDP Clock Gating support for yellow carp

HDP MGCG is enabled by default.
Adding AMD_CG_SUPPORT_HDP_MGCG to ensure hdp mgcg enabled.
HDP MGLS need to be enabled by driver.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add SDMA Clock Gating support for yellow carp
Aaron Liu [Mon, 11 Jan 2021 05:16:31 +0000 (13:16 +0800)]
drm/amdgpu: add SDMA Clock Gating support for yellow carp

Add AMD_CG_SUPPORT_SDMA_LS support.
SDMA MGCG programming is migrated to RLC.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: enable gfx_off in yellow carp smu post init
Aaron Liu [Mon, 25 Jan 2021 06:06:01 +0000 (14:06 +0800)]
drm/amdgpu/pm: enable gfx_off in yellow carp smu post init

Enable gfx_off in smu_late_init for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: add gfx_off_control for yellow carp
Aaron Liu [Thu, 7 Jan 2021 05:02:48 +0000 (13:02 +0800)]
drm/amdgpu/pm: add gfx_off_control for yellow carp

This patch implements gfx_off_control.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: enable smu_hw_init for yellow carp
Aaron Liu [Thu, 7 Jan 2021 03:05:05 +0000 (11:05 +0800)]
drm/amdgpu/pm: enable smu_hw_init for yellow carp

This patch is to enable smu_hw_init for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add GFX Power Gating support for yellow carp
Aaron Liu [Thu, 7 Jan 2021 01:38:04 +0000 (09:38 +0800)]
drm/amdgpu: add GFX Power Gating support for yellow carp

Add GFX Power Gating support.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add MMHUB Clock Gating support for yellow carp
Aaron Liu [Tue, 5 Jan 2021 09:29:03 +0000 (17:29 +0800)]
drm/amdgpu: add MMHUB Clock Gating support for yellow carp

Add AMD_CG_SUPPORT_MC_MGCG/AMD_CG_SUPPORT_MC_LS support.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add GFX Clock Gating support for yellow carp
Aaron Liu [Tue, 5 Jan 2021 09:17:11 +0000 (17:17 +0800)]
drm/amdgpu: add GFX Clock Gating support for yellow carp

Add below supports:
GFX Coarse Grain Clock Gating(CGCG)
GFX Coarse grain light sleep/deep sleep(CGLS)
GFX Medium Grain Clock Gating(MGCG)
GFX Medium Grain light sleep/deep sleep(MGLS)
GFX Fine Grain Clock Gating(FGCG)
RLC MGLS
CP  MGLS

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: add set_driver_table_location implementation for yellow carp
Aaron Liu [Thu, 7 Jan 2021 01:13:35 +0000 (09:13 +0800)]
drm/amdgpu/pm: add set_driver_table_location implementation for yellow carp

This patch adds set_driver_table_location implementation for yellow
carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: set_pp_feature is unsupport for yellow carp
Aaron Liu [Wed, 9 Dec 2020 02:23:08 +0000 (10:23 +0800)]
drm/amdgpu/pm: set_pp_feature is unsupport for yellow carp

For yellow carp, SMU firmware just only supports get_pp_feature.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: enable psp_v13 for yellow carp
Aaron Liu [Thu, 25 Mar 2021 06:32:58 +0000 (14:32 +0800)]
drm/amdgpu: enable psp_v13 for yellow carp

This patch enables psp_v13 for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add psp_v13 support for yellow carp
Aaron Liu [Thu, 25 Mar 2021 06:21:51 +0000 (14:21 +0800)]
drm/amdgpu: add psp_v13 support for yellow carp

This patch adds psp_v13 support for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add mmhub client support for yellow carp
Alex Deucher [Wed, 16 Dec 2020 15:40:30 +0000 (10:40 -0500)]
drm/amdgpu: add mmhub client support for yellow carp

To help debugging GPUVM page faults.

Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: reserved buffer is not needed with ip discovery enabled
Aaron Liu [Wed, 13 Jan 2021 09:14:02 +0000 (17:14 +0800)]
drm/amdgpu: reserved buffer is not needed with ip discovery enabled

When IP discovery enabled, the reserved buffer has been alloacted.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: introduce a stolen reserved buffer to protect specific buffer region...
Huang Rui [Wed, 16 Dec 2020 09:21:27 +0000 (17:21 +0800)]
drm/amdgpu: introduce a stolen reserved buffer to protect specific buffer region (v2)

Some ASICs such as Yellow Carp needs to reserve a region of video memory
to avoid access from driver. So this patch is to introduce a stolen
reserved buffer to protect specific buffer region.

v2: free this buffer in amdgpu_ttm_fini.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-and-Tested-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add gfx golden settings for yellow carp (v3)
Aaron Liu [Wed, 9 Dec 2020 05:00:55 +0000 (13:00 +0800)]
drm/amdgpu: add gfx golden settings for yellow carp (v3)

This patch is to add gfx golden settings for yellow carp post si.

v2: squash in updates (Alex)
v3: squash in LDS update (Alex)

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add smu ip block for yellow carp(V3)
Aaron Liu [Thu, 3 Dec 2020 08:55:00 +0000 (16:55 +0800)]
drm/amdgpu: add smu ip block for yellow carp(V3)

Yellow carp smu ip version: 13_0_1.
V2: rename smu_v13_0 to smu_v13_0_1.
V3: reuse smu_v13_0 with aldebaran.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: partially enable swsmu for yellow carp(V2)
Aaron Liu [Thu, 3 Dec 2020 08:44:46 +0000 (16:44 +0800)]
drm/amd/pm: partially enable swsmu for yellow carp(V2)

This patch is to partially enable swSMU for yellow carp for the moment.
V2: rename smu_v13_0 to smu_v13_0_1.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add yellow_carp_ppt implementation(V3)
Aaron Liu [Thu, 3 Dec 2020 08:32:36 +0000 (16:32 +0800)]
drm/amd/pm: add yellow_carp_ppt implementation(V3)

yellow_carp_ppt is swsmu layer 2 code for yellow carp.
V2: rename smu_v13_0 to smu_v13_0_1
V3: cleanup code.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add smu13 ip support for moment(V3)
Aaron Liu [Wed, 2 Dec 2020 02:01:43 +0000 (10:01 +0800)]
drm/amd/pm: add smu13 ip support for moment(V3)

For supporting yellow carp, we need to add smu13 ip
support for the moment.

V2: add smu_v13_0_1.c|h dedicated for apu.
V3: cleanup code.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: add smu v13.0.1 smc header for yellow carp (v2)
Aaron Liu [Mon, 30 Nov 2020 07:43:55 +0000 (15:43 +0800)]
drm/amdgpu/pm: add smu v13.0.1 smc header for yellow carp (v2)

This patch is to add smu v13.0.1 smc header for yellow carp.

v2: squash in updates (Alex)

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm: add smu v13.0.1 firmware header for yellow carp (V4)
Aaron Liu [Mon, 30 Nov 2020 07:41:04 +0000 (15:41 +0800)]
drm/amdgpu/pm: add smu v13.0.1 firmware header for yellow carp (V4)

This patch is to add smu v13.0.1 firmware header for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/admgpu/pm: add smu v13 driver interface header for yellow carp (v3)
Aaron Liu [Mon, 30 Nov 2020 07:27:45 +0000 (15:27 +0800)]
drm/admgpu/pm: add smu v13 driver interface header for yellow carp (v3)

This patch is to add smu v13 driver interface header for yellow carp.

v2: squash in updates (Alex)
v3: squash in v69.29.0 update (Alex)

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: support nbio_7_2_1 for yellow carp
Aaron Liu [Tue, 25 Aug 2020 02:27:59 +0000 (10:27 +0800)]
drm/amdgpu: support nbio_7_2_1 for yellow carp

This patch adds nbio_7_2_1 support yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdkfd: add yellow carp KFD support
Aaron Liu [Wed, 4 Nov 2020 06:38:24 +0000 (14:38 +0800)]
drm/amdkfd: add yellow carp KFD support

This patch is to add GFX10 based Yellow Carp KFD support.
We will bypass IOMMU v2.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: set ip blocks for yellow carp
Aaron Liu [Wed, 4 Nov 2020 06:12:58 +0000 (14:12 +0800)]
drm/amdgpu: set ip blocks for yellow carp

Enable ip blocks for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add sdma support for yellow carp
Aaron Liu [Wed, 4 Nov 2020 06:10:13 +0000 (14:10 +0800)]
drm/amdgpu: add sdma support for yellow carp

This patch adds the sdma v5.2 support for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add gfx support for yellow carp
Aaron Liu [Wed, 4 Nov 2020 06:06:23 +0000 (14:06 +0800)]
drm/amdgpu: add gfx support for yellow carp

Add yellow carp checks to gfx10 code.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: support fw load type for yellow carp
Aaron Liu [Wed, 4 Nov 2020 05:54:49 +0000 (13:54 +0800)]
drm/amdgpu: support fw load type for yellow carp

This patch sets fw load type as direct with fw_load_type=0 for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add gmc v10 supports for yellow carp
Aaron Liu [Wed, 4 Nov 2020 05:53:05 +0000 (13:53 +0800)]
drm/amdgpu: add gmc v10 supports for yellow carp

Add gfx memory controller support for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add yellow carp support for ih block
Aaron Liu [Wed, 4 Nov 2020 05:23:51 +0000 (13:23 +0800)]
drm/amdgpu: add yellow carp support for ih block

This patch adds the support for yellow carp ih block.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add nv common ip block support for yellow carp
Aaron Liu [Wed, 4 Nov 2020 05:21:55 +0000 (13:21 +0800)]
drm/amdgpu: add nv common ip block support for yellow carp

This patch adds common ip support for yellow carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add yellow_carp_reg_base_init function for yellow carp (v2)
Alex Deucher [Wed, 12 May 2021 21:13:25 +0000 (17:13 -0400)]
drm/amdgpu: add yellow_carp_reg_base_init function for yellow carp (v2)

This patch adds yellow_carp_reg_base_init function to init the register
base for yellow carp.

v2: squash in updates (Alex)

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add yellow carp support for gpu_info and ip block setting
Aaron Liu [Wed, 4 Nov 2020 05:08:26 +0000 (13:08 +0800)]
drm/amdgpu: add yellow carp support for gpu_info and ip block setting

This patch adds yellow carp support for gpu_info firmware and ip
block setting.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add uapi to define yellow carp series
Aaron Liu [Fri, 19 Jun 2020 04:26:40 +0000 (12:26 +0800)]
drm/amdgpu: add uapi to define yellow carp series

Add a flag to define yellow carp series.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add yellow carp asic_type enum
Aaron Liu [Wed, 4 Nov 2020 04:49:52 +0000 (12:49 +0800)]
drm/amdgpu: add yellow carp asic_type enum

This patch adds yellow carp to amd_asic_type enum and amdgpu_asic_name[].

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add yellow carp asic header files (v3)
Aaron Liu [Wed, 4 Nov 2020 05:00:05 +0000 (13:00 +0800)]
drm/amdgpu: add yellow carp asic header files (v3)

This patch is to add yellow carp asic header files.

v2: squash in updates (Alex)
v3: squash in DCN updates (Alex)

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agoradeon: use memcpy_to/fromio for UVD fw upload
Chen Li [Fri, 4 Jun 2021 08:43:02 +0000 (16:43 +0800)]
radeon: use memcpy_to/fromio for UVD fw upload

I met a gpu addr bug recently and the kernel log
tells me the pc is memcpy/memset and link register is
radeon_uvd_resume.

As we know, in some architectures, optimized memcpy/memset
may not work well on device memory. Trival memcpy_toio/memset_io
can fix this problem.

BTW, amdgpu has already done it in:
commit ba0b2275a678 ("drm/amdgpu: use memcpy_to/fromio for UVD fw upload"),
that's why it has no this issue on the same gpu and platform.

Signed-off-by: Chen Li <chenli@uniontech.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agoradeon: fix coding issues reported from sparse
Chen Li [Fri, 4 Jun 2021 08:40:32 +0000 (16:40 +0800)]
radeon: fix coding issues reported from sparse

Also fix some coding issues reported from sparse.

Signed-off-by: Chen Li <chenli@uniontech.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm: amdgpu: Remove unneeded semicolon in amdgpu_vm.c
Wan Jiabing [Thu, 3 Jun 2021 03:28:59 +0000 (11:28 +0800)]
drm: amdgpu: Remove unneeded semicolon in amdgpu_vm.c

Fix following coccicheck warning:
./drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1726:2-3: Unneeded semicolon

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: Fix fall-through warning for Clang
Gustavo A. R. Silva [Fri, 4 Jun 2021 05:06:13 +0000 (00:06 -0500)]
drm/amd/pm: Fix fall-through warning for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of letting the code fall
through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: Modify GC register access to use _SOC15 macros
Rohit Khaire [Fri, 4 Jun 2021 16:45:50 +0000 (12:45 -0400)]
drm/amdgpu: Modify GC register access to use _SOC15 macros

In SRIOV environment, KMD should access GC registers
with RLCG if GC indirect access flag enabled.

Using _SOC15 read/write macros ensures that they go
through RLC when flag is enabled.

Signed-off-by: Rohit Khaire <rohit.khaire@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: Enable RLCG read/write interface for Sienna Cichlid
Rohit Khaire [Fri, 4 Jun 2021 15:32:42 +0000 (11:32 -0400)]
drm/amdgpu: Enable RLCG read/write interface for Sienna Cichlid

Enable this only for Sienna Cichild
since only Navi12 and Sienna Cichlid support SRIOV

Signed-off-by: Rohit Khaire <rohit.khaire@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: Fix incorrect register offsets for Sienna Cichlid
Rohit Khaire [Fri, 4 Jun 2021 15:02:56 +0000 (11:02 -0400)]
drm/amdgpu: Fix incorrect register offsets for Sienna Cichlid

RLC_CP_SCHEDULERS and RLC_SPARE_INT0 have different
offsets for Sienna Cichlid

Signed-off-by: Rohit Khaire <rohit.khaire@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: Don't flush/invalidate HDP for APUs and A+A
Eric Huang [Wed, 2 Jun 2021 19:05:20 +0000 (15:05 -0400)]
drm/amdgpu: Don't flush/invalidate HDP for APUs and A+A

Integrate two generic functions to determine if HDP
flush is needed for all Asics.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: Use generic BACO function for smu11 ASICs
Lijo Lazar [Fri, 4 Jun 2021 08:05:49 +0000 (16:05 +0800)]
drm/amd/pm: Use generic BACO function for smu11 ASICs

Remove ASIC specific functions for BACO support check. Use generic smu11
function instead.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: Add VF check to BACO support check
Lijo Lazar [Fri, 4 Jun 2021 07:57:50 +0000 (15:57 +0800)]
drm/amd/pm: Add VF check to BACO support check

For smuv11, check for VF also during BACO check.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: Read BIF STRAP also for BACO check
Lijo Lazar [Fri, 4 Jun 2021 07:33:48 +0000 (15:33 +0800)]
drm/amd/pm: Read BIF STRAP also for BACO check

Avoid reading BIF STRAP each time for BACO capability. Read the STRAP
value while checking BACO capability in PPTable.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: Remove BACO check for aldebaran
Lijo Lazar [Fri, 4 Jun 2021 06:34:45 +0000 (14:34 +0800)]
drm/amd/pm: Remove BACO check for aldebaran

BACO/MACO is not applicable for aldebaran. Remove the redundant check.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Keep linebuffer pixel depth at 30bpp for DCE-11.0.
Mario Kleiner [Wed, 2 Jun 2021 20:45:56 +0000 (22:45 +0200)]
drm/amd/display: Keep linebuffer pixel depth at 30bpp for DCE-11.0.

Testing on AMD Carizzo with DCE-11.0 display engine showed that
it doesn't like a 36 bpp linebuffer very much. The display just
showed a solid green.

Testing on RavenRidge DCN-1.0, Polaris11 with DCE-11.2 and Kabini
with DCE-8.3 did not expose any problems, so for now only revert
to 30 bpp linebuffer depth on asics with DCE-11.0 display engine.

Fixes: a316db72096044 ("drm/amd/display: Increase linebuffer pixel depth to 36bpp.")
Reported-by: Tom StDenis <Tom.StDenis@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm: fix doc warnings in drm_atomic.h
Yu Kuai [Thu, 3 Jun 2021 11:30:51 +0000 (19:30 +0800)]
drm: fix doc warnings in drm_atomic.h

Add description for parameters for
for_each_new_plane_in_state_reverse to fix warnings:

include/drm/drm_atomic.h:908: warning: Function parameter or member '__state' not described in 'for_each_new_plane_in_state_reverse'
include/drm/drm_atomic.h:908: warning: Function parameter or member 'plane' not described in 'for_each_new_plane_in_state_reverse'
include/drm/drm_atomic.h:908: warning: Function parameter or member 'new_plane_state' not described in 'for_each_new_plane_in_state_reverse'
include/drm/drm_atomic.h:908: warning: Function parameter or member '__i' not described in 'for_each_new_plane_in_state_reverse'

Fixes: a6c3c37b661d ("drm/amd/display: fix gcc set but not used warning of variable 'old_plane_state'")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: remove variable active_disp
Colin Ian King [Thu, 3 Jun 2021 12:42:31 +0000 (13:42 +0100)]
drm/amd/display: remove variable active_disp

The variable active_disp is being initialized with a value that
is never read, it is being re-assigned immediately afterwards.
Clean up the code by removing the need for variable active_disp.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: remove redundant assignment of variable k
Colin Ian King [Thu, 3 Jun 2021 12:34:40 +0000 (13:34 +0100)]
drm/amdgpu: remove redundant assignment of variable k

The variable k is being assigned a value that is never read, the
assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdkfd: Make TLB flush conditional on mapping
Eric Huang [Tue, 1 Jun 2021 22:54:32 +0000 (18:54 -0400)]
drm/amdkfd: Make TLB flush conditional on mapping

It is to optimize memory mapping latency, and also aviod
a page fault in a corner case of changing valid PDE into
PTE.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update
Eric Huang [Tue, 1 Jun 2021 22:36:34 +0000 (18:36 -0400)]
drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update

It is to pass the flag to KFD, and optimize table_freed in
amdgpu_vm_bo_update_mapping.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdkfd: Add heavy-weight TLB flush after unmapping
Eric Huang [Tue, 1 Jun 2021 22:26:07 +0000 (18:26 -0400)]
drm/amdkfd: Add heavy-weight TLB flush after unmapping

It is a part of memory mapping optimization.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>