]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/log
mirror_ubuntu-jammy-kernel.git
6 years agodrm/amdgpu/soc15: add support for vega12
Alex Deucher [Wed, 7 Mar 2018 03:35:19 +0000 (22:35 -0500)]
drm/amdgpu/soc15: add support for vega12

Add the IP blocks, clock and powergating flags, and
common clockgating support.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/gfx9: add golden setting for vega12 (v3)
Hawking Zhang [Mon, 12 Mar 2018 06:55:48 +0000 (14:55 +0800)]
drm/amdgpu/gfx9: add golden setting for vega12 (v3)

Add gfx9_2_1 golden setting.

v2: switch to soc15_program_register_sequence for
golden setting programming
v3: squash in additional golden updates

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Ken Wang <ken.wang@amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/gfx9: add clockgating support for vega12
Alex Deucher [Sat, 2 Sep 2017 06:26:50 +0000 (02:26 -0400)]
drm/amdgpu/gfx9: add clockgating support for vega12

Same as vega10 and raven.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/gfx9: add support for vega12
Alex Deucher [Sat, 2 Sep 2017 06:26:09 +0000 (02:26 -0400)]
drm/amdgpu/gfx9: add support for vega12

Same as vega10 and raven.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/gfx9: add gfx config for vega12
Alex Deucher [Sat, 2 Sep 2017 06:24:39 +0000 (02:24 -0400)]
drm/amdgpu/gfx9: add gfx config for vega12

Just a place holder for now.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/gfx9: Add placeholder for vega12 golden settings
Alex Deucher [Sat, 2 Sep 2017 06:22:49 +0000 (02:22 -0400)]
drm/amdgpu/gfx9: Add placeholder for vega12 golden settings

Fill these in when we get them.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/gfx9: add support for vega12 firmware
Alex Deucher [Sat, 2 Sep 2017 06:10:18 +0000 (02:10 -0400)]
drm/amdgpu/gfx9: add support for vega12 firmware

Declare and fetch the appriopriate files.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/sdma4: Update vega12 sdma golden setting.
Feifei Xu [Wed, 7 Mar 2018 03:47:18 +0000 (22:47 -0500)]
drm/amdgpu/sdma4: Update vega12 sdma golden setting.

Update vega12 sdma golden setting.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Ken Wang <ken.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/sdma4: add sdma4_0_1 support for vega12 (v3)
Hawking Zhang [Mon, 12 Mar 2018 06:45:38 +0000 (14:45 +0800)]
drm/amdgpu/sdma4: add sdma4_0_1 support for vega12 (v3)

Add sdma golden setting for vega12.

v2: switch to soc15_program_register_sequence for
golden register programming
v3: squash in unused declaration fix

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/sdma4: add clockgating support for vega12
Alex Deucher [Fri, 1 Sep 2017 20:50:28 +0000 (16:50 -0400)]
drm/amdgpu/sdma4: add clockgating support for vega12

Same as vega10 for now.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/sdma4: Add placeholder for vega12 golden settings
Alex Deucher [Fri, 1 Sep 2017 20:43:47 +0000 (16:43 -0400)]
drm/amdgpu/sdma4: Add placeholder for vega12 golden settings

Fill these in when we get them.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/sdma4: specify vega12 firmware
Alex Deucher [Fri, 1 Sep 2017 20:41:07 +0000 (16:41 -0400)]
drm/amdgpu/sdma4: specify vega12 firmware

Declare the firmware and fetch the proper file.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/mmhub: add clockgating support for vega12
Alex Deucher [Fri, 1 Sep 2017 20:39:10 +0000 (16:39 -0400)]
drm/amdgpu/mmhub: add clockgating support for vega12

Treat it the same as vega10 for now.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/gmc9: add vega12 support (v2)
Alex Deucher [Wed, 14 Mar 2018 01:25:08 +0000 (20:25 -0500)]
drm/amdgpu/gmc9: add vega12 support (v2)

Same as vega10.

v2: squash in golden regs fix from Feifei

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: add vega12 to dc support check
Alex Deucher [Sat, 2 Sep 2017 06:05:29 +0000 (02:05 -0400)]
drm/amdgpu: add vega12 to dc support check

DC is used for modesetting on vega12.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amd/display: Add bios firmware info version for VG12
Jerry (Fangzhi) Zuo [Wed, 22 Nov 2017 19:16:13 +0000 (14:16 -0500)]
drm/amd/display: Add bios firmware info version for VG12

