platform/kernel/linux-starfive.git
7 years agodrm/amdgpu/gfx9: add enable/disable funcs for cp power gating
Hawking Zhang [Fri, 10 Feb 2017 07:47:28 +0000 (15:47 +0800)]
drm/amdgpu/gfx9: add enable/disable funcs for cp power gating

Used to enable/disable cp powergating.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: enable/disable sck slowdown thru rlc-smu handshake
Hawking Zhang [Fri, 10 Feb 2017 07:36:34 +0000 (15:36 +0800)]
drm/amdgpu/gfx9: enable/disable sck slowdown thru rlc-smu handshake

Required for proper powergating operation.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: init gfx power gating on raven
Hawking Zhang [Fri, 10 Feb 2017 07:13:17 +0000 (15:13 +0800)]
drm/amdgpu: init gfx power gating on raven

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: rlc save&restore list programming
Hawking Zhang [Fri, 10 Feb 2017 06:37:03 +0000 (14:37 +0800)]
drm/amdgpu/gfx9: rlc save&restore list programming

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: add rlc bo init/fini
Hawking Zhang [Mon, 13 Feb 2017 05:55:23 +0000 (13:55 +0800)]
drm/amdgpu/gfx9: add rlc bo init/fini

setup the save and restore buffers used for gfx
powergating.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: correct gfx9 csb size
Hawking Zhang [Thu, 9 Feb 2017 09:11:54 +0000 (17:11 +0800)]
drm/amdgpu: correct gfx9 csb size

programming pa_sc_raster_config/config1 reg is removed from gfx9 csb

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: enable cp interrupt for CGCG/CGLS/MGCG
Hawking Zhang [Thu, 9 Feb 2017 06:48:08 +0000 (14:48 +0800)]
drm/amdgpu/gfx9: enable cp interrupt for CGCG/CGLS/MGCG

Required for proper handshaking between the GFX and RLC.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: extend rlc fw setup
Hawking Zhang [Wed, 8 Feb 2017 10:17:44 +0000 (18:17 +0800)]
drm/amdgpu/gfx9: extend rlc fw setup

Required for gfx powergating.

Change-Id: I5a2f8f41253686d8bb776a92aa68bf90877ebaa8
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add gfx clock gating for raven
Huang Rui [Tue, 10 Jan 2017 03:04:25 +0000 (11:04 +0800)]
drm/amdgpu: add gfx clock gating for raven

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: add raven gfx config
Chunming Zhou [Thu, 8 Dec 2016 03:06:11 +0000 (11:06 +0800)]
drm/amdgpu/gfx9: add raven gfx config

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: add chip name for raven when initializing microcode
Chunming Zhou [Thu, 8 Dec 2016 02:49:37 +0000 (10:49 +0800)]
drm/amdgpu/gfx9: add chip name for raven when initializing microcode

Fetch the correct ucode for raven.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add gc9.1 golden setting (v2)
Chunming Zhou [Thu, 8 Dec 2016 02:41:58 +0000 (10:41 +0800)]
drm/amdgpu: add gc9.1 golden setting (v2)

Add the GFX9 golden settings.

v2: squash in updates

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add module firmware for raven
Chunming Zhou [Tue, 13 Dec 2016 07:58:33 +0000 (15:58 +0800)]
drm/amdgpu: add module firmware for raven

Fetch correct firmware for raven for gfx and sdma.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add Raven chip id case for ucode
Chunming Zhou [Thu, 4 May 2017 18:54:46 +0000 (14:54 -0400)]
drm/amdgpu: add Raven chip id case for ucode

