Christian König
e18fb1fd34
drm/amdgpu: wire up emit_wreg for gfx v6
...
Needed for vm_flush unification.
v2: handle compute rings as well.
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 >
2018-02-19 14:18:00 -05:00
Rex Zhu
7b158d1691
drm/amdgpu: Bump driver version for sensor pstate clk
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:58 -05:00
Rex Zhu
60bbade2a6
drm/amdgpu: Expose more GPU sensor queries
...
Add sub-queries for stable pstate shader/memory clock.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:57 -05:00
Chunming Zhou
156a81be3f
drm/amdgpu: all vram is visible for APU (v2)
...
missed in gmc9.
v2: squash in build fix (Rex)
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 >
2018-02-19 14:17:57 -05:00
Rex Zhu
11f64ff5f3
drm/amd/pp: Add a new pp feature mask bit for OD feature
...
when this bit was set on module load,
driver will allow the user over/under gpu
clock and voltage through sysfs.
by default, this bit was not set.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:55 -05:00
Rex Zhu
5ed8d656d6
drm/amd/pp: Add stable Pstate clk display support in debugfs
...
The additional output are: PSTATE_SCLK and PSTATE_MCLK value
in MHz as:
300 MHz (PSTATE_SCLK)
300 MHz (PSTATE_MCLK)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:53 -05:00
Rex Zhu
37c5c4dbf0
drm/amdgpu: add custom power policy support in sysfs
...
when cat pp_power_profile_mode on Vega10
NUM MODE_NAME BUSY_SET_POINT FPS USE_RLC_BUSY MIN_ACTIVE_LEVEL
0 3D_FULL_SCREEN : 70 60 1 3
1 POWER_SAVING : 90 60 0 0
2 VIDEO*: 70 60 0 0
3 VR : 70 90 0 0
4 COMPUTER : 30 60 0 6
5 CUSTOM : 0 0 0 0
the result show all the profile mode we can support and custom mode.
user can echo the num(0-4) to pp_power_profile_mode to select the profile
mode or can echo "5 value value value value" to enter CUSTOM mode.
the four parameter is set_point/FPS/USER_RLC_BUSY/MIN_ACTIVE_LEVEL.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:52 -05:00
Christian König
5a4633c4b8
drm/amdgpu: forward pasid to backend flush implementations
...
rd the pasid from the VM code to the emit_vm_flush function and update
all implementations with the new parameter.
Signed-off-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 >
2018-02-19 14:17:47 -05:00
Christian König
ba35222437
drm/amdgpu: trace the PASID instead of the VM pointer
...
Makes more sense than tracing the kernel pointer.
Signed-off-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 >
2018-02-19 14:17:47 -05:00
Christian König
c35ff18823
drm/amdgpu: trace allocated PASIDs
...
Trace all allocated PASIDs.
Signed-off-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 >
2018-02-19 14:17:46 -05:00
Christian König
5c2ff9a60d
drm/amdgpu: always allocate a PASIDs for each VM v2
...
Start to always allocate a pasid for each VM.
v2: use dev_warn when we run out of PASIDs
Signed-off-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 >
2018-02-19 14:17:46 -05:00
Christian König
4b5f755049
drm/amdgpu: add amdgpu_pasid_free_delayed v2
...
Free up a pasid after all fences signaled.
v2: also handle the case when we can't allocate a fence array.
Signed-off-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 >
2018-02-19 14:17:45 -05:00
Christian König
373ac645c9
drm/amdgpu: move PD/PT address calculation into backend function
...
This way we can better handle the differences for CPU based updates.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:45 -05:00
Christian König
132f34e4b5
drm/amdgpu: move struct gart_funcs into amdgpu_gmc.h
...
And rename it to struct gmc_funcs.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Samuel Li <Samuel.Li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:44 -05:00
Christian König
770d13b19f
drm/amdgpu: move struct amdgpu_mc into amdgpu_gmc.h
...
And rename it to amdgpu_gmc as well.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Samuel Li <Samuel.Li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:43 -05:00
Christian König
da320625de
drm/amdgpu: remove agp_base
...
No AGP support for in this driver.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Samuel Li <Samuel.Li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:43 -05:00
Christian König
904a3374a9
drm/amdgpu: print the PASID with VM faults on GMC v8
...
Print that extra information on GMC v8.
Signed-off-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 >
2018-02-19 14:17:42 -05:00
Christian König
a9f7cd1b0b
drm/amdgpu: print the PASID with VM faults on GMC v7
...
Print that extra information on GMC v7.
Signed-off-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 >
2018-02-19 14:17:42 -05:00
Christian König
3816e42f5f
drm/amdgpu: rename pas_id to pasid
...
sed -i "s/pas_id/pasid/g" drivers/gpu/drm/amd/amdgpu/*.c
sed -i "s/pas_id/pasid/g" drivers/gpu/drm/amd/amdgpu/*.h
Signed-off-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 >
2018-02-19 14:17:41 -05:00
Samuel Li
09052fc376
drm/amdgpu: Move to gtt before cpu accesses dma buf.
...
To improve cpu read performance. This is implemented for APUs currently.
v2: Adapt to change https://lists.freedesktop.org/archives/amd-gfx/2017-October/015174.html
v3: Adapt to change "forward begin_cpu_access callback to drivers"
v4: Instead of v3, reuse drm_gem dmabuf_ops here. Also some minor fixes as suggested.
v5: only set dma_buf ops when it is valid (Samuel)
Signed-off-by: Samuel Li <Samuel.Li@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:41 -05:00
Alex Deucher
2c9c178b7d
drm/amdgpu: only allow scatter/gather display with DC
...
Check if DC is enabled before allowing scanout buffers
to be pinned in system memory.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:39 -05:00
Christian König
5d43be0ccb
drm/amdgpu: allow framebuffer in GART memory as well
...
On CZ and newer APUs we can pin the fb into GART as well as VRAM.
v2: Don't enable gpu_vm_support for Raven yet since it leads to
a black screen. Need to debug this further before enabling.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Samuel Li <samuel.li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:39 -05:00
Yong Zhao
c8553f4bd2
drm/amdgpu: Update MMHUB power gating register settings
...
The new register settings are needed to fix a tlb invalidation issue
when MMHUB power gating is turned on for Raven.
Signed-off-by: Yong Zhao <yong.zhao@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com >
Acked-by: Eric Huang <JinhuiEric.Huang@amd.com >
Reviewed-by: Eric Huang <JinhuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:38 -05:00
Fengguang Wu
02d170e264
drm/amdgpu: fix semicolon.cocci warnings
...
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c:281:2-3: Unneeded semicolon
Remove unneeded semicolon.
Generated by: scripts/coccinelle/misc/semicolon.cocci
Fixes: 620f774f46 ("drm/amdgpu: separate VMID and PASID handling")
CC: Christian König <christian.koenig@amd.com >
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:16 -05:00
Alex Deucher
64b9342f31
drm/amdgpu: drop extra tlb invalidation in gpuvm
...
We only need to flush the HDP here, not invalidate the TLB.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:14 -05:00
Alex Deucher
b1d128689f
drm/amdgpu: adjust HDP write queue flushing for tlb invalidation
...
Separate tlb invalidation and hdp flushing and move the HDP
flush to the caller.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:14 -05:00
Alex Deucher
73c732405f
drm/amdgpu: add HDP asic callbacks for SOC15 (v2)
...
Needed to flush and invalidate the HDP block using the CPU.
v2: use preferred register on soc15.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Samuel Li <Samuel.Li@amd.com > (v1)
2018-02-19 14:17:13 -05:00
Alex Deucher
dd8d07f2fb
drm/amdgpu: add HDP asic callbacks for VI
...
Needed to flush and invalidate the HDP block using the CPU.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Samuel Li <Samuel.Li@amd.com >
2018-02-19 14:17:13 -05:00
Alex Deucher
13854c60d7
drm/amdgpu: add HDP asic callbacks for CIK
...
Needed to flush and invalidate the HDP block using the CPU.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Samuel Li <Samuel.Li@amd.com >
2018-02-19 14:17:12 -05:00
Alex Deucher
2d5e0807ed
drm/amdgpu: add HDP asic callbacks for SI
...
Needed to flush and invalidate the HDP block using the CPU.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Samuel Li <Samuel.Li@amd.com >
2018-02-19 14:17:12 -05:00
Alex Deucher
2df1b8b6a1
drm/amdgpu: add new asic callbacks for HDP flush/invalidation
...
Needed to properly flush the HDP cache with the CPU from rather
than the GPU.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Samuel Li <Samuel.Li@amd.com >
2018-02-19 14:17:11 -05:00
Andres Rodriguez
f8e3e0ee8f
drm/amdgpu: bump version for gfx9 high priority compute
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Andres Rodriguez <andresx7@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:10 -05:00
Andres Rodriguez
761c77c195
drm/amdgpu: add high priority compute support for gfx9
...
We follow the same approach as gfx8. The only changes are register
access macros.
Tested on vega10. The execution latency results fall within the expected
ranges from the polaris10 data.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Andres Rodriguez <andresx7@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:10 -05:00
Evan Quan
1357f0c5ac
drm/amd/powerplay: new cgs interface setting dpm thermal range
...
This will be used by powerplay to update the dpm temp range structure
used to interface with hwmon.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:06 -05:00
Evan Quan
39199b803b
drm/amd/powerplay: removed hwmgr_handle_task unused parameter and given a better name for
...
other parameter
Signed-off-by: Evan Quan <evan.quan@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:05 -05:00
Dhinakaran Pandiyan
23effc1100
drm/amdgpu: Handle 64-bit return from drm_crtc_vblank_count()
...
570e86963a ("drm: Widen vblank count to 64-bits [v3]") changed the
return type for drm_crtc_vblank_count() to u64. This could cause
potential problems if the return value is used in arithmetic operations
with a 32-bit reference HW vblank count. Explicitly typecasting this down
to u32 either fixes a potential problem or serves to add clarity in case
the typecasting was implicitly done.
Cc: Keith Packard <keithp@keithp.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Reviewed-by: Keith Packard <keithp@keithp.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com > for both this patch
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180203051302.9974-4-dhinakaran.pandiyan@intel.com
2018-02-15 11:49:35 -08:00
Shaoyun Liu
4fd09a19a6
drm/admgpu: Reduce the usage of soc15ip.h
...
Remove the header where it's not used.
Acked-by: Christian Konig <christian.koenig@amd.com >
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-08 11:35:19 -05:00
Shaoyun Liu
cd29253f65
drm/amdgpu: Change SOC15_REG_OFFSET to use dynamic register offset
...
Acked-by: Christian Konig <christian.koenig@amd.com >
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-08 11:32:24 -05:00
Shaoyun Liu
946a4d5b30
drm/amdgpu: Avoid use SOC15_REG_OFFSET in static const array
...
Handle dynamic offsets correctly in static arrays.
Acked-by: Christian Konig <christian.koenig@amd.com >
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-08 11:18:51 -05:00
Shaoyun Liu
b466107e8b
drm/amdgpu: Use dynamic IP offset for register access on SOC15
...
Update the register access macros and functions to take into
account the new dynamic IP base offsets.
Acked-by: Christian Konig <christian.koenig@amd.com >
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-08 11:17:56 -05:00
Shaoyun Liu
4522824c48
drm/amdgpu: Dynamic initialize IP base offset
...
The base offsets of the IP blocks may change across
asics even though the relative register offsets
are the same for an IP. Handle this dynamically.
Acked-by: Christian Konig <christian.koenig@amd.com >
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-08 11:16:51 -05:00
Lucas Stach
4983e48c85
drm/sched: move fence slab handling to module init/exit
...
This is the only part of the scheduler which must not be called from
different drivers. Move it to module init/exit so it is done a single
time when loading the scheduler.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-07 11:52:14 -05:00
Lucas Stach
1b1f42d8fd
drm: move amd_gpu_scheduler into common location
...
This moves and renames the AMDGPU scheduler to a common location in DRM
in order to facilitate re-use by other drivers. This is mostly a straight
forward rename with no code changes.
One notable exception is the function to_drm_sched_fence(), which is no
longer a inline header function to avoid the need to export the
drm_sched_fence_ops_scheduled and drm_sched_fence_ops_finished structures.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-07 11:51:56 -05:00
Alex Deucher
9ce6aae12c
drm/amdgpu: add license to files where it was missing
...
These files were missing it before.
Acked-by: Harry Wentland <harry.wentland@amd.com >
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-07 11:51:25 -05:00
Alex Deucher
1a09120f83
drm/amdgpu: add license to Makefiles
...
Was missing license text.
Acked-by: Harry Wentland <harry.wentland@amd.com >
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-07 11:51:10 -05:00
Andrey Grodzovsky
54f539086a
drm/amdgpu: Fix amdgpu_sync_add_later to preserve explicit flag.
...
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-07 11:48:56 -05:00
Noralf Trønnes
ab77e02ce9
drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
...
This driver can use drm_fb_helper_lastclose() in its .lastclose function.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.
Remove the unused driver implementations.
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:33 -05:00
Christian König
d4b7648d6d
drm/amdgpu: fix amdgpu_sync_resv v2
...
Fixes a bug introduced by AMDGPU_GEM_CREATE_EXPLICIT_SYNC. We still need
to wait for pipelined moves in the shared fences list.
v2: fix typo
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Andres Rodriguez <andresx7@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:32 -05:00
Roger He
5f97fc0e03
drm/amd/amdgpu: set gtt size according to system memory size only
...
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 >
2017-12-06 12:48:31 -05:00
Andrey Grodzovsky
cebb52b7bc
drm/amdgpu: Get rid of dep_sync as a seperate object.
...
Instead mark fence as explicit in it's amdgpu_sync_entry.
v2:
Fix use after free bug and add new parameter description.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:31 -05:00