VG12 shows minor revision version of 2 which is not handled in
bios_parser_get_firmware_info() routine.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display/dm: add vega12 support
Alex Deucher [Sat, 2 Sep 2017 06:01:55 +0000 (02:01 -0400)]
drm/amd/display/dm: add vega12 support

Add support for vega12 to the display manager.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu/virtual_dce: add vega12 support
Alex Deucher [Fri, 1 Sep 2017 20:37:59 +0000 (16:37 -0400)]
drm/amdgpu/virtual_dce: add vega12 support

Add virtual dce support for vega12.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: specify vega12 vce firmware
Alex Deucher [Fri, 1 Sep 2017 20:37:21 +0000 (16:37 -0400)]
drm/amdgpu: specify vega12 vce firmware

Declare firmware and add support for the file.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: specify vega12 uvd firmware
Alex Deucher [Fri, 1 Sep 2017 20:35:30 +0000 (16:35 -0400)]
drm/amdgpu: specify vega12 uvd firmware

Declare firmware and add support for the file.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: add vega12 ucode loading method
Feifei Xu [Fri, 20 Oct 2017 02:25:55 +0000 (10:25 +0800)]
drm/amdgpu: add vega12 ucode loading method

Same as vega10.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
6 years agodrm/amdgpu: initilize vega12 psp firmwares
Evan Quan [Wed, 7 Feb 2018 01:34:22 +0000 (09:34 +0800)]
drm/amdgpu: initilize vega12 psp firmwares

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/psp: initial vega12 support
Alex Deucher [Wed, 7 Mar 2018 03:18:09 +0000 (22:18 -0500)]
drm/amdgpu/psp: initial vega12 support

Same as vega10 for now.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: vega12 to smu firmware
Hawking Zhang [Mon, 19 Mar 2018 19:11:09 +0000 (14:11 -0500)]
drm/amdgpu: vega12 to smu firmware

Add the cgs interface to query the smu firmware for vega12
and declare the firmware.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
6 years agodrm/amdgpu: set asic family and ip blocks for vega12
Alex Deucher [Fri, 1 Sep 2017 20:22:35 +0000 (16:22 -0400)]
drm/amdgpu: set asic family and ip blocks for vega12

soc15 just like vega10 and raven.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: add gpu_info firmware for vega12
Alex Deucher [Fri, 1 Sep 2017 20:20:53 +0000 (16:20 -0400)]
drm/amdgpu: add gpu_info firmware for vega12

Stores gpu configuration details.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: add vega12 to asic_type enum
Feifei Xu [Thu, 19 Oct 2017 09:04:54 +0000 (17:04 +0800)]
drm/amdgpu: add vega12 to asic_type enum

Add vega12 to amd_asic_type enum and amdgpu_asic_name[].

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
6 years agodrm/amd/include: Add ip header files for vega12.
Feifei Xu [Mon, 16 Oct 2017 10:09:14 +0000 (18:09 +0800)]
drm/amd/include: Add ip header files for vega12.

Add ip header files for IPs with a delta for vg12:
GC, MMHUB, OSS

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-By: Ken Wang <ken.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Fix unable to handle kernel paging request
Rex Zhu [Wed, 21 Mar 2018 03:04:21 +0000 (11:04 +0800)]
drm/amd/pp: Fix unable to handle kernel paging request
when set pp table

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Fix gfx ring test failed on Fiji without hw avfs support
Rex Zhu [Tue, 20 Mar 2018 09:04:46 +0000 (17:04 +0800)]
drm/amd/pp: Fix gfx ring test failed on Fiji without hw avfs support

caused by
'commit ca82cec868d1 ("drm/amd/pp: Simplified the avfs btc state on smu7")'

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Fix kernel NULL pointer dereference in dpm functions
Rex Zhu [Tue, 20 Mar 2018 08:32:07 +0000 (16:32 +0800)]
drm/amdgpu: Fix kernel NULL pointer dereference in dpm functions

caused by
'commit 83e3c4615872 ("drm/amdgpu: Remove wrapper layer of smu ip functions")'

