Re: [PATCH hmm v2 4/5] mm/hmm: remove HMM_PFN_SPECIAL

2020-05-05 Thread John Hubbard
On 2020-05-01 11:20, Jason Gunthorpe wrote: From: Jason Gunthorpe This is just an alias for HMM_PFN_ERROR, nothing cares that the error was because of a special page vs any other error case. Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA Acked-by: Felix Kuehling Reviewed-by: Ch

Re: [PATCH hmm v2 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault

2020-05-05 Thread John Hubbard
On 2020-05-01 11:20, Jason Gunthorpe wrote: From: Jason Gunthorpe Presumably the intent here was that hmm_range_fault() could put the data into some HW specific format and thus avoid some work. However, nothing actually does that, and it isn't clear how anything actually could do that as hmm_ra

Re: [PATCH hmm v2 2/5] mm/hmm: make hmm_range_fault return 0 or -1

2020-05-05 Thread John Hubbard
On 2020-05-01 11:20, Jason Gunthorpe wrote: From: Jason Gunthorpe hmm_vma_walk->last is supposed to be updated after every write to the pfns, so that it can be returned by hmm_range_fault(). However, this is not done consistently. Fortunately nothing checks the return code of hmm_range_fault()

Re: [PATCH 1/1] drm/amdgpu: Take a reference to an exported BO

2020-05-05 Thread Christian König
Just to reply here once more, this patch is a clear NAK. The references are grabbed in the call path of drm_gem_prime_export() and dropped again in drm_gem_dmabuf_release(). So they are perfectly balanced as far as I can see. Regards, Christian. Am 01.05.20 um 16:44 schrieb Felix Kuehling:

[PATCH v3 03/25] drm: amdgpu: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
The Documentation/DMA-API-HOWTO.txt states that dma_map_sg returns the numer of the created entries in the DMA address space. However the subsequent calls to dma_sync_sg_for_{device,cpu} and dma_unmap_sg must be called with the original number of the entries passed to dma_map_sg. The sg_table->nent

[PATCH v3 11/25] drm: radeon: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
The Documentation/DMA-API-HOWTO.txt states that dma_map_sg returns the numer of the created entries in the DMA address space. However the subsequent calls to dma_sync_sg_for_{device,cpu} and dma_unmap_sg must be called with the original number of the entries passed to dma_map_sg. The sg_table->nent

[bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2020-05-05 Thread Dan Carpenter
Hello xinhui pan, The patch c030f2e4166c: "drm/amdgpu: add amdgpu_ras.c to support ras (v2)" from Oct 31, 2018, leads to the following static checker warning: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:620 amdgpu_ras_feature_enable() warn: uncapped user index 'ras_block_string[head->

Re: [bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2020-05-05 Thread Dan Carpenter
Here are a couple more: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:534 amdgpu_ras_is_feature_allowed() error: undefined (user controlled) shift '(((1))) << (head->block)' drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:542 amdgpu_ras_is_feature_enabled() error: undefined (user controlled) shift '(((1))) <<

[PATCH] amdgpu_acpi: add backlight control for the DC case

2020-05-05 Thread Andriy Gapon
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 1e41367ef74ee..a8157a5154243 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgp

[PATCH] amdgpu_acpi: add backlight control for the DC case

2020-05-05 Thread Andriy Gapon
This uses backlight_device_set_brightness() to set the brightness level requested via ATIF. Signed-off-by: Andriy Gapon --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

Re: [PATCH] drm/amdgpu: allocate large structures dynamically

2020-05-05 Thread Christian König
Am 05.05.20 um 16:01 schrieb Arnd Bergmann: After the structure was padded to 1024 bytes, it is no longer suitable for being a local variable, as the function surpasses the warning limit for 32-bit architectures: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:587:5: error: stack frame size of 1072 byt

Re: [PATCH] amdgpu: fix integer overflow on 32-bit architectures

2020-05-05 Thread Christian König
Am 05.05.20 um 16:15 schrieb Arnd Bergmann: Multiplying 10 by four overruns a 'long' variable, as clang points out: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4160:53: error: overflow in expression; result is -294967296 with type 'long' [-Werror,-Winteger-overflow] expi

[PATCH] drm/amdgpu/fb: use virt_to_phys to get smem_start

2020-05-05 Thread Alex Deucher
We set the fb smem pointer to the offset into the BAR which doesn't handle framebuffers in system memory. Use virt_to_phys which should handle both BARs and system memory. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=207581 Fixes: 6c8d74caa2fa33 ("drm/amdgpu: Enable scatter gather display supp

Re: [PATCH] drm/amdgpu: Avoid integer overflow in amdgpu_device_suspend_display_audio

2020-05-05 Thread Alex Deucher
On Sat, May 2, 2020 at 4:35 AM Nathan Chancellor wrote: > > When building with Clang: > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4160:53: warning: overflow in > expression; result is -294967296 with type 'long' [-Winteger-overflow] > expires = ktime_get_mono_fast_ns() + NSEC_PE

Re: [PATCH -next] drm/radeon: fix unsigned comparison with 0

2020-05-05 Thread Alex Deucher
On Tue, May 5, 2020 at 2:59 AM ChenTao wrote: > > Fixes warning because pipe is unsigned long and can never be negtative > > vers/gpu/drm/radeon/radeon_kms.c:831:11: warning: > comparison of unsigned expression < 0 is always false [-Wtype-limits] > if (pipe < 0 || pipe >= rdev->num_crtc) { > dri

[PATCH] drm/amdgpu/dc: don't pass -mhard-float to clang

2020-05-05 Thread Arnd Bergmann
Clang does not appear to care, and instead prints a warning: clang: warning: argument unused during compilation: '-mhard-float' [-Wunused-command-line-argument] Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 5 +++-- drivers/gpu/drm/amd/display/dc/dcn20/Makefi

[PATCH] amdgpu: fix integer overflow on 32-bit architectures

2020-05-05 Thread Arnd Bergmann
Multiplying 10 by four overruns a 'long' variable, as clang points out: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4160:53: error: overflow in expression; result is -294967296 with type 'long' [-Werror,-Winteger-overflow] expires = ktime_get_mono_fast_ns() + NSEC_PER_SEC *

[PATCH] drm/amdgpu: allocate large structures dynamically

2020-05-05 Thread Arnd Bergmann
After the structure was padded to 1024 bytes, it is no longer suitable for being a local variable, as the function surpasses the warning limit for 32-bit architectures: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:587:5: error: stack frame size of 1072 bytes in function 'amdgpu_ras_feature_enable' [-W

Re: [PATCH 1/1] drm/amdgpu: Take a reference to an exported BO

2020-05-05 Thread Felix Kuehling
Am 2020-05-05 um 3:47 a.m. schrieb Christian König: > Just to reply here once more, this patch is a clear NAK. Agreed. But see below. I don't think all is well. > > The references are grabbed in the call path of drm_gem_prime_export() > and dropped again in drm_gem_dmabuf_release(). > > So they

Re: [PATCH] amdgpu_acpi: add backlight control for the DC case

2020-05-05 Thread Alex Deucher
Applied. Thanks! Alex On Tue, May 5, 2020 at 9:27 AM Andriy Gapon wrote: > > This uses backlight_device_set_brightness() to set the brightness > level requested via ATIF. > > Signed-off-by: Andriy Gapon > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 20 +++- > 1 file chang

Re: [PATCH 1/1] drm/amdgpu: Take a reference to an exported BO

2020-05-05 Thread Christian König
Am 05.05.20 um 16:58 schrieb Felix Kuehling: Am 2020-05-05 um 3:47 a.m. schrieb Christian König: Just to reply here once more, this patch is a clear NAK. Agreed. But see below. I don't think all is well. The references are grabbed in the call path of drm_gem_prime_export() and dropped agai

Re: [PATCH] drm/amdgpu: allocate large structures dynamically

2020-05-05 Thread Alex Deucher
On Tue, May 5, 2020 at 10:07 AM Christian König wrote: > > Am 05.05.20 um 16:01 schrieb Arnd Bergmann: > > After the structure was padded to 1024 bytes, it is no longer > > suitable for being a local variable, as the function surpasses > > the warning limit for 32-bit architectures: > > > > driver

[PATCH] drm/amdgpu: implement soft_recovery for gfx10

2020-05-05 Thread Alex Deucher
Same as gfx9. This allows us to kill the waves for hung shaders. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index ddb4

Re: [PATCH] drm/amd/display: Fix pageflip event race condition for DCN. (v2)

2020-05-05 Thread Alex Deucher
Mario or Nick any thoughts? Alex On Mon, May 4, 2020 at 1:35 PM Matt Coffin wrote: > > Hey guys, > > This is still an issue for me, and I'm still having to run a patch to > revert this as of 5.7-rc4. To avoid breaking a lot of people's Navi > setups in 5.7, is there any news on this? Has anyone

Re: [PATCH 1/1] drm/amdgpu: Take a reference to an exported BO

2020-05-05 Thread Felix Kuehling
Am 2020-05-05 um 11:19 a.m. schrieb Christian König: > Am 05.05.20 um 16:58 schrieb Felix Kuehling: >> Am 2020-05-05 um 3:47 a.m. schrieb Christian König: >>> Just to reply here once more, this patch is a clear NAK. >> >> Agreed. But see below. I don't think all is well. >> >>> >>> The references a

Re: [PATCH] drm/amd/display: Fix pageflip event race condition for DCN. (v2)

2020-05-05 Thread Kazlauskas, Nicholas
Can you file a full bug report on the gitlab tracker? FreeSync is still working on my Navi setups with this patch applied, and this patch is essentially just a revert of another patch already (where FreeSync worked before). I can understand the v2 of this series causing issues, but the v1 sh

Re: [PATCH] drm/amd/display: Fix pageflip event race condition for DCN. (v2)

2020-05-05 Thread Matt Coffin
Sure, I'll file one after work today. To clarify though, FreeSync still "works" as in the monitor refresh rate is updating, but it constantly bounces between the maximum and minimum freesync refresh rates, causing it to look VERY stuttery. Thanks for the attention, I'll file the but tonight. If y

[PATCH] Revert "Revert "drm/amdgpu: use the BAR if possible in amdgpu_device_vram_access v2""

2020-05-05 Thread Kent Russell
This reverts commit e71391880aa72709fac53f98d96a2d4e8875b9fa. The RAS issue at the base of this problem appears to have been addressed Signed-off-by: Kent Russell Change-Id: I338a985e19cae8e103bd44b0f238314e9460d396 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 ++ 1 f

Re: [PATCH] Revert "Revert "drm/amdgpu: use the BAR if possible in amdgpu_device_vram_access v2""

2020-05-05 Thread Alex Deucher
On Tue, May 5, 2020 at 2:57 PM Kent Russell wrote: > > This reverts commit e71391880aa72709fac53f98d96a2d4e8875b9fa. > > The RAS issue at the base of this problem appears to have been addressed > > Signed-off-by: Kent Russell > Change-Id: I338a985e19cae8e103bd44b0f238314e9460d396 Would probably

RE: [PATCH] Revert "Revert "drm/amdgpu: use the BAR if possible in amdgpu_device_vram_access v2""

2020-05-05 Thread Russell, Kent
[AMD Official Use Only - Internal Distribution Only] I will do that instead. Thanks for the recommendation! Kent > -Original Message- > From: Alex Deucher > Sent: Tuesday, May 5, 2020 3:20 PM > To: Russell, Kent > Cc: amd-gfx list > Subject: Re: [PATCH] Revert "Revert "drm/amdgpu: us

Re: [PATCH] amdgpu: fix integer overflow on 32-bit architectures

2020-05-05 Thread Nick Desaulniers
See also https://lore.kernel.org/lkml/cadnq5_ndtzh5_rgdwkj9c_42xlvrnccs5ddu1ysptfzp94k...@mail.gmail.com/T/#me707e09e92c6e487285e8bb382a607e4e782c249 On Tue, May 5, 2020 at 7:17 AM Christian König wrote: > > Am 05.05.20 um 16:15 schrieb Arnd Bergmann: > > Multiplying 10 by four overruns

[PATCH] drm/amdgpu: simplify ATIF backlight handling

2020-05-05 Thread Alex Deucher
Just register the a pointer to the backlight device and use that. Unifies the DC and non-DC handling. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 73 ++-- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

Re: [PATCH] drm/amdgpu/dc: don't pass -mhard-float to clang

2020-05-05 Thread Nick Desaulniers
On Tue, May 5, 2020 at 7:25 AM Arnd Bergmann wrote: > > Clang does not appear to care, and instead prints a warning: > > clang: warning: argument unused during compilation: '-mhard-float' > [-Wunused-command-line-argument] > > Signed-off-by: Arnd Bergmann I want to be super careful here, this p

Re: [PATCH 1/1] drm/amdgpu: Take a reference to an exported BO

2020-05-05 Thread Felix Kuehling
Am 2020-05-05 um 1:29 p.m. schrieb Felix Kuehling: > Am 2020-05-05 um 11:19 a.m. schrieb Christian König: >> Am 05.05.20 um 16:58 schrieb Felix Kuehling: >>> Am 2020-05-05 um 3:47 a.m. schrieb Christian König: Just to reply here once more, this patch is a clear NAK. >>> >>> Agreed. But see bel

[PATCH 1/1] drm/amdgpu: Use GEM obj reference for KFD BOs

2020-05-05 Thread Felix Kuehling
Releasing the AMDGPU BO ref directly leads to problems when BOs were exported as DMA bufs. Releasing the GEM reference makes sure that the AMDGPU/TTM BO is not freed too early. Also take a GEM reference when importing BOs from DMABufs to keep references to imported BOs balances properly. Signed-o

A curious phenomenon in HDMI hotplug.

2020-05-05 Thread Aaron Chou
Hi all: I'm a newer about the amdgpu driver. I have a question about it. In my company, there are some experiments about HDMI hotplug. First, I introduce the lab environment: cpu: huawei kunpeng os: uos kernel: 4.19.90 video card: Radeon HD 700 the lab step is: 1, I connect the hdmi and vga with

RE: [PATCH] drm/amdgpu: address the static checker warnings V2

2020-05-05 Thread Quan, Evan
[AMD Official Use Only - Internal Distribution Only] Ping.. -Original Message- From: Quan, Evan Sent: Wednesday, April 29, 2020 10:39 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; dan.carpen...@oracle.com; Quan, Evan Subject: [PATCH] drm/amdgpu: address the static check

RE: [PATCH] drm/amdgpu: Add autodump debugfs node for gpu reset v4

2020-05-05 Thread Zhao, Jiange
[AMD Official Use Only - Internal Distribution Only] Hi Christian, > Hi Jiange, well that looks correct to me, but seems to be a bit to > complicated. What exactly was wrong with version 3? (1) If you open amdgpu_autodump, use it and close it, then you can't open it again, because wait_for_comp

[PATCH] drm/amdgpu: cleanup not_vf & pp_not_vf in powerplay

2020-05-05 Thread Kevin Wang
Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 14 +++--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 6 +++--- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/po

Re: [PATCH] drm/amdgpu: cleanup not_vf & pp_not_vf in powerplay

2020-05-05 Thread Wang, Kevin(Yang)
[AMD Official Use Only - Internal Distribution Only] send error, please ignore this patch. Best Regards, Kevin From: Wang, Kevin(Yang) Sent: Wednesday, May 6, 2020 2:20 PM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Deucher, Alexander ; Liu, Monk ; F

[PATCH 1/3] drm/amdgpu: add amdgpu_virt_get_vf_mode helper function

2020-05-05 Thread Kevin Wang
the swsmu or powerplay(hwmgr) need to handle task according to different VF mode, this function to help query vf mode. vf mode: 1. SRIOV_VF_MODE_BARE_METAL: the driver work on host OS (PF) 2. SRIOV_VF_MODE_ONE_VF: the driver work on guest OS with one VF 3. SRIOV_VF_MODE_MULTI_VF : the drive

[PATCH 2/3] drm/amdgpu: optimize amdgpu device attribute code

2020-05-05 Thread Kevin Wang
unified amdgpu device attribute node functions: 1. add some helper functions to create amdgpu device attribute node. 2. create device node according to device attr flags on different VF mode. 3. rename some functions name to adapt a new interface. 4. remove unneccessary virt mode check in inernal f

[PATCH 3/3] drm/amdgpu: cleanup sriov mode check in internal swsmu driver

2020-05-05 Thread Kevin Wang
cleanup unnecessary check in internal swsmu driver: 1. cleanup amdgpu_sriov_is_pp_one_vf() check logic. 2. cleanup amdgpu_sriov_vf() check logic. 3. add sw smu ip block according to different vf mode. Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/nv.c | 29 +++- drivers/

[PATCH 1/4] drm/amdgpu: switch to common xgmi ta helpers

2020-05-05 Thread Hawking Zhang
get_hive_id/get_node_id/get_topology_info/set_topology_info are common xgmi command supported by TA for all the ASICs that support xgmi link. They should be implemented as common helper functions to avoid duplicated code per IP generation Signed-off-by: Hawking Zhang --- drivers/gpu/drm/amd/amdg

[PATCH 4/4] drm/amdgpu: switch to common rlc_autoload helper

2020-05-05 Thread Hawking Zhang
drop IP specific psp functon for rlc autoload since the autoload_supported was introduced to mark ASICs that support rlc_autoload Signed-off-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 3 --- drivers/gpu/drm/amd/amdgpu/psp_v11_0

[PATCH 2/4] drm/amdgpu: switch to common ras ta helper

2020-05-05 Thread Hawking Zhang
TRIGGER_ERROR is common ras ta command for all the ASICs that support RAS feature. switch to common helper to avoid duplicate implementation per IP generation Signed-off-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 27 +++ drivers/gpu/drm/amd/amdgpu/amd

[PATCH 3/4] drm/amdgpu: drop unused ras ta helper function

2020-05-05 Thread Hawking Zhang
cure posion command was replaced by ras recovery solution and was not a formal command supported by ras ta anymore Signed-off-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 5 - drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 27 --- 2 files changed, 32 de

[PATCH] drm/amdgpu: use node_id and node_size to calcualte dram_base_address

2020-05-05 Thread Hawking Zhang
physical_node_id * node_segment_size should be the dram_base_address for current gpu node in xgmi config Signed-off-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_df.h | 3 -- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 27 ++-- drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 5