[PATCH] drm/amdgpu: limit GDS clearing workaround in cold boot sequence

2020-02-10 Thread Guchun Chen
GDS clear workaround will cause gfx failure in suspend/resume case. [ 98.679559] [drm:amdgpu_device_ip_late_init [amdgpu]] *ERROR* late_init of IP block failed -110 [ 98.679561] PM: dpm_run_callback(): pci_pm_resume+0x0/0xa0 returns -110 [ 98.679562] PM: Device :03:00.0 failed to resum

Re: [PATCH] drm/amdgpu: limit GDS clearing workaround in cold boot sequence

2020-02-10 Thread Christian König
Am 10.02.20 um 09:33 schrieb Guchun Chen: GDS clear workaround will cause gfx failure in suspend/resume case. [ 98.679559] [drm:amdgpu_device_ip_late_init [amdgpu]] *ERROR* late_init of IP block failed -110 [ 98.679561] PM: dpm_run_callback(): pci_pm_resume+0x0/0xa0 returns -110 [ 98.679

Re: [PATCH] drm/amdgpu: Do not move root PT bo to relocated list

2020-02-10 Thread Christian König
Yeah, that is indeed partially true. But we already have the same logic in amdgpu_vm_bo_base_init() and amdgpu_vm_validate_pt_bos(). Just in the functions amdgpu_vm_invalidate_pds() and amdgpu_vm_bo_invalidate() the handling seems to be incorrect. Still sounds like a good idea to me to have

Re: [PATCH 00/15] amdgpu: remove load and unload callbacks (v3)

2020-02-10 Thread Thomas Zimmermann
Hi Am 07.02.20 um 20:50 schrieb Alex Deucher: > These are deprecated and the drm will soon start warning when drivers still > use them. It was a long and twisty road, but seems to work. > > v2: Add additional patch (13/15) which should fix the crash reported by > Thomas Zimmermann. > v3: Fix dp

Re: [PATCH] drm/amd/powerplay: update smu11_driver_if_navi10.h

2020-02-10 Thread Yuan, Xiaojie
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Xiaojie Yuan BR, Xiaojie From: amd-gfx on behalf of Evan Quan Sent: Monday, February 10, 2020 3:11 PM To: amd-gfx@lists.freedesktop.org Cc: Quan, Evan Subject: [PATCH] drm/amd/powerplay

Re: [PATCH] drm/amdgpu/vcn2.5: fix warning

2020-02-10 Thread Zhu, James
[AMD Official Use Only - Internal Distribution Only] ping From: Zhu, James Sent: Friday, February 7, 2020 8:17 AM To: amd-gfx@lists.freedesktop.org Cc: Zhu, James Subject: [PATCH] drm/amdgpu/vcn2.5: fix warning Fix warning during switching to dpg pause mode f

Re: [PATCH] drm/amdgpu/vcn2.5: fix warning

2020-02-10 Thread Leo Liu
Acked-by: Leo Liu On 2020-02-07 8:17 a.m., James Zhu wrote: Fix warning during switching to dpg pause mode for VCN firmware Version ENC: 1.1 DEC: 1 VEP: 0 Revision: 16 Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

linux-5.6-rc1/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:8411:45: error: Division by zero.

2020-02-10 Thread David Binderman
Hello there, Source code is unsigned int vsync_rate_hz = 0; struct dc_static_screen_params params = {0}; /* Calculate number of static frames before generating interrupt to * enter PSR. */ unsigned int frame_time_microsec = 100 / vsync_rate_hz; Suggest code rework.

drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c:33:33: error: Buffer is accessed out of bounds

2020-02-10 Thread David Binderman
Hello there, linux-5.6-rc1/drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c:33:33: error: Buffer is accessed out of bounds: hdcp->auth.msg.hdcp1.bksv [bufferAccessOutOfBounds] Source code is memcpy(&n, hdcp->auth.msg.hdcp1.bksv, sizeof(uint64_t)); Field bksv is only five bytes lo

Cleanup TTMs delayed delete handling

2020-02-10 Thread Christian König
This series of patches cleans up TTMs delayed delete handling. The core of the new handling is that we new only have a single reference counter instead of two and use kref_get_unless_zero() to grab BOs from the LRU during eviction. This reduces the overhead of LRU moves and allows us to properl

[PATCH 2/6] drm/ttm: cleanup ttm_buffer_object_transfer

2020-02-10 Thread Christian König
The function is always called with deleted BOs. While at it cleanup the indentation as well. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo

[PATCH 4/6] drm/ttm: rework BO delayed delete.

2020-02-10 Thread Christian König
This patch reworks the whole delayed deletion of BOs which aren't idle. Instead of having two counters for the BO structure we resurrect the BO when we find that a deleted BO is not idle yet. This has many advantages, especially that we don't need to increment/decrement the BOs reference counter

[PATCH 1/6] drm/ttm: refine ghost BO resv criteria

2020-02-10 Thread Christian König
Ghost BOs need to stick with the resv object only when the origin is imported. This is a low hanging fruit to avoid OOM situations on evictions. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/d

[PATCH 6/6] drm/ttm: individualize resv objects before calling release_notify

2020-02-10 Thread Christian König
This allows release_notify to add and remove fences from deleted objects. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 4d16103

[PATCH 3/6] drm/ttm: use RCU in ttm_bo_flush_all_fences

2020-02-10 Thread Christian König
This allows it to call the function without the lock held. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c1104c8857b7..e12fc2c2d165 1

[PATCH 5/6] drm/ttm: replace dma_resv object on deleted BOs v2

2020-02-10 Thread Christian König
When non-imported BOs are resurrected for delayed delete we replace the dma_resv object to allow for easy reclaiming of the resources. v2: move that to ttm_bo_individualize_resv Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 10 +- 1 file changed, 9 insertions(+), 1 d

[PATCH] drm/amd/display: fix dtm unloading

2020-02-10 Thread Bhawanpreet Lakha
there was a type in the terminate command. We should be calling psp_dtm_unload() instead of psp_hdcp_unload() Fixes: 143f2305 ("drm/amdgpu: psp DTM init" Signed-off-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 26 - 1 file changed, 25 insertion

[PATCH] drm/amdgpu: enable VCN2.5 DPG mode for Arcturus

2020-02-10 Thread James Zhu
Enable VCN2.5 DPG mode for arcturus after below items are applied. ASD: 0x2123 SOS: 0x17003B VCN firmware Version ENC: 1.1 DEC: 1 VEP: 0 Revision: 16 VBIOS: 23 Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[RFC PATCH -next] drm/amd/display: Remove set but not unused variable 'stream_status'

2020-02-10 Thread YueHaibing
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In function dcn10_post_unlock_program_front_end: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2623:29: warning: variable stream_status set but not used [-Wunused-but-set-variable] commit bbf5f6c3f83b ("dr

RE: [PATCH] drm/amdgpu: enable VCN2.5 DPG mode for Arcturus

2020-02-10 Thread Liu, Leo
Reviewed-by: Leo Liu -Original Message- From: amd-gfx On Behalf Of James Zhu Sent: Monday, February 10, 2020 10:36 AM To: amd-gfx@lists.freedesktop.org Cc: Zhu, James Subject: [PATCH] drm/amdgpu: enable VCN2.5 DPG mode for Arcturus Enable VCN2.5 DPG mode for arcturus after below items

Re: [PATCH v4] drm/scheduler: Avoid accessing freed bad job.

2020-02-10 Thread Andrey Grodzovsky
Lucas - Ping on my question and also I attached this temporary solution for etnaviv to clarify my point. If that something acceptable for now at least i can do the same for v3d where it requires a bit more code changes. Andrey On 2/6/20 10:49 AM, Andrey Grodzovsky wrote: Well a revert would b

Re: [PATCH] drm/amd/display: fix dtm unloading

2020-02-10 Thread Xu, Feifei
Reviewed-by: Feifei Xu > On Feb 10, 2020, at 23:17, Bhawanpreet Lakha > wrote: > > there was a type in the terminate command. > > We should be calling psp_dtm_unload() instead of psp_hdcp_unload() > > Fixes: 143f2305 ("drm/amdgpu: psp DTM init" > Signed-off-by: Bhawanpreet Lakha > ---

[PATCH 2/2] drm/amdgpu/vcn: fix race condition issue for dpg unpause mode switch

2020-02-10 Thread James Zhu
Couldn't only rely on enc fence to decide switching to dpg unpaude mode. Since a enc thread may not schedule a fence in time during multiple threads running situation. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 12 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h

[PATCH 1/2] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-02-10 Thread James Zhu
Fix race condition issue when multiple vcn starts are called. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/am

[Patch v4 4/4] drm/amdgpu/runpm: enable runpm on baco capable VI+ asics

2020-02-10 Thread Rajneesh Bhardwaj
From: Alex Deucher Seems to work reliably on VI+ except for a few so enable runpm barring those where baco for runtime power management is not supported. [rajneesh] Picked https://patchwork.freedesktop.org/patch/335402/ to enable runtime pm with baco for kfd. Also fixed a checkpatch warning and

[Patch v4 0/4] Enable BACO with KFD

2020-02-10 Thread Rajneesh Bhardwaj
Changes in v4: * Addressed recent feedback from Felix. Changes in v3: * Addressed review comments. * Rebased to latest amd-staging-drm-next. * Slightly modified patch 4 to avoid runpm on devices where baco is not yet fully supported for runtime pm but still is used for gpu reset. Changes i

[Patch v4 3/4] drm/amdkfd: refactor runtime pm for baco

2020-02-10 Thread Rajneesh Bhardwaj
So far the kfd driver implemented same routines for runtime and system wide suspend and resume (s2idle or mem). During system wide suspend the kfd aquires an atomic lock that prevents any more user processes to create queues and interact with kfd driver and amd gpu. This mechanism created problem w

[Patch v4 2/4] drm/amdkfd: show warning when kfd is locked

2020-02-10 Thread Rajneesh Bhardwaj
During system suspend the kfd driver aquires a lock that prohibits further kfd actions unless the gpu is resumed. This adds some info which can be useful while debugging. Reviewed-by: Oak Zeng Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj --- drivers/gpu/drm/amd/amdkfd/kfd_chard

[Patch v4 1/4] drm/amdgpu: Fix missing error check in suspend

2020-02-10 Thread Rajneesh Bhardwaj
amdgpu_device_suspend might return an error code since it can be called from both runtime and system suspend flows. Add the missing return code in case of a failure. Reviewed-by: Oak Zeng Reviewed-by: Felix Kuehling Reviewed-by: Alex Deucher Signed-off-by: Rajneesh Bhardwaj --- drivers/gpu/dr

[PATCH] drm/amd/display: Add aconnector condition check for dpcd read

2020-02-10 Thread Zhan Liu
[Why] core_link_read_dpcd() will invoke dm_helpers_dp_read_dpcd(), which needs to read dpcd info with the help of aconnector. If aconnector (dc->links[i]->prev) is NULL, then dpcd status cannot be read. As a result, dpcd read fails and a line of error will be printed out in dmesg.log as: "*ERROR*

Re: [PATCH v4] drm/scheduler: Avoid accessing freed bad job.

2020-02-10 Thread Luben Tuikov
Hi Lucas, Thank you for bringing awareness of this issue, publicly. As soon as this patch showed up back in November of 2019, I objected to it, privately. I suggested to instead use a _list_ to store the "state" of all jobs of the same state. Then, at any time, timeout interrupt or whatever, we

[PATCH] drm/amdgpu: Move to a per-IB secure flag (TMZ)

2020-02-10 Thread Luben Tuikov
Move from a per-CS secure flag (TMZ) to a per-IB secure flag. Signed-off-by: Luben Tuikov --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 -- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 23 --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 3 --- drivers/gpu/drm/amd/amdgpu/amd

[PATCH v2] drm/amdgpu: Move to a per-IB secure flag (TMZ)

2020-02-10 Thread Luben Tuikov
Move from a per-CS secure flag (TMZ) to a per-IB secure flag. Signed-off-by: Luben Tuikov --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 -- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 23 --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 3 --- drivers/gpu/drm/amd/amdgpu/amd

[PATCH] drm/amdgpu: Do not move root PT bo to relocated list

2020-02-10 Thread xinhui pan
As root PD has no parent, we just need move its status to idle. Suggested-by: Christian König Signed-off-by: xinhui pan CC: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/dr

[PATCH] drm/amdgpu: correct comment to clear up the confusion

2020-02-10 Thread Guchun Chen
Former comment looks to be one intended behavior in code, actually it's not. So correct it. Suggested-by: Christian König Signed-off-by: Guchun Chen --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx

Re: [PATCH 4/6] drm/ttm: rework BO delayed delete.

2020-02-10 Thread Pan, Xinhui
comments inline. [xh] > 2020年2月10日 23:09,Christian König 写道: > > This patch reworks the whole delayed deletion of BOs which aren't idle. > > Instead of having two counters for the BO structure we resurrect the BO > when we find that a deleted BO is not idle yet. > > This has many advantages,

[PATCH] drm/amd/powerplay: always refetch the enabled features status on dpm enablement

2020-02-10 Thread Evan Quan
Otherwise, the cached dpm features status may be inconsistent under some case(e.g. baco reset of Navi asic). Change-Id: Ia7d7089e82cbe4ccaa9fadce1f2f0043c42c73df Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) di

Re: [PATCH 4/6] drm/ttm: rework BO delayed delete.

2020-02-10 Thread Pan, Xinhui
comments inline > 2020年2月11日 13:26,Pan, Xinhui 写道: > > comments inline. > [xh] > > >> 2020年2月10日 23:09,Christian König 写道: >> >> This patch reworks the whole delayed deletion of BOs which aren't idle. >> >> Instead of having two counters for the BO structure we resurrect the BO >> when we

Re: [PATCH] drm/amdgpu: correct comment to clear up the confusion

2020-02-10 Thread Christian König
Am 11.02.20 um 05:16 schrieb Guchun Chen: Former comment looks to be one intended behavior in code, actually it's not. So correct it. Suggested-by: Christian König Signed-off-by: Guchun Chen Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++- 1 file changed