BUG: unable to handle kernel NULL pointer dereference at 00000000000005d8
[  313.241459] IP: ci_dpm_read_sensor+0x37/0xf0 [amdgpu]

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Fix kernel NULL pointer dereference when amdgpu fini
Rex Zhu [Tue, 20 Mar 2018 08:28:56 +0000 (16:28 +0800)]
drm/amdgpu: Fix kernel NULL pointer dereference when amdgpu fini

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu - Disable all irqs before disabling all CRTCs
Mikita Lipski [Thu, 15 Mar 2018 20:53:08 +0000 (16:53 -0400)]
drm/amdgpu - Disable all irqs before disabling all CRTCs

By moving amdgpu_irq_disable_all earlier in the sequence
fixes an issue with disabling pflip interrupts:

*ERROR* dal_irq_service_dummy_ack: called for non-implemented irq source

Earlier patch fixed a memory corruption and revealed irq
warnings.This way it seems to be there no obvious issues
with unloading the module.

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Disable irq on device before destroying it
Mikita Lipski [Thu, 15 Mar 2018 13:37:08 +0000 (09:37 -0400)]
drm/amdgpu: Disable irq on device before destroying it

Disable irq on devices before destroying them. That prevents
use-after-free memory access when unloading the driver.

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Use atomic function to disable crtcs with dc enabled
Mikita Lipski [Wed, 14 Mar 2018 17:41:29 +0000 (13:41 -0400)]
drm/amdgpu: Use atomic function to disable crtcs with dc enabled

This change fixes the deadlock when unloading the driver with displays
connected.

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/amdgpu: fix offset into page with amdgpu_iomem debugfs file
Tom St Denis [Tue, 20 Mar 2018 13:13:08 +0000 (09:13 -0400)]
drm/amd/amdgpu: fix offset into page with amdgpu_iomem debugfs file

The offset inside the page wasn't included in the copy call meaning
the start of the page was being read/written instead.

Reported-by: Jay Cornwall <Jay.Cornwall@amd.com>
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/nbio6: Correct PCIE_INDEX/DATA pair used for smn register accessing
Hawking Zhang [Mon, 19 Mar 2018 09:28:28 +0000 (17:28 +0800)]
drm/amdgpu/nbio6: Correct PCIE_INDEX/DATA pair used for smn register accessing

PCIE_INDEX2/DATA2 pair will be used for smn register accessing since from vega.
PCIE_INDEX/DATA pair should be reserved for smu

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: Fix NULL pointer deref on driver unbind.
Andrey Grodzovsky [Mon, 19 Mar 2018 20:48:54 +0000 (16:48 -0400)]
drm/amd/powerplay: Fix NULL pointer deref on driver unbind.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add documentation for amdgpu_device.c
Alex Deucher [Thu, 15 Mar 2018 22:39:45 +0000 (17:39 -0500)]
drm/amdgpu: add documentation for amdgpu_device.c

Add kernel doc for the functions in amdgpu_device.c

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add VCN to firmware query interface
Alex Deucher [Fri, 16 Mar 2018 16:04:53 +0000 (11:04 -0500)]
drm/amdgpu: add VCN to firmware query interface

Need to be able to query the VCN firmware version from
userspace to determine supported features, etc.

Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove unneeded void * casts for Vega10
Rex Zhu [Fri, 16 Mar 2018 08:16:27 +0000 (16:16 +0800)]
drm/amd/pp: Remove unneeded void * casts for Vega10

Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Delete get_xclk function in powerplay (v2)
Rex Zhu [Fri, 16 Mar 2018 08:56:58 +0000 (16:56 +0800)]
drm/amd/pp: Delete get_xclk function in powerplay (v2)

use asic's callback function get_xclk in amdgpu

v2: squash in removal of leftover debug info
(drm/amd/pp: Delete debug info in smu7_hwmgr.c) (Rex)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Clean up header file for Vega10
Rex Zhu [Fri, 16 Mar 2018 07:26:15 +0000 (15:26 +0800)]
drm/amd/pp: Clean up header file for Vega10

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Move functions to smu backend table for vega10
Rex Zhu [Fri, 16 Mar 2018 07:16:10 +0000 (15:16 +0800)]
drm/amd/pp: Move functions to smu backend table for vega10

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Mark bunches of functins in vega10_smumgr.c static
Rex Zhu [Fri, 16 Mar 2018 05:56:18 +0000 (13:56 +0800)]
drm/amd/pp: Mark bunches of functins in vega10_smumgr.c static

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove dead functions in vega10_smumgr.c
Rex Zhu [Fri, 16 Mar 2018 05:43:42 +0000 (13:43 +0800)]
drm/amd/pp: Remove dead functions in vega10_smumgr.c