Set the appropriate ucode loading mechanism.  Set to
direct for now.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: enable soc15 clock gating flags for raven
Huang Rui [Wed, 18 Jan 2017 10:14:08 +0000 (18:14 +0800)]
drm/amdgpu: enable soc15 clock gating flags for raven

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/soc15: add clock gating functions for raven
Huang Rui [Wed, 18 Jan 2017 10:12:59 +0000 (18:12 +0800)]
drm/amdgpu/soc15: add clock gating functions for raven

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: fill in raven case in soc15 early init
Hawking Zhang [Tue, 27 Dec 2016 13:02:48 +0000 (21:02 +0800)]
drm/amd/amdgpu: fill in raven case in soc15 early init

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/soc15: add Raven golden setting
Chunming Zhou [Thu, 8 Dec 2016 02:16:00 +0000 (10:16 +0800)]
drm/amdgpu/soc15: add Raven golden setting

Add the common golden settings for Raven.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add Raven ip blocks (v2)
Chunming Zhou [Thu, 8 Dec 2016 02:09:13 +0000 (10:09 +0800)]
drm/amdgpu: add Raven ip blocks (v2)

Add the IP blocks for RAVEN.

v2: drop DC for upstream (Alex)

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add RAVEN family id definition
Chunming Zhou [Wed, 7 Dec 2016 09:31:19 +0000 (17:31 +0800)]
drm/amdgpu: add RAVEN family id definition

RAVEN is a new APU.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for VCN 1.0
Alex Deucher [Thu, 4 May 2017 17:09:18 +0000 (13:09 -0400)]
drm/amdgpu: add register headers for VCN 1.0

Add registers for Video Controller Next 1.0

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for THM 10.0
Alex Deucher [Thu, 4 May 2017 17:08:39 +0000 (13:08 -0400)]
drm/amdgpu: add register headers for THM 10.0

Add registers for THerMal control 10.0

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for SDMA 4.1
Alex Deucher [Thu, 4 May 2017 17:07:58 +0000 (13:07 -0400)]
drm/amdgpu: add register headers for SDMA 4.1

Add registers for SDMA 4.1

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for NBIO 7.0
Alex Deucher [Thu, 4 May 2017 17:06:58 +0000 (13:06 -0400)]
drm/amdgpu: add register headers for NBIO 7.0

Add registers for NBIO 7.0

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for MP 10.0
Alex Deucher [Thu, 4 May 2017 17:05:53 +0000 (13:05 -0400)]
drm/amdgpu: add register headers for MP 10.0

Add registers for MP 10.0

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for MMHUB 9.1
Alex Deucher [Thu, 4 May 2017 17:04:55 +0000 (13:04 -0400)]
drm/amdgpu: add register headers for MMHUB 9.1

Add registers for the MultiMedia Hub 9.1

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for GC 9.1
Alex Deucher [Thu, 4 May 2017 17:02:36 +0000 (13:02 -0400)]
drm/amdgpu: add register headers for GC 9.1

Registers for Graphics Controller 9.1

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add register headers for DCN 1.0
Alex Deucher [Thu, 4 May 2017 17:01:35 +0000 (13:01 -0400)]
drm/amdgpu: add register headers for DCN 1.0

Registers for Display Controller Next 1.0

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:use job's list instead of check fence
Monk Liu [Thu, 11 May 2017 05:59:15 +0000 (13:59 +0800)]
drm/amdgpu:use job's list instead of check fence

because if the fence is really signaled, it could already
released so the fence pointer is a wild pointer, but if
we use job->base.node we are safe because job will not
be released untill amdgpu_job_timedout finished.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/SRIOV:implement guilty job TDR for(V2)
Monk Liu [Thu, 11 May 2017 05:36:44 +0000 (13:36 +0800)]
drm/amdgpu/SRIOV:implement guilty job TDR for(V2)

1,TDR will kickout guilty job if it hang exceed the threshold
of the given one from kernel paramter "job_hang_limit", that
way a bad command stream will not infinitly cause GPU hang.

by default this threshold is 1 so a job will be kicked out
after it hang.

2,if a job timeout TDR routine will not reset all sched/ring,
instead if will only reset on the givn one which is indicated
by @job of amdgpu_sriov_gpu_reset, that way we don't need to
reset and recover each sched/ring if we already know which job
cause GPU hang.

