Re: [PATCH] drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

2018-09-17 Thread Huang Rui
On Mon, Sep 17, 2018 at 02:07:11PM -0400, Tom St Denis wrote: > Signed-off-by: Tom St Denis Reviewed-by: Huang Rui > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >

Re: [PATCH] drm/amdgpu: don't try to unreserve NULL pointer

2018-09-17 Thread Huang Rui
On Mon, Sep 17, 2018 at 08:07:24PM +0200, Christian König wrote: > Don't try to unreserve a BO we doesn't allocated. > > Fixes: 07012fdd497e drm/amdgpu: don't allocate zero sized kernel BOs > > Signed-off-by: Christian König If we set size as 0 while create bo, the bo_ptr will be NULL after

RE: [PATCH] drm/amd/dc: Trigger set power state task when display configuration changes

2018-09-17 Thread Zhu, Rex
Hi David, Yes, There is an issue you pointed out on Raven. Because the force_dpm_level was added for UMD-P state and the min clocks were hardcode. The display's clock requests were ignored. I will fix this issue. Thanks. Best Regards Rex From: Francis, David Sent: Monday, September 17, 2018

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 1/2] drm/amdgpu: update vram_info structure in atomfirmware.h

2018-09-17 Thread Huang Rui
On Mon, Sep 17, 2018 at 08:28:39PM +0800, Hawking Zhang wrote: > atomfirmware has structure changes in varm_info. Updated it > to the latest one. > > Change-Id: Ie5d60413e5db1dfb4aaf23dc94bc5fd4ed0a01cd > Signed-off-by: Hawking Zhang > Reviewed-by: Alex Deucher Series are Reviewed-by: Huang

Re: [PATCH] list: introduce list_bulk_move_tail helper

2018-09-17 Thread Huang Rui
On Mon, Sep 17, 2018 at 02:08:34PM +0200, 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

Re: [PATCH] drm/radeon: change function signature to pass full range

2018-09-17 Thread Alex Deucher
On Mon, Sep 17, 2018 at 4:29 PM Mathieu Malaterre wrote: > > > > On Fri, Apr 13, 2018 at 9:59 AM Huang Rui wrote: >> >> On Thu, Apr 12, 2018 at 09:33:33PM +0200, Mathieu Malaterre wrote: >> > In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against >> > 255 is done. Since it is

Re: [PATCH] amdgpu uses raw rlc_hdr values, causing kernel OOPS on big endian architectures

2018-09-17 Thread Alex Deucher
On Mon, Sep 17, 2018 at 3:41 AM A. Wilcox wrote: > > adev->gfx.rlc in gfx_v8_0_init_microcode has the values from rlc_hdr > already processed by le32_to_cpu. Using the rlc_hdr values on > big-endian machines causes a kernel Oops due to writing well outside of > the array (0x2400 instead of

BUG: [amdgpu]] *ERROR* ring gfx timeout

2018-09-17 Thread Daniel Andersson
Hey, GPU hangs for a while(~20s) and dmesg is: 110.343379] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, last signaled seq=7273, last emitted seq=7275 [ 110.343385] [drm] GPU recovery disabled. 4.18.8-arch1-1-ARCH & Vega10: Reproduce by: git clone

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-17 Thread Jonathan Cameron
On Wed, 12 Sep 2018 17:08:52 +0200 Arnd Bergmann wrote: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390 architecture,

Re: [PATCH] drm/radeon: change function signature to pass full range

2018-09-17 Thread Mathieu Malaterre
On Fri, Apr 13, 2018 at 9:59 AM Huang Rui wrote: > On Thu, Apr 12, 2018 at 09:33:33PM +0200, Mathieu Malaterre wrote: > > In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against > > 255 is done. Since it is always false, change the signature of this > > function to use an `int`

Re: [PATCH] drm/amdgpu: don't try to unreserve NULL pointer