use smc_table_manager function to copy/save tables to/from smu.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Delete dead code when early init
Rex Zhu [Fri, 16 Mar 2018 04:40:16 +0000 (12:40 +0800)]
drm/amdgpu: Delete dead code when early init

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoamdgpu/dm: Default PRE_VEGA ASIC support to 'y'
Harry Wentland [Wed, 8 Nov 2017 20:58:25 +0000 (15:58 -0500)]
amdgpu/dm: Default PRE_VEGA ASIC support to 'y'

Even though we default PRE_VEGA support to 'n' upstream in amd-staging
we want to keep it enabled by default.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove the cgs wrapper for notify smu version on APU
Rex Zhu [Thu, 15 Mar 2018 06:45:04 +0000 (14:45 +0800)]
drm/amd/pp: Remove the cgs wrapper for notify smu version on APU

Refine commit f49e9bac191b ("drm/amd/pp: Get and save Rv smu version")

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: fix dereferencing possible ERR_PTR()
Shirish S [Thu, 15 Mar 2018 10:31:00 +0000 (16:01 +0530)]
drm/amd/display: fix dereferencing possible ERR_PTR()

This patch fixes static checker warning caused by
"36cc549d5986: "drm/amd/display: disable CRTCs with
NULL FB on their primary plane (V2)"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Refine disable VGA
Clark Zheng [Thu, 15 Mar 2018 06:02:06 +0000 (14:02 +0800)]
drm/amd/display: Refine disable VGA

bad case won't follow normal sense, it will not enable vga1 as usual, but vga2,3,4 is on.

Signed-off-by: Clark Zheng <clark.zheng@amd.com>
Reviewed-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Improve documentation of bo_ptr in amdgpu_bo_create_kernel
Andrey Grodzovsky [Wed, 14 Mar 2018 15:45:22 +0000 (11:45 -0400)]
drm/amdgpu: Improve documentation of bo_ptr in amdgpu_bo_create_kernel

and amdgpu_bo_create_reserved.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@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>
6 years agodrm/radeon: Don't turn off DP sink when disconnected
Michel Dänzer [Wed, 14 Mar 2018 17:14:04 +0000 (18:14 +0100)]
drm/radeon: Don't turn off DP sink when disconnected

Turning off the sink in this case causes various issues, because
userspace expects it to stay on until it turns it off explicitly.

Instead, turn the sink off and back on when a display is connected
again. This dance seems necessary for link training to work correctly.

Bugzilla: https://bugs.freedesktop.org/105308
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Rename file name cz_* to smu8_*
Rex Zhu [Wed, 14 Mar 2018 12:05:12 +0000 (20:05 +0800)]
drm/amd/pp: Rename file name cz_* to smu8_*

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Replace function/struct name cz_* with smu8_*
Rex Zhu [Wed, 14 Mar 2018 09:29:54 +0000 (17:29 +0800)]
drm/amd/pp: Replace function/struct name cz_* with smu8_*

hw ip smu8 was used on CZ/ST,
so use smu8 as the prefix of the function/struct name in powerplay.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c
Rex Zhu [Tue, 13 Mar 2018 08:50:44 +0000 (16:50 +0800)]
drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c

Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Mv cz uvd/vce pg/dpm functions to cz_hwmgr.c
Rex Zhu [Tue, 13 Mar 2018 07:44:42 +0000 (15:44 +0800)]
drm/amd/pp: Mv cz uvd/vce pg/dpm functions to cz_hwmgr.c

1. delete cz_clockpowergating.c/.h files
2. mark uvd/vce dpm/pg functions static

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove dead header file pp_asicblocks.h
Rex Zhu [Tue, 13 Mar 2018 07:35:17 +0000 (15:35 +0800)]
drm/amd/pp: Remove dead header file pp_asicblocks.h

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Delete dead code on cz_clockpowergating.c
Rex Zhu [Tue, 13 Mar 2018 07:27:06 +0000 (15:27 +0800)]
drm/amd/pp: Delete dead code on cz_clockpowergating.c

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c
Rex Zhu [Mon, 12 Mar 2018 11:53:01 +0000 (19:53 +0800)]
drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c

make it symmetric with amdgpu_ucode_init_bo in amd_powerplay.c