3,unblock sriov_gpu_reset for AI family.

V2:
1:put kickout guilty job after sched parked.
2:since parking scheduler prior to kickout already occupies a
while, we can do last check on the in question job before
doing hw_reset.

TODO:
1:when a job is considered as guilty, we should mark some flag
in its fence status flag, and let UMD side aware that this
fence signaling is not due to job complete but job hang.

2:if gpu reset cause all video memory lost, we need introduce
a new policy to implement TDR, like drop all jobs not yet
signaled, and all IOCTL on this device will return ERROR
DEVICE_LOST.
this will be implemented later.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:don't init entity for KIQ
Monk Liu [Thu, 11 May 2017 05:36:33 +0000 (13:36 +0800)]
drm/amdgpu:don't init entity for KIQ

We don't need a scheduler for KIQ.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:only call flr_work under infinite timeout
Monk Liu [Wed, 26 Apr 2017 06:51:54 +0000 (14:51 +0800)]
drm/amdgpu:only call flr_work under infinite timeout

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:use job* to replace voluntary
Monk Liu [Wed, 26 Apr 2017 06:51:54 +0000 (14:51 +0800)]
drm/amdgpu:use job* to replace voluntary

that way we can know which job cause hang and
can do per sched reset/recovery instead of all
sched.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:don't invoke srio-gpu-reset in gpu-reset (v2)
Monk Liu [Fri, 5 May 2017 07:09:42 +0000 (15:09 +0800)]
drm/amdgpu:don't invoke srio-gpu-reset in gpu-reset (v2)

because we don't want to do sriov-gpu-reset under certain
cases, so just split those two funtion and don't invoke
sr-iov one from bare-metal one.

V2:
remove debugfs_gpu_reset routine on SRIOV case.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: id reset count only is updated when used end v2
Chunming Zhou [Wed, 10 May 2017 05:02:39 +0000 (13:02 +0800)]
drm/amdgpu: id reset count only is updated when used end v2

before that, we have function to check if reset happens by using reset count.
v2: always update reset count after vm flush

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: make pipeline sync be in same place v2
Chunming Zhou [Thu, 11 May 2017 18:52:48 +0000 (14:52 -0400)]
drm/amdgpu: make pipeline sync be in same place v2

v2: directly return for 'if' case.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add sched sync for amdgpu job v2
Chunming Zhou [Tue, 9 May 2017 07:50:22 +0000 (15:50 +0800)]
drm/amdgpu: add sched sync for amdgpu job v2

this is an improvement for previous patch, the sched_sync is to store fence
that could be skipped as scheduled, when job is executed, we didn't need
pipeline_sync if all fences in sched_sync are signalled, otherwise insert
pipeline_sync still.

v2: handle error when adding fence to sync failed.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> (v1)
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: remove unsed amdgpu_gem_handle_lockup (v2)
Christian König [Mon, 8 May 2017 13:14:54 +0000 (15:14 +0200)]
drm/amdgpu: remove unsed amdgpu_gem_handle_lockup (v2)

This kind of reset handling was removed a long time ago.

v2: fix warning (Alex)

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: print when gpu reset successed
Chunming Zhou [Fri, 5 May 2017 02:50:09 +0000 (10:50 +0800)]
drm/amdgpu: print when gpu reset successed

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Roger.He <Hongbo.He@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix ring0 failed on pro card
Chunming Zhou [Fri, 5 May 2017 02:33:33 +0000 (10:33 +0800)]
drm/amdgpu: fix ring0 failed on pro card

the root cause is vram content is lost completely after pci reset.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Roger.He <Hongbo.He@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: extend lock range for race condition when gpu reset
Roger.He [Fri, 5 May 2017 05:27:10 +0000 (13:27 +0800)]
drm/amdgpu: extend lock range for race condition when gpu reset

