drm/amd/powerplay: expose max engine and memory clock info for powerplay enabled case

2016-10-12 Thread Quan, Evan
Hi All, We found the max engine clock and max memory clock are both wrongly reported as 0(by AMDGPU_INFO_DEV_INFO ioctl). The attached patch tries to fix it. Please help to review it. Any comment is welcomed. Regards, Evan 0001-drm-amd-powerplay-expose-max-engine-memory-clock-inf.patch Descrip

Re: [PATCH] drm/amdgpu: fix broken UVD startup in phys mode

2016-10-12 Thread Christian König
Am 11.10.2016 um 21:39 schrieb Alex Deucher: Add type, align_mask and nop to the physical mode UVD funcs as well. Signed-off-by: Alex Deucher Reviewed-by: Christian König . --- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/am

RE: [PATCH 5/6] drm/amdgpu/powerplay: add an implementation for get_vce_clock_table

2016-10-12 Thread Zhu, Rex
Hi Alex, In Patch1, I moved struct amdgpu_vce_states to amd_shared.h from amdgpu.h. So in powerplay, we used same vce state definition. So the define of static struct drm_amdgpu_info_vce_clock_table pp_dpm_get_vce_clock_table(void *handle) Can change to static struct amd_vce_state pp_dpm_get

Re: [PATCH 5/6] drm/amdgpu/powerplay: add an implementation for get_vce_clock_table

2016-10-12 Thread Christian König
Hi Rex, the problem with this approach is that you need to copy the entries from one structure to another, like we have below: > + vce_clk_table.entries[i].sclk = hwmgr->vce_states[i].sclk; > + vce_clk_table.entries[i].mclk = hwmgr-

RE: [PATCH 5/6] drm/amdgpu/powerplay: add an implementation for get_vce_clock_table

