[PATCH 05/11] drm/ttm: add per process lru

2018-04-12 Thread Chunming Zhou
Change-Id: Id2333f69119222a7e9bdb0357bbed97cf08636da Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/ttm/ttm_bo.c| 59 ++--- include/drm/ttm/ttm_bo_driver.h | 3 ++- 2 files changed, 52 insertions(+), 10 deletions(-) diff

[PATCH 04/11] drm/amdgpu: pass process to tbo

2018-04-12 Thread Chunming Zhou
Change-Id: I4de8146567b858ae07a8a27cadf71d13d490e8ac Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 7 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/g

[PATCH 03/11] drm/amdgpu: add kernel process

2018-04-12 Thread Chunming Zhou
Change-Id: Ie43f3c73cc65526a449208f3ce927b1dfad5cf6b Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/d

[PATCH 02/11] drm/amdgpu: use ttm process in amdgpu vm

2018-04-12 Thread Chunming Zhou
Change-Id: I2cf802e641d8b2cdb2bf8bdf1957f3f4f27afaba Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_v

[PATCH 00/11] ***[WIP] TTM per process lru ***

2018-04-12 Thread Chunming Zhou
order. Thanks, David Zhou Chunming Zhou (11): drm/ttm: add ttm process struct drm/amdgpu: use ttm process in amdgpu vm drm/amdgpu: add kernel process drm/amdgpu: pass process to tbo drm/ttm: add per process lru drm/amdgpu: pass ttm process to buffer object drm/ttm: use RB tree i

[PATCH 01/11] drm/ttm: add ttm process struct

2018-04-12 Thread Chunming Zhou
Change-Id: I34924a40392653e72f143c30ab312cbbf9fa Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/ttm/ttm_bo.c| 23 +++ include/drm/ttm/ttm_bo_api.h| 1 + include/drm/ttm/ttm_bo_driver.h | 10 ++ 3 files changed, 34 inse

[PATCH 1/2] drm/amdgpu: Don't change preferred domian when fallback GTT v6

2018-04-03 Thread Chunming Zhou
v2: add sanity checking v3: make code open v4: also handle visible to invisible fallback v5: Since two fallback cases, re-use goto retry v6: avoid bo is unref when retry, and only user BO can fallback Change-Id: I2cf672ad36b8b4cc1a6b2e704f786bf6a155d9ce Signed-off-by: Chunming Zhou <david

[PATCH 2/2] drm/amdgpu: add new bo flag that indicates BOs don't need fallback

2018-04-03 Thread Chunming Zhou
this flag for their allocation as well if they like. Change-Id: Id3ac1a0bdd48633328d0b22c4c057fab4e94d0b3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> Cc: felix.kuehl...@amd.com --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_object

[PATCH 2/2] drm/amdgpu: add bo flag that indicates KFD BOs

2018-04-02 Thread Chunming Zhou
: Id3ac1a0bdd48633328d0b22c4c057fab4e94d0b3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> Cc: felix.kuehl...@amd.com --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- include/uapi/drm/amdgpu_drm.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/

[PATCH 1/2] drm/amdgpu: Don't change preferred domian when fallback GTT v6

2018-04-02 Thread Chunming Zhou
v2: add sanity checking v3: make code open v4: also handle visible to invisible fallback v5: Since two fallback cases, re-use goto retry v6: avoid bo is unref when retry, and only user BO can fallback Change-Id: I2cf672ad36b8b4cc1a6b2e704f786bf6a155d9ce Signed-off-by: Chunming Zhou <david

Re: [PATCH 2/3] drm/amdgpu: refresh per vm bo lru

2018-03-29 Thread Chunming Zhou
good idea because it massively increases the per submission overhead. Christian. Am 27.03.2018 um 12:16 schrieb Chunming Zhou: > Change-Id: Ibad84ed585b0746867a5f4cd1eadc2273e7cf596 > Signed-off-by: Chunming Zhou <david1.z...@amd.com> > --- >   drivers/gpu/drm/amd/amdgpu

[PATCH 3/3] drm/amdgpu: re-validate per VM BOs if required v2

2018-03-27 Thread Chunming Zhou
ed-off-by: Christian König <christian.koe...@amd.com> Reviewed-and-Tested-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

[PATCH 2/3] drm/amdgpu: refresh per vm bo lru

