[pull] amdgpu drm-fixes-5.8

2020-07-29 Thread Alex Deucher
Hi Dave, Daniel, A few fixes for 5.8. It would be nice to get these in for 5.8 final, but if it's too late, they can go back via stable from 5.9. The following changes since commit a4a2739beb8933a19281bca077fdb852598803ed: Merge tag 'drm-misc-fixes-2020-07-28' of

[PATCH 5/8] drm/amd/powerplay: update the data structure for NV12 SmuMetrics

2020-07-29 Thread Evan Quan
Although it does not bring any problem for now, the coming gpu metrics interface needs to handle them differently based on the asic type. Change-Id: I88ee78c26795267588f944d4f1983e4dbf23ba85 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- .../powerplay/inc/smu11_driver_if_navi10.h|

[PATCH 8/8] drm/amd/powerplay: add Renoir support for gpu metrics export

2020-07-29 Thread Evan Quan
Add Renoir gpu metrics export interface. Change-Id: Ic83265536eeaa9e458dc395b2be18ea49da4c68a Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/renoir_ppt.c| 95 ++-

[PATCH 7/8] drm/amd/powerplay: add Sienna Cichlid support for gpu metrics export

2020-07-29 Thread Evan Quan
Add Sienna Cichlid gpu metrics export interface. Change-Id: I89e6a4415fe467e7e4aaabe07d9e8cee379caa25 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 91 ++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git

[PATCH 6/8] drm/amd/powerplay: add Navi1x support for gpu metrics export

2020-07-29 Thread Evan Quan
Add Navi1x gpu metrics export interface. Change-Id: I9028fb925e70c36fb2a0b00968c462c0bbc822db Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 93 +- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git

[PATCH 4/8] drm/amd/powerplay: add Arcturus support for gpu metrics export

2020-07-29 Thread Evan Quan
Add Arcturus gpu metrics export interface. Change-Id: I372337f31e2b7174d41fb4e3af180deb94b5ec06 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 92 +++ .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 3 +

[PATCH 3/8] drm/amd/powerplay: implement SMU V11 common APIs for retrieving link speed/width

2020-07-29 Thread Evan Quan
This will be shared around all SMU V11 asics. Change-Id: Iaa4554fb0e011b9f565d89375ac7b6a7eb525420 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 8 +++ drivers/gpu/drm/amd/powerplay/navi10_ppt.c| 9 +---

[PATCH 1/8] drm/amd/powerplay: define an universal data structure for gpu metrics (V3)

2020-07-29 Thread Evan Quan
Thus we can provide an interface for UMD to retrieve gpu metrics data. V2: better naming and comments V3: two structures created for dGPU and APU separately Change-Id: Ibc2d5c642eff732c082f8447348749a44dc35be3 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher ---

[PATCH 2/8] drm/amd/powerplay: add new sysfs interface for retrieving gpu metrics(V2)

2020-07-29 Thread Evan Quan
A new interface for UMD to retrieve gpu metrics data. V2: rich the documentation Change-Id: If7f3523915505c0ece0a56dfd476d2b8473440d4 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- Documentation/gpu/amdgpu.rst | 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h |

RE: FW: [PATCH] drm/amdgpu: introduce a new parameter to configure how many KCQ we want(v3)

2020-07-29 Thread Liu, Monk
[AMD Official Use Only - Internal Distribution Only] Ping _ Monk Liu|GPU Virtualization Team |AMD -Original Message- From: amd-gfx On Behalf Of Liu, Monk Sent: Tuesday, July 28, 2020 5:32 PM To: Koenig, Christian ; amd-...@freedesktop.org Cc:

Re: [PATCH] drm/amdgpu: Fix regression in adjusting power table/profile

2020-07-29 Thread Alex Deucher
On Wed, Jul 29, 2020 at 10:20 PM Paweł Gronowski wrote: > > Regression was introduced in commit 38e0c89a19fd > ("drm/amdgpu: Fix NULL dereference in dpm sysfs handlers") which > made the set_pp_od_clk_voltage and set_pp_power_profile_mode return > -EINVAL for previously valid input. This was

[PATCH] drm/amdgpu: Fix regression in adjusting power table/profile

2020-07-29 Thread Paweł Gronowski
Regression was introduced in commit 38e0c89a19fd ("drm/amdgpu: Fix NULL dereference in dpm sysfs handlers") which made the set_pp_od_clk_voltage and set_pp_power_profile_mode return -EINVAL for previously valid input. This was caused by an empty string (starting at the \0 character) being passed