to cover below case:
1. A task gart bind/unbind but not add to adev->gtt_list yet
2. at this time gpu reset, gtt only recover those gtt in adev->gtt_list

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Roger.He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: Fix comments in source code
Alex Xie [Tue, 9 May 2017 01:36:03 +0000 (21:36 -0400)]
drm/amdgpu: Fix comments in source code

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix errors in comments.
Alex Xie [Mon, 8 May 2017 17:41:11 +0000 (13:41 -0400)]
drm/amdgpu: fix errors in comments.

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: move define to header file
Alex Deucher [Thu, 4 May 2017 14:32:33 +0000 (10:32 -0400)]
drm/amdgpu/gfx9: move define to header file

rather than defining it locally.

Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: get rid of else branch
Nikola Pajkovsky [Thu, 4 May 2017 16:39:50 +0000 (12:39 -0400)]
drm/amd/amdgpu: get rid of else branch

else branch is pointless if it's right at the end of function and use
unlikely() on err path.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Nikola Pajkovsky <npajkovsky@suse.cz>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:cleanup flag not used
Monk Liu [Wed, 3 May 2017 06:55:07 +0000 (14:55 +0800)]
drm/amdgpu:cleanup flag not used

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:use FRAME_CNTL for new GFX ucode (v2)
Monk Liu [Mon, 1 May 2017 10:09:22 +0000 (18:09 +0800)]
drm/amdgpu:use FRAME_CNTL for new GFX ucode (v2)

AI affected:

CP/HW team requires KMD insert FRAME_CONTROL(end) after
the last IB and before the fence of this DMAframe.

this is to make sure the cache are flushed, and it's a must
change no matter MCBP/SR-IOV or bare-metal case because new
CP hw won't do the cache flush for each IB anymore, it just
leaves it to KMD now.

with this patch, certain MCBP hang issue when rendering
vulkan/chained-ib are resolved.

v2: drop gfx8 changes.  gfx8 is not affected (Alex)

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:new PM4 entry for VI/AI
Monk Liu [Mon, 1 May 2017 09:23:44 +0000 (17:23 +0800)]
drm/amdgpu:new PM4 entry for VI/AI

TMZ package will be used for VULKAN/CHAINED-IB MCBP

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:change SR-IOV DMAframe scheme
Monk Liu [Mon, 1 May 2017 09:05:02 +0000 (17:05 +0800)]
drm/amdgpu:change SR-IOV DMAframe scheme

According to CP/hw team requirment, to support PAL/CHAINED-IB
MCBP, kernel driver must guarantee DE_META must be inserted
right prior to the work_load DE IB (with PREEMPT flag), there
cannot be any non-work_load DE IB between-in DE_META and
work_load DE IB.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:unify gfx8/9 ce/de meta_data
Monk Liu [Mon, 1 May 2017 10:05:06 +0000 (18:05 +0800)]
drm/amdgpu:unify gfx8/9 ce/de meta_data

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:cleanup indent/format for gfx_v9_0.c
Monk Liu [Mon, 1 May 2017 09:00:13 +0000 (17:00 +0800)]
drm/amdgpu:cleanup indent/format for gfx_v9_0.c

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: clean doorbell after sending init table to mmsch
Frank Min [Tue, 2 May 2017 11:49:32 +0000 (19:49 +0800)]
drm/amdgpu: clean doorbell after sending init table to mmsch

According to HW design, need to clean doorbell after setup MMSCH
table.

Signed-off-by: Frank Min <Frank.Min@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/virt: change AI ack-irq message to debug level
Xiangliang Yu [Thu, 4 May 2017 06:02:31 +0000 (14:02 +0800)]
drm/amdgpu/virt: change AI ack-irq message to debug level

Change message to debug level as VI does.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/psp: Do not load asd for SRIOV
Xiangliang Yu [Thu, 4 May 2017 03:05:13 +0000 (11:05 +0800)]
drm/amdgpu/psp: Do not load asd for SRIOV

