4d54588e94
drm/amdgpu/gfx7: make gfx_v7_0_rlc_stop static
...
Not used outside of gfx7.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:01:58 -04:00
06120a1e0f
drm/amdgpu/gfx7: switch to using the existing rlc callbacks
...
gfx8 already uses them. Remove the direct exports and
use the callbacks fpr gfx7.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:01:57 -04:00
05fb7291fd
drm/amdgpu: move select_se_sh into the gfx struct
...
It's gfx IP specific, not asic specific, so move to a
gfx callback.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:01:57 -04:00
b95e31fdda
drm/amdgpu: move get_gpu_clock_counter into the gfx struct
...
It's gfx IP specific, not asic specific, so move to a
gfx callback.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:01:42 -04:00
4b7d97ac83
drm/amdgpu: drop wait_for_mc_idle asic callback
...
Only used in the gmc IP modules so just call the local
function directly.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:50 -04:00
ccd73f24ae
drm/amdgpu/gmc: make some functions static
...
These are not used outside of the respective gmc ip modules.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:50 -04:00
5a712a8727
drm/amdgpu: validate VM PTs only on eviction
...
We don't need to validate them again if the eviction counter didn't changed.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:49 -04:00
dbd5ed60ac
drm/amdgpu: add eviction counter
...
Keep track of the number of evictions since boot.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:49 -04:00
0eaeb070ed
drm/amdgpu: add amdgpu_irq_gpu_reset_resume_helper
...
irq need to update when gpu reset happens.
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com >
Reviewed-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 >
2016-07-07 14:54:48 -04:00
fb065ce7d3
drm/amd/amdgpu: make sure VCE is disabled by default
...
With the current code, when we boot with the amdgpu
driver enabled and loaded, the VCE also automatically
remains enabled since bootup. This can be verified from
the output of amdgpu_pm_info. It does not matter whether
we boot into command line directly or into X, the VCE
stays enabled the entire time.
This patch addresses the issue and makes sure that
VCE is turned on only during playback, and remains
disaled otherwise.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Arindam Nath <arindam.nath@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:47 -04:00
93dcc37d2c
drm/amdgpu: disable compute pipeline sync workaround when using fixed fw
...
No need to stall the pipe when we are using firmware with the
fix.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:46 -04:00
9de06de80e
drm/amdgpu/gfx8: set USER_SHADER_ARRAY_CONFIG based on disable_cu parameter
...
v2: do not overwrite register when bitmap is zero
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:46 -04:00
324c614a81
drm/amdgpu/gfx7: set USER_SHADER_ARRAY_CONFIG based on disable_cu parameter
...
v2: do not overwrite register when bitmap is zero
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:45 -04:00
6f8941a230
drm/amdgpu: add disable_cu parameter
...
This parameter will allow disabling individual CUs on module load, e.g.
amdgpu.disable_cu=2.0.3,2.0.4 to disable CUs 3 and 4 of SE2.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:44 -04:00
8b2ac10320
drm/amdgpu: evict vram when gpu reset
...
On workstation cards with ECC vram, the entirety of vram is cleared to 0
on asic init to set the ECC status correctly. On non ECC boards, I don't
think they do any explicit clearing, but the vram controller is reset
which may cause issues with the data there.
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:44 -04:00
0875dc9e80
drm/amdgpu: block scheduler when gpu reset
...
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 >
2016-07-07 14:54:43 -04:00
ce64bc25ef
drm/amdgpu: pipeline evictions as well
...
This boosts Xonotic from 38fps to 47fps when artificially limiting VRAM to
256MB for testing. It should improve all CPU bound rendering situations
where we have a lot of swapping to/from VRAM.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:42 -04:00
281d144ddd
drm/amdgpu: save the PD addr before scheduling the job
...
When we pipeline evictions the page directory could already be
moving somewhere else when grab_id is called.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:41 -04:00
74561cd4f1
drm/ttm: remove no_gpu_wait param from ttm_bo_move_accel_cleanup
...
It isn't used and not waiting for the GPU after scheduling a move is
actually quite dangerous.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:39 -04:00
99c44632d4
drm/amdgpu: remove pre move wait
...
Not needed any more.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:38 -04:00
3cabaa54e7
drm/amdgpu: sync to buffer moves before VM updates
...
Otherwise we could update the VM page tables while the move is only scheduled.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:38 -04:00
77dfc28bad
drm/ttm: wait for BO idle in ttm_bo_move_memcpy
...
When we want to pipeline accelerated moves we need to wait in the fallback path.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:35 -04:00
88932a7be2
drm/ttm: add wait for idle in all drivers bo_move functions
...
Wait for idle before moving the BO in all drivers implementing
an accelerated move function.
This should keep the current behavior when removing the pre move wait.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:35 -04:00
14b3307429
drm/amdgpu: some improvement in parsing inputs
...
It changes the way to skip newline character and also avoids
warning message from some compiler.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:32 -04:00
50ab2533d2
drm/amdgpu: introduce a firmware debugfs to dump all current firmware versions
...
This patch implements the debugfs to dump all currect firmware
version:
root@jenkins-All-Series:/home/jenkins# cat /sys/kernel/debug/dri/0/amdgpu_firmware_info
VCE feature version: 0, firmware version: 0x34040300
UVD feature version: 0, firmware version: 0x01451000
MC feature version: 0, firmware version: 0x00000000
ME feature version: 37, firmware version: 0x00000093
PFP feature version: 37, firmware version: 0x000000da
CE feature version: 37, firmware version: 0x00000080
RLC feature version: 1, firmware version: 0x0000010e
MEC feature version: 37, firmware version: 0x0000029e
MEC2 feature version: 37, firmware version: 0x0000029e
SMC feature version: 0, firmware version: 0x013353e6
SDMA0 feature version: 31, firmware version: 0x00000036
SDMA1 feature version: 0, firmware version: 0x00000036
Suggested-by: Alex Deucher <Alexander.Deucher@amd.com >
Signed-off-by: Huang Rui <ray.huang@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:33 -04:00
000cab9a61
drm/amdgpu: factor out the AMDGPU_INFO_FW_VERSION case branch into amdgpu_firmware_info
...
The new amdgpu_firmware_info function will be used on amdgpu firmware
version debugfs.
Suggested-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Huang Rui <ray.huang@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:33 -04:00
8db6f83bef
drm/amdgpu: remove cgs_acpi_method_argument member method_length
...
It was redundant with data_length, and in fact set incorrectly in one case
leading to an out-of-bound read by memcpy in acpi_ut_copy_esimple_to_isimple,
reported by CONFIG_KASAN=y.
Signed-off-by: Nicolai Hähnle <Nicolai.Haehnle@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:32 -04:00
840dd4c605
drm/amd/powerplay: set UVD clocks bypass mode for Polaris10
...
Saves power when not in use.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:32 -04:00
b58bc5598a
drm/amdgpu/gfx7: fix CP jump table size
...
Align to the jump table offset. May fix hangs on some
asics with GFX PG enabled.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Acked-by: Tom St Denis <tom.stdenis@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:30 -04:00
07cf1a0b95
drm/amdgpu/gfx8: fix CP jump table size
...
Align to the jump table offset. Fixes hangs on some
systems with GFX PG enabled.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Tested-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Reviewed-by: Tom St Denis <tom.stdenis@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:29 -04:00
15da301d88
drm/amd/amdgpu : adding new tracepoints to track memory information.
...
- adding amdgpu_cs_bo_status to track total size and
total entry count of bo for each submission.
- adding amdgpu_ttm_bo_move to track the bo eviction
including the size of bo and the location before/after the move
Signed-off-by: David Mao <David.Mao@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:29 -04:00
42ffb5822b
drm/amd/amdgpu : Refine tracepoints to track more information
...
- adding memory type, prefered heap, allowed heap, and host visible
information to the amdgpu_bo_create tracepoint.
- adding bo size to the amdgpu_bo_list_set tracepoint.
Signed-off-by: David Mao <David.Mao@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:28 -04:00
f78c34221b
drm/amdgpu/uvd6: De-numberify startup
...
To make the code more legible various numerical constants
have been changed to their #define'ed MASKs.
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:27 -04:00
2171849768
drm/amdgpu: Initialize the variables in a straight-forward way
...
Initialize the variable in a straight-forward way instead of
hiding the initialization inside the loop. This can also
reduce one function call.
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:27 -04:00
3a6f8e0c72
drm/amdgpu: Add comment to describe the purpose of one difficult if statement
...
Use == instead of != in the if statement to make code easier understood
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:26 -04:00
677131a16d
drm/amdgpu: Change some variable names to make code easier understood
...
Add comment to describe some variables otherwise.
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:26 -04:00
b314f9a997
drm/amdgpu: enable BUS master after pci reset
...
Re-enable bus mastering after GPU reset. We disable it
at the top of these functions, so balance them by
re-enabling it.
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com >
eviewed-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 >
2016-07-07 14:51:25 -04:00
89a3182737
drm/amdgpu: add return value for pci config reset
...
So we know whether or not the reset succeeded.
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com >
Reviewed-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 >
2016-07-07 14:51:24 -04:00
3dab83bee1
drm/amdgpu: remove now unnecessary checks
...
vm_flush() now comes directly after vm_grab_id().
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:24 -04:00
1fbb2e9299
drm/amdgpu: use a fence array for VMID management
...
Just wait for any fence to become available, instead
of waiting for the last entry of the LRU.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:23 -04:00
8d76001e00
drm/amdgpu: reuse VMIDs assigned to a VM only if there is also a free one
...
This fixes a fairness problem with the GPU scheduler. VM having lot of
jobs could previously starve VM with less jobs.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:23 -04:00
36fd7c5c3c
drm/amdgpu: prefer VMIDs idle on the current ring
...
Prefer to use a VMIDs which are idle on the ring we want to submit to. This
also removes bubbling idle VMIDs up on the LRU, which is actually not
beneficial.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:22 -04:00
3542023896
drm/amdgpu: add optional ring to amdgpu_sync_is_idle
...
Check if the sync object is idle depending on the ring a submission works with.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:21 -04:00
a7e7a93e57
drm/amdgpu: remove amdgpu_sync_wait
...
Stop hiding bugs, instead print a proper error when the scheduler
doesn't handle all dependencies.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:21 -04:00
6fc1367582
drm/amdgpu: generalize the scheduler fence
...
Make it two events, one for the job being scheduled and one when it is finished.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:20 -04:00
0e9d239b8d
drm/amdgpu: document amdgpu_sync_get_fence
...
It's not obvious what it should do.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:19 -04:00
78f73bf03c
drm/amdgpu/gfx80: Add QUICK_PG bit to GFX header and use it.
...
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:19 -04:00
dad4acc896
drm/amdgpu/gfx8: Tidy up various PG helpers
...
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:18 -04:00
216cde6008
drm/amdgpu/gfx8: Enable PG on Stoney
...
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:18 -04:00
413cf60073
drm/amdgpu/gfx8: Enable CG on Stoney
...
Enable all relevant CG flags for Stoney parts.
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:17 -04:00