Re: [PATCH] drm/amdgpu/dc: Stop dma_resv_lock inversion in commit_tail

2020-07-29 Thread Alex Deucher
Applied. Thanks! Alex On Tue, Jul 28, 2020 at 2:56 AM Christian König wrote: > > Am 27.07.20 um 23:30 schrieb Daniel Vetter: > > Trying to grab dma_resv_lock while in commit_tail before we've done > > all the code that leads to the eventual signalling of the vblank event > > (which can be a

Re: [PATCH -next] drm/amd/powerplay: Remove unneeded cast from memory allocation

2020-07-29 Thread Alex Deucher
Applied. Thanks! Alex On Wed, Jul 29, 2020 at 9:11 AM Li Heng wrote: > > Remove casting the values returned by memory allocation function. > > Coccinelle emits WARNING: > > ./drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c:893:37-46: > WARNING: casting value returned by memory

Re: [Linux-kernel-mentees] [PATCH] drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()

2020-07-29 Thread Alex Deucher
Applied. Thanks! Alex On Wed, Jul 29, 2020 at 4:11 AM Christian König wrote: > > Am 28.07.20 um 21:29 schrieb Peilin Ye: > > Compiler leaves a 4-byte hole near the end of `dev_info`, causing > > amdgpu_info_ioctl() to copy uninitialized kernel stack memory to userspace > > when `size` is

[PATCH 11/17] drm/amdgpu/gmc9: switch to using amdgpu_gmc_get_vbios_allocations

2020-07-29 Thread Alex Deucher
The new helper centralizes the logic in one place. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 112 +- 1 file changed, 38 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

[PATCH 04/17] drm/amdgpu: move stolen vga bo from amdgpu to amdgpu.gmc

2020-07-29 Thread Alex Deucher
Since that is where we store the other data related to the stolen vga memory. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +++---

[PATCH 03/17] drm/amdgpu: use a define for the memory size of the vga emulator

2020-07-29 Thread Alex Deucher
Rather than open coding it everywhere. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 ++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +-

[PATCH 02/17] drm/amdgpu: use create_at for the stolen pre-OS buffer

2020-07-29 Thread Alex Deucher
Should be functionally the same since nothing else is allocated at that point, but let's be exact. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 01/17] drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at (v2)

2020-07-29 Thread Alex Deucher
Just return early to match other bo_create functions. v2: check if the bo_ptr is NULL rather than checking the size. Reviewed-by: Felix Kuehling (v1) Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 15/17] drm/amdgpu: move stolen memory from gmc to mman

2020-07-29 Thread Alex Deucher
It's more related to memory management than memory controller. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 5 - drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 20 ++--

[PATCH 17/17] drm/amdgpu: move vram usage by vbios to mman

2020-07-29 Thread Alex Deucher
It's related to the memory manager so move it there. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 12 --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 4 ++-- .../gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 4 ++--

[PATCH 09/17] drm/amdgpu/gmc7: switch to using amdgpu_gmc_get_vbios_allocations

2020-07-29 Thread Alex Deucher
The new helper centralizes the logic in one place. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c

[PATCH 07/17] drm/amdgpu/gmc: add new helper to get the FB size used by pre-OS console

2020-07-29 Thread Alex Deucher
This adds a new gmc callback to get the size reserved by the pre-OS console and provides a helper function for use by gmc IP drivers. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 43 +

[PATCH 08/17] drm/amdgpu/gmc6: switch to using amdgpu_gmc_get_vbios_allocations

2020-07-29 Thread Alex Deucher
The new helper centralizes the logic in one place. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c

[PATCH 06/17] drm/amdgpu: add support for extended stolen vga memory

2020-07-29 Thread Alex Deucher
This will allow us to split the allocation for systems where we have to keep the stolen memory around to avoid S3 issues. This way we don't waste as much memory and still avoid any screen artifacts during the bios to driver transition. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher

[PATCH 13/17] drm/amdgpu: drop the CPU pointers for the stolen vga bos

2020-07-29 Thread Alex Deucher
We never use them. Reviewed-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

[PATCH 14/17] drm/amdgpu/gmc: disable keep_stolen_vga_memory on arcturus