2018-03-27 Thread Chunming Zhou
Change-Id: Ibad84ed585b0746867a5f4cd1eadc2273e7cf596 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 1 + 3 files changed, 18 inse

[PATCH 1/3] drm/amdgpu: make all per vm BOs list

2018-03-27 Thread Chunming Zhou
the list decides the lru order. Change-Id: I8baf85aefd5781501599ff672949a9b71099a30e Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 6 ++ 2 files changed, 13 insertions(+) diff

[PATCH 2/2] drm/amdgpu: add per vm bo validation order

2018-03-26 Thread Chunming Zhou
Change-Id: I59f1da8a765efae8196c0b1599f47a8b8485c4d3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 6 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH 1/2] drm/amdgpu: re-validate per VM BOs if required

2018-03-26 Thread Chunming Zhou
From: Christian König <ckoenig.leichtzumer...@gmail.com> If a per VM BO ends up in a allowed domain it never moves back into the prefered domain. Change-Id: Ifb3e561785d3b464da28c439b271c26825224c5e Signed-off-by: Christian König <christian.koe...@amd.com> Reviewed-and-Tested-by: C

[PATCH 2/2] drm/amdgpu: add per vm bo validation order

2018-03-26 Thread Chunming Zhou
Change-Id: I59f1da8a765efae8196c0b1599f47a8b8485c4d3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 12 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 6 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/g

[PATCH 1/2] drm/amdgpu: re-validate per VM BOs if required

2018-03-26 Thread Chunming Zhou
From: Christian König <ckoenig.leichtzumer...@gmail.com> If a per VM BO ends up in a allowed domain it never moves back into the prefered domain. Change-Id: Ifb3e561785d3b464da28c439b271c26825224c5e Signed-off-by: Christian König <christian.koe...@amd.com> Reviewed-and-Tested-by: C

[PATCH] drm/amdgpu: fix typo of domain fallback

2018-03-23 Thread Chunming Zhou
Change-Id: I71c01f1526db785463af0ba3747fbd2ab8291d1f Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/

[PATCH] drm/amdgpu: Don't change preferred domian when fallback GTT v5

2018-03-21 Thread Chunming Zhou
v2: add sanity checking v3: make code open v4: also handle visible to invisible fallback v5: Since two fallback cases, re-use goto retry Change-Id: I2cf672ad36b8b4cc1a6b2e704f786bf6a155d9ce Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

[PATCH] drm/amdgpu: Don't change preferred domian when fallback GTT v4

2018-03-20 Thread Chunming Zhou
v2: add sanity checking v3: make code open v4: also handle visible to invisible fallback Change-Id: I2cf672ad36b8b4cc1a6b2e704f786bf6a155d9ce Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 16 ++-- drivers/gpu/drm/amd/

[PATCH 2/2] drm/amdgpu: validate fallback BOs

2018-03-19 Thread Chunming Zhou
with perferred domain. Change-Id: I4335470bf867b46ac93c8e2531eac3f8ba9ac2da Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 15 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 49 -- drivers/gpu/drm/amd/

[PATCH 1/2] drm/amdgpu: Don't change preferred domian when fallback GTT v3

2018-03-19 Thread Chunming Zhou
v2: add sanity checking v3: make code open Change-Id: I2cf672ad36b8b4cc1a6b2e704f786bf6a155d9ce Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 5 - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 16 2 files chang

[PATCH 2/2] drm/amdgpu: validate fallback BOs

2018-03-19 Thread Chunming Zhou
with perferred domain. Change-Id: I4335470bf867b46ac93c8e2531eac3f8ba9ac2da Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 15 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 49 -- drivers/gpu/drm/amd/

[PATCH 1/2] drm/amdgpu: Don't change preferred domian when fallback GTT v2

2018-03-19 Thread Chunming Zhou
v2: add sanity checking Change-Id: I2cf672ad36b8b4cc1a6b2e704f786bf6a155d9ce Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 5 - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 15 +-- 2 files changed, 13 insertions

[PATCH 1/2] drm/amdgpu: Don't change preferred domian when fallback GTT

2018-03-16 Thread Chunming Zhou
Change-Id: I2cf672ad36b8b4cc1a6b2e704f786bf6a155d9ce Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 5 - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 12 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/d

[PATCH 2/2] drm/amdgpu: validate fallback BOs

2018-03-16 Thread Chunming Zhou
with perferred domain. Change-Id: I4335470bf867b46ac93c8e2531eac3f8ba9ac2da Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 15 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 49 -- drivers/gpu/drm/amd/