If psp version doesn't match asd version, asd loading will be
failed. Add workaround to bypass it for sriov.

Signed-off-by: Daniel Wang <Daniel.Wang2@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: Bypass GMC/UVD/VCE hw_fini in SR-IOV
Trigger Huang [Wed, 26 Apr 2017 06:29:47 +0000 (02:29 -0400)]
drm/amdgpu: Bypass GMC/UVD/VCE hw_fini in SR-IOV

On vega10, some hw finish operations should not be applied in SR-IOV
case. This works as workaround to fix multi-VFs reboot/shutdown
issues.

Signed-off-by: Trigger Huang <trigger.huang@amd.com>
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:re-write sriov_reinit_early/late (v2)
Monk Liu [Wed, 26 Apr 2017 04:00:49 +0000 (12:00 +0800)]
drm/amdgpu:re-write sriov_reinit_early/late (v2)

1,this way we make those routines compatible with the sequence
  requirment for both Tonga and Vega10
2,ignore PSP hw init when doing TDR, because for SR-IOV device
the ucode won't get lost after VF FLR, so no need to invoke PSP
doing the ucode reloading again.

v2: squash in ARRAY_SIZE fix

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:need som change on vega10 mailbox
Monk Liu [Fri, 21 Apr 2017 11:35:11 +0000 (19:35 +0800)]
drm/amdgpu:need som change on vega10 mailbox

if sriov gpu reset is invoked by job timeout, it is run
in a global work-queue which is very slow and better not call
msleep ortherwise it takes long time to get back CPU.

so make below changes:

1: Change msleep 1 to mdelay 5
2: Ignore the ack fail from pf after time out,
   because VF FLR will clear ack, sometime VF FLR is done
   prior to the beginning of poll_ack so we can ignore this ack

TODO:
Put job_timedout (and the following gpu reset) in a driver thread,
instead of the global work_struct.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:fix cannot receive rcv/ack irq bug
Monk Liu [Sun, 23 Apr 2017 03:25:59 +0000 (11:25 +0800)]
drm/amdgpu:fix cannot receive rcv/ack irq bug

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:kiq reg access need timeout(v2)
Monk Liu [Fri, 5 May 2017 21:30:50 +0000 (17:30 -0400)]
drm/amdgpu:kiq reg access need timeout(v2)

this is to prevent fence forever waiting if FLR occured
during register accessing.

v2:
use define instead of hardcode for the timeout msec

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: wait for completion in KIQ init
Alex Deucher [Mon, 17 Apr 2017 20:21:52 +0000 (16:21 -0400)]
drm/amdgpu/gfx9: wait for completion in KIQ init

We need to make sure the various init sequences submitted
to KIQ complete before testing the rings.

Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: use new KIQ packet defines
Alex Deucher [Mon, 17 Apr 2017 20:14:09 +0000 (16:14 -0400)]
drm/amdgpu/gfx9: use new KIQ packet defines

Rather than magic numbers.

Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add KIQ packet defines to soc15d.h
Alex Deucher [Mon, 17 Apr 2017 19:54:55 +0000 (15:54 -0400)]
drm/amdgpu: add KIQ packet defines to soc15d.h

Will be used in subsequent commits rather rather than
magic numbers.

Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: clear the compute ring on reset
Alex Deucher [Mon, 17 Apr 2017 20:32:12 +0000 (16:32 -0400)]
drm/amdgpu/gfx9: clear the compute ring on reset

To be consistent with gfx8.

Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx9: create mqd backups
Alex Deucher [Mon, 17 Apr 2017 19:29:14 +0000 (15:29 -0400)]
drm/amdgpu/gfx9: create mqd backups

And properly synchronize them with the master during
queue init.

Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: Move kiq ring lock out of virt structure
Shaoyun Liu [Fri, 28 Apr 2017 21:18:26 +0000 (17:18 -0400)]
drm/amdgpu: Move kiq ring lock out of virt structure

