Re: [PATCH] drm/amdgpu: revert "XGMI pstate switch initial support"

2019-03-19 Thread Liu, Shaoyun
As I understand,  if we want to implement the  logic in bo_add/rmv function ,  I need following conditions are all to be true for a valid XGMI request. 1.  check the adev and the bo_adev are different .     This is correct on rocm implementation .( amdgpu_amdkfd_gpuvm_map_memory_to_gpu pass

Re: randr: Virtual monitor not present with MST display

2019-03-19 Thread Wentland, Harry
On 2019-03-18 5:58 p.m., Paul Menzel wrote: > > Dear Harry, > ... snip ... >> >> Michel, do you know if this is supposed to work with >> xf86-video-amdgpu? When I've tried it before I didn't have any luck but >> didn't have time to look into it. > > Sorry, what is your question. With the

Re: Potential NULL pointer dereference in radeon_ttm_tt_populate

2019-03-19 Thread Shaobo He
> See here: > #if IS_ENABLED(CONFIG_AGP) > if (rdev->flags & RADEON_IS_AGP) { > return ttm_agp_tt_populate(ttm, ctx); > } > #endif > This code appears to be after the potential location of NULL pointer dereference that I pointed out. Please see, ```

Re: [PATCH 8/8] drm/amdgpu: use the new VM backend for clears

2019-03-19 Thread zhoucm1
patch#2 and patch#4 are Ached-by: Chunming Zhou patch#1, #3, #5~#8 are Reviewed-by: Chunming Zhou On 2019年03月19日 20:44, Christian König wrote: And remove the existing code when it is unused. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 89

RE: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-19 Thread Pan, Xinhui
these two enumerated types are same for now. both of them might change in the future. I have not used clang, but would .block_id = (int)head->block fix your warning? If such change is acceptable, I can make one then. Thanks xinhui -Original Message- From: Nathan Chancellor Sent:

[PATCH 6/9] drm/amdgpu: add timeline support in amdgpu CS v3

2019-03-19 Thread Chunming Zhou
syncobj wait/signal operation is appending in command submission. v2: separate to two kinds in/out_deps functions v3: fix checking for timeline syncobj Signed-off-by: Chunming Zhou Cc: Tobias Hector Cc: Jason Ekstrand Cc: Dave Airlie Cc: Chris Wilson Cc: Lionel Landwerlin ---

[PATCH 7/9] drm/syncobj: add transition iotcls between binary and timeline v2

2019-03-19 Thread Chunming Zhou
we need to import/export timeline point. v2: unify to one transfer ioctl Signed-off-by: Chunming Zhou Cc: Lionel Landwerlin --- drivers/gpu/drm/drm_internal.h | 2 + drivers/gpu/drm/drm_ioctl.c| 2 + drivers/gpu/drm/drm_syncobj.c | 74 ++

[PATCH libdrm] tests/amdgpu: minor fix for dispatch/draw test

2019-03-19 Thread Cui, Flora
1. clear cmd buffer 2. make amdgpu_memcpy_dispatch_test static 3. tab/space fix Change-Id: Idf55f8881f66458b585092eccb55b6042520e4ad Signed-off-by: Flora Cui --- tests/amdgpu/basic_tests.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git

Re: [PATCH 8/9] drm/syncobj: add timeline signal ioctl for syncobj v3

2019-03-19 Thread zhoucm1
On 2019年03月19日 19:54, Lionel Landwerlin wrote: On 15/03/2019 12:09, Chunming Zhou wrote: v2: individually allocate chain array, since chain node is free independently. v3: all existing points must be already signaled before cpu perform signal operation, so add check condition for that.

[PATCH 5/9] drm/syncobj: use the timeline point in drm_syncobj_find_fence v4

2019-03-19 Thread Chunming Zhou
From: Christian König Implement finding the right timeline point in drm_syncobj_find_fence. v2: return -EINVAL when the point is not submitted yet. v3: fix reference counting bug, add flags handling as well v4: add timeout for find fence Signed-off-by: Christian König Cc: Lionel Landwerlin

[PATCH 4/9] drm/syncobj: add timeline payload query ioctl v6

2019-03-19 Thread Chunming Zhou
user mode can query timeline payload. v2: check return value of copy_to_user v3: handle querying entry by entry v4: rebase on new chain container, simplify interface v5: query last signaled timeline point, not last point. v6: add unorder point check Signed-off-by: Chunming Zhou Cc: Tobias Hector

[PATCH 1/9] dma-buf: add new dma_fence_chain container v6

2019-03-19 Thread Chunming Zhou
From: Christian König Lockless container implementation similar to a dma_fence_array, but with only two elements per node and automatic garbage collection. v2: properly document dma_fence_chain_for_each, add dma_fence_chain_find_seqno, drop prev reference during garbage collection if it's

[PATCH 9/9] drm/amdgpu: update version for timeline syncobj support in amdgpu

2019-03-19 Thread Chunming Zhou
Signed-off-by: Chunming Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 8a0732088640..4d8db87048d3 100644 ---

[PATCH 3/9] drm/syncobj: add support for timeline point wait v8

2019-03-19 Thread Chunming Zhou
points array is one-to-one match with syncobjs array. v2: add seperate ioctl for timeline point wait, otherwise break uapi. v3: userspace can specify two kinds waits:: a. Wait for time point to be completed. b. and wait for time point to become available v4: rebase v5: add comment for

[PATCH 8/9] drm/syncobj: add timeline signal ioctl for syncobj v4

2019-03-19 Thread Chunming Zhou
v2: individually allocate chain array, since chain node is free independently. v3: all existing points must be already signaled before cpu perform signal operation, so add check condition for that. v4: remove v3 change and add checking to prevent out-of-order Signed-off-by: Chunming Zhou

[PATCH 2/9] drm/syncobj: add new drm_syncobj_add_point interface v4

2019-03-19 Thread Chunming Zhou
From: Christian König Use the dma_fence_chain object to create a timeline of fence objects instead of just replacing the existing fence. v2: rebase and cleanup v3: fix garbage collection parameters v4: add unorder point check, print a warn calltrace Signed-off-by: Christian König Cc: Lionel

[ANNOUNCE] xf86-video-amdgpu 19.0.1

2019-03-19 Thread Michel Dänzer
I'm pleased to announce the 19.0.1 release of xf86-video-amdgpu, the Xorg driver for AMD Radeon GPUs supported by the amdgpu kernel driver. This release supports xserver versions 1.13-1.20. This is a minor follow-up release with only one change: * Add support for RandR output tile properties,

Re: Potential NULL pointer dereference in radeon_ttm_tt_populate

2019-03-19 Thread Shaobo He
Hi Christian, Thank you very much for your reply. I'm a little confused here so I really appreciate if you could clarify it more. For example, I don't understand why the condition of function `radeon_ttm_tt_to_gtt` returning NULL is the argument being an AGP ttm. Based on its definition, it

Re: Potential NULL pointer dereference in atombios_get_encoder_mode

2019-03-19 Thread Shaobo He
On 2019/3/18 14:15, Shaobo He wrote: Hello everyone, My name is Shaobo He and I am a graduate student at University of Utah. I am using a static analysis tool to search for null pointer dereferences and came across a potentially invalid memory accesses in the file

Re: Potential NULL pointer dereference in radeon_ttm_tt_populate

2019-03-19 Thread Christian König
... or the backend methods is not `radeon_backend_func`. That's the case when it is an AGP backend. Moreover, could you point out the check of such case before the offending code? See here: #if IS_ENABLED(CONFIG_AGP)     if (rdev->flags & RADEON_IS_AGP) {     return

Re: [PATCH 3/4] drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank.

2019-03-19 Thread Paul Menzel
Dear Mario, On 18.03.19 18:19, Mario Kleiner wrote: In VRR mode, proper vblank/pageflip timestamps can only be computed after the display scanout position has left front-porch. Therefore delay calls to drm_crtc_handle_vblank(), and thereby calls to drm_update_vblank_count() and pageflip event

Re: [PATCH 1/9] dma-buf: add new dma_fence_chain container v5

2019-03-19 Thread Lionel Landwerlin
On 15/03/2019 12:09, Chunming Zhou wrote: From: Christian König Lockless container implementation similar to a dma_fence_array, but with only two elements per node and automatic garbage collection. v2: properly document dma_fence_chain_for_each, add dma_fence_chain_find_seqno, drop prev

Re: [PATCH 8/9] drm/syncobj: add timeline signal ioctl for syncobj v3

2019-03-19 Thread Lionel Landwerlin
On 15/03/2019 12:09, Chunming Zhou wrote: v2: individually allocate chain array, since chain node is free independently. v3: all existing points must be already signaled before cpu perform signal operation, so add check condition for that. Signed-off-by: Chunming Zhou ---

Re: [PATCH] drm/amdgpu: revert "XGMI pstate switch initial support"

2019-03-19 Thread Kuehling, Felix
We discussed a few different approaches before settling on this one. Maybe it needs some more background. XGMI links are quite power hungry. Being able to power them down improves performance for power-limited workloads that don't need XGMI. In machine learning, pretty much all workloads are

Re: [PATCH] drm/amdgpu: revert "XGMI pstate switch initial support"

2019-03-19 Thread Kuehling, Felix
On 3/19/2019 8:49 AM, Christian König wrote: > Yeah, all that is perfectly fine. > > The problem is Shaoyun didn't put this into the mapping code, but > rather into the VM state machine. So this won't work at all (the > counter and increment/decrement unbalanced and multiple times). We tried to

[PATCH] drm/amdgpu: revert "XGMI pstate switch initial support"

2019-03-19 Thread Christian König
This reverts commit c9115f8904eef0f880d3b4f8306f553b1bb1c532. Adding this to the mapping is complete nonsense and the whole implementation looks racy. This patch wasn't thoughtfully reviewed and should be reverted for now. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h

Re: [PATCH 1/9] dma-buf: add new dma_fence_chain container v5

2019-03-19 Thread Christian König
Am 19.03.19 um 13:27 schrieb Lionel Landwerlin: On 15/03/2019 12:09, Chunming Zhou wrote: [SNIP] +/** + * struct dma_fence_chain - fence to represent an node of a fence chain + * @base: fence base class + * @lock: spinlock for fence handling + * @prev: previous fence of the chain + *

[PATCH 4/8] drm/amdgpu: reserve less memory for PDE updates

2019-03-19 Thread Christian König
Allocating 16KB was way to much, just use 2KB as a start for now. Signed-off-by: Christian König --- 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 b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index

[PATCH 3/8] drm/amdgpu: move and rename amdgpu_pte_update_params

2019-03-19 Thread Christian König
Move the update parameter into the VM header and rename them. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 75 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 45 2 files changed, 60 insertions(+), 60 deletions(-) diff --git

[PATCH 2/8] drm/amdgpu: always set and check dma addresses in the VM code

2019-03-19 Thread Christian König
Clean that up a bit and allow to always have the DMA addresses around. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

[PATCH 1/8] drm/amdgpu: remove some unused VM defines

2019-03-19 Thread Christian König
Not needed any more. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index f5c25c0ae367..8348804c46cd 100644 ---

[PATCH 7/8] drm/amdgpu: use the new VM backend for PTEs

2019-03-19 Thread Christian König
And remove the existing code when it is unused. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 229 + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 13 -- 2 files changed, 6 insertions(+), 236 deletions(-) diff --git

[PATCH 6/8] drm/amdgpu: use the new VM backend for PDEs

2019-03-19 Thread Christian König
And remove the existing code when it is unused. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 74 +- 1 file changed, 14 insertions(+), 60 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

[PATCH 5/8] drm/amdgpu: new VM update backends

2019-03-19 Thread Christian König
Separate out all functions for SDMA and CPU based page table updates into separate backends. This way we can keep most of the complexity of those from the core VM code. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +-

[PATCH 8/8] drm/amdgpu: use the new VM backend for clears

2019-03-19 Thread Christian König
And remove the existing code when it is unused. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 89 +- 1 file changed, 32 insertions(+), 57 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Re: [PATCH] drm/amdgpu: revert "XGMI pstate switch initial support"

2019-03-19 Thread Christian König
Yeah, all that is perfectly fine. The problem is Shaoyun didn't put this into the mapping code, but rather into the VM state machine. So this won't work at all (the counter and increment/decrement unbalanced and multiple times). The correct place to add this is

Re: [PATCH 4/4] drm/amd/display: Make pageflip event delivery compatible with VRR.

2019-03-19 Thread Kazlauskas, Nicholas
On 3/18/19 1:19 PM, Mario Kleiner wrote: > We want vblank counts and timestamps of flip completion as sent > in pageflip completion events to be consistent with the vblank > count and timestamp of the vblank of flip completion, like in non > VRR mode. > > In VRR mode, drm_update_vblank_count() -

Re: [PATCH 3/4] drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank.

2019-03-19 Thread Kazlauskas, Nicholas
On 3/18/19 1:19 PM, Mario Kleiner wrote: > In VRR mode, proper vblank/pageflip timestamps can only be computed > after the display scanout position has left front-porch. Therefore > delay calls to drm_crtc_handle_vblank(), and thereby calls to > drm_update_vblank_count() and pageflip event

Re: Potential NULL pointer dereference in radeon_ttm_tt_populate

2019-03-19 Thread Christian König
Hi Shaobo, that question came up a couple of times now. And the answer is: No, there can't be a NULL pointer dereference. The function radeon_ttm_tt_to_gtt returns NULL only when it is an AGP ttm structure, and that case is checked right before the offending code. Unfortunately I don't see

Re: [PATCH] drm/amdgpu: revert "XGMI pstate switch initial support"

2019-03-19 Thread Liu, Shaoyun
Thanks Felix . We did consider to put the  logic into bo_add/bo_rmv, but Felix pointed out the  object can be migrate from FB to system memory after allocation .  I also think of put the  logic inside amdgpu_vm_bo_update_mapping , but seems that function prefer to take the  dma address already

Re: [PATCH] drm/amdgpu: add one rlc version into gfxoff blacklist

2019-03-19 Thread Alex Deucher
On Tue, Mar 19, 2019 at 9:31 AM Huang Rui wrote: > > RLC #53815 ucode has the noise issue on 4k playback while gfxoff enabled. > > Signed-off-by: Huang Rui Acked-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git

Re: [PATCH 3/4] drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank.

2019-03-19 Thread Kazlauskas, Nicholas
On 3/19/19 9:23 AM, Kazlauskas, Nicholas wrote: > On 3/18/19 1:19 PM, Mario Kleiner wrote: >> In VRR mode, proper vblank/pageflip timestamps can only be computed >> after the display scanout position has left front-porch. Therefore >> delay calls to drm_crtc_handle_vblank(), and thereby calls to

[PATCH] drm/amdgpu: add one rlc version into gfxoff blacklist

2019-03-19 Thread Huang Rui
RLC #53815 ucode has the noise issue on 4k playback while gfxoff enabled. Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 6b48d4c..3765d97

Re: Radeon init fail and resulting cascade of UBSAN errors

2019-03-19 Thread Meelis Roos
I just put a Radeon 9600XT into an Athlon XP machine. I do not know if the card is good or not, but 2D dumb framebufer works fine with radeon module. However, init of the acceleration engine fails. I compiled my own kernel (v5.0 from git) with UBSAN (no other debug yet) and got a cascade of UBSAN

5.1-rc1: radeon WARNING: CPU: 1 PID: 160 at drivers/gpu/drm/drm_fourcc.c:278 drm_format_info+0x74/0xe0 [drm]

2019-03-19 Thread Meelis Roos
I am seeing the following warning on at least 2 different servers with onboard radeon graphics. It was not there with 5.0. [4.764838] [drm] radeon kernel modesetting enabled. [4.765334] radeon :01:01.0: vgaarb: deactivate vga console [4.767746] Console: switching to colour dummy

Re: [PATCH] drm/amd/amdgpu: fix incorrect translation about the PCIe MLW info

2019-03-19 Thread Alex Deucher
On Tue, Mar 19, 2019 at 12:26 AM Chengming Gui wrote: > > Max Link Width's full mask is 0x3f, > and it's highest bit express X16. > > Signed-off-by: Chengming Gui > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++-- > 1 file changed, 2 insertions(+), 10 deletions(-) > > diff

[ANNOUNCE] xf86-video-ati 19.0.1

2019-03-19 Thread Michel Dänzer
I'm pleased to announce the 19.0.1 release of xf86-video-ati, the Xorg driver for ATI/AMD Radeon GPUs supported by the radeon kernel driver. This release supports xserver versions 1.13-1.20. This is a bug-fix release, with only three changes: * Fixes for two regressions which crept into the

Re: [PATCH] drm/amdgpu: revert "XGMI pstate switch initial support"

2019-03-19 Thread Koenig, Christian
Am 19.03.19 um 16:42 schrieb Liu, Shaoyun: > Thanks Felix . > > We did consider to put the  logic into bo_add/bo_rmv, but Felix pointed > out the  object can be migrate from FB to system memory after allocation > . Yeah, I also considered that and that is actually a really good argument. But