Re: [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-02-08 Thread Chunming Zhou
On 2018年02月08日 17:13, Chunming Zhou wrote: On 2018年02月08日 17:01, Michel Dänzer wrote: Hi David, this change completely broke radeonsi due to memory management errors (see valgrind output for glxgears below), so I had to revert it. ok, I will look into what happens. Sorry for broken. The p

RE: [PATCH 3/4] drm/ttm: add input parameter force_alloc for ttm_bo_evict_mm

2018-02-08 Thread He, Roger
I can't think of an use case when we don't want this to succeed. That is true. seems I can simplify more here. Thanks Roger(Hongbo.He) -Original Message- From: Koenig, Christian Sent: Thursday, February 08, 2018 8:58 PM To: He, Roger ; amd-gfx@lists.freedesktop.org; dri-de...@li

[PATCH 3/3] drm/radeon: only enable swiotlb path when need v2

2018-02-08 Thread Chunming Zhou
swiotlb expands our card accessing range, but its path always is slower than ttm pool allocation. So add condition to use it. v2: move a bit later Change-Id: I1802645833155a9cd808913f863981173a82145f Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu Reviewed-by: Christian König --- drivers/gp

[PATCH 1/3] drm: add func to get max iomem address v2

2018-02-08 Thread Chunming Zhou
it will be used to check if the driver needs swiotlb v2: Don't use inline, instead, move function to drm_memory.c (Mechel Daenzer ) Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu Reviewed-by: Christian König --- drivers/gpu/drm/drm_memo

[PATCH 2/3] drm/amdgpu: only enable swiotlb alloc when need v2

2018-02-08 Thread Chunming Zhou
get the max io mapping address of system memory to see if it is over our card accessing range. v2: move checking later Change-Id: Ibc38dbd34a20af5b4a4b1ed154c14e1c58aa4c55 Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h

Re: [PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment

2018-02-08 Thread Matthias Kaehlcke
El Thu, Feb 08, 2018 at 04:44:21PM -0500 Harry Wentland ha dit: > On 2018-02-08 04:03 PM, Harry Wentland wrote: > > On 2018-02-08 03:53 PM, Matthias Kaehlcke wrote: > >> calcs uses the compiler option -mpreferred-stack-boundary=4 to configure > >> a stack alignment of 16 bytes. Clang uses the opti

Re: [PATCH] drm/amd/display: Remove unused CFLAGS entry in DML Makefile

2018-02-08 Thread Deucher, Alexander
Acked-by: Alex Deucher From: amd-gfx on behalf of Harry Wentland Sent: Thursday, February 8, 2018 4:47:28 PM To: amd-gfx@lists.freedesktop.org Cc: Wentland, Harry Subject: [PATCH] drm/amd/display: Remove unused CFLAGS entry in DML Makefile Missed that with a p

[PATCH] drm/amdkfd: Delete an error message for a failed memory allocation in kfd_topology_init()

2018-02-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Feb 2018 22:23:57 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 1 - 1 file changed, 1 dele

[PATCH] drm/amd/display: Remove unused CFLAGS entry in DML Makefile

2018-02-08 Thread Harry Wentland
Missed that with a previous change that removed unused files. Signed-off-by: Harry Wentland --- drivers/gpu/drm/amd/display/dc/dml/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile index 0271043c

Re: [PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment

2018-02-08 Thread Harry Wentland
On 2018-02-08 04:03 PM, Harry Wentland wrote: > On 2018-02-08 03:53 PM, Matthias Kaehlcke wrote: >> calcs uses the compiler option -mpreferred-stack-boundary=4 to configure >> a stack alignment of 16 bytes. Clang uses the option -mstack-alignment >> instead, which expects as parameter the alignment

Re: [PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment

2018-02-08 Thread Harry Wentland
On 2018-02-08 03:53 PM, Matthias Kaehlcke wrote: > calcs uses the compiler option -mpreferred-stack-boundary=4 to configure > a stack alignment of 16 bytes. Clang uses the option -mstack-alignment > instead, which expects as parameter the alignment in bytes, and not a > power of two like -mpreferre

[PATCH v3 1/4] amdgpu/dc/dml: Consolidate redundant CFLAGS

2018-02-08 Thread Matthias Kaehlcke
Use a variable for common CFLAGS instead of specifying the same flags for every source file. Signed-off-by: Matthias Kaehlcke --- Changes in v3: - Use variable for compiler options instead of subdir-ccflags-y drivers/gpu/drm/amd/display/dc/dml/Makefile | 17 + 1 file changed, 9

[PATCH v3 3/4] amdgpu/dc/dml: Support clang option for stack alignment

2018-02-08 Thread Matthias Kaehlcke
DML uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary. Probe for both compiler options and use

[PATCH v3 2/4] amdgpu/dc/calcs: Consolidate redundant CFLAGS

2018-02-08 Thread Matthias Kaehlcke
Use a variable for common CFLAGS instead of specifying the same flags for every source file. Signed-off-by: Matthias Kaehlcke --- Changes in v3: - patch added drivers/gpu/drm/amd/display/dc/calcs/Makefile | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/dr

[PATCH v3 4/4] amdgpu/dc/calcs: Support clang option for stack alignment

2018-02-08 Thread Matthias Kaehlcke
calcs uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary. Probe for both compiler options and us

[PATCH 3/3] drm/amd/powerplay/hwmgr: Delete an unnecessary return statement in three functions

2018-02-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Feb 2018 21:10:58 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: void function return statements are not generally useful Thus remove such a statement in the affected functions. Signed-off-by: Markus Elfring --- drivers

[PATCH 0/3] drm/amd/powerplay/hwmgr: Adjustments for eight function implementations

2018-02-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Feb 2018 21:37:42 +0100 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete an error message for a failed memory allocation in three functions Adjust layout for source code from five if statements D

[PATCH 1/3] drm/amd/powerplay/hwmgr: Delete an error message for a failed memory allocation in three functions

2018-02-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Feb 2018 20:32:39 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 4 +--- drivers/gpu/

[PATCH 2/3] drm/amd/powerplay/hwmgr: Adjust layout for source code from five if statements

2018-02-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Feb 2018 21:01:24 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: Comparisons should place the constant on the right side of the test WARNING: else is not generally useful after a break or return Thus fix the affected sourc

Re: [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS

2018-02-08 Thread Matthias Kaehlcke
El Thu, Feb 08, 2018 at 09:33:53AM -0500 Harry Wentland ha dit: > On 2018-02-07 08:51 PM, Matthias Kaehlcke wrote: > > Use subdir-ccflags instead of specifying the same flags for every source > > file. > > > > Signed-off-by: Matthias Kaehlcke > > Reviewed-by: Guenter Roeck > > --- > > Changes i

Re: [PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Eric Huang
Is the switching automatically by driver or manually by user? Regards, Eric On 2018-02-08 11:54 AM, Zhu, Rex wrote: >In case of compute, we have auto switching mechanism. when compute ring is coming, it switches to the default compute profile or user set profile, >and switches back when i

Re: [PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Zhu, Rex
>In case of compute, we have auto switching mechanism. when compute ring is >coming, it switches to the default compute profile or user set profile, >and >switches back when it's done. So VR should be doing the same thing with >compute. Auto wattman will be disabled when profile auto switching >

Re: [PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Eric Huang
On 2018-02-08 11:35 AM, Zhu, Rex wrote: >But in auto mode, we may want to force a particular profile within the >driver for a specific use case.  E.g., for VR, we may want to select >the VR profile when the user sets the priority to high in the context >ioctl, and then switch it back to autowa

Re: [PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Zhu, Rex
>But in auto mode, we may want to force a particular profile within the >driver for a specific use case. E.g., for VR, we may want to select >the VR profile when the user sets the priority to high in the context >ioctl, and then switch it back to autowattman or the default profile >when the contex

Re: [PATCH] drm/amdgpu: add new device to use atpx quirk

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:46 AM, Kai-Heng Feng wrote: > The affected system (0x0813) is pretty similar to another one (0x0812), > it also needs to use ATPX power control. > > Signed-off-by: Kai-Heng Feng Applied. thanks! Alex > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 1 + > 1

Re: [PATCH 04/10] drm/amd/pp: Implement update_dpm_settings on Polaris

2018-02-08 Thread Eric Huang
Again, it still has risk when updating smc table without calling smu7_freeze/unfreeze_sclk_mclk_dpm(). Regards, Eric On 2018-02-08 04:14 AM, Rex Zhu wrote: Change-Id: I4533826ef6e18df125ae4445016873be3b5fe0ce Signed-off-by: Rex Zhu --- .../drm/amd/powerplay/smumgr/polaris10_smumgr.c| 1

Re: [PATCH] drm/amd/pp: Expose new interface to DC to ctrl auto wattman

2018-02-08 Thread Zhu, Rex
Thanks Harry for clarify this question thoroughly. >We'll still need a patch to call this interface from DC. Is that on your plate >or is this something we should hook up? No, I just implemented the interface in pp. DC need to call this function to enable/disable the auto wattman feature when

Re: [PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 10:14 AM, Zhu, Rex wrote: > if user select manual dpm mode,we will disabe autowattman. > When switch to auto, we will restart the auto wattman on Polaris, > Restore to default profile mode on other ASICS. > But in auto mode, we may want to force a particular profile within

Re: [PATCH] drm/amd/pp: Expose new interface to DC to ctrl auto wattman

2018-02-08 Thread Harry Wentland
On 2018-02-08 10:10 AM, Harry Wentland wrote: > On 2018-02-08 10:07 AM, Zhu, Rex wrote: >> when autowattman enabled,we will update uphyst/downhyst/min-sclk/mclk >> activity  value to smu based on the workload. >> > > Why is this incompatible with Freesync? > Just had a chat with the Windows guy

Re: [PATCH v2 09/10] drm/amd/pp: Restore power profile mode in auto dpm level on smu7

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 6:19 AM, Rex Zhu wrote: > v2: cancel or wait current work finish before restart auto wattman. > > Disable auto wattman feature in manual mode if feature is enabled > Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher > > Change-Id: I4361d16df27d2666dd978c3e33e05c020d65fe6a

Re: [PATCH v2 08/10] drm/amd/pp: Implement auto wattman feature on Smu7

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 6:18 AM, Rex Zhu wrote: > v2: refine work queue name. > > Change-Id: I2521d83cbea9b3418bed63de86cf93deafaab3fb > Signed-off-by: Rex Zhu Please provide a patch description. With that fixed: Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c

Re: [PATCH 07/10] drm/amd/pp: Add new hw interface for auto wattman feature.

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > Change-Id: Ib34c2815ab95890ba91f9a61bc0594b0f5e0c3fd > Signed-off-by: Rex Zhu Please provide a patch description. With that fixed: Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 ++ > 1 file changed, 2 insertio

Re: [PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Zhu, Rex
if user select manual dpm mode,we will disabe autowattman. When switch to auto, we will restart the auto wattman on Polaris, Restore to default profile mode on other ASICS. Best Regards Rex From: Alex Deucher Sent: Thursday, February 8, 2018 11:02:21 PM To: Zhu,

Re: [PATCH 06/10] drm/amd/pp: Implement set_power_profile_mode on smu7

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > User can set smu7 dpm pamameters through sysfs > > Depending on the workloads, > user can echo "0/1/2/3/4">pp_power_profile_mode > to select 3D_FULL_SCREEN/POWER_SAVING/VIDEO/VR/COMPUTE > mode. > > echo "5 * * * * * * * *">pp_power_profile_mode > to

Re: [PATCH 05/10] drm/amd/pp: Implement get_power_profile_mode on smu7

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > It show what parameters can be setted on smu7(vi/ci asics) > to get better performance. > > Also show some profiling modes, user can select directly > by serial number based on workloads. > > cat pp_power_profile_mode > NUMMODE_NAME SCLK

Re: [PATCH] drm/amd/pp: Expose new interface to DC to ctrl auto wattman

2018-02-08 Thread Harry Wentland
On 2018-02-08 10:07 AM, Zhu, Rex wrote: > when autowattman enabled,we will update uphyst/downhyst/min-sclk/mclk > activity  value to smu based on the workload. > Why is this incompatible with Freesync? Harry > Best Regards > Rex > >

Re: [PATCH] drm/amd/pp: Expose new interface to DC to ctrl auto wattman

2018-02-08 Thread Zhu, Rex
when autowattman enabled,we will update uphyst/downhyst/min-sclk/mclk activity value to smu based on the workload. Best Regards Rex From: Wentland, Harry Sent: Thursday, February 8, 2018 10:22:16 PM To: Zhu, Rex; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH

Re: [PATCH 04/10] drm/amd/pp: Implement update_dpm_settings on Polaris

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > Change-Id: I4533826ef6e18df125ae4445016873be3b5fe0ce > Signed-off-by: Rex Zhu Please provide a patch description, with that fixed: Reviewed-by: Alex Deucher > --- > .../drm/amd/powerplay/smumgr/polaris10_smumgr.c| 104 > +++

Re: [PATCH 03/10] drm/amd/pp: Add new smu callback function

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > it is used for adjust part of dpm settigs > to get better performance under different > workloads. > > Change-Id: I1e1ed786e9c07c91fb7e810af5b1ec5dd5cc4791 > Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/powerplay

Re: [PATCH 02/10] drm/amdgpu: Add a pp feature mask bit for autowattman

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > Change-Id: Ie329d6c806fc5ab71417ffabe413ddbdf9d367ea > Signed-off-by: Rex Zhu Please provide a better patch description. With that fixed: Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > drivers/gpu/drm/amd

Re: [PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > Change-Id: I69b24ce65ddb361a89e5ac9b197ae6df9b60a9e5 > Signed-off-by: Rex Zhu Would be good to give a brief description of what autowattman actually does in the patch description. Also, we may need to manually select a profile in some cases (e.g.

Re: [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS

2018-02-08 Thread Harry Wentland
On 2018-02-07 08:51 PM, Matthias Kaehlcke wrote: > Use subdir-ccflags instead of specifying the same flags for every source > file. > > Signed-off-by: Matthias Kaehlcke > Reviewed-by: Guenter Roeck > --- > Changes in v2: > - added 'Reviewed-by: Guenter Roeck ' tag > > drivers/gpu/drm/amd/displ

Re: [PATCH 01/10] drm/amd/amdgpu: Add query vram width in CGS query system info

2018-02-08 Thread Alex Deucher
On Thu, Feb 8, 2018 at 4:14 AM, Rex Zhu wrote: > Change-Id: I4bf7abab944253c8c744c1290b8a9fb5a62b6240 > Signed-off-by: Rex Zhu Please add a patch description that explains what we will be using this for. With that fixed: Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_cg

Re: [PATCH] drm/amd/pp: Expose new interface to DC to ctrl auto wattman

2018-02-08 Thread Harry Wentland
On 2018-02-08 06:20 AM, Rex Zhu wrote: > Disable AutoWattman (if enabled) when FreeSync is enabled. Do you have a DC change calling this? What's the use case for this and why do we need to disable AutoWattman when Freesync is enabled? What does AutoWattman do? Harry > > Change-Id: I9a531321d

[PATCH] drm/amdgpu: add new device to use atpx quirk

2018-02-08 Thread Kai-Heng Feng
The affected system (0x0813) is pretty similar to another one (0x0812), it also needs to use ATPX power control. Signed-off-by: Kai-Heng Feng --- drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c

Re: [PATCH 3/4] drm/ttm: add input parameter force_alloc for ttm_bo_evict_mm

2018-02-08 Thread Christian König
Am 08.02.2018 um 10:06 schrieb Roger He: if true, allocate TTM pages regardless of zone global memory account limit. For suspend, We should avoid TTM memory allocate failure then result in suspend failure. Why the extra parameter for amdgpu_bo_evict_vram ? I can't think of an use case when we

Re: [PATCH 2/4] drm/ttm: add bit flag TTM_OPT_FLAG_FORCE_ALLOC

2018-02-08 Thread Christian König
Am 08.02.2018 um 10:05 schrieb Roger He: set TTM_OPT_FLAG_FORCE_ALLOC when we are servicing for page fault routine. for ttm_mem_global_reserve if in page fault routine, allow the gtt pages reservation always. because page fault routing already grabbed system memory and the allowance of this exce

[PATCH] drm/amd/pp: Expose new interface to DC to ctrl auto wattman

2018-02-08 Thread Rex Zhu
Disable AutoWattman (if enabled) when FreeSync is enabled. Change-Id: I9a531321d7913b8b40e60070c569a01c4f202002 Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 25 + 2 files changed, 26 ins

[PATCH v2 09/10] drm/amd/pp: Restore power profile mode in auto dpm level on smu7

2018-02-08 Thread Rex Zhu
v2: cancel or wait current work finish before restart auto wattman. Disable auto wattman feature in manual mode if feature is enabled Signed-off-by: Rex Zhu Change-Id: I4361d16df27d2666dd978c3e33e05c020d65fe6a --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 19 +++ 1 file

[PATCH v2 08/10] drm/amd/pp: Implement auto wattman feature on Smu7

2018-02-08 Thread Rex Zhu
v2: refine work queue name. Change-Id: I2521d83cbea9b3418bed63de86cf93deafaab3fb Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 35 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 200 ++- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.

[PATCH 10/10] drm/amd/pp: Enable auto automan feature on Polaris

2018-02-08 Thread Rex Zhu
Change-Id: I69b24ce65ddb361a89e5ac9b197ae6df9b60a9e5 Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c index f50b6cd..549e830 100

[PATCH 09/10] drm/amd/pp: Restore power profile mode in auto dpm level on smu7

2018-02-08 Thread Rex Zhu
Disable auto wattman feature in manual mode if feature is enabled Signed-off-by: Rex Zhu Change-Id: I4361d16df27d2666dd978c3e33e05c020d65fe6a --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/

[PATCH 08/10] drm/amd/pp: Implement auto wattman feature on Smu7

2018-02-08 Thread Rex Zhu
Change-Id: Id0826f7a12a30461fca38862904f2f20c811989a Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 35 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 200 ++- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h | 26 +++ drivers/gpu/drm/

[PATCH 06/10] drm/amd/pp: Implement set_power_profile_mode on smu7

2018-02-08 Thread Rex Zhu
User can set smu7 dpm pamameters through sysfs Depending on the workloads, user can echo "0/1/2/3/4">pp_power_profile_mode to select 3D_FULL_SCREEN/POWER_SAVING/VIDEO/VR/COMPUTE mode. echo "5 * * * * * * * *">pp_power_profile_mode to config custom mode. "5 * * * * * * * *" mean "CUSTOM enable_scl

[PATCH 05/10] drm/amd/pp: Implement get_power_profile_mode on smu7

2018-02-08 Thread Rex Zhu
It show what parameters can be setted on smu7(vi/ci asics) to get better performance. Also show some profiling modes, user can select directly by serial number based on workloads. cat pp_power_profile_mode NUMMODE_NAME SCLK_UP_HYST SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL MCLK_UP_HYST

[PATCH 07/10] drm/amd/pp: Add new hw interface for auto wattman feature.

2018-02-08 Thread Rex Zhu
Change-Id: Ib34c2815ab95890ba91f9a61bc0594b0f5e0c3fd Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h index 31988d7..d809d96 100644 ---

[PATCH 04/10] drm/amd/pp: Implement update_dpm_settings on Polaris

2018-02-08 Thread Rex Zhu
Change-Id: I4533826ef6e18df125ae4445016873be3b5fe0ce Signed-off-by: Rex Zhu --- .../drm/amd/powerplay/smumgr/polaris10_smumgr.c| 104 + 1 file changed, 104 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/

[PATCH 03/10] drm/amd/pp: Add new smu callback function

2018-02-08 Thread Rex Zhu
it is used for adjust part of dpm settigs to get better performance under different workloads. Change-Id: I1e1ed786e9c07c91fb7e810af5b1ec5dd5cc4791 Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + drivers/gpu/drm/amd/powerplay/inc/smumgr.h| 1 + drivers/gpu/drm

[PATCH 02/10] drm/amdgpu: Add a pp feature mask bit for autowattman

2018-02-08 Thread Rex Zhu
Change-Id: Ie329d6c806fc5ab71417ffabe413ddbdf9d367ea Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/d

[PATCH 01/10] drm/amd/amdgpu: Add query vram width in CGS query system info

2018-02-08 Thread Rex Zhu
Change-Id: I4bf7abab944253c8c744c1290b8a9fb5a62b6240 Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 3 +++ drivers/gpu/drm/amd/include/cgs_common.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/am

[PATCH 00/10] Enable auto wattman feature on Polaris

2018-02-08 Thread Rex Zhu
Enable auto wattman on polaris. Manual set wattman feature related parameters on other smu7 asics. In manual dpm mode, auto wattman feature was disabled. user can change auto wattman related parameters through sysfs pp_power_profile_mode. Rex Zhu (10): drm/amd/amdgpu: Add query vram width in CG

Re: [PATCH 1/4] drm/ttm: use bit flag to replace allow_reserved_eviction in ttm_operation_ctx

2018-02-08 Thread Christian König
Am 08.02.2018 um 10:05 schrieb Roger He: for saving memory and more bit flag can be used in future Signed-off-by: Roger He Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++-- drivers/gpu/drm/ttm/ttm_

Re: [PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Christian König
Am 08.02.2018 um 10:09 schrieb Michel Dänzer: On 2018-02-08 09:32 AM, Chunming Zhou wrote: it will be used to check if the driver needs swiotlb Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu --- include/drm/drm_cache.h | 13 ++

Re: [PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Michel Dänzer
On 2018-02-08 10:15 AM, Chunming Zhou wrote: > On 2018年02月08日 17:09, Michel Dänzer wrote: >> On 2018-02-08 09:32 AM, Chunming Zhou wrote: >>> it will be used to check if the driver needs swiotlb >>> >>> Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 >>> Signed-off-by: Chunming Zhou >>> Revie

Re: [PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Chunming Zhou
On 2018年02月08日 17:09, Michel Dänzer wrote: On 2018-02-08 09:32 AM, Chunming Zhou wrote: it will be used to check if the driver needs swiotlb Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu --- include/drm/drm_cache.h | 13 +++

Re: [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-02-08 Thread Chunming Zhou
On 2018年02月08日 17:01, Michel Dänzer wrote: Hi David, this change completely broke radeonsi due to memory management errors (see valgrind output for glxgears below), so I had to revert it. ok, I will look into what happens. Sorry for broken. Regards, David Zhou ==4831== Memcheck, a memory

Re: [PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Michel Dänzer
On 2018-02-08 09:32 AM, Chunming Zhou wrote: > it will be used to check if the driver needs swiotlb > > Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 > Signed-off-by: Chunming Zhou > Reviewed-by: Monk Liu > --- > include/drm/drm_cache.h | 13 + > 1 file changed, 13 insertions

[PATCH 3/4] drm/ttm: add input parameter force_alloc for ttm_bo_evict_mm

2018-02-08 Thread Roger He
if true, allocate TTM pages regardless of zone global memory account limit. For suspend, We should avoid TTM memory allocate failure then result in suspend failure. Signed-off-by: Roger He --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +

[PATCH 2/4] drm/ttm: add bit flag TTM_OPT_FLAG_FORCE_ALLOC

2018-02-08 Thread Roger He
set TTM_OPT_FLAG_FORCE_ALLOC when we are servicing for page fault routine. for ttm_mem_global_reserve if in page fault routine, allow the gtt pages reservation always. because page fault routing already grabbed system memory and the allowance of this exception is harmless. Otherwise, it will trigg

[PATCH 4/4] drm/ttm: check if the mem free space is under lower limit

2018-02-08 Thread Roger He
mem free space and lower limit both include two parts: system memory and swap space. For the OOM triggered by TTM, that is the case as below: swap space is full of swapped pages and then system memory will be filled up with ttm pages. and then any memory allocation request will run into OOM. to c

[PATCH 1/4] drm/ttm: use bit flag to replace allow_reserved_eviction in ttm_operation_ctx

2018-02-08 Thread Roger He
for saving memory and more bit flag can be used in future Signed-off-by: Roger He --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++-- drivers/gpu/drm/ttm/ttm_bo.c | 3 ++- include/drm/ttm/ttm_bo_api.h | 7 +

Re: [PATCH 3/9] drm/amdgpu: add amdgpu module parameter for zfb

2018-02-08 Thread Christian König
Well ZFB is only for emulation, so the risk should be minimal. According to my test CMA works fine and I think it is a must have for upstreaming ZFB. Regards, Christian. Am 08.02.2018 um 09:40 schrieb He, Roger: For the CMA, I have some concern. First, it is strongly depend on other module's

Re: [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr

2018-02-08 Thread Michel Dänzer
Hi David, this change completely broke radeonsi due to memory management errors (see valgrind output for glxgears below), so I had to revert it. ==4831== Memcheck, a memory error detector ==4831== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==4831== Using Valgrind-3.13.0 an

RE: [PATCH 3/9] drm/amdgpu: add amdgpu module parameter for zfb

2018-02-08 Thread He, Roger
For the CMA, I have some concern. First, it is strongly depend on other module's robustness which can use CMA memory with flag __GFP_MOVABLE. My mean is dma_alloc_coherent sometimes will fail because its owner cannot migrate its memory out from CMA range because some internal bugs. Second becaus

Re: [PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Christian König
Am 08.02.2018 um 09:32 schrieb Chunming Zhou: it will be used to check if the driver needs swiotlb Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu Reviewed-by: Christian König for the whole series. --- include/drm/drm_cache.h | 1

[PATCH 3/3] drm/radeon: only enable swiotlb path when need v2

2018-02-08 Thread Chunming Zhou
swiotlb expands our card accessing range, but its path always is slower than ttm pool allocation. So add condition to use it. v2: move a bit later Change-Id: I1802645833155a9cd808913f863981173a82145f Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu --- drivers/gpu/drm/radeon/radeon.h|

[PATCH 2/3] drm/amdgpu: only enable swiotlb alloc when need v2

2018-02-08 Thread Chunming Zhou
get the max io mapping address of system memory to see if it is over our card accessing range. v2: move checking later Change-Id: Ibc38dbd34a20af5b4a4b1ed154c14e1c58aa4c55 Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/a

[PATCH 1/3] drm: add func to get max iomem address

2018-02-08 Thread Chunming Zhou
it will be used to check if the driver needs swiotlb Change-Id: Idbe47af8f12032d4803bb3d47273e807f19169c3 Signed-off-by: Chunming Zhou Reviewed-by: Monk Liu --- include/drm/drm_cache.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/drm/drm_cache.h b/include/drm/drm_c

Re: [PATCH 11/25] drm/amdkfd: Centralize IOMMUv2 code and make it conditional

2018-02-08 Thread Christian König
Am 07.02.2018 um 21:51 schrieb Felix Kuehling: On 2018-02-07 06:20 AM, Christian König wrote: Am 07.02.2018 um 02:32 schrieb Felix Kuehling: dGPUs work without IOMMUv2. Make IOMMUv2 initialization dependent on ASIC information. Also allow building KFD without IOMMUv2 support. This is still usef

Re: [PATCH 3/9] drm/amdgpu: add amdgpu module parameter for zfb

2018-02-08 Thread Christian König
Am 08.02.2018 um 05:51 schrieb Zhang, Hawking: Apart from the allocation failure, reserving 1024M cma is also not realistic Sure it is, I just tried it and it works perfectly fine. The option even accepts a G postfix for gigabytes, e.g. I can specify cma=8G on my 32GB Ryzen box and get ex