The usage of kiq should not depend on the virtualization.

Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com>
Reviewed-by:Andres Rodriquez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: bump module verion for reserved vmid
Chunming Zhou [Mon, 24 Apr 2017 03:47:05 +0000 (11:47 +0800)]
drm/amdgpu: bump module verion for reserved vmid

Interface to reserve a vmid for a specific process to
add in shader debugging that requries a fixed vmid.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: implement grab reserved vmid V4
Chunming Zhou [Fri, 21 Apr 2017 03:13:56 +0000 (11:13 +0800)]
drm/amdgpu: implement grab reserved vmid V4

Implement the vmid reservation.

v2: move sync waiting only when flush needs
v3: fix racy
v4: peek fence instead of get fence, and fix potential context starved.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add limitation for dedicated vm number v4
Chunming Zhou [Fri, 21 Apr 2017 07:51:04 +0000 (15:51 +0800)]
drm/amdgpu: add limitation for dedicated vm number v4

Limit reserved vmids to 1 to avoid taking too many
out of commission and starving the system.

v2: move #define to amdgpu_vm.h
v3: move reserved vmid counter to id_manager,
and increase counter before allocating vmid
v4: rename to reserved_vmid_num

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: reserve/unreserve vmid by vm ioctl v4
Chunming Zhou [Thu, 20 Apr 2017 08:18:48 +0000 (16:18 +0800)]
drm/amdgpu: reserve/unreserve vmid by vm ioctl v4

add reserve/unreserve vmid funtions. Used to reserve
vmids for certain shader debugging functionality that
required a fixed vmid for the life of the debug.

v3:
only reserve vmid from gfxhub
v4:
fix racy condition

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add reserved vmid field in vm struct v2
Chunming Zhou [Thu, 20 Apr 2017 08:17:34 +0000 (16:17 +0800)]
drm/amdgpu: add reserved vmid field in vm struct v2

v2: rename dedicated_vmid to reserved_vmid

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add vm ioctl
Chunming Zhou [Mon, 24 Apr 2017 03:09:04 +0000 (11:09 +0800)]
drm/amdgpu: add vm ioctl

It will be used for reserving vmid for shader debugging
that requires a fixed vmid.

v2: fix warning (Alex)

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: Enable chained IB MCBP support
Trigger Huang [Thu, 27 Apr 2017 07:09:31 +0000 (03:09 -0400)]
drm/amdgpu: Enable chained IB MCBP support

Support for MCBP/Virtualization in combination with chained IBs is
formal released on firmware feature version #46. So enable it
according to firmware feature version, otherwise, world switch will
hang.

Signed-off-by: Trigger Huang <trigger.huang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu:fix get wrong gfx always on cu masks.
Rex Zhu [Wed, 26 Apr 2017 08:32:22 +0000 (16:32 +0800)]
drm/amdgpu:fix get wrong gfx always on cu masks.

Bug: SWDEV-117987: Always on CU mask broken for gfx7+

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix s3 ring test failed on Vi caused by KIQ enabled.
Rex Zhu [Mon, 24 Apr 2017 14:00:09 +0000 (22:00 +0800)]
drm/amdgpu: fix s3 ring test failed on Vi caused by KIQ enabled.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/virt: change the place of virt_init_setting
Xiangliang Yu [Fri, 21 Apr 2017 06:06:09 +0000 (14:06 +0800)]
drm/amdgpu/virt: change the place of virt_init_setting

Change place of virt_init_setting function so that can cover the
cg and pg flags configuration.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/virt: bypass cg and pg setting for SRIOV
Xiangliang Yu [Fri, 21 Apr 2017 06:01:29 +0000 (14:01 +0800)]
drm/amdgpu/virt: bypass cg and pg setting for SRIOV

GPU hypervisor cover all settings of CG and PG, so guest doesn't
need to do anything. Bypass it.

