Re: [PATCH 1/2] drm/ttm: fix out-of-bounds read in ttm_put_pages() v2

2019-04-09 Thread Zhang, Jerry(Junwei)
On 4/8/19 9:13 PM, Christian König wrote: When ttm_put_pages() tries to figure out whether it's dealing with transparent hugepages, it just reads past the bounds of the pages array without a check. v2: simplify the test if enough pages are left in the array (Christian). Series is Reviewed-by:

Re: [PATCH] drm/amdgpu: fix CPDMA hang in PRT mode for VEGA20

2019-01-08 Thread Zhang, Jerry(Junwei)
On 1/9/19 10:23 AM, Zhou1, Tao wrote: -Original Message- From: amd-gfx On Behalf Of Zhang, Jerry(Junwei) Sent: 2019年1月9日 9:39 To: Zhou1, Tao ; amd-gfx@lists.freedesktop.org Cc: Li, Yukun1 Subject: Re: [PATCH] drm/amdgpu: fix CPDMA hang in PRT mode for VEGA20 On 1/8/19 6:55 PM, Tao

Re: [PATCH] drm/amdgpu: fix CPDMA hang in PRT mode for VEGA20

2019-01-08 Thread Zhang, Jerry(Junwei)
On 1/8/19 6:55 PM, Tao Zhou wrote: Fix CPDMA hang in PRT mode for both of VEGA10 and VEGA20 Change-Id: I0e5e089d2192063c4a04fa6dbd534f25eb0177be Signed-off-by: Tao Zhou Tested-by: Yukun.Li --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 +- 1 file changed, 5 insertions(+), 5

Re: [PATCH 2/2] drm/amdgpu: update MC firmware image for polaris10 variants

2018-12-10 Thread Zhang, Jerry(Junwei)
On 12/11/18 4:06 AM, Alex Deucher wrote: On Fri, Dec 7, 2018 at 3:40 AM Zhang, Jerry(Junwei) wrote: we can drop MC update patch, since a new fw could fix that. Shouldn't we apply this as well for consistency? I did apply it for simple test. That looks no harm. But confirmed the MC firmware

Re: [PATCH 2/2] drm/amdgpu: update MC firmware image for polaris10 variants

2018-12-07 Thread Zhang, Jerry(Junwei)
we can drop MC update patch, since a new fw could fix that. Regards, Jerry On 12/7/18 3:19 PM, Junwei Zhang wrote: Some new variants require different firmwares. Signed-off-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH 2/2] drm/amdgpu/powerplay: fix clock stretcher limits on polaris

2018-12-03 Thread Zhang, Jerry(Junwei)
On 12/4/18 12:21 AM, Alex Deucher wrote: Adjust limits for newer polaris variants. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 1/2] drm/amdgpu/powerplay: fix mclk switch limit on polaris

2018-12-03 Thread Zhang, Jerry(Junwei)
On 12/4/18 12:21 AM, Alex Deucher wrote: Update switch limit on newer polaris variants. This may fix flickering with high refresh rates with mclk switching enabled. Signed-off-by: Alex Deucher Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 5 - 1

Re: [PATCH] drm/amdgpu: disable UVD/VCE for some polaris 12 variants

2018-11-26 Thread Zhang, Jerry(Junwei)
On 11/26/18 5:28 PM, Christian König wrote: Am 26.11.18 um 03:38 schrieb Zhang, Jerry(Junwei): On 11/24/18 3:32 AM, Deucher, Alexander wrote: Is this required? Are the harvesting fuses incorrect?  If the blocks are harvested, we should bail out of the blocks properly during init.  Also

Re: [PATCH] drm/amdgpu: disable UVD/VCE for some polaris 12 variants

2018-11-25 Thread Zhang, Jerry(Junwei)
On 11/24/18 3:32 AM, Deucher, Alexander wrote: Is this required?  Are the harvesting fuses incorrect?  If the blocks are harvested, we should bail out of the blocks properly during init.  Also, please make this more explicit if we still need it.  E.g., The harvest fuse is indeed

Re: [PATCH] drm/amdgpu: disable UVD/VCE for some polaris 12 variants

2018-11-23 Thread Zhang, Jerry(Junwei)
please ignore this patch, there is typo in code. On 11/23/18 4:01 PM, Junwei Zhang wrote: Some variants don't support UVD and VCE. Signed-off-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/vi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c

Re: [PATCH 1/2] drm/amdgpu/sdma4: use paging queue for buffer funcs

2018-11-07 Thread Zhang, Jerry(Junwei)
+ Curry On 11/8/18 10:59 AM, Alex Deucher wrote: On Wed, Nov 7, 2018 at 9:05 PM Zhang, Jerry(Junwei) wrote: On 11/8/18 1:29 AM, Alex Deucher wrote: Use the paging queue for buffer functions to avoid contention with the other queues. Signed-off-by: Alex Deucher Reviewed-by: Junwei Zhang

