[PATCH][next] drm/amdgpu/df: fix potential array out-of-bounds read

2018-05-30 Thread Colin King
From: Colin Ian King The comparison with the number of elements in array df_v3_7_channel_number is off-by-one and can produce an array out-of-bounds read if fb_channel_number is equal to the number of elements of the array. Fix this by changing the comparison to >= instead of >. Detected by Cove

Re: [PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block is disabled

2018-05-30 Thread Deucher, Alexander
Reviewed-by: Alex Deucher From: amd-gfx on behalf of Shaoyun Liu Sent: Wednesday, May 30, 2018 6:05:21 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Shaoyun Subject: [PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block is disabled When PP b

[PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block is disabled

2018-05-30 Thread Shaoyun Liu
When PP block is disabled, return a fix value(100M) for mclk and sclk on bare-metal mode. This will cover the emulation mode as well. Change-Id: If34e3517b6cb6f31e898bbe7921485fbddb79fb9 Signed-off-by: Shaoyun Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 18 +++--- 1 file cha

Re: [PATCH 10/17] drm/amdgpu: add patch for fixing a known bug

2018-05-30 Thread Boyuan Zhang
On 2018-05-28 02:28 AM, Christian König wrote: Am 25.05.2018 um 17:33 schrieb Boyuan Zhang: On 2018-05-25 05:07 AM, Christian König wrote: Am 24.05.2018 um 22:15 schrieb boyuan.zh...@amd.com: From: Boyuan Zhang Allocate extra space in vcn jpeg ring buffer and store the jpeg ring patch

Re: [PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block is disabled

2018-05-30 Thread Deucher, Alexander
Actually, please include at least a basic patch description. Alex From: Deucher, Alexander Sent: Wednesday, May 30, 2018 5:28 PM To: Liu, Shaoyun; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block

Re: [PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block is disabled

2018-05-30 Thread Deucher, Alexander
Reviewed-by: Alex Deucher From: amd-gfx on behalf of Shaoyun Liu Sent: Wednesday, May 30, 2018 4:29:51 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Shaoyun Subject: [PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block is disabled Change-Id

[PATCH 04/18] drm/amdgpu: add more jpeg register offset headers

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add more jpeg registers defines that are needed for jpeg ring functions Signed-off-by: Boyuan Zhang --- .../drm/amd/include/asic_reg/vcn/vcn_1_0_offset.h| 20 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/amd/include/asic_reg/vcn/vcn

[PATCH 03/18] drm/amdgpu: add jpeg packet defines to soc15d.h

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add new packet for vcn jpeg, including condition checks, types and packet Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/soc15d.h | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15d.h b/drivers/gpu/drm/a

[PATCH 18/18] drm/amdgpu: add AMDGPU_HW_IP_VCN_JPEG to queue mgr

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_HW_IP_VCN_JPEG to queue mgr Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c inde

[PATCH 11/18] drm/amdgpu: add patch to jpeg ring

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add patch commands to jepg ring by calling set patch ring function. v2: remove modifications on max_dw, buf_mask and ptr_mask, since we are now using extra_dw for jpeg ring. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 7 +++ 1 file changed, 7

[PATCH 14/18] drm/amdgpu: add vcn jpeg ib test

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add an ib test for vcn jpeg. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 86 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- 3 files changed, 88 insertions(+), 1

[PATCH 16/18] uapi/drm: add AMDGPU_HW_IP_VCN_JPEG for jpeg CS

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_HW_IP_VCN_JPEG define for jpeg CS Signed-off-by: Boyuan Zhang --- include/uapi/drm/amdgpu_drm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index 5b007fa..eb8515d 100644 --- a/

[PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP block is disabled

2018-05-30 Thread Shaoyun Liu
Change-Id: If34e3517b6cb6f31e898bbe7921485fbddb79fb9 Signed-off-by: Shaoyun Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 887

[PATCH 08/18] drm/amdgpu: initialize vcn jpeg ring

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add implementations for vcn jpeg ring initialization Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_

[PATCH 06/18] drm/amdgpu: set jpeg ring functions

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Set all vcn jpeg ring function pointers. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 40 +++ 1 file changed, 40 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_

[PATCH 15/18] drm/amdgpu: enable vcn jpeg ib test

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Enable vcn jpeg ib ring test in amdgpu_ib.c Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index f70

[PATCH 17/18] drm/amdgpu: add AMDGPU_HW_IP_VCN_JPEG to info query

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_HW_IP_VCN_JPEG to info query Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index ca21549..0f1514

[PATCH 07/18] drm/amdgpu: add vcn jpeg irq support

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add vcn jpeg irq support. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index 8b29f47..076c49c 100644 --- a/driv

[PATCH 1/2] drm/scheduler: Avoid using wait_event_killable for dying process.

2018-05-30 Thread Andrey Grodzovsky
Dying process might be blocked from receiving any more signals so avoid using it. Also retire enity->fini_status and just check the SW queue, if it's not empty do the fallback cleanup. Also handle entity->last_scheduled == NULL use case which happens when HW ring is already hangged whem a new en

[PATCH 13/18] drm/amdgpu: add vcn jpeg ring test

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add a ring test for vcn jpeg. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 40 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 2 ++ drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- 3 files changed, 43 insertions(+),

[PATCH 09/18] drm/amdgpu: implement patch for fixing a known bug

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Implement a patch to maunally reset read pointer v2: using ring assignment instead of amdgpu_ring_write. adding comments for each steps in the patch function. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 92 +++ 1 f

[PATCH 2/2] drm/amdgpu: move amdgpu_ctx_mgr_entity_fini to f_ops flush hook.

2018-05-30 Thread Andrey Grodzovsky
With this we can now terminate jobs enqueue into SW queue the moment the task is being killed instead of waiting for last user of drm file to release it. Also stop checking for kref_read(&ctx->refcount) == 1 when calling drm_sched_entity_do_release since other task might still hold a reference to

[PATCH 10/18] drm/amdgpu: define and add extra dword for jpeg ring

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Define extra dword for jpeg ring. Jpeg ring will allocate extra dword to store the patch commands for fixing the known issue. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 + drivers/gpu/drm/amd/

[PATCH 05/18] drm/amdgpu: implement jpeg ring functions

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Implement all ring functions needed for jpeg ring v2: remove unnecessary mem read function. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 286 ++ 1 file changed, 286 insertions(+) diff --git a/drivers/gpu/drm/amd/am

[PATCH 12/18] drm/amdgpu: add vcn jpeg sw finish

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add software finish for vcn jpeg ring. v2: remove unnecessary scheduler entity. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgp

[PATCH 02/18] drm/amdgpu: add vcn jpeg ring

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add jpeg to amdgpu_vcn v2: remove unnecessary scheduler entity Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h inde

[PATCH 01/18] drm/amdgpu: define vcn jpeg ring

2018-05-30 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_RING_TYPE_VCN_JPEG ring define Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index

[PATCH] drm/amdgpu: add kernel DOC for ioctls in amdgpu_cs.c file

2018-05-30 Thread Leo Liu
There are four ioctls in this files, and DOC gives details of data structures for each of ioctls, and their functionalities. Signed-off-by: Leo Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 142 + 1 file changed, 142 insertions(+) diff --git a/drivers/gpu/drm/amd/amdg

Re: [PATCH v2 00/13] drm: Eliminate plane->fb/crtc usage for atomic drivers

2018-05-30 Thread Sinclair Yeh
Thanks Ville. This series: Reviewed-by: Sinclair Yeh On Fri, May 25, 2018 at 09:50:32PM +0300, Ville Syrjala wrote: > From: Ville Syrjälä > > Here are again the last (?) bits of eliminating the plane->fb/crtc > usage for atomic drivers. I've pushed everything else (thanks to > everyone who rev

Re: [PATCH] drm/amdgpu/display: check if ppfuncs exists before using it

2018-05-30 Thread Zhu, Rex
Reviewed-by: Rex Zhu Best Regards Rex From: amd-gfx on behalf of Alex Deucher Sent: Wednesday, May 30, 2018 10:37 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: [PATCH] drm/amdgpu/display: check if ppfuncs exists before using it Fixes

Re: [PATCH] drm/amd/display: avoid sleeping in atomic context while creating new context or state

2018-05-30 Thread Harry Wentland
On 2018-05-30 06:17 AM, Shirish S wrote: > This patch fixes the warning messages that are caused due to calling > sleep in atomic context as below: > > BUG: sleeping function called from invalid context at mm/slab.h:419 > in_atomic(): 1, irqs_disabled(): 1, pid: 5, name: kworker/u4:0 > CPU: 1 PID:

Re: [PATCH] drm/amdgpu: replace mutex with spin_lock

2018-05-30 Thread Christian König
Keep in mind that under SRIOV you can read registers while in atomic context, e.g. while holding a spinlock. Please double check if that won't bite us. Apart from that the change looks good to me, Christian. Am 30.05.2018 um 12:19 schrieb Shirish S: mutex's lead to sleeps which should be avoi

RE: [PATCH] drm/amdgpu/pp: replace mutex with spin_lock

2018-05-30 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Shirish S > Sent: Wednesday, May 30, 2018 6:21 AM > To: amd-gfx@lists.freedesktop.org; Wentland, Harry > ; Zhu, Rex > Cc: S, Shirish > Subject: [PATCH] drm/amdgpu/pp: replace mutex with spin

RE: [PATCH] drm/amdgpu: replace mutex with spin_lock

2018-05-30 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Shirish S > Sent: Wednesday, May 30, 2018 6:20 AM > To: amd-gfx@lists.freedesktop.org; Wentland, Harry > ; Zhu, Rex > Cc: S, Shirish > Subject: [PATCH] drm/amdgpu: replace mutex with spin_lo

RE: [PATCH] drm/amdgpu: avoid sleep while executing atombios table

2018-05-30 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Shirish S > Sent: Wednesday, May 30, 2018 6:19 AM > To: amd-gfx@lists.freedesktop.org; Wentland, Harry > ; Zhu, Rex > Cc: S, Shirish > Subject: [PATCH] drm/amdgpu: avoid sleep while executin

[PATCH] drm/amdgpu/display: check if ppfuncs exists before using it

2018-05-30 Thread Alex Deucher
Fixes a crash on asics without powerplay yet (e.g., vega20). Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c b/drivers/gpu/dr

Re: [PATCH] drm/amd/pp: Allow underclocking when od table is empty in vbios

2018-05-30 Thread Deucher, Alexander
Reviewed-by: Alex Deucher From: amd-gfx on behalf of Rex Zhu Sent: Wednesday, May 30, 2018 5:00:08 AM To: amd-gfx@lists.freedesktop.org Cc: Zhu, Rex Subject: [PATCH] drm/amd/pp: Allow underclocking when od table is empty in vbios if the max od engine clock lim

Re: [PATCH] drm/amdgpu: detect buffer overflow and avoid unnecessary dereference

2018-05-30 Thread Huang Rui
On Tue, May 29, 2018 at 06:17:59PM +0800, Evan Quan wrote: > Change-Id: Id7dcf60acf524f290460d2ffe3f1f5f46354 Need a commit log even it is very short. > Signed-off-by: Evan Quan > --- > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +-- > 1 file changed, 9 insertions(+), 6 deletion

[PATCH] drm/amdgpu/pp: replace mutex with spin_lock

2018-05-30 Thread Shirish S
This patch replaces usage of mutex with spin_lock to avoid sleep in atomic context. Signed-off-by: Shirish S --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 152 +- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 +- 2 files changed, 77 insertions(+), 77 deletions

[PATCH] drm/amdgpu: replace mutex with spin_lock

2018-05-30 Thread Shirish S
mutex's lead to sleeps which should be avoided in atomic context. Hence this patch replaces it with the spin_locks. Signed-off-by: Shirish S --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +- drivers/gpu/drm/amd/amdgpu/atom.c| 4 ++-- drivers/gpu/drm/amd/amdgpu/atom.h

[PATCH] drm/amdgpu: avoid sleep while executing atombios table

2018-05-30 Thread Shirish S
This patch replaces kzalloc's flag from GFP_KERNEL to GFP_ATOMIC to avoid sleeping in atomic context. Signed-off-by: Shirish S --- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amd/display: avoid sleeping in atomic context while creating new context or state

2018-05-30 Thread Shirish S
This patch fixes the warning messages that are caused due to calling sleep in atomic context as below: BUG: sleeping function called from invalid context at mm/slab.h:419 in_atomic(): 1, irqs_disabled(): 1, pid: 5, name: kworker/u4:0 CPU: 1 PID: 5 Comm: kworker/u4:0 Tainted: GW 4.14.

[PATCH] drm/amd/pp: Allow underclocking when od table is empty in vbios

2018-05-30 Thread Rex Zhu
if the max od engine clock limit and memory clock limit are not set in vbios. driver will allow underclocking instand of disable od feature completely. Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | 6 -- drivers/gpu/drm/amd/powerplay/hwmgr/processp

Re: [PATCH] drm/amdgpu: detect buffer overflow and avoid unnecessary dereference

2018-05-30 Thread Christian König
Am 30.05.2018 um 06:20 schrieb Quan, Evan: Maybe this should be a WARN_ON and then we clamp the range? According to the spec, it should store all indirect_start_offsets into the array. And the current array should be enough. So, if overflow occurred, it should be a bug case and BUG_ON seems mo