Signed-off-by: Frank Min <Frank.Min@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: drop support for per ASIC read registers
Christian König [Wed, 12 Apr 2017 10:53:18 +0000 (12:53 +0200)]
drm/amdgpu: drop support for per ASIC read registers

Only per family registers are still used.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: drop support for untouched registers
Christian König [Wed, 12 Apr 2017 10:49:54 +0000 (12:49 +0200)]
drm/amdgpu: drop support for untouched registers

I couldn't figure out what this was original good for, but we
don't use it any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: delete redundant kiq irq funcs type check in gfx8.
Rex Zhu [Tue, 18 Apr 2017 04:59:41 +0000 (12:59 +0800)]
drm/amdgpu: delete redundant kiq irq funcs type check in gfx8.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix typo in dmesg in gfx_v8_0_kiq_kcq_disable.
Rex Zhu [Tue, 18 Apr 2017 05:00:43 +0000 (13:00 +0800)]
drm/amdgpu: fix typo in dmesg in gfx_v8_0_kiq_kcq_disable.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add HDMI audio support for si dce6
Xiaojie Yuan [Tue, 21 Feb 2017 03:41:40 +0000 (11:41 +0800)]
drm/amdgpu: add HDMI audio support for si dce6

Signed-off-by: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add DP audio support for si dce6 (v3)
Xiaojie Yuan [Sun, 19 Feb 2017 11:56:17 +0000 (19:56 +0800)]
drm/amdgpu: add DP audio support for si dce6 (v3)

v2: refine dce_v6_0_audio_endpt_wreg() and unify inconsistent method names
v3: fix num_pins for tahiti, pitcairn, verde and oland

Signed-off-by: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: move CP_PQ_STATUS after doorbell range setting (v2)
Alex Deucher [Thu, 13 Apr 2017 18:35:02 +0000 (14:35 -0400)]
drm/amdgpu/gfx8: move CP_PQ_STATUS after doorbell range setting (v2)

I'm not sure if the order matters, but it seems like it makes
more sense to set this after the range is programmed.

v2: rebase (Alex)

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: set cpg doorbell for fiji and polaris.
Rex Zhu [Tue, 11 Apr 2017 07:44:29 +0000 (15:44 +0800)]
drm/amdgpu: set cpg doorbell for fiji and polaris.

add set_doorbell functions for mec and cpg.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: unify the HQD deactivation code
Alex Deucher [Tue, 11 Apr 2017 21:37:01 +0000 (17:37 -0400)]
drm/amdgpu/gfx8: unify the HQD deactivation code

This could be used in Andres' priority scheduling patch
as well.

Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: enable cp/rlc ints after we disable clockgating
Alex Deucher [Tue, 14 Mar 2017 19:00:23 +0000 (15:00 -0400)]
drm/amdgpu/gfx8: enable cp/rlc ints after we disable clockgating

Even if we disable clockgating, we still need to make sure the
cp/rlc interrupts are enabled for powergating which might still
be enabled.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx7: enable cp/rlc ints after we disable clockgating
Alex Deucher [Tue, 14 Mar 2017 19:04:59 +0000 (15:04 -0400)]
drm/amdgpu/gfx7: enable cp/rlc ints after we disable clockgating

Even if we disable clockgating, we still need to make sure the
cp/rlc interrupts are enabled for powergating which might still
be enabled.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: move MEC doorbell range setting
Alex Deucher [Mon, 10 Apr 2017 17:00:14 +0000 (13:00 -0400)]
drm/amdgpu/gfx8: move MEC doorbell range setting

It's global, not queue specific, so move it out of the
kiq register init function.

Tested-and-Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: fix resume of KIQ and KCQs
Alex Deucher [Fri, 31 Mar 2017 16:00:14 +0000 (12:00 -0400)]
drm/amdgpu/gfx8: fix resume of KIQ and KCQs

