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
6ab3886c2c
drm/amdgpu/gfx8: Switch Stoney to share CZ's RLC functions
...
According to the bringup code ST/CZ share the RLC
ENTER/EXIT logic.
Tested on my ST board.
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:16 -04:00
395d1fb948
drm/amdgpu: add amdgpu.cg_mask and amdgpu.pg_mask parameters
...
They allow disabling clock and power gating from the kernel command line,
which hopefully helps with diagnosing problems in the field.
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:51:16 -04:00
f4b373f41c
drm/amdgpu/trace: Add tracepoints to MMIO read/writes
...
Add tracepoints to the MMIO read/write so we can log
MMIO traffic.
Signed-off-by: Tom St Denis <tom.stdenis@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:15 -04:00
c66875b1ee
drm/amdgpu: print smc fw info in CGS.
...
The non-powerplay code handles this directly. Do
it in cgs for powerplay.
Signed-off-by: yanyang1 <Young.Yang@amd.com >
Reviewed-by: Rex Zhu Rex.Zhu@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:15 -04:00
83ba126a9b
drm/amdgpu: properly clean up runtime pm
...
Was missing the calls to fini.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:14 -04:00
c63695cc5e
drm/amdgpu: work around lack of upstream ACPI support for D3cold
...
Until Dave's patch to support the new hybrid gfx ACPI method goes
upstream, we can fallback to the old ATPX method which seems to
still work.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:13 -04:00
1974e30eb1
drm/amdgpu: add gpu reset to timeout handler
...
so that we could actually reset the GPU when it hangs.
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com >
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:12 -04:00
a909c6bd9f
drm/amdgpu: fix ring debugfs bug
...
debugfs file added but not released after driver unloaded
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:12 -04:00
c71dbd93eb
drm/amd/amdgpu: ring debugfs is read in increments of 4 bytes
...
If a user tries to read a non-multiple of 4 bytes it would have
read until the end of the ring potentially crashing the user
task.
Signed-off-by: Tom St Denis <tom.stdenis@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:11 -04:00
4f4824b556
drm/amd/amdgpu: Convert ring debugfs entries to binary
...
They now emit ring data in binary which will be read/written by
the userspace tool umr shortly.
Signed-off-by: Tom St Denis <tom.stdenis@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:10 -04:00
522761cbc8
drm/amdgpu: drop explicit pci D3/D0 setting for ATPX power control
...
The ATPX power control method does this for you.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:08 -04:00
1167097576
drm/amdgpu/atpx: hybrid platforms use d3cold
...
The platform d3 cold is used to power down the dGPU.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:07 -04:00
2f5af82eea
drm/amdgpu/atpx: track whether if this is a hybrid graphics platform
...
hybrid graphics in this case refers to systems which use the new
platform d3 cold ACPI methods as opposed to ATPX for dGPU power
control.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:07 -04:00
d85555f885
drm/amdgpu/atpx: drop forcing of dGPU power control
...
Now that we handle this correctly, there is no need to force
it.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:02 -04:00
7e32aa611b
drm/amdgpu: use PCI_D3hot for PX systems without dGPU power control
...
On PX systems without dGPU power control, use PCI_D3hot.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:51:02 -04:00