[PATCH] drm/amdgpu: Replace kzalloc with kcalloc

2019-01-14 Thread Gustavo A. R. Silva
Replace kzalloc() function with its 2-factor argument form, kcalloc(). This patch replaces cases of: kzalloc(a * b, gfp) with: kcalloc(a, b, gfp) Also, improve the coding style and the use of sizeof during allocation by changing sizeof(struct dc_surface_update) and sizeof(struct

RE: [PATCH 4/4] drm/amd/powerplay: support retrieving and adjusting dcefclock power levels

2019-01-14 Thread Quan, Evan
For ppfeatures, it will be seen only if (adev->asic_type >= CHIP_VEGA10 && !APU). Regards, Evan > -Original Message- > From: Quan, Evan > Sent: Tuesday, January 15, 2019 2:44 PM > To: Alex Deucher > Cc: amd-gfx list ; Deucher, Alexander > > Subject: RE: [PATCH 4/4] drm/amd/powerplay: su

RE: [PATCH 4/4] drm/amd/powerplay: support retrieving and adjusting dcefclock power levels

2019-01-14 Thread Quan, Evan
I think we can use asic_type to determine whether to expose these new interfaces. If (adev->asic_type >= CHIP_VEGA10), socclk and dcefclk are OK to expose If (adev->asic_type >= CHIP_VEGA20), fclk is OK to expose Regards, Evan > -Original Message- > From: Alex Deucher > Sent: Tuesday, Ja

RE: [[PATCH v2]drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Liu, Aaron
Hi Paul, The psp code only support ucode loading at the beginning, but forgot to remove the checking when more and more PSP command get into PSP. So some old PSP FW maybe have problem but PSP driver didn’t find it out. If reverting the patch, we also can’t find out wrong PSP FW and have big pro

RE: [PATCH] drm/amdgpu: csa_vaddr should not larger than AMDGPU_GMC_HOLE_START

2019-01-14 Thread Liu, Monk
The max_pfn is now 1'''' (bytes) which is above 48 bit now, and it with AMDGPU_GMC_HOLE_MASK make it to zero And in code "amdgpu_driver_open_kms()" I saw @Zhu, Rex write the code as : "csa_addr = amdgpu_csa_vadr(adev) & AMDGPU_GMC_HOLE_MASK", I think this is wrong since you

答复: [PATCH] drm/amdgpu/soc15: return proper error codes in baco reset

2019-01-14 Thread Qu, Jim
Reviewed-by: JimQu Thanks JimQu 发件人: amd-gfx 代表 Alex Deucher 发送时间: 2019年1月15日 3:57:56 收件人: amd-gfx@lists.freedesktop.org 抄送: Deucher, Alexander 主题: [PATCH] drm/amdgpu/soc15: return proper error codes in baco reset Rather than just -1. Signed-off-by:

[PATCH] drm/amdgpu: Setting doorbell range registers earlier

2019-01-14 Thread Zeng, Oak
HW doorbell writing routing policy: writing to doorbell not in SDMA/IH/MM/ACV doorbell range will be routed to CP. So CP doorbell routing depends on doorbell range setting of above blocks. Setting doorbell range of above blocks earlier (soc15_common_hw_init) to make sure CP doorbell writing be rout

[PATCH] drm/amd/display: eDP fast bootup does not work for pre-raven asic

2019-01-14 Thread sunpeng.li
From: hersen wu [Why] bios will light up eDP before sw driver loaded. sw driver will check if eDP lighted up by bios by reading BIOS_SCRATCH_3. If yes, sw driver will not power down eDP power, phy to save time. definition of BIOS_SCRATCH_3 are missed for pre-raven asic. this cuase eDP fast boot u

[PATCH] drm: radeon: annotate implicit fall through

2019-01-14 Thread Mathieu Malaterre
There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1). This commit remove the following warning: drivers/gpu/drm/radeon/evergreen_cs.c:1301:11: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Mathi

[PATCH] drm/amdgpu/soc15: return proper error codes in baco reset

2019-01-14 Thread Alex Deucher
Rather than just -1. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index 5248b03df5fa..7130a4c8dd5f 100644 --- a/drivers/gpu/d

Re: amdgpu/TTM oopses since merging swiotlb_dma_ops into the dma_direct code

2019-01-14 Thread Sibren Vasse
On Mon, 14 Jan 2019 at 19:13, Christoph Hellwig wrote: > > Hmm, I wonder if we are not actually using swiotlb in the end, > can you check if your dmesg contains this line or not? > > PCI-DMA: Using software bounce buffering for IO (SWIOTLB) This line does not appear in my dmesg. > > If not I gues

Re: amdgpu/TTM oopses since merging swiotlb_dma_ops into the dma_direct code

2019-01-14 Thread Sibren Vasse
On Mon, 14 Jan 2019 at 19:10, Christoph Hellwig wrote: > > On Thu, Jan 10, 2019 at 06:52:26PM +0100, Sibren Vasse wrote: > > On Thu, 10 Jan 2019 at 15:48, Christoph Hellwig wrote: > > > > > > On Thu, Jan 10, 2019 at 03:00:31PM +0100, Christian König wrote: > > > >> From the trace it looks like w

Re: amdgpu/TTM oopses since merging swiotlb_dma_ops into the dma_direct code

2019-01-14 Thread Christoph Hellwig
On Thu, Jan 10, 2019 at 06:52:26PM +0100, Sibren Vasse wrote: > On Thu, 10 Jan 2019 at 15:48, Christoph Hellwig wrote: > > > > On Thu, Jan 10, 2019 at 03:00:31PM +0100, Christian König wrote: > > >> From the trace it looks like we git the case where swiotlb tries > > >> to copy back data from a b

Re: amdgpu/TTM oopses since merging swiotlb_dma_ops into the dma_direct code

2019-01-14 Thread Christoph Hellwig
Hmm, I wonder if we are not actually using swiotlb in the end, can you check if your dmesg contains this line or not? PCI-DMA: Using software bounce buffering for IO (SWIOTLB) If not I guess we found a bug in swiotlb exit vs is_swiotlb_buffer, and you can try this patch: diff --git a/kernel/dma/

Re: [PATCH] drm/amd/display: Skip create new stream if crtc state doesn't change

2019-01-14 Thread Kazlauskas, Nicholas
On 1/14/19 1:41 PM, Jerry (Fangzhi) Zuo wrote: > Need to check if crtc state is changed so that mode set is > required before trying to create new stream. > > It deals with the MST hotplug use case when plug back to the > same connector where the failure to create new stream for the > inactive crt

[PATCH] drm/amd/display: Skip create new stream if crtc state doesn't change

2019-01-14 Thread Jerry (Fangzhi) Zuo
Need to check if crtc state is changed so that mode set is required before trying to create new stream. It deals with the MST hotplug use case when plug back to the same connector where the failure to create new stream for the inactive crtc state. Simply skip the check for the old connector and go

Re: [PATCH] drm/amd/display: Include names of all PP clock types

2019-01-14 Thread Alex Deucher
On Sun, Jan 13, 2019 at 8:24 AM Rafał Miłecki wrote: > > From: Rafał Miłecki > > This fixes printing clock names in cases like: > [5.352311] [drm] DM_PPLIB: values for Invalid clock > [5.352313] [drm] DM_PPLIB: 40 in kHz > [5.352313] [drm] DM_PPLIB: 933000 in kHz > [5.3523

Re: pitch alignment questions

2019-01-14 Thread Michel Dänzer
On 2019-01-11 10:37 p.m., Yu Zhao wrote: > On Fri, Jan 11, 2019 at 04:27:44PM +0100, Michel Dänzer wrote: >> On 2019-01-10 6:56 p.m., Przemek Socha wrote: >>> >>> [ 147.846148] [drm:amdgpu_display_user_framebuffer_create [amdgpu]] >>> Invalid >>> pitch: expecting 10752 but got 10624 >>> [ 147.8

Re: amdgpu/TTM oopses since merging swiotlb_dma_ops into the dma_direct code

2019-01-14 Thread Michel Dänzer
On 2019-01-10 3:48 p.m., Christoph Hellwig wrote: > On Thu, Jan 10, 2019 at 03:00:31PM +0100, Christian König wrote: >>> From the trace it looks like we git the case where swiotlb tries >>> to copy back data from a bounce buffer, but hits a dangling or NULL >>> pointer. So a couple questions for

Re: [PATCH 4/4] drm/amd/powerplay: support retrieving and adjusting dcefclock power levels

2019-01-14 Thread Alex Deucher
On Mon, Jan 14, 2019 at 5:02 AM Evan Quan wrote: > > User can use "pp_dpm_dcefclk" to retrieve and adjust dcefclock power > levels. > > Change-Id: Ia3f61558ca96104c88d129ba5194103b2fe702ec > Signed-off-by: Evan Quan We should probably find a way to hide these new files on asics which don't suppo

Re: [PATCH] drm/ttm: stop always moving BOs on the LRU on page fault

2019-01-14 Thread Michel Dänzer
On 2019-01-11 8:12 p.m., Christian König wrote: > Am 11.01.19 um 15:17 schrieb Michel Dänzer: >> On 2019-01-11 2:15 p.m., Christian König wrote: >>> Move the BO on the LRU only when it is actually moved by a DMA >>> operation. >>> >>> [...] >>> >>> @@ -177,6 +175,13 @@ static vm_fault_t ttm_bo_vm_f

Re: [PATCH] drm/amd/display: Skip create new stream if crtc state doesn't change

2019-01-14 Thread Kazlauskas, Nicholas
On 1/14/19 11:05 AM, Jerry (Fangzhi) Zuo wrote: > Need to check if crtc state is changed so that mode set is > required before trying to create new stream. > > It deals with the MST hotplug use case when plug back to the > same connector where the failure to create new stream for the > inactive cr

[PATCH] drm/amd/display: Skip create new stream if crtc state doesn't change

2019-01-14 Thread Jerry (Fangzhi) Zuo
Need to check if crtc state is changed so that mode set is required before trying to create new stream. It deals with the MST hotplug use case when plug back to the same connector where the failure to create new stream for the inactive crtc state. Simply skip the check for the old connector and go

Re: [PATCH] drm/amd: fix typo

2019-01-14 Thread Alex Deucher
Applied. thanks. Alex On Mon, Jan 7, 2019 at 8:06 AM Matteo Croce wrote: > > Fix spelling mistake: "lenght" -> "length" > > Signed-off-by: Matteo Croce > --- > drivers/gpu/drm/amd/include/atombios.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/i

Re: [PATCH 3/3] drm/amdgpu: replace get_user_pages with HMM address mirror helpers v6

2019-01-14 Thread Yang, Philip
Ping Christian, any comments for the GEM and CS part changes? Thanks. Philip On 2019-01-10 12:02 p.m., Yang, Philip wrote: > Use HMM helper function hmm_vma_fault() to get physical pages backing > userptr and start CPU page table update track of those pages. Then use > hmm_vma_range_done() to che

Re: [[PATCH v2]drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Paul Menzel
Dear Aaron, Am 14.01.19 um 09:47 schrieb Aaron Liu: In some cases, psp response status is not 0 even there is no problem while the command is submitted. Some version of PSP FW doesn't write 0 to that field. So here we would like to only print a warning instead of an error during psp initializat

Re: [PATCH] drm/amdgpu: csa_vaddr should not larger than AMDGPU_GMC_HOLE_START

2019-01-14 Thread Christian König
Am 14.01.19 um 09:40 schrieb wentalou: After removing unnecessary VM size calculations, vm_manager.max_pfn would reach 0x10,, max_pfn << AMDGPU_GPU_PAGE_SHIFT exceeding AMDGPU_GMC_HOLE_START would caused GPU reset. Change-Id: I47ad0be2b0bd9fb7490c4e1d7bb7bdacf71132cb Signed-off-by: wenta

Re: [PATCH 2/2] drm/amdgpu: set bulk_moveable to false when lru changed v2

2019-01-14 Thread Koenig, Christian
Am 14.01.19 um 08:02 schrieb Chunming Zhou: > if lru is changed, we cannot do bulk moving. > v2: > root bo isn't bulk moving, skip its change. > > Change-Id: Ide0fe920295cc25f7cabcf41a6400519e5783f2a > Signed-off-by: Chunming Zhou We could now remove all other cases where we set bulk_movable to f

Re: [PATCH 1/2] drm/ttm: add lru notify to bo driver v2

2019-01-14 Thread Koenig, Christian
Am 14.01.19 um 08:02 schrieb Chunming Zhou: > allow driver do somethings when lru changed. > v2: > address Michel's comments. > > Change-Id: Ie82053da49272881d4b52b1c406f7c221a3fcadf > Signed-off-by: Chunming Zhou Reviewed-by: Christian König > --- > drivers/gpu/drm/ttm/ttm_bo.c| 11 +

Re: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Christian König
Am 14.01.19 um 09:16 schrieb Aaron Liu: Don't return err if psp reponse status isn't zero Change-Id: I680679983f972b6969f4949f1faafaf17fe996a6 Signed-off-by: Aaron Liu Thanks for taking care of that. Fix is Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +

[PATCH 4/4] drm/amd/powerplay: support retrieving and adjusting dcefclock power levels

2019-01-14 Thread Evan Quan
User can use "pp_dpm_dcefclk" to retrieve and adjust dcefclock power levels. Change-Id: Ia3f61558ca96104c88d129ba5194103b2fe702ec Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c| 53 ++- .../gpu/drm/amd/include/kgd_pp_interface.h| 1 + .../drm/amd

[PATCH 2/4] drm/amd/powerplay: support retrieving and adjusting SOC clock power levels

2019-01-14 Thread Evan Quan
User can use "pp_dpm_socclk" to retrieve and adjust SOC clock power levels. Change-Id: I24d2f1df2dcf6b8dfa188f82767b36624610406f Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c| 49 ++- .../gpu/drm/amd/include/kgd_pp_interface.h| 1 + .../drm/amd/

[PATCH 3/4] drm/amd/powerplay: support retrieving and adjusting fclock power levels

2019-01-14 Thread Evan Quan
User can use "pp_dpm_fclk" to retrieve and adjust fclock power levels. Change-Id: Ib5325a9533b5fe8c125738a2f26e7b976d3ec991 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c| 49 +- .../gpu/drm/amd/include/kgd_pp_interface.h| 1 + .../drm/amd/powerplay/

[PATCH 1/4] drm/amd/powerplay: support enabled ppfeatures retrieving and setting

2019-01-14 Thread Evan Quan
User can use "ppfeatures" sysfs interface to retrieve and set enabled powerplay features. Change-Id: I00d5b4931ab426b506e1c187f81a279b00afbb66 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 8 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c| 66 +++ ...

RE: [PATCH] drm/amdgpu: csa_vaddr should not larger than AMDGPU_GMC_HOLE_START

2019-01-14 Thread Liu, Monk
Good catch, patch is Reviewed-by: Monk Liu -Original Message- From: amd-gfx On Behalf Of wentalou Sent: Monday, January 14, 2019 4:41 PM To: amd-gfx@lists.freedesktop.org Cc: Lou, Wentao Subject: [PATCH] drm/amdgpu: csa_vaddr should not larger than AMDGPU_GMC_HOLE_START After removin

[[PATCH v2]drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Aaron Liu
In some cases, psp response status is not 0 even there is no problem while the command is submitted. Some version of PSP FW doesn't write 0 to that field. So here we would like to only print a warning instead of an error during psp initialization to avoid breaking hw_init and it doesn't return -EIN

[PATCH] drm/amdgpu: csa_vaddr should not larger than AMDGPU_GMC_HOLE_START

2019-01-14 Thread wentalou
After removing unnecessary VM size calculations, vm_manager.max_pfn would reach 0x10,, max_pfn << AMDGPU_GPU_PAGE_SHIFT exceeding AMDGPU_GMC_HOLE_START would caused GPU reset. Change-Id: I47ad0be2b0bd9fb7490c4e1d7bb7bdacf71132cb Signed-off-by: wentalou --- drivers/gpu/drm/amd/amdgpu/amdg

RE: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Xu, Feifei
Reviewed-by: Feifei Xu -Original Message- From: amd-gfx On Behalf Of Huang, Ray Sent: Monday, January 14, 2019 4:28 PM To: Liu, Aaron ; amd-gfx@lists.freedesktop.org; Yu, Xiangliang ; Deucher, Alexander ; Zhang, Hawking Cc: Liu, Aaron ; Koenig, Christian Subject: RE: [PATCH drm/amdgp

RE: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Yu, Xiangliang
Please add more comments to explain why don't return error. And add my RB with that fix. Reviewed-by: Xiangliang Yu -Original Message- From: amd-gfx On Behalf Of Aaron Liu Sent: Monday, January 14, 2019 4:17 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Aaron Subject: [PATCH drm/amdgpu/

RE: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Huang, Ray
Is some cases, response status is not 0 even there is no problem while the command is submitted. Some version of PSP FW doesn't write 0 to that field. So here we would like to only print a warning instead of an error during psp initialization to avoid breaking hw_init. Reviewed-by: Huang Rui

[PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

2019-01-14 Thread Aaron Liu
Don't return err if psp reponse status isn't zero Change-Id: I680679983f972b6969f4949f1faafaf17fe996a6 Signed-off-by: Aaron Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/driv