Alex Deucher
313c45fdb4
drm/amdgpu/gmc7: remove duplicate wait_for_idle functions
...
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:02:05 -04:00
Alex Deucher
34e3205e08
drm/amdgpu/gmc8: remove duplicate wait_for_idle functions
...
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:02:05 -04:00
Junwei Zhang
5a3f25dbcb
drm/amdgpu/dce8: fix flash with white screen on monitor
...
Fixed mc stop and resume hardware programming sequence.
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:02:04 -04:00
Alex Deucher
9ecbe7f506
drm/amdgpu: skip invalid ip blocks in ip helpers
...
Skip IP blocks that are not enabled.
Reviewed-by: Chunming zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:02:04 -04:00
Alex Deucher
a225bf1c9c
drm/amdgpu: add missing breaks
...
Saves a few CPU cycles.
Reviewed-by: Chunming zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:02:03 -04:00
Alex Deucher
5dbbb60ba6
drm/amdgpu: add IP helpers for wait_for_idle and is_idle
...
Helpers to to call the IP functions for the selected IP.
Reviewed-by: Chunming zhou <david1.zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:02:02 -04:00
Alex Deucher
7359ee637d
drm/amdgpu/dce11: update async flip update time
...
Use UPDATE_IMMEDIATE (update on next data request boundary) rather
than UPDATE_H_RETRACE (update on next line boundary). The data
request boundary is less than a scanline, so it update will happen
sooner.
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:02:01 -04:00
Christian König
9a79588c42
drm/amdgpu: don't update page tables for VM emulation
...
It's just overhead to do so and allocating a VMID
when we don't need one is actually a bit dangerous.
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 >
2016-07-07 15:02:00 -04:00
Christian König
d5b4e25d83
drm/amdgpu: implement HDP functions for UVD v2
...
Flush and invalidate the HDP caches.
v2: fix typo in comment
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 >
2016-07-07 15:01:59 -04:00
Huang Rui
d1371f8c5d
drm/amdgpu: change pcie_gen_cap magic code to macro
...
This patch changes pcie_gen_cap magic code to macro to make it more
readable.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Huang Rui <ray.huang@amd.com >
Cc: Eric Huang <JinHuiEric.Huang@amd.com >
Cc: Ken Wang <Qingqing.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:01:59 -04:00
Alex Deucher
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
Alex Deucher
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
Alex Deucher
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
Alex Deucher
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
Alex Deucher
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
Alex Deucher
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
Christian König
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
Christian König
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
Chunming Zhou
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
Arindam Nath
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
Alex Deucher
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
Nicolai Hähnle
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
Nicolai Hähnle
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
Nicolai Hähnle
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
Chunming Zhou
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
Chunming Zhou
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
Christian König
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
Christian König
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
Christian König
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
Christian König
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
Christian König
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
Christian König
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
Christian König
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
Eric Huang
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
Huang Rui
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
Huang Rui
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
Nicolai Hähnle
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
Eric Huang
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
Alex Deucher
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
Alex Deucher
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
David Mao
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
David Mao
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
Tom St Denis
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
Alex Xie
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
Alex Xie
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
Alex Xie
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
Chunming Zhou
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
Chunming Zhou
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
Christian König
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
Christian König
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