Alex Deucher
273a14cd15
drm/amdgpu/gmc9: add vega12 support (v2)
...
Same as vega10.
v2: squash in golden regs fix from Feifei
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:36:46 -05:00
Alex Deucher
dca7b4015c
drm/amdgpu: add vega12 to dc support check
...
DC is used for modesetting on vega12.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:24:51 -05:00
Alex Deucher
f79f3fc141
drm/amdgpu/virtual_dce: add vega12 support
...
Add virtual dce support for vega12.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:24:35 -05:00
Alex Deucher
9aa52bc487
drm/amdgpu: specify vega12 vce firmware
...
Declare firmware and add support for the file.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:24:30 -05:00
Alex Deucher
2327e6261a
drm/amdgpu: specify vega12 uvd firmware
...
Declare firmware and add support for the file.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:24:24 -05:00
Feifei Xu
6b9c6e1b15
drm/amdgpu: add vega12 ucode loading method
...
Same as vega10.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
2018-03-21 14:24:18 -05:00
Evan Quan
eddfa8dfad
drm/amdgpu: initilize vega12 psp firmwares
...
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
Acked-by: Huang Rui <ray.huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-21 14:24:12 -05:00
Alex Deucher
ff13dc671d
drm/amdgpu/psp: initial vega12 support
...
Same as vega10 for now.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:24:07 -05:00
Hawking Zhang
ad0ad9aa20
drm/amdgpu: vega12 to smu firmware
...
Add the cgs interface to query the smu firmware for vega12
and declare the firmware.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
2018-03-21 14:24:00 -05:00
Alex Deucher
e48a3cd9cb
drm/amdgpu: set asic family and ip blocks for vega12
...
soc15 just like vega10 and raven.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:23:55 -05:00
Alex Deucher
3f76dcedb3
drm/amdgpu: add gpu_info firmware for vega12
...
Stores gpu configuration details.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-21 14:23:49 -05:00
Feifei Xu
8fab806ad1
drm/amdgpu: add vega12 to asic_type enum
...
Add vega12 to amd_asic_type enum and amdgpu_asic_name[].
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
2018-03-21 14:23:39 -05:00
Sean Paul
1c7095d283
Merge airlied/drm-next into drm-misc-next
...
Refresh -misc-next
Signed-off-by: Sean Paul <seanpaul@chromium.org >
2018-03-21 09:40:55 -04:00
Rex Zhu
eb4900aa4c
drm/amdgpu: Fix kernel NULL pointer dereference in dpm functions
...
caused by
'commit 83e3c4615872 ("drm/amdgpu: Remove wrapper layer of smu ip functions")'
BUG: unable to handle kernel NULL pointer dereference at 00000000000005d8
[ 313.241459] IP: ci_dpm_read_sensor+0x37/0xf0 [amdgpu]
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-03-20 23:44:50 -05:00
Rex Zhu
81ce8bea03
drm/amdgpu: Fix kernel NULL pointer dereference when amdgpu fini
...
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-03-20 23:44:21 -05:00
Mikita Lipski
e5b03032e3
drm/amdgpu - Disable all irqs before disabling all CRTCs
...
By moving amdgpu_irq_disable_all earlier in the sequence
fixes an issue with disabling pflip interrupts:
*ERROR* dal_irq_service_dummy_ack: called for non-implemented irq source
Earlier patch fixed a memory corruption and revealed irq
warnings.This way it seems to be there no obvious issues
with unloading the module.
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:44:12 -05:00
Mikita Lipski
088e7c1617
drm/amdgpu: Disable irq on device before destroying it
...
Disable irq on devices before destroying them. That prevents
use-after-free memory access when unloading the driver.
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:44:03 -05:00
Mikita Lipski
ff97cba8c1
drm/amdgpu: Use atomic function to disable crtcs with dc enabled
...
This change fixes the deadlock when unloading the driver with displays
connected.
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com >
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:42 -05:00
Tom St Denis
864917a3b8
drm/amd/amdgpu: fix offset into page with amdgpu_iomem debugfs file
...
The offset inside the page wasn't included in the copy call meaning
the start of the page was being read/written instead.
Reported-by: Jay Cornwall <Jay.Cornwall@amd.com >
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 >
2018-03-20 23:43:34 -05:00
Hawking Zhang
bd08a8d9e8
drm/amdgpu/nbio6: Correct PCIE_INDEX/DATA pair used for smn register accessing
...
PCIE_INDEX2/DATA2 pair will be used for smn register accessing since from vega.
PCIE_INDEX/DATA pair should be reserved for smu
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:25 -05:00
Alex Deucher
e3ecdffac9
drm/amdgpu: add documentation for amdgpu_device.c
...
Add kernel doc for the functions in amdgpu_device.c
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:05 -05:00
Alex Deucher
3ac952b10d
drm/amdgpu: add VCN to firmware query interface
...
Need to be able to query the VCN firmware version from
userspace to determine supported features, etc.
Reviewed-by: Huang Rui <ray.huang@amd.com >
Acked-by: Leo Liu <leo.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:42:49 -05:00
Rex Zhu
2538090cb6
drm/amd/pp: Delete get_xclk function in powerplay (v2)
...
use asic's callback function get_xclk in amdgpu
v2: squash in removal of leftover debug info
(drm/amd/pp: Delete debug info in smu7_hwmgr.c) (Rex)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:38:31 -05:00
Rex Zhu
699f47951e
drm/amdgpu: Delete dead code when early init
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:34:46 -05:00
Rex Zhu
59156faf81
drm/amd/pp: Remove the cgs wrapper for notify smu version on APU
...
Refine commit f49e9bac19 ("drm/amd/pp: Get and save Rv smu version")
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-03-16 16:16:49 -05:00
Felix Kuehling
ede0dd86f4
drm/amdgpu: Add kfd2kgd interface to acquire an existing VM
...
This allows acquiring an existing VM from a render node FD to use it
for a compute process.
Such VMs get destroyed when the original file descriptor is released.
Added a callback from amdgpu_vm_fini to handle KFD VM destruction
correctly in this case.
v2:
* Removed vm->vm_context check in amdgpu_amdkfd_gpuvm_destroy_cb,
check vm->process_info earlier instead
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com >
2018-03-15 17:27:43 -04:00
Felix Kuehling
b236fa1d33
drm/amdgpu: Add helper to turn an existing VM into a compute VM
...
v2: Removed updating and checking of vm->vm_context
v3: Enable amdgpu_vm_clear_bo in amdgpu_vm_make_compute
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com >
2018-03-15 17:27:42 -04:00
Felix Kuehling
3486625bbf
drm/amdgpu: Fix initial validation of PD BO for KFD VMs
...
Make sure the PD BO is valid and attach the eviction fence during VM
creation. This ensures that the pd_phys_address is actually valid
and an eviction that would invalidate it triggers a KFD process
eviction like it should.
v2: Use uninterruptible waiting in initial PD validation
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com >
2018-03-15 17:27:41 -04:00
Felix Kuehling
5b21d3e5fd
drm/amdgpu: Move KFD-specific fields into struct amdgpu_vm
...
Remove struct amdkfd_vm and move the fields into struct amdgpu_vm.
This will allow turning a VM created by a DRM render node into a
KFD VM.
v2: Removed vm_context field
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com >
2018-03-15 17:27:40 -04:00
Andrey Grodzovsky
64350f1b7f
drm/amdgpu: Improve documentation of bo_ptr in amdgpu_bo_create_kernel
...
and amdgpu_bo_create_reserved.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 14:34:15 -05:00
Mikita Lipski
d1bb88e078
drm/amdgpu: Use atomic function to disable crtcs with dc enabled
...
This change fixes the deadlock when unloading the driver with displays
connected.
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com >
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 10:46:37 -05:00
Rex Zhu
2dac5936e5
drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c
...
make it symmetric with amdgpu_ucode_init_bo in amd_powerplay.c
refine the "commit b22558bb4ff8fc9fe925222f90297d7a03a5fb20"
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:58 -05:00
Rex Zhu
b905090d2b
drm/amdgpu: Remove wrapper layer of smu ip functions
...
1. delete amdgpu_powerplay.c used for wrapping smu ip functions
2. delete struct pp_instance,
3. make struct hwmgr as the smu hw handle.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:50 -05:00
Rex Zhu
5b2a3d2c15
drm/amdgpu: Don't compared ip_block_type with ip_block_index
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:41 -05:00
Rex Zhu
5771632723
drm/amdgpu: Plus NULL function pointer check
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:32 -05:00
Oded Gabbay
7420f482ea
drm/amdkfd: add missing include of mm.h
...
This patch fixes kernel build in ARCH=frv
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com >
2018-03-15 10:08:35 +02:00
Feifei Xu
2f51d6e8e4
drm/amdgpu/sdma4: Remove unused header file from sdma_v4_0.c
...
Remove mmhub header files inclusion which not used.
Signed-off-by: Feifei Xu <Feifei.Xu@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 >
2018-03-14 16:01:19 -05:00
Alex Deucher
fcb7d51571
drm/amdgpu/sdma4: use num_instances for clock/powergating config
...
Rather then relying on the asic type for the second instance.
Makes it more consistent with the rest of the code.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-14 16:01:18 -05:00
Michel Dänzer
daf8809626
drm/amdgpu/dce: Don't turn off DP sink when disconnected
...
Turning off the sink in this case causes various issues, because
userspace expects it to stay on until it turns it off explicitly.
Instead, turn the sink off and back on when a display is connected
again. This dance seems necessary for link training to work correctly.
Bugzilla: https://bugs.freedesktop.org/105308
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:17 -05:00
Alex Deucher
5494d8640f
drm/amdgpu: move getting pcie info to common code
...
No need to replicate it in several places.
Reviewed-by: Rex Zhu <rezhu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:16 -05:00
Alex Deucher
3cdfe70056
drm/amdgpu/soc15: always load the psp module
...
Regardless of whether the user has selected psp fw loading or
not. It's still needed for GPU reset among other things.
There are already guards in place to avoid setting up the full
psp if PSP fw loading is not enabled.
Reviewed-by: Rex Zhu <rezhu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:16 -05:00
Alex Deucher
454bbbf915
drm/amdgpu: use adev->firmware to determine whether to load the PSP module
...
The per device firmware load method is limited to what makes sense for
that asic rather than whatever arbitrary value may have been set by the
user.
Reviewed-by: Rex Zhu <rezhu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:16 -05:00
Alex Deucher
19aede7791
drm/amdgpu: move firmware loading type setup to common code
...
No need to replicate it in several places.
Reviewed-by: Rex Zhu <rezhu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:15 -05:00
Alex Deucher
a9f3636019
drm/amdgpu/psp: add a few more fw load type checks
...
We already checked and returned early in most of the IP
functions, fill in the rest as well.
Reviewed-by: Rex Zhu <rezhu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:15 -05:00
Michel Dänzer
7d617264eb
drm/amdgpu/dce: Don't turn off DP sink when disconnected
...
Turning off the sink in this case causes various issues, because
userspace expects it to stay on until it turns it off explicitly.
Instead, turn the sink off and back on when a display is connected
again. This dance seems necessary for link training to work correctly.
Bugzilla: https://bugs.freedesktop.org/105308
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 15:40:00 -05:00
Alex Deucher
b5e3241316
drm/amdgpu: save/restore backlight level in legacy dce code
...
Save/restore the backlight level scratch register in S3/S4 so the
backlight level comes back at the previously requested level.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=199047
Fixes: 4ec6ecf48c (drm/amdgpu: drop scratch regs save and restore from S3/S4 handling)
Acked-by: Michel Dänzer <michel.daenzer@amd.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 15:39:51 -05:00
Christian König
342038d924
drm/amdgpu: fix prime teardown order
...
We unmapped imported DMA-bufs when the GEM handle was dropped, not when the
hardware was done with the buffere.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com >
CC: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 15:39:35 -05:00
Oak Zeng
3760f76cbe
drm/amdgpu: Move IH clientid defs to separate file
...
This is preparation for sharing client ID definitions
between amdgpu and amdkfd
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 15:16:35 -05:00
Harry Wentland
d179664a2a
drm/amdgpu: Remove some unused elements from amdgpu_connector struct
...
They were used by amdgpu_dm at some point but since it has its own
amdgpu_dm_connector now these aren't needed anymore.
Signed-off-by: Harry Wentland <harry.wentland@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 15:08:40 -05:00
Alex Deucher
a59b3c80fd
drm/amdgpu: save/restore backlight level in legacy dce code
...
Save/restore the backlight level scratch register in S3/S4 so the
backlight level comes back at the previously requested level.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=199047
Fixes: 4ec6ecf48c (drm/amdgpu: drop scratch regs save and restore from S3/S4 handling)
Acked-by: Michel Dänzer <michel.daenzer@amd.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 15:08:40 -05:00