Re: [PATCH 2/2] drm/amdgpu/sdma4: use page queue 1 for buffer funcs

2018-11-07 Thread Zhang, Jerry(Junwei)
On 11/8/18 1:29 AM, Alex Deucher wrote: Use page queue 0 rather than 1 to avoid contention with GPUVM updates using page queue 0. Signed-off-by: Alex Deucher A little confuse, I thought we were going to use page queue(in any instance) for PT update, gfx ring for general sdma jobs. Any

Re: [PATCH 1/2] drm/amdgpu/sdma4: use paging queue for buffer funcs

2018-11-07 Thread Zhang, Jerry(Junwei)
On 11/8/18 1:29 AM, Alex Deucher wrote: Use the paging queue for buffer functions to avoid contention with the other queues. Signed-off-by: Alex Deucher Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 12 +++- 1 file changed, 11 insertions(+), 1

Re: [PATCH] drm/amdgpu: disable page queue on Vega10 SR-IOV VF

2018-11-07 Thread Zhang, Jerry(Junwei)
On 11/7/18 3:55 PM, Koenig, Christian wrote: Am 07.11.18 um 08:41 schrieb Zhang, Jerry(Junwei): On 11/7/18 3:29 PM, Koenig, Christian wrote: Hi guys, this is necessary for recoverable page fault handling. When the normal SDMA queue is blocked because of a page fault the SDMA firmware

Re: [PATCH] drm/amdgpu: disable page queue on Vega10 SR-IOV VF

2018-11-06 Thread Zhang, Jerry(Junwei)
f priority aware gpu-scheduler ... unless we are going to remove the "KERNEL" priority and always do the mapping/unmapping in page_queue ... /Monk -Original Message- From: amd-gfx On Behalf Of Zhang, Jerry(Junwei) Sent: Wednesday, November 7, 2018 1:26 PM To: Huang, Trigger ; amd-gfx@

Re: [PATCH] drm/amdgpu: disable page queue on Vega10 SR-IOV VF

2018-11-06 Thread Zhang, Jerry(Junwei)
On 11/7/18 1:15 PM, Trigger Huang wrote: Currently, SDMA page queue is not used under SR-IOV VF, and this queue will cause ring test failure in amdgpu module reload case. So just disable it. Signed-off-by: Trigger Huang Looks we ran into several issues about it on vega. kfd also disabled

Re: [PATCH] drm/ttm: Fix bo_global and mem_global kfree error

2018-11-06 Thread Zhang, Jerry(Junwei)
On 11/6/18 7:59 PM, Christian König wrote: Am 06.11.18 um 12:54 schrieb Trigger Huang: ttm_bo_glob and ttm_mem_glob are defined as structure instance, while not allocated by kzalloc, so kfree should not be invoked to release them anymore. Otherwise, it will cause the following kernel BUG when

Re: [PATCH] drm/amdgpu: wait for IB test on first device open

2018-11-02 Thread Zhang, Jerry(Junwei)
On 11/2/18 5:32 PM, Christian König wrote: Am 02.11.18 um 10:19 schrieb Zhang, Jerry(Junwei): On 11/2/18 4:44 PM, Christian König wrote: Instead of delaying that to the first query. Otherwise we could try to use the SDMA for VM updates before the IB tests are done. Be curious: Does

Re: [PATCH] drm/amdgpu: wait for IB test on first device open

2018-11-02 Thread Zhang, Jerry(Junwei)
On 11/2/18 4:44 PM, Christian König wrote: Instead of delaying that to the first query. Otherwise we could try to use the SDMA for VM updates before the IB tests are done. Be curious: Does that happen when App opens dri node without libdrm? since device init always queries info at first.

Re: [PATCH 6/8] drm/amdgpu: always reserve two slots for the VM

2018-10-23 Thread Zhang, Jerry(Junwei)
On 10/4/18 9:12 PM, Christian König wrote: And drop the now superflous extra reservations. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 ++- 2 files changed, 6 insertions(+), 13 deletions(-)

Re: [PATCH 1/8] dma-buf: remove shared fence staging in reservation object

2018-10-23 Thread Zhang, Jerry(Junwei)
Patch 3, 5 is Acked-by: Junwei Zhang Others are Reviewed-by: Junwei Zhang On 10/4/18 9:12 PM, Christian König wrote: No need for that any more. Just replace the list when there isn't enough room any more for the additional fence. Signed-off-by: Christian König ---

Re: [PATCH libdrm 2/2] amdgpu: don't track handles for non-memory allocations

2018-10-23 Thread Zhang, Jerry(Junwei)
On 10/24/18 3:07 AM, Marek Olšák wrote: From: Marek Olšák commit log and sign-off here as well. And any reason for that? Regards, Jerry --- amdgpu/amdgpu_bo.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c

Re: [PATCH libdrm 1/2] amdgpu: prevent an integer wraparound of cpu_map_count