2018-09-17 Thread James Zhu
On 2018-09-17 02:07 PM, Christian König wrote: Don't try to unreserve a BO we doesn't allocated. Fixes: 07012fdd497e drm/amdgpu: don't allocate zero sized kernel BOs Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1

Re: [PATCH] drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

2018-09-17 Thread Tom St Denis
On 2018-09-17 2:08 p.m., Christian König wrote: Am 17.09.2018 um 20:07 schrieb Tom St Denis: Signed-off-by: Tom St Denis Reviewed-by: Christian König You was faster than me :) Been a while since I got a patch on the kernel side... need to keep up numbers :-) Tom ---  

Re: [PATCH] drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

2018-09-17 Thread Christian König
Am 17.09.2018 um 20:07 schrieb Tom St Denis: Signed-off-by: Tom St Denis Reviewed-by: Christian König You was faster than me :) --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: ttm crash on init

2018-09-17 Thread Tom St Denis
I've sent a patch to the list that fixes the bug on my end. Cheers, Tom On 2018-09-17 2:01 p.m., Tom St Denis wrote: On 2018-09-17 1:55 p.m., Christian König wrote: Am 17.09.2018 um 19:50 schrieb Tom St Denis: On 2018-09-17 1:45 p.m., Christian König wrote: Mhm, not the slightest idea.

Re: ttm crash on init

2018-09-17 Thread Christian König
Am 17.09.2018 um 20:01 schrieb Tom St Denis: On 2018-09-17 1:55 p.m., Christian König wrote: Am 17.09.2018 um 19:50 schrieb Tom St Denis: On 2018-09-17 1:45 p.m., Christian König wrote: Mhm, not the slightest idea. That nearly looks like adev->stolen_vga_memory already contains something.

[PATCH] drm/amdgpu: don't try to unreserve NULL pointer

2018-09-17 Thread Christian König
Don't try to unreserve a BO we doesn't allocated. Fixes: 07012fdd497e drm/amdgpu: don't allocate zero sized kernel BOs Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH] drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

2018-09-17 Thread Tom St Denis
Signed-off-by: Tom St Denis --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 84d82d5382f9..c1387efc0c91 100644 ---

Re: ttm crash on init

2018-09-17 Thread Tom St Denis
On 2018-09-17 1:55 p.m., Christian König wrote: Am 17.09.2018 um 19:50 schrieb Tom St Denis: On 2018-09-17 1:45 p.m., Christian König wrote: Mhm, not the slightest idea. That nearly looks like adev->stolen_vga_memory already contains something. Nope, [   51.564605]

Re: ttm crash on init

2018-09-17 Thread Christian König
Am 17.09.2018 um 19:50 schrieb Tom St Denis: On 2018-09-17 1:45 p.m., Christian König wrote: Mhm, not the slightest idea. That nearly looks like adev->stolen_vga_memory already contains something. Nope, [   51.564605] >>>adev->stolen_vga_memory == (null) [   51.564619] kasan:

Re: ttm crash on init

2018-09-17 Thread Tom St Denis
On 2018-09-17 1:45 p.m., Christian König wrote: Mhm, not the slightest idea. That nearly looks like adev->stolen_vga_memory already contains something. Nope, [ 51.564605] >>>adev->stolen_vga_memory == (null) [ 51.564619] kasan: CONFIG_KASAN_INLINE enabled [ 51.564877] kasan:

Re: ttm crash on init

2018-09-17 Thread Christian König
Mhm, not the slightest idea. That nearly looks like adev->stolen_vga_memory already contains something. Christian. Am 17.09.2018 um 18:47 schrieb Tom St Denis: On 2018-09-17 12:21 p.m., Tom St Denis wrote: (attached).  I'll try to bisect in a second.  Is anyone aware of this? Tom

Re: ttm crash on init