[PATCH libdrm] test/amdgpu: disable bo eviction test by default

2018-03-01 Thread Chunming Zhou
if some system hase no swap space and memory is less, than the test could fail. And bo eviction test takes much more time in some system, which effects automation test result and efficiency. So disable it by default now, only be used by developer manually. Signed-off-by: Chunming Zhou <david

[PATCH libdrm] Revert "tests/amdgpu: add bo eviction test"

2018-03-01 Thread Chunming Zhou
if some system hase no swap space and memory is less, than the test could fail. And bo eviction test takes much more time in some system, which effects automation test result and efficiency. So revert it now, only can be used by developer manually. This reverts commit

Re: [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-02-25 Thread Chunming Zhou
n 02/09/2018 03:58 AM, Michel Dänzer wrote: On 2018-02-09 07:01 AM, Chunming Zhou wrote: On 2018年02月08日 17:13, Chunming Zhou wrote: On 2018年02月08日 17:01, Michel Dänzer wrote: this change completely broke radeonsi due to memory management errors (see valgrind output for glxgears below), so I h

Re: [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-02-08 Thread Chunming Zhou
On 2018年02月08日 17:13, Chunming Zhou wrote: On 2018年02月08日 17:01, Michel Dänzer wrote: Hi David, this change completely broke radeonsi due to memory management errors (see valgrind output for glxgears below), so I had to revert it. ok, I will look into what happens. Sorry for broken

[PATCH 3/3] drm/radeon: only enable swiotlb path when need v2

2018-02-08 Thread Chunming Zhou
swiotlb expands our card accessing range, but its path always is slower than ttm pool allocation. So add condition to use it. v2: move a bit later Change-Id: I1802645833155a9cd808913f863981173a82145f Signed-off-by: Chunming Zhou <david1.z...@amd.com> Reviewed-by: Monk Liu <monk...

[PATCH 1/3] drm: add func to get max iomem address v2

2018-02-08 Thread Chunming Zhou
it will be used to check if the driver needs swiotlb v2: Don't use inline, instead, move function to drm_memory.c (Mechel Daenzer <mic...@daenzer.net>) Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> Reviewed-by: Monk Liu <m

[PATCH 2/3] drm/amdgpu: only enable swiotlb alloc when need v2

2018-02-08 Thread Chunming Zhou
get the max io mapping address of system memory to see if it is over our card accessing range. v2: move checking later Change-Id: Ibc38dbd34a20af5b4a4b1ed154c14e1c58aa4c55 Signed-off-by: Chunming Zhou <david1.z...@amd.com> Reviewed-by: Monk Liu <monk@amd.com> Reviewed-by: Chr

Re: [PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Chunming Zhou
On 2018年02月08日 17:09, Michel Dänzer wrote: On 2018-02-08 09:32 AM, Chunming Zhou wrote: it will be used to check if the driver needs swiotlb Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> Reviewed-by: Monk Liu <monk...

Re: [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-02-08 Thread Chunming Zhou
On 2018年02月08日 17:01, Michel Dänzer wrote: Hi David, this change completely broke radeonsi due to memory management errors (see valgrind output for glxgears below), so I had to revert it. ok, I will look into what happens. Sorry for broken. Regards, David Zhou ==4831== Memcheck, a

[PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Chunming Zhou
it will be used to check if the driver needs swiotlb Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> Reviewed-by: Monk Liu <monk@amd.com> --- include/drm/drm_cache.h | 13 + 1 file changed, 13 insertions(+)

[PATCH 3/3] drm/radeon: only enable swiotlb path when need

2018-02-07 Thread Chunming Zhou
swiotlb expands our card accessing range, but its path always is slower than ttm pool allocation. So add condition to use it. Change-Id: I1802645833155a9cd808913f863981173a82145f Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/radeon/radeon.h| 1 + drivers/g

[PATCH 1/3] drm: add func to get max iomem address

2018-02-07 Thread Chunming Zhou
it will be used to check if the driver needs swiotlb Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- include/drm/drm_cache.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/drm/drm_cache.h b/inclu

[PATCH 2/3] drm/amdgpu: only enable swiotlb alloc when need

2018-02-07 Thread Chunming Zhou
get the max io mapping address of system memory to see if it is over our card accessing range. Change-Id: Ibc38dbd34a20af5b4a4b1ed154c14e1c58aa4c55 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm

Re: [PATCH 3/9] drm/amdgpu: add amdgpu module parameter for zfb

2018-02-07 Thread Chunming Zhou
On 2018年02月08日 02:48, Christian König wrote: Hi Feifei, ok the correct approach of doing this: 1. Compile the kernel with CONFIG_DMA_CMA. 2. Specify cma=1025M on the kernel command line. 3. Call dma_alloc_coherent() to allocate up to 1GB of memory for ZFB. Have you tried CMA? In early time, I

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-02-05 Thread Chunming Zhou
Zhou Regards, Christian. Am 31.01.2018 um 11:30 schrieb Chunming Zhou: On 2018年01月26日 22:35, Christian König wrote: I just realized that a change I'm thinking about for a while would solve your problem as well, but keep concurrent allocation possible. See ttm_mem_evict_first() unlocks

Re: [PATCH 1/2] drm/amdgpu: release the VM shadow in the error path as well

2018-02-04 Thread Chunming Zhou
The series is Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年02月03日 04:17, Christian König wrote: Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/dr

Re: [PATCH 1/8] drm/amdgpu: make VMID assignment more fair

2018-02-01 Thread Chunming Zhou
why you always make idle vmid for re-using vmid. Adding this explain to patch commit is better. Acked-by: Chunming Zhou <david1.z...@amd.com> for this patch and patch #7 then. Regards, David Zhou Regards, Christian. Am 01.02.2018 um 05:42 schrieb Chunming Zhou: NAK, reserve

Re: [PATCH 8/8] drm/amdgpu: cache the fence to wait for a VMID

2018-01-31 Thread Chunming Zhou
On 2018年01月31日 23:47, Christian König wrote: Beneficial when a lot of processes are waiting for VMIDs. Yeah, we can save re-creating fence array when vmid is used up. Reviewed-by: Chunming Zhou <david1.z...@amd.com> Signed-off-by: Christian König <christian.koe...@amd.com> -

Re: [PATCH 6/8] drm/amdgpu: move reusing VMIDs into separate function

2018-01-31 Thread Chunming Zhou
Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月31日 23:47, Christian König wrote: Let's try this once more. Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 130 1 file

Re: [PATCH 5/8] drm/amdgpu: cleanup and simplify amdgpu_vmid_grab_reserved

2018-01-31 Thread Chunming Zhou
Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月31日 23:47, Christian König wrote: Drop the "_locked" from the name, cleanup and simplify the logic a bit. Add missing comments. Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/a

Re: [PATCH 4/8] drm/amdgpu: stop checking GPU reset counter during VMID grab

2018-01-31 Thread Chunming Zhou
Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月31日 23:47, Christian König wrote: We do this later on when we flush the VMID anyway. Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 6 +- 1 file changed,

Re: [PATCH 3/8] drm/amdgpu: make VMID owner none atomic

2018-01-31 Thread Chunming Zhou
On 2018年01月31日 23:47, Christian König wrote: The variable is protected by the VMID mutex anyway. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 10 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h | 2 +- 2 files changed, 6

Re: [PATCH 2/8] drm/amdgpu: split finding idle VMID into separate function

2018-01-31 Thread Chunming Zhou
Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月31日 23:47, Christian König wrote: No functional change, but makes it easier to maintain the code. Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu

Re: [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-31 Thread Chunming Zhou
rther, if we run containers for our gpu, container A could run high score, container B runs low score with same benchmark. So this is bug that we need fix. Regards, David Zhou 发自坚果 Pro Christian K鰊ig <ckoenig.leichtzumer...@gmail.com> 于 2018年1月26日 下午6:31写道: Am 26.01.20

[PATCH 2/2] [WIP]drm/amdgpu: fix scheduling balance

2018-01-26 Thread Chunming Zhou
Change-Id: I6535023db57d4ff5e79f7928595bf8ff1f60f23f Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/

[PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order

2018-01-26 Thread Chunming Zhou
: I3daa892e50f82226c552cc008a29e55894a98f18 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/ttm/ttm_bo.c| 69 +++-- include/drm/ttm/ttm_bo_api.h| 7 + include/drm/ttm/ttm_bo_driver.h | 7 + 3 files changed, 80 insertions(+), 3 del

Re: [PATCH 1/2] drm/amdgpu: add amdgpu.ttm_dma_allocation parameter

2018-01-25 Thread Chunming Zhou
On 2018年01月25日 16:34, Michel Dänzer wrote: On 2018-01-25 07:50 AM, Chunming Zhou wrote: it will be used to set ttm dma allocation path. Change-Id: I9fa936db751811779cea66598bba0b8cf4cfd869 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h

Re: [PATCH 1/2] drm/amdgpu: add amdgpu.ttm_dma_allocation parameter

2018-01-25 Thread Chunming Zhou
On 2018年01月25日 16:29, Christian König wrote: Am 25.01.2018 um 07:50 schrieb Chunming Zhou: it will be used to set ttm dma allocation path. NAK, disabling swiotlb on the kernel command line should have the same effect. The tricky is swiotlb is enabled by default, and there may be some other

[PATCH 2/2] drm/amdgpu: disable ttm dma allocation path by kernel parameter

2018-01-24 Thread Chunming Zhou
kernel parameter in grub to enable it. Change-Id: Idd53acdd157487e784d1166886f018361b10ad67 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/

[PATCH 1/2] drm/amdgpu: add amdgpu.ttm_dma_allocation parameter

2018-01-24 Thread Chunming Zhou
it will be used to set ttm dma allocation path. Change-Id: I9fa936db751811779cea66598bba0b8cf4cfd869 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 2 files changed, 5 insertions(+)

Re: [PATCH] drm/amdgpu: use ttm pool first

2018-01-24 Thread Chunming Zhou
On 2018年01月24日 18:52, Christian König wrote: Am 24.01.2018 um 11:32 schrieb Chunming Zhou: On 2018年01月24日 17:49, Christian König wrote: [SNIP] Nope, as I wrote that won't work. You must improve the detection if we need coherent or not coherent allocation. But how to differentiate coherent

Re: [PATCH] drm/amdgpu: use ttm pool first

2018-01-24 Thread Chunming Zhou
On 2018年01月24日 17:49, Christian König wrote: Am 24.01.2018 um 10:48 schrieb Chunming Zhou: On 2018年01月24日 17:43, Christian König wrote: Am 24.01.2018 um 10:17 schrieb Chunming Zhou: dma path is low than ttm pool. That won't work correctly in some cases. Question: But why need two path

Re: [PATCH] drm/amdgpu: use ttm pool first

2018-01-24 Thread Chunming Zhou
On 2018年01月24日 17:43, Christian König wrote: Am 24.01.2018 um 10:17 schrieb Chunming Zhou: dma path is low than ttm pool. That won't work correctly in some cases. Question: But why need two path? What spicific problem can be solved by dma path? That is mostly for ARM and some (rare) x86

[PATCH] drm/amdgpu: use ttm pool first

2018-01-24 Thread Chunming Zhou
dma path is low than ttm pool. Question: But why need two path? What spicific problem can be solved by dma path? Change-Id: I4a9fc7103658e643f33e267616fc69743b20b09e Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 ++ 1 file chan

Re: lock/unlock mismatch in ttm_bo.c

2018-01-24 Thread Chunming Zhou
On 2018年01月24日 17:06, Chunming Zhou wrote: On 2018年01月24日 16:58, Christian König wrote: NAK, that doesn't looks correct to me. unlock_resv means that the function is allowed to unlock the reservation. So the original logic seems to do exactly what it is supposed to do. Please keep

Re: lock/unlock mismatch in ttm_bo.c

2018-01-24 Thread Chunming Zhou
derstanding right? is that expected? Regards, David Zhou Regards, Christian. Am 24.01.2018 um 06:46 schrieb Chunming Zhou: update the fix. On 2018年01月24日 11:09, Chunming Zhou wrote: Hi Tom, Your change looks ok, as Roger suggested, you can send both dri and amd mail lists. In addit

Re: lock/unlock mismatch in ttm_bo.c

2018-01-23 Thread Chunming Zhou
update the fix. On 2018年01月24日 11:09, Chunming Zhou wrote: Hi Tom, Your change looks ok, as Roger suggested, you can send both dri and amd mail lists. In addition, when I review your patches, I found a bug as the attached, you can send it together with yours if you think that's a right

Re: lock/unlock mismatch in ttm_bo.c

2018-01-23 Thread Chunming Zhou
wrote: On 22/01/18 01:42 AM, Chunming Zhou wrote: On 2018年01月20日 02:23, Tom St Denis wrote: On 19/01/18 01:14 PM, Tom St Denis wrote: Hi all, In the function ttm_bo_cleanup_refs() it seems possible to get to line 551 without entering the block on 516 which means you'll be unlocking a mutex

[PATCH libdrm] amdgpu: typedef syncobj handle

2018-01-22 Thread Chunming Zhou
Change-Id: I1e798d0fbb7e2023d6619f515a9cfaf029b62b6d Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- amdgpu/amdgpu.h| 21 + amdgpu/amdgpu_cs.c | 16 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/amdgpu/amdgpu.h b/amdgpu/am

Re: [PATCH 3/3] drm/amdgpu: remove now superflous *_hdp operation

2018-01-22 Thread Chunming Zhou
Acked-by: Chunming Zhou <david1.z...@amd.com> for series. On 2018年01月22日 18:00, Christian König wrote: All HDP invalidation and most flush can now be replaced by the generic ASIC function. Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/amd/amd

Re: [PATCH 01/21] drm/amdgpu: wire up emit_wreg for gfx v6

2018-01-21 Thread Chunming Zhou
patch#1~18 are Acked-by: Chunming Zhou <david1.z...@amd.com> patch#19~21 are Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月19日 19:48, Christian König wrote: Needed for vm_flush unification. v2: handle compute rings as well. Signed-off-by: Christian König &l

Re: lock/unlock mismatch in ttm_bo.c

2018-01-21 Thread Chunming Zhou
On 2018年01月20日 02:23, Tom St Denis wrote: On 19/01/18 01:14 PM, Tom St Denis wrote: Hi all, In the function ttm_bo_cleanup_refs() it seems possible to get to line 551 without entering the block on 516 which means you'll be unlocking a mutex that wasn't locked. Now it might be that in the

[PATCH libdrm] amdgpu: add bo eviction test

2018-01-19 Thread Chunming Zhou
for(( i=1; i < 100; i++)) do echo "Hello, Welcome $i times " sudo ./amdgpu_test -s 1 -t 5 done with above stricpt, run in two terminals, will reproduce Felix's swap leeking issue. Change-Id: If637b5da1eabe69806f41f0c6f9056b1e9447efc Signed-off-by: Chunming Zhou <dav

Re: [PATCH 3/4] drm/gem: adjust per file OOM badness on handling buffers

2018-01-18 Thread Chunming Zhou
On 2018年01月19日 00:47, Andrey Grodzovsky wrote: Large amounts of VRAM are usually not CPU accessible, so they are not mapped into the processes address space. But since the device drivers usually support swapping buffers from VRAM to system memory we can still run into an out of memory

[PATCH] quick fix since gmc rename

2018-01-18 Thread Chunming Zhou
Change-Id: Ie6a4a4219d92ac1ad28a7c341cb7d73930f9386d Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_

[PATCH] drm/amdgpu: quick fix since gmc rename

2018-01-18 Thread Chunming Zhou
Change-Id: Ie6a4a4219d92ac1ad28a7c341cb7d73930f9386d Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_

[PATCH] drm/amdgpu: quick fix since gmc rename

2018-01-18 Thread Chunming Zhou
Change-Id: Ie6a4a4219d92ac1ad28a7c341cb7d73930f9386d Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_

Re: [PATCH 14/21] drm/amdgpu: add new amdgpu_gmc_emit_flush_gpu_tlb callback

2018-01-18 Thread Chunming Zhou
On 2018年01月17日 20:19, Christian König wrote: Am 17.01.2018 um 07:24 schrieb Chunming Zhou: I'm not sure if this is a good ongoing, as I know, our per IP topology is intended for every generation asic bringup. Actually the intention goes beyond that, e.g. we want to reuse IPs for newer

[PATCH] drm/amdgpu: all vram is visible for APU

2018-01-17 Thread Chunming Zhou
missed in gmc9. Change-Id: I710044595454338edd770092100f13d6f46cb0fe Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gm

Re: [PATCH 21/21] drm/amdgpu: add PASID mapping for GFX v8

2018-01-16 Thread Chunming Zhou
gmc8, gmc9, not gfx... On 2018年01月17日 14:13, Chunming Zhou wrote: and please fix patch #21 title, which should be gfx9 not gfx8. On 2018年01月17日 14:11, Chunming Zhou wrote: patch #19, #20, #21 are Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月17日 03:40, Christian König

Re: [PATCH 21/21] drm/amdgpu: add PASID mapping for GFX v8

2018-01-16 Thread Chunming Zhou
and please fix patch #21 tile, which should be gfx9 not gfx8. On 2018年01月17日 14:11, Chunming Zhou wrote: patch #19, #20, #21 are Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月17日 03:40, Christian König wrote: This way we can see the PASID in VM faults. Sign

Re: [PATCH 21/21] drm/amdgpu: add PASID mapping for GFX v8

2018-01-16 Thread Chunming Zhou
and please fix patch #21 title, which should be gfx9 not gfx8. On 2018年01月17日 14:11, Chunming Zhou wrote: patch #19, #20, #21 are Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月17日 03:40, Christian König wrote: This way we can see the PASID in VM faults. Sign

Re: [PATCH 21/21] drm/amdgpu: add PASID mapping for GFX v8

2018-01-16 Thread Chunming Zhou
patch #19, #20, #21 are Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月17日 03:40, Christian König wrote: This way we can see the PASID in VM faults. Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 12 +

Re: TTM leaking swap space?

2018-01-16 Thread Chunming Zhou
Hi Felix, Could I get your test to have a try? Thanks, David Zhou On 2018年01月17日 11:21, Felix Kuehling wrote: I'm running an eviction stress test with KFD and find that sometimes it starts swapping. When that happens, swap usage goes up rapidly, but it never comes down. Even after the

Re: [PATCH 1/2] drm/amdgpu: fix CPU based VM updates

2018-01-16 Thread Chunming Zhou
The series is Ached-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月17日 01:05, Felix Kuehling wrote: Thanks for taking care of this. Patch 2 is a nice simplification that should reduce the chances of breaking CPU updates in the future. The series is Reviewed-by: Felix Kuehling <fe

[PATCH libdrm] drm: fix return value

2018-01-15 Thread Chunming Zhou
otherwise -ETIME is missed. Change-Id: Ic5580a74d8027cc468c6135f8cf2f81817993423 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 8a327170..3881bd9f 100644 --- a/xf86drm.c

Re: [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-01-12 Thread Chunming Zhou
On 2018年01月12日 16:04, Christian König wrote: Am 12.01.2018 um 06:45 schrieb Chunming Zhou: Change-Id: I7ca19a1f6404356a6c69ab4af27c8e13454f0279 Signed-off-by: Chunming Zhou <david1.z...@amd.com> ---   amdgpu/amdgpu_internal.h |   2 -   amdgpu/amdgpu_vamgr.c   

[PATCH libdrm 1/2] libdrm: fix inefficient vamgr algorithm

2018-01-11 Thread Chunming Zhou
recovers as non-list path, next patch will remove non-list code path. Change-Id: I3f00ef193815d31a78d416b53c1511098b88da8f Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- amdgpu/amdgpu_vamgr.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/amdgpu/amdgpu_vam

[PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-01-11 Thread Chunming Zhou
Change-Id: I7ca19a1f6404356a6c69ab4af27c8e13454f0279 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- amdgpu/amdgpu_internal.h | 2 - amdgpu/amdgpu_vamgr.c| 152 ++- 2 files changed, 46 insertions(+), 108 deletions(-) diff --git a/

Re: [PATCH 21/21] drm/amdgpu: print the PASID with VM faults on GMC v8

2018-01-10 Thread Chunming Zhou
Except some small nitpicks in patch #3, #4, #5, the series looks ok to me, Reviewed-by: Chunming Zhou <david1.z...@amd.com> Regards, David Zhou On 2018年01月10日 20:54, Christian König wrote: Print that extra information on GMC v8. Signed-off-by: Christian König <christian.koe..

Re: [PATCH 04/21] drm/amdgpu: always allocate a pasid for each VM

2018-01-10 Thread Chunming Zhou
On 2018年01月10日 20:54, Christian König wrote: Start to always allocate a pasid for each VM. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 43 ++--- 1 file changed, 29 insertions(+), 14 deletions(-) diff

Re: [PATCH 05/21] drm/amdgpu: trace allocated PASIDs

2018-01-10 Thread Chunming Zhou
On 2018年01月10日 20:54, Christian König wrote: Trace all allocated PASIDs. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 22 ++ 2 files changed, 32

Re: [PATCH v2] drm/amdgpu/gfx9: fix ngg enablement to clear gds reserved memory (v2)

2018-01-10 Thread Chunming Zhou
Could I how to verify this is valid fix? Regards, David Zhou On 2018年01月11日 10:30, Junwei Zhang wrote: v2: fix register access Signed-off-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

Re: [PATCH 2/4] drm/amdgpu: minor optimize VM moved handling v2

2018-01-03 Thread Chunming Zhou
On 2018年01月03日 17:25, Christian König wrote: Am 03.01.2018 um 09:10 schrieb Zhou, David(ChunMing): On 2018年01月02日 22:47, Christian König wrote: Try to lock moved BOs if it's successful we can update the PTEs directly to the new location. v2: rebase Signed-off-by: Christian König

Re: [PATCH 4/4] drm/amdgpu: simplify huge page handling

2018-01-03 Thread Chunming Zhou
On 2018年01月03日 17:24, Christian König wrote: Am 03.01.2018 um 09:29 schrieb Chunming Zhou: On 2018年01月02日 22:47, Christian König wrote: Update the PDEs after resetting the huge flag. Signed-off-by: Christian König <christian.koe...@amd.com> ---   drivers/gpu/drm/amd/amdgpu/amdgp

Re: [PATCH 4/4] drm/amdgpu: simplify huge page handling

2018-01-03 Thread Chunming Zhou
On 2018年01月02日 22:47, Christian König wrote: Update the PDEs after resetting the huge flag. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 60 ++ 1 file changed, 18 insertions(+), 42 deletions(-) diff

Re: [PATCH 1/4] drm/amdgpu: loosen the criteria for huge pages a bit

2018-01-02 Thread Chunming Zhou
On 2018年01月02日 22:47, Christian König wrote: We can actually handle invalid huge pages perfectly fine now. It seems be a bug fix for those valid no-huge-page ptes. Reviewed-by: Chunming Zhou <david1.z...@amd.com> Signed-off-by: Christian König <christian.koe...@amd.com> ---

Re: [PATCH] drm/amd/display/dc: fix double free issue for dc sink

2018-01-02 Thread Chunming Zhou
The quick patch doesn't fix the problem, I encounter it again, please don't review. Hi Harry, Could you take a look it? You're familiar with dc code, or it's a known issue? Thanks, David Zhou On 2018年01月02日 18:11, Chunming Zhou wrote: [345508.995835

[PATCH] drm/amd/display/dc: fix double free issue for dc sink

2018-01-02 Thread Chunming Zhou
-Id: I069f723d501acb988aae7895a4f865ebf0313f21 Signed-off-by: Chunming Zhou <david1.z...@amd.com> --- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/displa

Re: Deadlocks with multiple applications on AMD RX 460 and RX 550 - Update 2

2018-01-01 Thread Chunming Zhou
Did you try it on x86 board? Is there same issue? We should identify it is ARM specific or genera issue for amdgpu driver. Thanks, David Zhou On 2018年01月02日 00:32, Luís Mendes wrote: I am currently testing the amdgpu driver with AMD RX460 and RX550 graphics cards on an ARM Cortex-A9 with

Re: [PATCH] drm/amdgpu/gfx9: only init the apertures used by KGD

2018-01-01 Thread Chunming Zhou
Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2018年01月02日 05:17, Alex Deucher wrote: Use adev->vm_manager.id_mgr[0].num_ids rather than hardcoded 16. Noticed-by: Felix Kuehling <felix.kuehl...@amd.com> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com> ---

Re: [PATCH] drm/amdgpu: Correct the IB size of bo update mapping.

2017-12-27 Thread Chunming Zhou
Good catch, Reviewed-by: Chunming Zhou <david1.z...@amd.com> On 2017年12月28日 11:17, Emily Deng wrote: The amdgpu_vm_frag_ptes will call amdgpu_vm_update_ptes, and for buffer object that has shadow buffer, need twice commands. Signed-off-by: Emily Deng <emily.d...@amd.com> --- dri

Re: [PATCH] drm/amdgpu: fix VM faults with per VM BOs

2017-12-24 Thread Chunming Zhou
On 2017年12月23日 00:17, Christian König wrote: There was a small window where the freshly allocated BO could have been evicted without the VM noticing it. Signed-off-by: Christian König <christian.koe...@amd.com> small window between unreserve and second reserve. Reviewed-by: Chunmin

<    1   2   3   4   5   6   7   >