2018-10-23 Thread Zhang, Jerry(Junwei)
On 10/24/18 3:07 AM, Marek Olšák wrote: From: Marek Olšák We need commit log and sign-off here. BTW, have you encounter any issue about that? --- amdgpu/amdgpu_bo.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/amdgpu/amdgpu_bo.c

Re: [PATCH] drm/amdgpu: Fix amdgpu_vm_alloc_pts failed

2018-10-22 Thread Zhang, Jerry(Junwei)
On 10/23/2018 01:12 PM, Zhang, Jerry(Junwei) wrote: On 10/23/2018 11:29 AM, Rex Zhu wrote: when the VA address located in the last PD entries, the alloc_pts will faile. Use the right PD mask instand of hardcode, suggested by jerry.zhang. Signed-off-by: Rex Zhu Thanks to verify that. Feel

Re: [PATCH] drm/amdgpu: Fix amdgpu_vm_alloc_pts failed

2018-10-22 Thread Zhang, Jerry(Junwei)
On 10/23/2018 11:29 AM, Rex Zhu wrote: when the VA address located in the last PD entries, the alloc_pts will faile. Use the right PD mask instand of hardcode, suggested by jerry.zhang. Signed-off-by: Rex Zhu Thanks to verify that. Feel free to add Reviewed-by: Junwei Zhang Also like to

Re: [PATCH] drm/amdgpu: Reverse the sequence of ctx_mgr_fini and vm_fini in amdgpu_driver_postclose_kms

2018-10-22 Thread Zhang, Jerry(Junwei)
On 10/22/2018 05:47 PM, Rex Zhu wrote: csa buffer will be created per ctx, when ctx fini, the csa buffer and va will be released. so need to do ctx_mgr fin before vm fini. Signed-off-by: Rex Zhu Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- 1 file

Re: [PATCH] drm/amdgpu: Fix amdgpu_vm_alloc_pts failed

2018-10-22 Thread Zhang, Jerry(Junwei)
On 10/23/2018 12:09 AM, Rex Zhu wrote: When the va address located in the last pd entry, Do you mean the root PD? maybe we need roundup root PD in amdgpu_vm_entries_mask() like amdgpu_vm_num_entries(). BTW, looks amdgpu_vm_entries_mask() is going to replace the amdgpu_vm_num_entries()

Re: [PATCH 4/5] drm/ttm: initialize globals during device init