2018-09-17 Thread Tom St Denis
On 2018-09-17 12:21 p.m., Tom St Denis wrote: (attached).  I'll try to bisect in a second.  Is anyone aware of this? Tom Bisection led to: a327772a5655ff4fb104c8aae6515faa461df466 is the first bad commit commit a327772a5655ff4fb104c8aae6515faa461df466 Author: Christian König Date: Fri Sep

ttm crash on init

2018-09-17 Thread Tom St Denis
(attached). I'll try to bisect in a second. Is anyone aware of this? Tom [0.00] Linux version 4.19.0-rc1+ (root@raven) (gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC)) #29 SMP Fri Sep 14 07:30:30 EDT 2018 [0.00] Command line: BOOT_IMAGE=/vmlinuz-4.19.0-rc1+

RE: [PATCH 1/3] drm/amd/powerplay: update OD feature judgement

2018-09-17 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx On Behalf Of Evan > Quan > Sent: Monday, September 17, 2018 3:14 AM > To: amd-gfx@lists.freedesktop.org > Cc: Quan, Evan > Subject: [PATCH 1/3] drm/amd/powerplay: update OD feature judgement > > Update the conditions to judge whether an OD feature

RE: [PATCH 2/7] drm/amdgpu: fix up GDS/GWS/OA shifting

2018-09-17 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx On Behalf Of > Christian König > Sent: Saturday, September 15, 2018 3:52 AM > To: Alex Deucher > Cc: amd-gfx list > Subject: Re: [PATCH 2/7] drm/amdgpu: fix up GDS/GWS/OA shifting > > Am 14.09.2018 um 22:26 schrieb Alex Deucher: > > On Fri, Sep 14,

Re: [PATCH] drm/amd/dc: Trigger set power state task when display configuration changes

2018-09-17 Thread Francis, David
On Linux, the clocks are already set by the time that function call is reached. amdgpu_pm_compute clocks resets the clocks to their default value. From: Zhu, Rex Sent: September 17, 2018 4:12:33 AM To: Deucher, Alexander; Wentland, Harry; Francis, David Cc:

[PATCH 1/2] drm/amdgpu: update vram_info structure in atomfirmware.h

2018-09-17 Thread Hawking Zhang
atomfirmware has structure changes in varm_info. Updated it to the latest one. Change-Id: Ie5d60413e5db1dfb4aaf23dc94bc5fd4ed0a01cd Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 +- drivers/gpu/drm/amd/include/atomfirmware.h

[PATCH 2/2] drm/amdgpu: fix unknown vram mem type for vega20

2018-09-17 Thread Hawking Zhang
vega20 should use umc_info v3_3 instead of v3_1. There are serveral versions of umc_info for vega series. Compared to various versions of these structures, vram_info strucure is unified for vega series. The patch switch to query mem_type from vram_info structure for all the vega series dGPU.

Re: [PATCH 2/7] drm/amdgpu: fix up GDS/GWS/OA shifting

2018-09-17 Thread Christian König
Am 15.09.2018 um 09:52 schrieb Christian König: Am 14.09.2018 um 22:26 schrieb Alex Deucher: On Fri, Sep 14, 2018 at 3:12 PM Christian König wrote: That only worked by pure coincident. Completely remove the shifting and always apply correct PAGE_SHIFT. Signed-off-by: Christian König ---  

Re: [PATCH 4/7] drm/amdgpu: initialize GDS/GWS/OA domains even when they are zero sized

2018-09-17 Thread Christian König
Am 14.09.2018 um 22:14 schrieb Alex Deucher: On Fri, Sep 14, 2018 at 3:12 PM Christian König wrote: Stops crashing on SI. Signed-off-by: Christian König Presumably ttm allows this? Yes, actually explicitly tested this. Christian. Acked-by: Alex Deucher ---

[PATCH] list: introduce list_bulk_move_tail helper

2018-09-17 Thread Christian König
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. Signed-off-by: Christian König ---

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

2018-09-17 Thread Christian König
Am 17.09.2018 um 11:10 schrieb Huang Rui: On Fri, Sep 14, 2018 at 03:42:57PM +0200, 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

