RE: [PATCH v2 1/5] drm/amdgpu:add tmr mac address into amdgpu_firmware_info

2018-08-10 Thread Gao, Likun
For series: Review-by: Likun Gao Thanks for all your efforts and will apply those patch to pco topic branch Regards, Likun -Original Message- From: James Zhu Sent: Friday, August 10, 2018 12:32 AM To: amd-gfx@lists.freedesktop.org Cc: Zhu, James ; Deucher, Alexander ; Gao, Likun ; Hu

Re: [PATCH] drm/amdpu/vce_v3: skip suspend and resume if powergated

2018-08-10 Thread S, Shirish
On 8/10/2018 12:02 PM, Zhu, Rex wrote: I am Ok with the check when call vce_v3_0_hw_fini. But we may still need to call amdpug_vce_suspend/resume. Done in V2. Have moved the check such that both are executed. Regards, Shirish S and not sure whether need to do ring test when resume back.

Re: [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h

2018-08-10 Thread Huang Rui
On Fri, Aug 10, 2018 at 01:44:28PM +0800, Junwei Zhang wrote: > code cleanup for amdgpu ttm structures > > Signed-off-by: Junwei Zhang Acked-by: Huang Rui > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 20 > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 17

Re: [PATCH xf86-video-amdgpu] Store FB for each CRTC in drmmode_flipdata_rec

2018-08-10 Thread Johannes Hirte
On 2018 Jul 27, Michel Dänzer wrote: > From: Michel Dänzer > > We were only storing the FB provided by the client, but on CRTCs with > TearFree enabled, we use a separate FB. This could cause > drmmode_flip_handler to fail to clear drmmode_crtc->flip_pending, which > could result in a hang when w

Re: [PATCH] drm/amdgpu/powerplay: check vrefresh when when changing displays

2018-08-10 Thread Huang Rui
On Thu, Aug 09, 2018 at 03:16:23PM -0500, Alex Deucher wrote: > Compare the current vrefresh in addition to the number of displays > when determining whether or not the smu needs updates when changing > modes. The SMU needs to be updated if the vbi timeout changes due > to a different refresh rate.

Re: [PATCH 2/6] dma-buf: add reservation object shared fence accessor

2018-08-10 Thread Huang Rui
On Thu, Aug 09, 2018 at 01:37:09PM +0200, Christian König wrote: > Add a helper to access the shared fences in an reservation object. > > Signed-off-by: Christian König Reviewed-by: Huang Rui > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 7 ++- > drivers/gpu/drm/amd/amdgpu/a

Re: [Intel-gfx] RFC: Add write flag to reservation object fences

2018-08-10 Thread Chris Wilson
Quoting Christian König (2018-08-09 15:54:31) > Am 09.08.2018 um 16:22 schrieb Daniel Vetter: > > On Thu, Aug 9, 2018 at 3:58 PM, Christian König > > wrote: > >> Am 09.08.2018 um 15:38 schrieb Daniel Vetter: > >>> On Thu, Aug 09, 2018 at 01:37:07PM +0200, Christian König wrote: > >>> [SNIP] > >> S

Re: [Intel-gfx] RFC: Add write flag to reservation object fences

2018-08-10 Thread Christian König
Am 10.08.2018 um 09:51 schrieb Chris Wilson: Quoting Christian König (2018-08-09 15:54:31) Am 09.08.2018 um 16:22 schrieb Daniel Vetter: On Thu, Aug 9, 2018 at 3:58 PM, Christian König wrote: Am 09.08.2018 um 15:38 schrieb Daniel Vetter: On Thu, Aug 09, 2018 at 01:37:07PM +0200, Christian Kö

Re: RFC: Add write flag to reservation object fences

2018-08-10 Thread Daniel Vetter
On Thu, Aug 9, 2018 at 4:54 PM, Christian König wrote: > Am 09.08.2018 um 16:22 schrieb Daniel Vetter: >> >> On Thu, Aug 9, 2018 at 3:58 PM, Christian König >> wrote: >>> >>> Am 09.08.2018 um 15:38 schrieb Daniel Vetter: On Thu, Aug 09, 2018 at 01:37:07PM +0200, Christian König wrote: >

Re: [Intel-gfx] RFC: Add write flag to reservation object fences

2018-08-10 Thread Daniel Vetter
On Fri, Aug 10, 2018 at 10:24 AM, Christian König wrote: > Am 10.08.2018 um 09:51 schrieb Chris Wilson: >> >> Quoting Christian König (2018-08-09 15:54:31) >>> >>> Am 09.08.2018 um 16:22 schrieb Daniel Vetter: On Thu, Aug 9, 2018 at 3:58 PM, Christian König wrote: > > Am 09

Re: [Intel-gfx] RFC: Add write flag to reservation object fences

2018-08-10 Thread Christian König
Am 10.08.2018 um 10:32 schrieb Daniel Vetter: On Fri, Aug 10, 2018 at 10:24 AM, Christian König wrote: Am 10.08.2018 um 09:51 schrieb Chris Wilson: Quoting Christian König (2018-08-09 15:54:31) Am 09.08.2018 um 16:22 schrieb Daniel Vetter: On Thu, Aug 9, 2018 at 3:58 PM, Christian König wro

Re: [PATCH 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling

2018-08-10 Thread Huang Rui
On Thu, Aug 09, 2018 at 08:27:10PM +0800, Koenig, Christian wrote: > Am 09.08.2018 um 14:25 schrieb Huang Rui: > > On Thu, Aug 09, 2018 at 03:18:55PM +0800, Koenig, Christian wrote: > >> Am 09.08.2018 um 08:18 schrieb Huang Rui: > >>> On Wed, Aug 08, 2018 at 06:47:49PM +0800, Christian König wrote:

Re: RFC: Add write flag to reservation object fences

2018-08-10 Thread Christian König
Am 10.08.2018 um 10:29 schrieb Daniel Vetter: [SNIP] I'm only interested in the case of shared buffers. And for those you _do_ pessimistically assume that all access must be implicitly synced. Iirc amdgpu doesn't support EGL_ANDROID_native_fence_sync, so this makes sense that you don't bother wit

Re: RFC: Add write flag to reservation object fences

2018-08-10 Thread Daniel Vetter
On Fri, Aug 10, 2018 at 11:14 AM, Christian König wrote: > Am 10.08.2018 um 10:29 schrieb Daniel Vetter: >> >> [SNIP] >> I'm only interested in the case of shared buffers. And for those you >> _do_ pessimistically assume that all access must be implicitly synced. >> Iirc amdgpu doesn't support EGL

Re: [Intel-gfx] RFC: Add write flag to reservation object fences

2018-08-10 Thread Daniel Vetter
On Fri, Aug 10, 2018 at 10:51 AM, Christian König wrote: > Am 10.08.2018 um 10:32 schrieb Daniel Vetter: >> >> On Fri, Aug 10, 2018 at 10:24 AM, Christian König >> wrote: >>> >>> Am 10.08.2018 um 09:51 schrieb Chris Wilson: Quoting Christian König (2018-08-09 15:54:31) > > Am 09

Re: RFC: Add write flag to reservation object fences

2018-08-10 Thread Daniel Vetter
On Fri, Aug 10, 2018 at 11:14 AM, Christian König wrote: > Am 10.08.2018 um 10:29 schrieb Daniel Vetter: >> >> [SNIP] >> I'm only interested in the case of shared buffers. And for those you >> _do_ pessimistically assume that all access must be implicitly synced. >> Iirc amdgpu doesn't support EGL

[PATCH] drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create()

2018-08-10 Thread Dan Carpenter
We accidentally left out the size of the amdgpu_bo_list struct. It could lead to memory corruption on 32 bit systems. You'd have to pick the absolute maximum and set "num_entries == 59652323" then size would wrap to 16 bytes. Fixes: 920990cb080a ("drm/amdgpu: allocate the bo_list array after the

Re: [PATCH] drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create()

2018-08-10 Thread Bas Nieuwenhuizen
Reviewed-by: Bas Nieuwenhuizen On Fri, Aug 10, 2018 at 12:50 PM Dan Carpenter wrote: > > We accidentally left out the size of the amdgpu_bo_list struct. It > could lead to memory corruption on 32 bit systems. You'd have to > pick the absolute maximum and set "num_entries == 59652323" then size

Re: [PATCH] drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create()

2018-08-10 Thread Huang Rui
On Fri, Aug 10, 2018 at 06:50:32PM +0800, Dan Carpenter wrote: > We accidentally left out the size of the amdgpu_bo_list struct. It > could lead to memory corruption on 32 bit systems. You'd have to > pick the absolute maximum and set "num_entries == 59652323" then size > would wrap to 16 bytes.

[PATCH v2 0/5] drm/ttm,amdgpu: Introduce LRU bulk move functionality

2018-08-10 Thread Huang Rui
The idea and proposal is originally from Christian, and I continue to work to deliver it. Background: amdgpu driver will move all PD/PT and PerVM BOs into idle list. Then move all of them on the end of LRU list one by one. Thus, that cause so many BOs moved to the end of the LRU, and impact perfor

[PATCH v2 1/5] drm/ttm: add helper structures for bulk moves on lru list

2018-08-10 Thread Huang Rui
From: Christian König Add bulk move pos to store the pointer of first and last buffer object. The list in between will be bulk moved on lru list. Signed-off-by: Christian König Signed-off-by: Huang Rui --- include/drm/ttm/ttm_bo_driver.h | 28 1 file changed, 28 i

[PATCH v2 2/5] drm/ttm: revise ttm_bo_move_to_lru_tail to support bulk moves

2018-08-10 Thread Huang Rui
From: Christian König When move a BO to the end of LRU, it need remember the BO positions. Make sure all moved bo in between "first" and "last". And they will be bulk moving together. Signed-off-by: Christian König Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 -

[PATCH v2 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v2)

2018-08-10 Thread Huang Rui
I continue to work for bulk moving that based on the proposal by Christian. Background: amdgpu driver will move all PD/PT and PerVM BOs into idle list. Then move all of them on the end of LRU list one by one. Thus, that cause so many BOs moved to the end of the LRU, and impact performance seriousl

[PATCH v2 3/5] drm/ttm: add bulk move function on LRU

2018-08-10 Thread Huang Rui
This function allow us to bulk move a group of BOs to the tail of their LRU. The positions of group of BOs are stored on the (first, last) bulk_move_pos structure. Signed-off-by: Christian König Signed-off-by: Huang Rui --- drivers/gpu/drm/ttm/ttm_bo.c | 52 +

[PATCH v2 5/5] drm/amdgpu: move PD/PT bos on LRU again

2018-08-10 Thread Huang Rui
The new bulk moving functionality is ready, the overhead of moving PD/PT bos to LRU is fixed. So move them on LRU again. Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Re: [PATCH libdrm 6/6] amdgpu: always add all BOs to lockup table

2018-08-10 Thread Christian König
Why should it? Adding the handle is now not more than setting an array entry. I've tested with allocating 250k BOs of 4k size each and there wasn't any measurable performance differences. Christian. Am 09.08.2018 um 18:56 schrieb Marek Olšák: I don't think this is a good idea. Can you pleas

Re: [PATCH v2 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v2)

2018-08-10 Thread Christian König
Am 10.08.2018 um 13:55 schrieb Huang Rui: I continue to work for bulk moving that based on the proposal by Christian. Background: amdgpu driver will move all PD/PT and PerVM BOs into idle list. Then move all of them on the end of LRU list one by one. Thus, that cause so many BOs moved to the end

Re: [PATCH libdrm 2/2] [RFC] amdgpu: do not free flink bo for flink_fd

2018-08-10 Thread Christian König
Am 10.08.2018 um 07:05 schrieb Junwei Zhang: the flink bo is used to export Why should we do this? That makes no sense, this way we would create a memory leak. Christian. Signed-off-by: Junwei Zhang --- amdgpu/amdgpu_bo.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/amdgpu

Re: [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h

2018-08-10 Thread Christian König
Well NAK, that is intentionally kept local to the amdgpu_ttm.c file. This way we can make sure that we don't accidentally leak the structure somewhere else. What you could do is to move it to the beginning of the file. Christian. Am 10.08.2018 um 07:44 schrieb Junwei Zhang: code cleanup for

Re: RFC: Add write flag to reservation object fences

2018-08-10 Thread Christian König
Am 10.08.2018 um 11:21 schrieb Daniel Vetter: [SNIP] Then don't track _any_ of the amdgpu internal fences in the reservation object: - 1 reservation object that you hand to ttm, for use internally within amdgpu - 1 reservation object that you attach to the dma-buf (or get from the imported dma-bu

Re: [PATCH libdrm 6/6] amdgpu: always add all BOs to lockup table

2018-08-10 Thread Marek Olšák
OK. Thanks. Marek On Fri, Aug 10, 2018 at 9:06 AM, Christian König wrote: > Why should it? Adding the handle is now not more than setting an array > entry. > > I've tested with allocating 250k BOs of 4k size each and there wasn't any > measurable performance differences. > > Christian. > > > Am

[PATCH 2/3] drm/amdgpu/powerplay/smu7: enable AVFS control via ppfeaturemask

2018-08-10 Thread Alex Deucher
Allow the user to disable AFVS via ppfeaturemask for debugging. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/power

[PATCH 3/3] drm/amdgpu/powerplay/vega10: enable AVFS control via ppfeaturemask

2018-08-10 Thread Alex Deucher
Allow the user to disable AFVS via ppfeaturemask for debugging. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/power

[PATCH 1/3] drm/amdgpu: add AVFS control to PP_FEATURE_MASK

2018-08-10 Thread Alex Deucher
Add a ppfeaturemask flag to disable AVFS control. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/include/amd_shared.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h index 265621d8945c..86b167ec9863 100

Re: [PATCH v2 4/5] drm/amdgpu: use bulk moves for efficient VM LRU handling (v2)

2018-08-10 Thread Huang Rui
On Fri, Aug 10, 2018 at 10:18:24PM +0800, Koenig, Christian wrote: > Am 10.08.2018 um 13:55 schrieb Huang Rui: > > I continue to work for bulk moving that based on the proposal by Christian. > > > > Background: > > amdgpu driver will move all PD/PT and PerVM BOs into idle list. Then move > > all o