refine the "commit b22558bb4ff8fc9fe925222f90297d7a03a5fb20"

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Remove wrapper layer of smu ip functions
Rex Zhu [Mon, 12 Mar 2018 11:52:23 +0000 (19:52 +0800)]
drm/amdgpu: Remove wrapper layer of smu ip functions

1. delete amdgpu_powerplay.c used for wrapping smu ip functions
2. delete struct pp_instance,
3. make struct hwmgr as the smu hw handle.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Don't compared ip_block_type with ip_block_index
Rex Zhu [Wed, 14 Mar 2018 07:38:48 +0000 (15:38 +0800)]
drm/amdgpu: Don't compared ip_block_type with ip_block_index

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Plus NULL function pointer check
Rex Zhu [Mon, 12 Mar 2018 11:50:38 +0000 (19:50 +0800)]
drm/amdgpu: Plus NULL function pointer check

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Move helper functions to smu_help.c
Rex Zhu [Fri, 9 Mar 2018 11:52:26 +0000 (19:52 +0800)]
drm/amd/pp: Move helper functions to smu_help.c

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Replace rv_* with smu10_*
Rex Zhu [Tue, 6 Mar 2018 09:28:38 +0000 (17:28 +0800)]
drm/amd/pp: Replace rv_* with smu10_*

Powerplay is for the hw ip smu, for RV, smu10 is used,
so use smu10 as the prefix of the files name/function name.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Fix function parameter not correct
Rex Zhu [Tue, 13 Mar 2018 05:40:00 +0000 (13:40 +0800)]
drm/amd/pp: Fix function parameter not correct

caused by "commit dcefb7668e5b4fb56099b16d1790cd3056322b03"

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add rv_copy_table_from/to_smc to smu backend function table
Rex Zhu [Wed, 7 Mar 2018 08:14:38 +0000 (16:14 +0800)]
drm/amd/pp: Add rv_copy_table_from/to_smc to smu backend function table

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add new smu backend function smc_table_manager
Rex Zhu [Wed, 7 Mar 2018 08:12:05 +0000 (16:12 +0800)]
drm/amd/pp: Add new smu backend function smc_table_manager

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Mark internal functions as static in rv_smumgr.c
Rex Zhu [Fri, 9 Mar 2018 11:00:14 +0000 (19:00 +0800)]
drm/amd/pp: Mark internal functions as static in rv_smumgr.c

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Add rv_read_arg_from_smc to smu backend function table
Rex Zhu [Fri, 9 Mar 2018 10:57:37 +0000 (18:57 +0800)]
drm/amd/pp: Add rv_read_arg_from_smc to smu backend function table

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove meanless return value check in RV
Rex Zhu [Wed, 7 Mar 2018 05:49:03 +0000 (13:49 +0800)]
drm/amd/pp: Remove meanless return value check in RV

In send_message_to_smu helper functions,
Print out the error code for debug if smu failed to response.

The helper functions always return true, so no need to
check their return value.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Delete is_smc_ram_running function on RV
Rex Zhu [Wed, 7 Mar 2018 05:32:45 +0000 (13:32 +0800)]
drm/amd/pp: Delete is_smc_ram_running function on RV

1. There is a race condition when another ip also use same register pairs
2. check once at boot up by GetDriverIfVersion message is sufficient
   to check SMU health. so delete is_smc_ram_running check.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Clean up header file include
Rex Zhu [Wed, 7 Mar 2018 08:40:21 +0000 (16:40 +0800)]
drm/amd/pp: Clean up header file include

smu7_smumgr.h should not be included in rv and vega, The common functions
for all smu7 asics are put in smu_smumgr.c.

Not include cgs interface in smumgr.c. the code used cgs interface has been
deleted.

Not include smu_ucode_xfer_vi.h in rv/vega

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Fix memory leak in error path in smumgr
Rex Zhu [Wed, 14 Mar 2018 08:14:59 +0000 (16:14 +0800)]
drm/amd/pp: Fix memory leak in error path in smumgr

Free the backend structure if we fail to allocate device memory.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Simplified the avfs btc state on smu7
Rex Zhu [Fri, 9 Mar 2018 10:07:59 +0000 (18:07 +0800)]
drm/amd/pp: Simplified the avfs btc state on smu7

AVFS feature support/not support is enough to driver.

so remove the complex define of the avfs btc state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: Fix KASAN user after free on driver unload.
Andrey Grodzovsky [Wed, 14 Mar 2018 18:07:49 +0000 (14:07 -0400)]
drm/amd/powerplay: Fix KASAN user after free on driver unload.