Re: [PATCH] drm/ttm: once more fix ttm_bo_bulk_move_lru_tail

2018-09-17 Thread Huang Rui
On Fri, Sep 14, 2018 at 05:22:16PM +0800, Michel Dänzer wrote: > On 2018-09-14 10:22 a.m., Huang Rui wrote: > > On Thu, Sep 13, 2018 at 07:32:24PM +0800, Christian König wrote: > >> Am 13.09.2018 um 10:31 schrieb Huang Rui: > >>> On Wed, Sep 12, 2018 at 09:23:55PM +0200, Christian König wrote: >

Re: [PATCH] [RFC]drm: add syncobj timeline support v5

2018-09-17 Thread zhoucm1
On 2018年09月17日 16:37, Christian König wrote: Am 14.09.2018 um 12:37 schrieb Chunming Zhou: This patch is for VK_KHR_timeline_semaphore extension, semaphore is called syncobj in kernel side: This extension introduces a new type of syncobj that has an integer payload identifying a point in a

Re: [PATCH 1/2] drm/amdgpu: add amdgpu_vm_entries_mask

2018-09-17 Thread Huang Rui
On Mon, Sep 17, 2018 at 05:00:42PM +0800, Christian König wrote: > Am 17.09.2018 um 10:52 schrieb Huang Rui: > > On Sat, Sep 15, 2018 at 10:05:40AM +0200, Christian König wrote: > >> We can't get the mask for the root directory from the number of entries. > >> > >> So add a new function to avoid

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

2018-09-17 Thread Huang Rui
On Fri, Sep 14, 2018 at 03:42:57PM +0200, 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 > - >

Re: [PATCH 1/2] drm/amdgpu: add amdgpu_vm_entries_mask

2018-09-17 Thread Christian König
Am 17.09.2018 um 10:52 schrieb Huang Rui: On Sat, Sep 15, 2018 at 10:05:40AM +0200, Christian König wrote: We can't get the mask for the root directory from the number of entries. So add a new function to avoid that problem. Signed-off-by: Christian König ---

Re: [PATCH 1/2] drm/amdgpu: add amdgpu_vm_entries_mask

2018-09-17 Thread Huang Rui
On Sat, Sep 15, 2018 at 10:05:40AM +0200, Christian König wrote: > We can't get the mask for the root directory from the number of entries. > > So add a new function to avoid that problem. > > Signed-off-by: Christian König > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 34 >

Re: [PATCH] [RFC]drm: add syncobj timeline support v5

2018-09-17 Thread Christian König
Am 14.09.2018 um 12:37 schrieb Chunming Zhou: This patch is for VK_KHR_timeline_semaphore extension, semaphore is called syncobj in kernel side: This extension introduces a new type of syncobj that has an integer payload identifying a point in a timeline. Such timeline syncobjs support the

RE: [PATCH] drm/amd/dc: Trigger set power state task when display configuration changes

2018-09-17 Thread Zhu, Rex
+Harry and David. Best Regards Rex From: Deucher, Alexander Sent: Friday, September 14, 2018 9:40 PM To: Zhu, Rex ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH] drm/amd/dc: Trigger set power state task when display configuration changes Acked-by: Alex Deucher

Re: [PATCH 2/2] drm/amdgpu: fix parameter documentation for amdgpu_vm_free_pts

2018-09-17 Thread Huang Rui
On Sat, Sep 15, 2018 at 10:05:41AM +0200, Christian König wrote: > The function was modified without updating the documentation. > > Signed-off-by: Christian König > --- Reviewed-by: Huang Rui > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [BUG] gpu: drm: amdgpu: Possible sleep-in-atomic-context bugs in amdgpu_uvd_ring_begin_use()