2018-10-22 Thread Zhang, Jerry(Junwei)
On 10/22/2018 08:35 PM, Christian König wrote: Am 22.10.18 um 08:45 schrieb Zhang, Jerry(Junwei): A question in ttm_bo.c [SNIP]     int ttm_bo_device_release(struct ttm_bo_device *bdev)   { @@ -1623,18 +1620,25 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev

Re: [PATCH 4/5] drm/ttm: initialize globals during device init

2018-10-22 Thread Zhang, Jerry(Junwei)
A question for ttm_bo.c On 10/20/2018 12:41 AM, Christian König wrote: Make sure that the global BO state is always correctly initialized. This allows removing all the device code to initialize it. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59

Re: [PATCH 1/5] drm/ttm: use a static ttm_mem_global instance

2018-10-22 Thread Zhang, Jerry(Junwei)
On 10/20/2018 12:41 AM, Christian König wrote: As the name says we only need one global instance of ttm_mem_global. Drop all the driver initialization and just use a single exported instance which is initialized during BO global initialization. Signed-off-by: Christian König Patch 1, 2, 3,

Re: [PATCH 4/5] drm/ttm: initialize globals during device init

2018-10-22 Thread Zhang, Jerry(Junwei)
A question in ttm_bo.c On 10/20/2018 12:41 AM, Christian König wrote: Make sure that the global BO state is always correctly initialized. This allows removing all the device code to initialize it. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59

Re: [PATCH 2/3] drm/amdgpu: Replace TTM initialization/release with ttm_global

2018-10-19 Thread Zhang, Jerry(Junwei)
On 10/19/2018 12:27 AM, Thomas Zimmermann wrote: Unified initialization and relesae of the global TTM state is provided by struct ttm_global and its interfaces. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 63 ++---

Re: [PATCH v3] drm/amdgpu: Set the default value about gds vmid0 size

2018-10-12 Thread Zhang, Jerry(Junwei)
On 10/12/2018 06:08 PM, Emily Deng wrote: For sriov, when first run windows guest, then run linux guest, the gds vmid0 size will be reset to 0 by windows guest. So if the value has been reset to 0, then set the value to the default value in linux guest. v2: Fixed value instead of reading

Re: [PATCH v2] drm/amdgpu: Set the default value about gds vmid0 size

2018-10-12 Thread Zhang, Jerry(Junwei)
On 10/12/2018 05:34 PM, Emily Deng wrote: For sriov, when first run windows guest, then run linux guest, the gds vmid0 size will be reset to 0 by windows guest. So if the value has been reset to 0, then set the value to the default value in linux guest. v2: Fixed value instead of reading

Re: [PATCH] drm/amdgpu/sriov: Set the default value about gds vmid0 size

2018-10-12 Thread Zhang, Jerry(Junwei)
On 10/12/2018 03:39 PM, Christian König wrote: Am 12.10.2018 um 05:21 schrieb Emily Deng: For sriov, when first run windows guest, then run linux guest, the gds vmid0 size will be reset to 0 by windows guest. So if the value has been reset to 0, then set the value to the default value in linux

Re: [PATCH] drm/amdgpu/sriov: Set the default value about gds vmid0 size

2018-10-11 Thread Zhang, Jerry(Junwei)
On 10/12/2018 11:21 AM, Emily Deng wrote: For sriov, when first run windows guest, then run linux guest, the gds vmid0 size will be reset to 0 by windows guest. So if the value has been reset to 0, then set the value to the default value in linux guest. Signed-off-by: Emily Deng ---

Re: [PATCH] drm/amdgpu: fix AGP location with VRAM at 0x0

2018-10-09 Thread Zhang, Jerry(Junwei)
On 10/04/2018 05:02 PM, Christian König wrote: That also simplifies handling quite a bit. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

Re: [PATCH 5/5] drm/amdgpu: fix shadow BO restoring

2018-09-18 Thread Zhang, Jerry(Junwei)
On 09/14/2018 07:54 PM, Christian König wrote: Am 13.09.2018 um 11:29 schrieb Zhang, Jerry(Junwei): On 09/11/2018 05:56 PM, Christian König wrote: Don't grab the reservation lock any more and simplify the handling quite a bit. Signed-off-by: Christian König ---   drivers/gpu/drm/amd/amdgpu

Re: [PATCH libdrm 3/3] test/amdgpu: add GDS, GWS and OA tests

2018-09-18 Thread Zhang, Jerry(Junwei)
On 09/14/2018 09:09 PM, Christian König wrote: Add allocation tests for GDW, GWS and OA. Signed-off-by: Christian König --- tests/amdgpu/amdgpu_test.h | 48 +- tests/amdgpu/bo_tests.c| 21 2 files changed, 47

Re: [PATCH libdrm 1/3] amdgpu: remove invalid check in amdgpu_bo_alloc

2018-09-18 Thread Zhang, Jerry(Junwei)
On 09/14/2018 09:09 PM, Christian König wrote: The heap is checked by the kernel and not libdrm, to make it even worse it prevented allocating resources other than VRAM and GTT. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- amdgpu/amdgpu_bo.c | 9 ++--- 1 file

Re: [PATCH libdrm 2/3] test/amdgpu: add proper error handling

2018-09-18 Thread Zhang, Jerry(Junwei)
On 09/14/2018 09:09 PM, Christian König wrote: Otherwise the calling function won't notice that something is wrong. Signed-off-by: Christian König --- tests/amdgpu/amdgpu_test.h | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git

Re: [PATCH] list: introduce list_bulk_move_tail helper

2018-09-18 Thread Zhang, Jerry(Junwei)
On 09/17/2018 08:08 PM, Christian König wrote: Move all entries between @first and including @last before @head. This is useful for LRU lists where a whole block of entries should be moved to the end of the list. Used as a band aid in TTM, but better placed in the common list headers.

Re: [PATCH] list: introduce list_bulk_move_tail helper

2018-09-17 Thread Zhang, Jerry(Junwei)
On 09/17/2018 08:08 PM, Christian König wrote: Move all entries between @first and including @last before @head. This is useful for LRU lists where a whole block of entries should be moved to the end of the list. Used as a band aid in TTM, but better placed in the common list headers.

Re: [PATCH libdrm] tests/amdgpu: add unaligned VM test

2018-09-14 Thread Zhang, Jerry(Junwei)
On 09/13/2018 08:20 PM, Christian König wrote: Am 11.09.2018 um 04:06 schrieb Zhang, Jerry (Junwei): On 09/10/2018 05:33 PM, Christian König wrote: Am 10.09.2018 um 04:44 schrieb Zhang, Jerry (Junwei): On 09/10/2018 02:04 AM, Christian König wrote: Make a VM mapping which is as unaligned

Re: [PATCH 5/5] drm/amdgpu: fix shadow BO restoring

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:56 PM, Christian König wrote: Don't grab the reservation lock any more and simplify the handling quite a bit. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 109 - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 46

Re: [PATCH 3/5] drm/amdgpu: shadow BOs don't need any alignment

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:56 PM, Christian König wrote: They aren't directly used by the hardware. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

Re: [PATCH 4/5] drm/amdgpu: always recover VRAM during GPU recovery

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:56 PM, Christian König wrote: It shouldn't add much overhead and we should make sure that critical VRAM content is always restored. Signed-off-by: Christian König Acked-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +- 1 file changed, 5

Re: [PATCH 1/5] drm/amdgpu: stop pipelining VM PDs/PTs moves

2018-09-13 Thread Zhang, Jerry(Junwei)
On 09/11/2018 05:55 PM, Christian König wrote: We are going to need this for recoverable page fault handling and it makes shadow handling during GPU reset much more easier. Signed-off-by: Christian König Acked-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-

Re: [PATCH 1/8] drm/amdgpu: add some VM PD/PT iterators v2

2018-09-12 Thread Zhang, Jerry(Junwei)
On 09/12/2018 04:54 PM, Christian König wrote: Both a leaf as well as dfs iterator to walk over all the PDs/PTs. v2: update comments and fix for_each_amdgpu_vm_pt_dfs_safe Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 224

Re: [PATCH 4/8] drm/amdgpu: use the DFS iterator in amdgpu_vm_invalidate_pds v2

2018-09-12 Thread Zhang, Jerry(Junwei)
On 09/12/2018 04:54 PM, Christian König wrote: Less code and easier to maintain. v2: rename the function as well Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 32 1 file changed, 8 insertions(+), 24

Re: [PATCH] drm/amdgpu: Fix the dead lock issue.

2018-09-10 Thread Zhang, Jerry (Junwei)
On 09/11/2018 10:51 AM, Emily Deng wrote: It will ramdomly have the dead lock issue when test TDR: 1. amdgpu_device_handle_vram_lost gets the lock shadow_list_lock 2. amdgpu_bo_create locked the bo's resv lock 3. amdgpu_bo_create_shadow is waiting for the shadow_list_lock 4.

Re: Optimize VM handling a bit more

2018-09-10 Thread Zhang, Jerry (Junwei)
Apart from Felix comments, Looks good for me, patch 2 ~ 8 are Reviewed-by: Junwei Zhang Patch 9 ~ 11 are Acked-by: Junwei Zhang On 09/10/2018 02:03 AM, Christian König wrote: Hi everyone, Especially on Vega and Raven VM handling is rather inefficient while creating PTEs because we

Re: [PATCH 04/11] drm/amdgpu: add some VM PD/PT iterators

2018-09-10 Thread Zhang, Jerry (Junwei)
On 09/10/2018 02:03 AM, Christian König wrote: Both a leaf as well as dfs iterator to walk over all the PDs/PTs. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 221 + 1 file changed, 221 insertions(+) diff --git

Re: [PATCH libdrm] tests/amdgpu: add unaligned VM test

2018-09-10 Thread Zhang, Jerry (Junwei)
On 09/10/2018 05:33 PM, Christian König wrote: Am 10.09.2018 um 04:44 schrieb Zhang, Jerry (Junwei): On 09/10/2018 02:04 AM, Christian König wrote: Make a VM mapping which is as unaligned as possible. Is it going to test unaligned address between BO allocation and BO mapping and skip huge

Re: [PATCH libdrm] tests/amdgpu: add unaligned VM test

2018-09-09 Thread Zhang, Jerry (Junwei)
On 09/10/2018 02:04 AM, Christian König wrote: Make a VM mapping which is as unaligned as possible. Is it going to test unaligned address between BO allocation and BO mapping and skip huge page mapping? Signed-off-by: Christian König --- tests/amdgpu/vm_tests.c | 45

Re: [PATCH] drm/amdgpu: Fix SDMA hang in prt mode

2018-09-07 Thread Zhang, Jerry (Junwei)
On 09/07/2018 03:41 PM, Tao Zhou wrote: Fix SDMA hang in prt mode, clear XNACK_WATERMARK in reg SDMA0_UTCL1_WATERMK to avoid the issue What test case for that? new case? Previously we have passed Vulkan CTS for that. IIRC, NACK is required to reply, what's that meaning to clear that? no

Re: [PATCH 1/1] drm/amdgpu: Fix compute VM BO params after rebase

2018-09-05 Thread Zhang, Jerry (Junwei)
On 09/06/2018 08:28 AM, Felix Kuehling wrote: The intent of two commits was lost in the last rebase: 810955b drm/amdgpu: Fix acquiring VM on large-BAR systems b5d21aa drm/amdgpu: Don't use shadow BO for compute context This commit restores the original behaviour: * Don't set

Re: [PATCH] drm/amdgpu: enable AGP aperture for GMC9 v2

2018-09-03 Thread Zhang, Jerry (Junwei)
On 09/03/2018 08:22 PM, Christian König wrote: Enable the old AGP aperture to avoid GART mappings. v2: don't enable it for SRIOV Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 10 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Re: [PATCH libdrm] amdgpu: fix typo in function comment

2018-09-03 Thread Zhang, Jerry (Junwei)
On 09/03/2018 06:59 PM, Qiang Yu wrote: Signed-off-by: Qiang Yu Reviewed-by: Junwei Zhang --- amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index dc51659..e6ec7a8 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@

Re: [PATCH] drm/amdgpu: improve VM state machine documentation v2

2018-09-03 Thread Zhang, Jerry (Junwei)
On 09/03/2018 05:08 PM, Christian König wrote: Since we have a lot of FAQ on the VM state machine try to improve the documentation by adding functions for each state move. v2: fix typo in amdgpu_vm_bo_invalidated, use amdgpu_vm_bo_relocated in one more place as well. Signed-off-by:

Re: [PATCH libdrm] amdgpu: When couldn't find bo, need to return error.

2018-09-03 Thread Zhang, Jerry (Junwei)
On 09/03/2018 04:44 PM, Christian König wrote: Am 03.09.2018 um 09:16 schrieb Zhang, Jerry (Junwei): On 09/03/2018 03:11 PM, Christian König wrote: About master branch, needs someone's help with correct permission. I've already took care of that on the weekend. Thank you again. BTW, how

Re: [PATCH] drm/amdgpu: fix amdgpu_mn_unlock() in the CS error path

2018-09-03 Thread Zhang, Jerry (Junwei)
On 09/03/2018 04:53 PM, Christian König wrote: Avoid unlocking a lock we never locked. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH libdrm] amdgpu: add amdgpu_bo_inc_ref() function.

