RE: [PATCH libdrm 2/2] drm:fix race issue between two bo functions(v2)

2017-08-07 Thread Liu, Monk
One mistake from me: > BTW: You can completely merge amdgpu_bo_reference() and >amdgpu_bo_free_internal() into amdgpu_bo_free() if you like. Yes, they can be merged, will do... BR Monk -Original Message- From: Liu, Monk Sent: Tuesday, August 8, 2017 10:57 AM To: 'Christian König'

RE: [PATCH libdrm 2/2] drm:fix race issue between two bo functions(v2)

2017-08-07 Thread Liu, Monk
Christian See below code (if it is what you mean) and it shows why I don't understand your point: (1) I assume you tend to change to below logic: /* The buffer already exists, just bump the refcount. */ if (bo && atomic_inc_return(>bo_table_mutex) > 1) {0

RE: [PATCH libdrm 2/2] drm:fix race issue between two bo functions(v2)

2017-08-07 Thread Liu, Monk
> @@ -340,10 +338,9 @@ int amdgpu_bo_import(amdgpu_device_handle dev, > } > > if (bo) { > - pthread_mutex_unlock(>bo_table_mutex); > - > /* The buffer already exists, just bump the refcount. */ > atomic_inc(>refcount); > +

[PATCH 1/3] dma-buf: dma_fence_put is NULL safe

2017-08-07 Thread Alex Deucher
From: Christian König No need to check. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- drivers/dma-buf/reservation.c | 6 ++ 1 file

[PATCH 0/3] dma-buf changes for ttm and amdgpu

2017-08-07 Thread Alex Deucher
We have some changes in ttm and amdgpu that depend on these patches. Sumit, can you pull these in via dma-buf or should I roll them up through my amdgpu tree? Christian König (3): dma-buf: dma_fence_put is NULL safe dma-buf: add reservation_object_copy_fences dma-buf: fix

[PATCH 2/3] dma-buf: add reservation_object_copy_fences

2017-08-07 Thread Alex Deucher
From: Christian König Allows us to copy all the fences in a reservation object to another one. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher ---

Re: [PATCH libdrm 1/2] drm: fix missing mutex unlock before return

2017-08-07 Thread Alex Deucher
On Mon, Aug 7, 2017 at 10:46 AM, Christian König wrote: > Am 07.08.2017 um 16:35 schrieb Monk Liu: >> >> From: Monk Liu >> >> Change-Id: I377dde976648d53bc9a3a2d5ba294c284910b109 >> Signed-off-by: Monk Liu > > > Reviewed-by: Christian

RE: [PATCH] drm/amd/powerplay: fix coccinelle warnings in vega10_hwmgr.c

2017-08-07 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Rex Zhu > Sent: Monday, August 07, 2017 3:37 AM > To: amd-gfx@lists.freedesktop.org > Cc: Zhu, Rex > Subject: [PATCH] drm/amd/powerplay: fix coccinelle warnings in > vega10_hwmgr.c > >

[PATCH 5/7] drm/amdgpu: move debug print into the MM managers

2017-08-07 Thread Christian König
From: Christian König Instead of the separate switch/case in the calling function. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13

[PATCH 6/7] drm/amdgpu: move gtt usage tracking into the gtt manager

2017-08-07 Thread Christian König
From: Christian König It doesn't make much sense to count those numbers twice. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 18 +++---

[PATCH 4/7] drm/amdgpu: fix incorrect use of the lru_lock

2017-08-07 Thread Christian König
From: Christian König The BO manager has its own lock and doesn't use the lru_lock. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH 2/7] drm/qxl: fix incorrect use of the lru_lock

2017-08-07 Thread Christian König
From: Christian König The BO manager has its own lock and doesn't use the lru_lock. Signed-off-by: Christian König --- drivers/gpu/drm/qxl/qxl_ttm.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git

[PATCH 1/7] drm/ttm: make ttm_mem_type_manager_func debug more usfull

2017-08-07 Thread Christian König
From: Christian König Provide the drm printer directly instead of just the callback. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 7 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 7 +++

Re: [PATCH libdrm 2/2] drm:fix race issue between two bo functions(v2)

2017-08-07 Thread Christian König
Am 07.08.2017 um 16:35 schrieb Monk Liu: From: Monk Liu there is race issue between two threads on amdgpu_bo_reference and amdgpu_bo_import, this patch tends to fix it by moving the pthread_mutex_lock out of bo_free_internal and move to bo_reference to cover the

Re: [PATCH libdrm 1/2] drm: fix missing mutex unlock before return

2017-08-07 Thread Christian König
Am 07.08.2017 um 16:35 schrieb Monk Liu: From: Monk Liu Change-Id: I377dde976648d53bc9a3a2d5ba294c284910b109 Signed-off-by: Monk Liu Reviewed-by: Christian König for this one. --- amdgpu/amdgpu_bo.c | 1 + 1 file changed, 1

RE: [PATCH libdrm] drm: fix race issue

2017-08-07 Thread Liu, Monk
Christian > output->buf_handle = bo; > output->alloc_size = bo->alloc_size; @@ -466,6 +461,8 @@ int > amdgpu_bo_cpu_map(amdgpu_bo_handle bo, void **cpu) > bo->cpu_map_count = 1; > pthread_mutex_unlock(>cpu_access_mutex); > > +

[PATCH libdrm 2/2] drm:fix race issue between two bo functions(v2)

2017-08-07 Thread Monk Liu
From: Monk Liu there is race issue between two threads on amdgpu_bo_reference and amdgpu_bo_import, this patch tends to fix it by moving the pthread_mutex_lock out of bo_free_internal and move to bo_reference to cover the update_reference part. The mutex_unlock in bo_import

[PATCH libdrm 1/2] drm: fix missing mutex unlock before return

2017-08-07 Thread Monk Liu
From: Monk Liu Change-Id: I377dde976648d53bc9a3a2d5ba294c284910b109 Signed-off-by: Monk Liu --- amdgpu/amdgpu_bo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index ec99488..07eb743 100644 ---

Re: [PATCH libdrm] drm: fix race issue

2017-08-07 Thread Christian König
Am 07.08.2017 um 13:44 schrieb Monk Liu: From: Monk Liu there is race issue between two threads on amdgpu_bo_free and amdgpu_bo_import, this patch tend to fix it by moving the pthread_mutex_lock out of bo_internal and cover the update_reference function. besides the

[PATCH] drm/amd/powerplay: fix coccinelle warnings in vega10_hwmgr.c

2017-08-07 Thread Rex Zhu
delete unneeded semicolon. Change-Id: If869857cac8127db91a3738f3ad2718343a49dd7 Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c