2018-09-17 Thread Jia-Ju Bai
On 2018/9/15 17:23, Koenig, Christian wrote: No, the problem is the function pointer analysis. In other words the KIQ ring is sometimes used in atomic and even interrupt context. But the UVD ring is never used in atomic context. But I don't see a way a static analysis could ever figure

Re: [BUG] gpu: drm: amdgpu: Possible sleep-in-atomic-context bugs in amdgpu_uvd_ring_begin_use()

2018-09-17 Thread Jia-Ju Bai
Sorry, I am still not clear why the call chain I proposed is incorrect... I find a conditional in amdgpu_mm_wreg(): if (!(acc_flags & AMDGPU_REGS_NO_KIQ) && amdgpu_sriov_runtime(adev)) return amdgpu_virt_kiq_wreg(adev, reg, v); Is amdgpu_virt_kiq_wreg() never called from WREG32()

[PATCH] amdgpu uses raw rlc_hdr values, causing kernel OOPS on big endian architectures

2018-09-17 Thread A. Wilcox
adev->gfx.rlc in gfx_v8_0_init_microcode has the values from rlc_hdr already processed by le32_to_cpu. Using the rlc_hdr values on big-endian machines causes a kernel Oops due to writing well outside of the array (0x2400 instead of 0x24). gfx_v9_0 had the same issue and was fixed in the same

Re: [BUG] gpu: drm: amdgpu: Possible sleep-in-atomic-context bugs in amdgpu_uvd_ring_begin_use()

2018-09-17 Thread Jia-Ju Bai
Thanks for your reply. On 2018/9/15 17:01, Koenig, Christian wrote: Sorry to say that but your analysis tool is buggy. The proposed call paths will never trigger. Could you please explain which piece of the call path is incorrect? I am not very sure of my function pointer analysis. Does

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-17 Thread Al Viro
On Fri, Sep 14, 2018 at 01:35:06PM -0700, Darren Hart wrote: > Acked-by: Darren Hart (VMware) > > As for a longer term solution, would it be possible to init fops in such > a way that the compat_ioctl call defaults to generic_compat_ioctl_ptrarg > so we don't have to duplicate this boilerplate

[BUG] gpu: drm: amdgpu: Possible sleep-in-atomic-context bugs in amdgpu_uvd_ring_begin_use()

2018-09-17 Thread Jia-Ju Bai
The driver may sleep with holding a spinlock. The function call paths (from bottom to top) in Linux-4.17 are: [FUNC] mutex_lock_nested drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c, 1477: mutex_lock_nested in amdgpu_dpm_enable_uvd drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c, 1154:

[PATCH] amdgpu/dcn10 : fix compile warning

2018-09-17 Thread Peng Hao
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In function ‘dcn10_update_mpcc’: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:1903:9: warning: missing braces around initializer [-Wmissing-braces] Signed-off-by: Peng Hao ---

[PATCH 3/3] drm/amd/powerplay: retrieve the updated clock table after OD

2018-09-17 Thread Evan Quan
With OD settings applied, the clock table will be updated accordingly. We need to retrieve the new clock tables then. Change-Id: Iad4e95d3f195a0217456d41e495730578209062b Signed-off-by: Evan Quan --- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c| 114 ++

[PATCH 2/3] drm/amd/powerplay: update OD to take voltage value instead of offset

2018-09-17 Thread Evan Quan
With the latest SMC fw, we are able to get the voltage value for specific frequency point. So, we update the OD relates to take absolute voltage instead of offset. Change-Id: I4ac8518f518cf3d70e59b16e3ea2102cd63c52d6 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c|

[PATCH 1/3] drm/amd/powerplay: update OD feature judgement

2018-09-17 Thread Evan Quan
Update the conditions to judge whether an OD feature should be supported on vega20. Change-Id: Iaabdd4db8f685fb94c960263fe38a21b36377aa2 Signed-off-by: Evan Quan --- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c| 81 +-- .../drm/amd/powerplay/hwmgr/vega20_pptable.h | 2 + 2