2018-09-03 Thread Zhang, Jerry (Junwei)
On 09/03/2018 02:55 PM, Qiang Yu wrote: For Pro OGL be able to work with upstream libdrm. Signed-off-by: Qiang Yu Reviewed-by: Christian König I'm fine with that, not sure if mesa is going to use that as well. Reviewed-by: Junwei Zhang Regards, Jerry --- amdgpu/amdgpu-symbol-check |

Re: [PATCH libdrm] amdgpu: When couldn't find bo, need to return error.

2018-09-03 Thread Zhang, Jerry (Junwei)
, Jerry (Junwei): On 09/01/2018 04:58 PM, Deng, Emily wrote: Ok, then just ignore this patch. But seems didn't saw the patch on branch amd-staging-hybrid-master20180315. Thanks to take care of this as well. I'm waiting some verification, and now push the patch to internal staging branch mainline

Re: [PATCH 1/3] drm/amdgpu: move size calculations to the front of the file again

2018-09-02 Thread Zhang, Jerry (Junwei)
On 09/02/2018 02:05 AM, Christian König wrote: amdgpu_vm_bo_* functions should come much later. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 90 +- 1 file changed, 45 insertions(+), 45 deletions(-)

Re: [PATCH 3/3] drm/amdgpu: improve VM state machine documentation