2016-10-12 Thread Zhu, Rex
Hi Christian, I mean patch 5 can be changed as static struct amd_vce_state* pp_dpm_get_vce_clock_table(void *handle, int num) { PP_CHECK((struct pp_instance *)handle); hwmgr = ((struct pp_instance *)handle)->hwmgr; if (hwmgr && num < hwmgr->num_vce_state_tables) return &hwmgr->vc

Re: [PATCH 5/6] drm/amdgpu/powerplay: add an implementation for get_vce_clock_table

2016-10-12 Thread Christian König
Hi Rex, So amd_vce_state is our hardware representation and drm_amdgpu_info_vce_clock_table is the IOCTL interface structure? Is there a reason for not using drm_amdgpu_info_vce_clock_table directly in the hw manager, except that we don't want to include the IOCTL interface here? Cause that

Re: [PATCH 4/4] drm/amdgpu: used cached gca values for vi_read_register

2016-10-12 Thread Grazvydas Ignotas
On Wed, Oct 12, 2016 at 2:48 AM, Andy Furniss wrote: > > I still can't shutdown/reboot > as in https://bugs.freedesktop.org/show_bug.cgi?id=98200 > which is fixed for radeon, but apparently not (for me at least) with amdgpu. You probably need a951ed85abd46 that went to 4.8-fixes and is not part o

Re: [PATCH 2/2] drm/amdgpu: add VCE VM session tracking

2016-10-12 Thread Christian König
Andy & Leo could you give that a brief testing? I currently don't have a setup for encoding/transcoding clips. Regards, Christian. Am 10.10.2016 um 18:45 schrieb Alex Deucher: On Mon, Oct 10, 2016 at 9:40 AM, Christian König wrote: From: Christian König Only compile tested, but should fix

RE: [PATCH] drm/amd/powerplay: don't give up if DPM is already running

2016-10-12 Thread Zhu, Rex
Hi Grazvydas and Alex, We needed to disable dpm when rmmod amdgpu for this issue. I am checking the function of disable dpm task. Best Regards Rex -Original Message- From: Alex Deucher [mailto:alexdeuc...@gmail.com] Sent: Wednesday, October 12, 2016 4:01 AM To: Grazvydas Ignotas; Zhu,

Re: [PATCH 4/4] drm/amdgpu: used cached gca values for vi_read_register

2016-10-12 Thread Andy Furniss
Grazvydas Ignotas wrote: On Wed, Oct 12, 2016 at 2:48 AM, Andy Furniss wrote: I still can't shutdown/reboot as in https://bugs.freedesktop.org/show_bug.cgi?id=98200 which is fixed for radeon, but apparently not (for me at least) with amdgpu. You probably need a951ed85abd46 that went to 4.8-f

Re: [PATCH 2/2] drm/amdgpu: add VCE VM session tracking

2016-10-12 Thread Andy Furniss
Christian König wrote: Andy & Leo could you give that a brief testing? Seems to be OK for me. I currently don't have a setup for encoding/transcoding clips. Regards, Christian. Am 10.10.2016 um 18:45 schrieb Alex Deucher: On Mon, Oct 10, 2016 at 9:40 AM, Christian König wrote: From: Chr

Re: [PATCH] drm/amd/amdgpu: Allow broadcast on debugfs read (v2)

2016-10-12 Thread StDenis, Tom
It comes from amdgpu_query_gpu_info_init() for (i = 0; i < (int)dev->info.num_shader_engines; i++) { unsigned instance = (i << AMDGPU_INFO_MMR_SE_INDEX_SHIFT) | (AMDGPU_INFO_MMR_SH_INDEX_MASK << AMDGP

Re: [PATCH 2/2] drm/amdgpu: add VCE VM session tracking

2016-10-12 Thread Leo Liu
On 10/12/2016 07:05 AM, Christian König wrote: Andy & Leo could you give that a brief testing? run `kill -9' over 30 times, no issue. Patch is: Reviewed-and-Tested by: Leo Liu I currently don't have a setup for encoding/transcoding clips. Regards, Christian. Am 10.10.2016 um 18:45 schri

[PATCH] drm/radeon: change vblank_time's calculation method to reduce computational error.

2016-10-12 Thread Alex Deucher
Ported from Rex's amdgpu change. Signed-off-by: Alex Deucher Cc: sta...@vger.kernel.org --- drivers/gpu/drm/radeon/r600_dpm.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index 6a4b020..

Re: [PATCH 5/6] drm/amdgpu/powerplay: add an implementation for get_vce_clock_table

2016-10-12 Thread Alex Deucher
On Wed, Oct 12, 2016 at 5:56 AM, Christian König wrote: > Hi Rex, > > So amd_vce_state is our hardware representation and > drm_amdgpu_info_vce_clock_table is the IOCTL interface structure? Is there a > reason for not using drm_amdgpu_info_vce_clock_table directly in the hw > manager, except that

[PATCH 5/8] drm/amdgpu/dpm: add new callback to fetch vce clock state (v2)

2016-10-12 Thread Alex Deucher
Will be used by the new info ioctl query. v2: fetch a single state per request Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 5 + drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 1 + 2 files changed, 6 insertions(+) di

[PATCH 2/8] drm/amdgpu: use same vce state definition in dpm and powerplay

2016-10-12 Thread Alex Deucher
From: Rex Zhu Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h| 28 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +- drivers/gpu/drm/amd/amdgp

[PATCH 1/8] drm/amdgpu: move dpm related definitions to amdgpu_dpm.h

2016-10-12 Thread Alex Deucher
No intended functional change. Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 449 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 447 +++ 2 files changed, 448 insertions(+), 448 dele

[PATCH 4/8] drm/amdgpu: add info ioctl query for vce clock info (v3)

2016-10-12 Thread Alex Deucher
This is needed to set up the vce clock table in userspace for proper VCE DPM. v2: fix copy paste typo in comment v3: track number of valid states Reviewed-by: Christian König Signed-off-by: Alex Deucher --- include/uapi/drm/amdgpu_drm.h | 20 1 file changed, 20 insertions(

[PATCH 8/8] drm/amdgpu: fill in vce clock info ioctl query (v2)

2016-10-12 Thread Alex Deucher
Returns the vce clock table for the user mode driver. The user mode driver can fill this data into vce clock data packet for optimal VCE DPM. v2: update to the new API Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 18 ++

[PATCH 6/8] drm/amdgpu/dpm: add an implementation for get_vce_clock_state (v2)

2016-10-12 Thread Alex Deucher
Used by the non-powerplay dpm code. v2: update to the new API Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 9 + drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 3 +++ drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 1 + drivers/gpu/drm/amd/

[PATCH 3/8] drm/amdgpu: save number of vce states in dpm struct.

2016-10-12 Thread Alex Deucher
From: Rex Zhu Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 7 --- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 1 + drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 +- drivers/gpu/drm/amd/amdgpu/si

[PATCH 7/8] drm/amdgpu/powerplay: add an implementation for get_vce_clock_state (v2)

2016-10-12 Thread Alex Deucher
Used by the powerplay dpm code. v2: update to the new API Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_power

[PATCH 7/8] drm/amdgpu/powerplay: add an implementation for get_vce_clock_state (v3)

2016-10-12 Thread Alex Deucher
Used by the powerplay dpm code. v2: update to the new API v3: drop old include Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd

RE: drm/amd/powerplay: expose max engine and memory clock info for powerplay enabled case

2016-10-12 Thread Deucher, Alexander
I don't know if we need to add a cgs call to fill in the max_clock_voltage_limits structure. That's mostly just leftover from radeon. A better solution would be use the existing amdgpu_dpm_get_sclk and amdgpu_dpm_get_mclk macros. Maybe something like the attached patch? Unless there is a spe