No need to reset the wptr and clear the rings.  The UNMAP_QUEUES
packet writes the current MQD state back the MQD on suspend,
so there is no need to reset it as well.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: properly disable the KCQs in hw_fini
Alex Deucher [Thu, 30 Mar 2017 17:06:32 +0000 (13:06 -0400)]
drm/amdgpu/gfx8: properly disable the KCQs in hw_fini

Use the UNMAP_QUEUES packet to have the KIQ properly
disable them.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: use new KIQ packet defines
Alex Deucher [Thu, 30 Mar 2017 16:34:06 +0000 (12:34 -0400)]
drm/amdgpu/gfx8: use new KIQ packet defines

Rather than open coding them.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: move SET_RESOURCES into the same command stream
Alex Deucher [Wed, 29 Mar 2017 19:31:22 +0000 (15:31 -0400)]
drm/amdgpu/gfx8: move SET_RESOURCES into the same command stream

As the KCQ setup.  This way we only have to wait once for the
entire MEC.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: wait once for all KCQs to be created
Alex Deucher [Wed, 29 Mar 2017 17:42:32 +0000 (13:42 -0400)]
drm/amdgpu/gfx8: wait once for all KCQs to be created

Rather than waiting for each queue.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: split gfx_v8_0_kiq_init_queue into two
Alex Deucher [Wed, 29 Mar 2017 17:23:44 +0000 (13:23 -0400)]
drm/amdgpu: split gfx_v8_0_kiq_init_queue into two

One for KIQ and one for the KCQ. This simplifies the logic and
allows for future optimizations.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: wait for completion in KIQ init
Alex Deucher [Wed, 29 Mar 2017 17:15:22 +0000 (13:15 -0400)]
drm/amdgpu/gfx8: wait for completion in KIQ init

We need to make sure the various init sequences submitted
to KIQ complete before testing the rings.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoRevert "drm/amd/amdgpu: Disable GFX_PG on Carrizo until compute issues solved"
Alex Deucher [Fri, 17 Mar 2017 19:27:06 +0000 (15:27 -0400)]
Revert "drm/amd/amdgpu: Disable GFX_PG on Carrizo until compute issues solved"

Re-enable GFX PG.  It's working properly with MEC now that KIQ is
enabled.

Reviewed-by: Samuel Li <samuel.li@amd.com>
This reverts commit e9ef19aa1bdeac380662a112f1d03a7c3477527f.

7 years agodrm/amdgpu: Switch baremetal to use KIQ for compute ring management. (v3)
David Panariti [Tue, 28 Mar 2017 16:57:31 +0000 (12:57 -0400)]
drm/amdgpu: Switch baremetal to use KIQ for compute ring management. (v3)

KIQ is the Kernel Interface Queue for managing the MEC.  Rather than setting
up rings via direct MMIO of ring registers, the rings are configured via
special packets sent to the KIQ.  The allows the MEC to better manage shared
resources and certain power events.

v2: squash in s3/s4 fix from Rex
v3: further fixes from Rex

Signed-off-by: David Panariti <David.Panariti@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: set doorbell range for polaris as well
Alex Deucher [Mon, 10 Apr 2017 16:48:02 +0000 (12:48 -0400)]
drm/amdgpu/gfx8: set doorbell range for polaris as well

Add missing chips to the doorbell range setup.  These
were missed in the KIQ code.  Fixes power and performance
regressions with KIQ.  Spotted by Rex.

Tested-and-Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: add additional MQD initialization
Alex Deucher [Fri, 7 Apr 2017 21:43:05 +0000 (17:43 -0400)]
drm/amdgpu/gfx8: add additional MQD initialization

Need to properly set the MTYPE and ROQ space setting.
This should fix performance regressions with KIQ enabled.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: fix pcie dpm table for vega10
Eric Huang [Thu, 11 May 2017 15:55:48 +0000 (11:55 -0400)]
drm/amd/powerplay: fix pcie dpm table for vega10

This resolves pcie low speed problem.

Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>