2018-09-02 Thread Zhang, Jerry (Junwei)
On 09/02/2018 02:05 AM, Christian König wrote: Since we have a lot of FAQ on the VM state machine try to improve the documentation by adding functions for each state move. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 139 + 1

Re: [PATCH 2/3] drm/amdgpu: separate per VM BOs from normal in the moved state

2018-09-02 Thread Zhang, Jerry (Junwei)
On 09/02/2018 02:05 AM, Christian König wrote: Allows us to avoid taking the spinlock in more places. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 67 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 7

Re: [PATCH 1/2] drm/amdgpu: move size calculations to the front of the file again

2018-09-02 Thread Zhang, Jerry (Junwei)
On 08/31/2018 09:27 PM, Christian König wrote: amdgpu_vm_bo_* functions should come much later. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 90 +- 1 file changed, 45 insertions(+), 45 deletions(-)

Re: [PATCH 2/3] drm/amdgpu: fix "use bulk moves for efficient VM LRU handling" v2

2018-09-02 Thread Zhang, Jerry (Junwei)
On 08/31/2018 09:10 PM, Christian König wrote: First step to fix the LRU corruption, we accidentially tried to move things on the LRU after dropping the lock. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 ++--- 1 file changed, 2

Re: [PATCH 1/3] drm/ttm: fix ttm_bo_bulk_move_helper

2018-09-02 Thread Zhang, Jerry (Junwei)
On 08/31/2018 09:10 PM, Christian König wrote: Staring at the function for six hours, just to essentially move one line of code. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/ttm/ttm_bo.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-)

Re: [PATCH libdrm] amdgpu: When couldn't find bo, need to return error.

2018-09-02 Thread Zhang, Jerry (Junwei)
On 09/01/2018 04:58 PM, Deng, Emily wrote: Ok, then just ignore this patch. But seems didn't saw the patch on branch amd-staging-hybrid-master20180315. Thanks to take care of this as well. I'm waiting some verification, and now push the patch to internal staging branch mainline will be

Re: [PATCH 1/4] drm/amdgpu/gmc9: rework stolen vga memory handling

2018-08-30 Thread Zhang, Jerry (Junwei)
On 08/30/2018 10:53 PM, Alex Deucher wrote: No functional change, just rework it in order to adjust the behavior on a per asic level. The problem is that on vega10, something corrupts the lower 8 MB of vram on the second resume from S3. This does not seem to affect Raven, other gmc9 based

Re: [PATCH 2/4] drm/amdgpu/gmc9: don't keep stolen memory on Raven