2020-07-29 Thread Alex Deucher
I suspect the only reason this was set was to avoid touching the display related registers on arcturus. Someone should double check this on arcturus with S3. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 - 1 file changed, 1

[PATCH 16/17] drm/amdgpu: move IP discovery data to mman

2020-07-29 Thread Alex Deucher
It's related to the memory manager so move it there. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 -- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 54 +--

[PATCH 00/17] rework stolen pre-OS fb allocation handling (v2)

2020-07-29 Thread Alex Deucher
Split the allocations into two so we can still support the S3 workarounds required on some platforms while also avoiding any artifacts when transitioning from bios to driver. In the future we could integrate handling of the ip discovery data and other vbios allocations into this helper function

[PATCH 05/17] drm/amdgpu: move keep stolen memory check into gmc core

2020-07-29 Thread Alex Deucher
Rather than leaving this as a gmc v9 specific hack. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 - drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 11 +++ 3 files changed, 12

[PATCH 12/17] drm/amdgpu/gmc10: switch to using amdgpu_gmc_get_vbios_allocations

2020-07-29 Thread Alex Deucher
The new helper centralizes the logic in one place. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 57 +++--- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c

[PATCH 10/17] drm/amdgpu/gmc8: switch to using amdgpu_gmc_get_vbios_allocations

2020-07-29 Thread Alex Deucher
The new helper centralizes the logic in one place. Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c

Re: [PATCH] drm/amd/display: Clear dm_state for fast updates

2020-07-29 Thread Kazlauskas, Nicholas
On 2020-07-28 5:08 a.m., dan...@ffwll.ch wrote: On Mon, Jul 27, 2020 at 10:49:48PM -0400, Kazlauskas, Nicholas wrote: On 2020-07-27 5:32 p.m., Daniel Vetter wrote: On Mon, Jul 27, 2020 at 11:11 PM Mazin Rezk wrote: On Monday, July 27, 2020 4:29 PM, Daniel Vetter wrote: On Mon, Jul 27,

Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access

2020-07-29 Thread Koenig, Christian
Sure. Christian. Am 29.07.2020 17:30 schrieb "Deucher, Alexander" : [AMD Public Use] Christian, Can you cc stable when you apply it to drm-misc? Alex From: Kuehling, Felix Sent: Wednesday, July 29, 2020 10:15 AM To: Koenig, Christian ;

Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access

2020-07-29 Thread Deucher, Alexander
[AMD Public Use] Christian, Can you cc stable when you apply it to drm-misc? Alex From: Kuehling, Felix Sent: Wednesday, July 29, 2020 10:15 AM To: Koenig, Christian ; dri-de...@lists.freedesktop.org ; amd-gfx@lists.freedesktop.org ; Deucher, Alexander Cc:

Re: [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2)

2020-07-29 Thread Deucher, Alexander
Are any of those situations really time sensitive? Otherwise, I think we'll end up having to patch this in everywhere we want SPM to be consistent. Alex From: Yin, Tianci (Rico) Sent: Tuesday, July 28, 2020 10:26 PM To: Deucher, Alexander ;

Re: [PATCH] drm/amdgpu: fix PSP autoload twice in FLR

2020-07-29 Thread Luben Tuikov
Reviewed-by: Luben Tuikov On 2020-07-29 04:50, Liu ChengZhe wrote: > Assigning false to block->status.hw overwrites PSP's previous > hardware status, which causes the PSP to Resume operation after > hardware init. > > Remove this assignment and let the PSP execute Resume operation > when it is

Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access

2020-07-29 Thread Felix Kuehling
Am 2020-07-29 um 4:08 a.m. schrieb Christian König: > Am 28.07.20 um 20:27 schrieb Felix Kuehling: >> VMAs with a pg_offs that's offset from the start of the vma_node need >> to adjust the offset within the BO accordingly. This matches the >> offset calculation in ttm_bo_vm_fault_reserved. >> >>

Re: [PATCH 1/2] drm amdgpu: Skip tmr load for SRIOV

2020-07-29 Thread Luben Tuikov
Reviewed-by: Luben Tuikov On 2020-07-29 04:23, Liu ChengZhe wrote: > 1. For Navi12, CHIP_SIENNA_CICHLID, skip tmr load operation; > 2. Check pointer before release firmware. > > v2: use CHIP_SIENNA_CICHLID instead > v3: remove local "bool ret"; fix grammer issue > v4: use my name instead of

Re: [Linux-kernel-mentees] [PATCH] drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()