Reusing local handle to initialize BO without resetting it to
NULL is wrong since it causes amdgpu_bo_create_reserved to skip
new BO creation and just reuse the given pointer for pinning.

Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/sdma4: Remove unused header file from sdma_v4_0.c
Feifei Xu [Wed, 7 Mar 2018 03:42:33 +0000 (22:42 -0500)]
drm/amdgpu/sdma4: Remove unused header file from sdma_v4_0.c

Remove mmhub header files inclusion which not used.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/sdma4: use num_instances for clock/powergating config
Alex Deucher [Fri, 1 Sep 2017 20:47:54 +0000 (16:47 -0400)]
drm/amdgpu/sdma4: use num_instances for clock/powergating config

Rather then relying on the asic type for the second instance.
Makes it more consistent with the rest of the code.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
6 years agodrm/amdgpu: remove trailing whitespace from soc15ip.h
Alex Deucher [Wed, 7 Mar 2018 04:01:46 +0000 (23:01 -0500)]
drm/amdgpu: remove trailing whitespace from soc15ip.h

no intended functional change.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/powerplay/vega10: fix memory leak in error path
Alex Deucher [Wed, 14 Mar 2018 01:43:00 +0000 (20:43 -0500)]
drm/amdgpu/powerplay/vega10: fix memory leak in error path

Free the backend structure if we fail to allocate device
memory.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/dce: Don't turn off DP sink when disconnected
Michel Dänzer [Fri, 9 Mar 2018 17:26:18 +0000 (18:26 +0100)]
drm/amdgpu/dce: Don't turn off DP sink when disconnected

Turning off the sink in this case causes various issues, because
userspace expects it to stay on until it turns it off explicitly.

Instead, turn the sink off and back on when a display is connected
again. This dance seems necessary for link training to work correctly.

Bugzilla: https://bugs.freedesktop.org/105308
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: remove redundant pointer internal_buf
Colin Ian King [Tue, 13 Mar 2018 13:22:17 +0000 (13:22 +0000)]
drm/amd/pp: remove redundant pointer internal_buf

The pointer internal_buf is assigned a value but the pointer is never
read, hence it is redundant and can be removed.

Cleans up clang warning:
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:630:2:
warning: Value stored to 'internal_buf' is never read

Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: move getting pcie info to common code
Alex Deucher [Fri, 9 Mar 2018 20:14:11 +0000 (15:14 -0500)]
drm/amdgpu: move getting pcie info to common code

No need to replicate it in several places.

Reviewed-by: Rex Zhu <rezhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/soc15: always load the psp module
Alex Deucher [Fri, 9 Mar 2018 20:22:28 +0000 (15:22 -0500)]
drm/amdgpu/soc15: always load the psp module

Regardless of whether the user has selected psp fw loading or
not.  It's still needed for GPU reset among other things.
There are already guards in place to avoid setting up the full
psp if PSP fw loading is not enabled.

Reviewed-by: Rex Zhu <rezhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: use adev->firmware to determine whether to load the PSP module
Alex Deucher [Fri, 9 Mar 2018 20:19:44 +0000 (15:19 -0500)]
drm/amdgpu: use adev->firmware to determine whether to load the PSP module

The per device firmware load method is limited to what makes sense for
that asic rather than whatever arbitrary value may have been set by the
user.

Reviewed-by: Rex Zhu <rezhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: move firmware loading type setup to common code
Alex Deucher [Fri, 9 Mar 2018 20:06:35 +0000 (15:06 -0500)]
drm/amdgpu: move firmware loading type setup to common code

No need to replicate it in several places.

Reviewed-by: Rex Zhu <rezhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu/psp: add a few more fw load type checks
Alex Deucher [Thu, 8 Mar 2018 20:47:04 +0000 (15:47 -0500)]
drm/amdgpu/psp: add a few more fw load type checks

We already checked and returned early in most of the IP
functions, fill in the rest as well.

Reviewed-by: Rex Zhu <rezhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Check msg->size before starting aux transfer
Shirish S [Tue, 13 Mar 2018 06:25:11 +0000 (11:55 +0530)]
drm/amd/display: Check msg->size before starting aux transfer

This patch adds an essential check related to the size of the
payload to be transferred via aux channel.