2018-08-30 Thread Zhang, Jerry (Junwei)
On 08/30/2018 10:53 PM, Alex Deucher wrote: Raven does not appear to be affected by the same issue as vega10. Enable the full stolen memory handling on Raven. Reserve the appropriate size at init time to avoid display artifacts and then free it at the end of init once the new FB is up and

Re: [PATCH 1/6] drm/amdgpu: correctly sign extend 48bit addresses v3

2018-08-30 Thread Zhang, Jerry (Junwei)
Patch 1~5 are Reviewed-by: Junwei Zhang Patch 6 is Acked-by: Junwei Zhang BTW, [PATCH 4/6] drm/amdgpu: manually map the shadow BOs again with this patch, the user cannot create a shadow bo with gart address. anyway, I cannot image that use case either. Regards, Jerry On 08/30/2018 08:14

Re: [PATCH 4/7] drm/amdgpu: use the AGP aperture for system memory access v2

2018-08-30 Thread Zhang, Jerry (Junwei)
On 08/30/2018 08:15 PM, Christian König wrote: Am 30.08.2018 um 05:20 schrieb Zhang, Jerry (Junwei): On 08/29/2018 10:08 PM, Christian König wrote: Start to use the old AGP aperture for system memory access. v2: Move that to amdgpu_ttm_alloc_gart Signed-off-by: Christian König --- drivers

Re: [PATCH] drm/amdgpu: Revert "kmap PDs/PTs in amdgpu_vm_update_directories"

2018-08-30 Thread Zhang, Jerry (Junwei)
On 08/30/2018 03:50 PM, Christian König wrote: This reverts commit a7f91061c60ad9cac2e6a03b642be6a4f88b3662. Felix pointed out that we need to have the BOs mapped even before amdgpu_vm_update_directories is called. Signed-off-by: Christian König Acked-by: Junwei Zhang ---

Re: [PATCH libdrm] amdgpu: add error return value for finding bo by cpu mapping

2018-08-30 Thread Zhang, Jerry (Junwei)
On 08/30/2018 04:57 PM, Michel Dänzer wrote: On 2018-08-30 10:50 a.m., Junwei Zhang wrote: If nothing is found, error should be returned. Signed-off-by: Junwei Zhang [...] @@ -577,10 +578,11 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev, } else {

Re: [PATCH] drm/amdgpu: correctly sign extend 48bit addresses v3

2018-08-30 Thread Zhang, Jerry (Junwei)
On 08/30/2018 02:48 PM, Christian König wrote: Am 30.08.2018 um 04:43 schrieb Zhang, Jerry (Junwei): On 08/29/2018 05:39 PM, Christian König wrote: Am 29.08.2018 um 04:03 schrieb Zhang, Jerry (Junwei): On 08/28/2018 08:17 PM, Christian König wrote: Correct sign extend the GMC addresses

Re: When to kmap PT BOs?

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/30/2018 06:30 AM, Felix Kuehling wrote: Hi, Currently PT BOs are kmapped in amdgpu_vm_update_directories. That means, to avoid kernel oopses after page table evictions, I need to call amdgpu_vm_update_directories before calling amdgpu_vm_bo_update. But amdgpu_vm_bo_update can also move

Re: [PATCH 6/7] drm/amdgpu: enable AGP aperture for GMC9

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/29/2018 10:08 PM, Christian König wrote: Enable the old AGP aperture to avoid GART mappings. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 10 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c| 1 +

Re: [PATCH 5/7] drm/amdgpu: manually map the shadow BOs again

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/29/2018 10:08 PM, Christian König wrote: Otherwise we won't be able to use the AGP aperture. do you mean we use AGP for GTT shadow only now? Jerry Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c |

Re: [PATCH 4/7] drm/amdgpu: use the AGP aperture for system memory access v2

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/29/2018 10:08 PM, Christian König wrote: Start to use the old AGP aperture for system memory access. v2: Move that to amdgpu_ttm_alloc_gart Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 23 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 +

Re: [PATCH 3/7] drm/amdgpu: add amdgpu_gmc_agp_location v2

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/29/2018 10:08 PM, Christian König wrote: Helper to figure out the location of the AGP BAR. v2: fix a couple of bugs Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 43 + drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 5 +++ 2 files

Re: [PATCH 2/7] drm/amdgpu: put GART away from VRAM v2

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/29/2018 10:08 PM, Christian König wrote: Always try to put the GART away from where VRAM is. v2: correctly handle the 4GB limitation Signed-off-by: Christian König Fix my concern :) Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 8 +--- 1 file

Re: [PATCH] drm/amdgpu: remove redundant memset

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/29/2018 11:17 PM, Philip Yang wrote: kvmalloc_array uses __GFP_ZERO flag ensures that the returned address is zeroed already, memset it to zero again afterwards is unnecessary, and in this case buggy because we only clear the first entry. Change-Id:

Re: [PATCH] drm/amdgpu: Need to set moved to true when evict bo