2020-07-29 Thread Alex Deucher
On Wed, Jul 29, 2020 at 4:11 AM Christian König wrote: > > Am 28.07.20 um 21:29 schrieb Peilin Ye: > > Compiler leaves a 4-byte hole near the end of `dev_info`, causing > > amdgpu_info_ioctl() to copy uninitialized kernel stack memory to userspace > > when `size` is greater than 356. > > > > In

[PATCH -next] drm/amd/powerplay: Remove unneeded cast from memory allocation

2020-07-29 Thread Li Heng
Remove casting the values returned by memory allocation function. Coccinelle emits WARNING: ./drivers/gpu/drm/amd/powerplay/hwmgr/vega20_processpptables.c:893:37-46: WARNING: casting value returned by memory allocation function to (PPTable_t *) is useless. Signed-off-by: Li Heng ---

Re: [Linux-kernel-mentees] [PATCH] drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()

2020-07-29 Thread Daniel Vetter
On Wed, Jul 29, 2020 at 10:11 AM Christian König wrote: > > Am 28.07.20 um 21:29 schrieb Peilin Ye: > > Compiler leaves a 4-byte hole near the end of `dev_info`, causing > > amdgpu_info_ioctl() to copy uninitialized kernel stack memory to userspace > > when `size` is greater than 356. > > > > In

[PATCH] drm/amdgpu: fix PSP autoload twice in FLR

2020-07-29 Thread Liu ChengZhe
Assigning false to block->status.hw overwrites PSP's previous hardware status, which causes the PSP to Resume operation after hardware init. Remove this assignment and let the PSP execute Resume operation when it is told to. v2: Remove the braces. v3: Modify the description. Signed-off-by: Liu

Re: [PATCH 13/14] drm/amdgpu: drop the CPU pointers for the stolen vga bos

2020-07-29 Thread Christian König
Am 29.07.20 um 00:46 schrieb Alex Deucher: We never use them. Signed-off-by: Alex Deucher Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git

Re: [PATCH 04/14] drm/amdgpu: move stolen vga bo from amdgpu to amdgpu.gmc

2020-07-29 Thread Christian König
Am 29.07.20 um 00:45 schrieb Alex Deucher: Since that is where we store the other data related to the stolen vga memory. Mhm, how about putting everything into struct amdgpu_mman instead? This stuff is not at all GMC related as far as I can see. We just put it into the GMC code because we

RE: [PATCH] drm/amdgpu: fix PSP autoload twice in FLR

2020-07-29 Thread Liu, Cheng Zhe
[AMD Official Use Only - Internal Distribution Only] Thanks for the modification! -Original Message- From: Tuikov, Luben Sent: Wednesday, July 29, 2020 2:49 AM To: Liu, Cheng Zhe ; amd-gfx@lists.freedesktop.org Cc: Koenig, Christian ; Deucher, Alexander ; Xiao, Jack ; Zhang, Hawking

Re: [PATCH 01/14] drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at

2020-07-29 Thread Christian König
Am 29.07.20 um 00:45 schrieb Alex Deucher: Just return early to match other bo_create functions. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

[PATCH 1/2] drm amdgpu: Skip tmr load for SRIOV

2020-07-29 Thread Liu ChengZhe
1. For Navi12, CHIP_SIENNA_CICHLID, skip tmr load operation; 2. Check pointer before release firmware. v2: use CHIP_SIENNA_CICHLID instead v3: remove local "bool ret"; fix grammer issue v4: use my name instead of "root" v5: fix grammer issue and indent issue Signed-off-by: Liu ChengZhe ---

Re: [Linux-kernel-mentees] [PATCH] drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()

2020-07-29 Thread Christian König
Am 28.07.20 um 21:29 schrieb Peilin Ye: Compiler leaves a 4-byte hole near the end of `dev_info`, causing amdgpu_info_ioctl() to copy uninitialized kernel stack memory to userspace when `size` is greater than 356. In 2015 we tried to fix this issue by doing `= {};` on `dev_info`, which

Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access

2020-07-29 Thread Christian König
Am 28.07.20 um 20:27 schrieb Felix Kuehling: VMAs with a pg_offs that's offset from the start of the vma_node need to adjust the offset within the BO accordingly. This matches the offset calculation in ttm_bo_vm_fault_reserved. Signed-off-by: Felix Kuehling Tested-by: Laurent Morichetti