Without this check dal_ddc_service_read_dpcd_data() is fed with
inappropriate payload size leading to deadlocks.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: clean up dcn pplib notification call
Dmytro Laktyushkin [Fri, 16 Feb 2018 18:18:59 +0000 (13:18 -0500)]
drm/amd/display: clean up dcn pplib notification call

We have unused variables being populated when notifying pplib.
This change amends that.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Fixed dim around 1sec when resume from S3 (v2)
Yongqiang Sun [Mon, 5 Mar 2018 15:28:34 +0000 (10:28 -0500)]
drm/amd/display: Fixed dim around 1sec when resume from S3 (v2)

root cause:
DMCU try to perform a smoothness brightness change.Incorrect initial
brightness level causes the 1 sec dim.
Change:
Cache brightness level in stream, and clear it when edp backlight on.
If brightness level in stream is 0, set brightness with ramp value is 0.
DMCU will set the brightness without smoothness transition.

v2: squash in null pointer fix (Harry)

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Use actual TG instance instead of pipe instance
Jerry (Fangzhi) Zuo [Fri, 2 Mar 2018 18:35:53 +0000 (13:35 -0500)]
drm/amd/display: Use actual TG instance instead of pipe instance

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Check for HW blocks in HWSS, rather than DC core for cursor
Harry Wentland [Fri, 2 Mar 2018 22:19:27 +0000 (17:19 -0500)]
drm/amd/display: Check for HW blocks in HWSS, rather than DC core for cursor

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Move IH clientid defs to separate file
Oak Zeng [Thu, 8 Mar 2018 21:44:47 +0000 (16:44 -0500)]
drm/amdgpu: Move IH clientid defs to separate file

This is preparation for sharing client ID definitions
between amdgpu and amdkfd

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: update dce_calcs to latest version
Dmytro Laktyushkin [Mon, 26 Feb 2018 19:37:25 +0000 (14:37 -0500)]
drm/amd/display: update dce_calcs to latest version

Bw spreadsheet was updated while dce_calcs was not

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Set disp clk in a safe way to avoid over high dpp clk. (v2)
Yongqiang Sun [Wed, 28 Feb 2018 22:14:50 +0000 (17:14 -0500)]
drm/amd/display: Set disp clk in a safe way to avoid over high dpp clk. (v2)

Increase clock, if current dpp div is 0 and request dpp div is 1, request clk is
higher than maximum dpp clk as per dpm table.
set dispclk to the value of maximum supported dpp clk
set div to 1
set dispclk to request value.
Decrease clock, currrent dpp div is 1 and request dpp div is 0, current clk is
higher than maximum dpp clk as per dpm table.
set dispclk to the value of maximum supported dpp clk
set div to 0
set dispclk to request value.

v2: squash in !DCN build fix

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: add support for regkey "LCDFreeSyncDefault"
Samson Tam [Thu, 1 Mar 2018 16:06:34 +0000 (11:06 -0500)]
drm/amd/display: add support for regkey "LCDFreeSyncDefault"

Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Correct the plane enumeration order (v2)
Shirish S [Tue, 27 Feb 2018 09:18:13 +0000 (14:48 +0530)]
drm/amd/display: Correct the plane enumeration order (v2)

The order of planes is given by the order they are enumerated
by kms.
Planes with a higher ID appears above planes with a lower ID.

Currently the planes are enumerated in the wrong order,
putting the nv12 only plane after the two RGBA planes.

This patch corrects the plane enumeration order such that all
the overlay planes are initialized first then the primary planes.

Due to this change in order the dc_add_plane_to_context() shall
receive the planes in reverse order hence this patch reverses
the parsing of planes in DM side itself.

v2: drop local reverse macro for upstream

Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Fix handling of linear transfer function
Vitaly Prosyak [Wed, 28 Feb 2018 16:44:54 +0000 (10:44 -0600)]
drm/amd/display: Fix handling of linear transfer function

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: dal 3.1.38
Tony Cheng [Wed, 21 Feb 2018 21:41:19 +0000 (16:41 -0500)]
drm/amd/display: dal 3.1.38

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Add variable refresh rate parameters to DC structures
Anthony Koo [Wed, 28 Feb 2018 16:37:51 +0000 (11:37 -0500)]
drm/amd/display: Add variable refresh rate parameters to DC structures

Time stamping will be part of surface, and will be updated when address is flipped.
FreeSync parameters will be attached to stream, as it adjusts the timing dynamically.

Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>