2018-08-29 Thread Zhang, Jerry (Junwei)
On 08/29/2018 04:53 PM, Christian König wrote: Am 29.08.2018 um 04:52 schrieb Zhang, Jerry (Junwei): On 08/28/2018 08:40 PM, Emily Deng wrote: Fix the VMC page fault when the running sequence is as below: 1.amdgpu_gem_create_ioctl 2.ttm_bo_swapout->amdgpu_vm_bo_invalidate, as not cal

Re: [PATCH] drm/amdgpu: Need to set moved to true when evict bo

2018-08-28 Thread Zhang, Jerry (Junwei)
On 08/28/2018 08:40 PM, Emily Deng wrote: Fix the VMC page fault when the running sequence is as below: 1.amdgpu_gem_create_ioctl 2.ttm_bo_swapout->amdgpu_vm_bo_invalidate, as not called amdgpu_vm_bo_base_init, so won't called list_add_tail(>bo_list, >va). Even the bo was evicted, it won't set

Re: [PATCH] drm/amdgpu: correctly sign extend 48bit addresses v3

2018-08-28 Thread Zhang, Jerry (Junwei)
On 08/28/2018 08:17 PM, Christian König wrote: Correct sign extend the GMC addresses to 48bit. Could you explain a bit more why to extend the sign? the address is uint64_t. is if failed in some case? > -/* VA hole for 48bit addresses on Vega10 */ > -#define AMDGPU_VA_HOLE_START

Re: [PATCH] drm/amdgpu: Only retrieve GPU address of GART table after pinning it

2018-08-28 Thread Zhang, Jerry (Junwei)
On 08/28/2018 05:27 PM, Michel Dänzer wrote: From: Michel Dänzer Doing it earlier hits a WARN_ON_ONCE in amdgpu_bo_gpu_offset. Fixes: "drm/amdgpu: remove gart.table_addr" Signed-off-by: Michel Dänzer Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 5 -

Re: [PATCH] drm/amdgpu: remove extra newline when printing VM faults

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/27/2018 10:04 PM, Alex Deucher wrote: On Mon, Aug 27, 2018 at 9:45 AM Christian König wrote: Looks like a copy error to me. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +- 1 file changed,

Re: [PATCH 09/10] drm/amdgpu: use the AGP aperture for system memory access

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 12:53 AM, Christian König wrote: Start to use the old AGP aperture for system memory access. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 24 + drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h |

Re: [PATCH 06/10] drm/amdgpu: add amdgpu_gmc_agp_location

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 12:53 AM, Christian König wrote: Helper to figure out the location of the AGP BAR. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 42 + drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 5 +++ 2 files changed, 47 insertions(+)

Re: [PATCH 08/10] drm/amdgpu: distinct between allocated GART space and GMC addr

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 12:53 AM, Christian König wrote: Most of the time we only need to know if the BO has a valid GMC addr. Signed-off-by: Christian König good to see this cleanup :) Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 --

Re: [PATCH 07/10] drm/amdgpu: stop using gart_start as offset for the GTT domain

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 03:07 AM, Alex Deucher wrote: On Mon, Aug 27, 2018 at 12:56 PM Christian König wrote: Further separate GART and GTT domain. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 3 ++-

Re: [PATCH 01/10] drm/amdgpu: use only the lower address space on GMC9

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 09:56 AM, Zhang, Jerry (Junwei) wrote: On 08/28/2018 12:53 AM, Christian König wrote: Only use the lower address space on GMC9 for the system domain. Otherwise we would need to sign extend GMC addresses. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Re: [PATCH 05/10] drm/amdgpu: put GART away from VRAM

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 12:53 AM, Christian König wrote: Always try to put the GART away from where VRAM is. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

Re: [PATCH 04/10] drm/amdgpu: use the smaller hole for GART

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 03:05 AM, Alex Deucher wrote: On Mon, Aug 27, 2018 at 12:55 PM Christian König wrote: Instead of the larger one use the smaller hole in the MC address space for the GART mappings. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Junwei Zhang ---

Re: [PATCH 03/10] drm/amdgpu: fix amdgpu_gmc_gart_location a little bit

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 12:53 AM, Christian König wrote: Improve the VCE limitation handling. Signed-off-by: Christian König Reviewed-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 28 - 1 file changed, 13 insertions(+), 15 deletions(-) diff --git

Re: [PATCH 02/10] drm/amdgpu: move amdgpu_device_(vram|gtt)_location

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 02:59 AM, Alex Deucher wrote: On Mon, Aug 27, 2018 at 12:56 PM Christian König wrote: Move that into amdgpu_gmc.c since we are really deadling with GMC address space here. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Junwei Zhang ---

Re: [PATCH 01/10] drm/amdgpu: use only the lower address space on GMC9

2018-08-27 Thread Zhang, Jerry (Junwei)
On 08/28/2018 12:53 AM, Christian König wrote: Only use the lower address space on GMC9 for the system domain. Otherwise we would need to sign extend GMC addresses. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 7 +++ 1 file changed, 3 insertions(+), 4

  1   2   3   4   >