aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd
AgeCommit message (Collapse)AuthorFilesLines
2017-08-17drm/amdgpu: move debug print into the MM managersChristian König3-22/+11
Instead of the separate switch/case in the calling function. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-17drm/amdgpu: fix incorrect use of the lru_lockChristian König1-5/+2
The BO manager has its own lock and doesn't use the lru_lock. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-17drm/ttm: make ttm_mem_type_manager_func debug more usefulChristian König2-8/+6
Provide the drm printer directly instead of just the callback. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-17drm/amd/amdgpu: Add tracepoint for DMA page mapping (v4)Tom St Denis2-6/+106
This helps map DMA addresses back to physical addresses. Signed-off-by: Tom St Denis <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (v2): Added tracepoints for USERPTR, SG mappings, and SWIOTBL mappings. Reformatted trace call perform PCI decoding internal to the trace. (v3): Add unmap tracepoints as well (v4): Move traces into separate functions
2017-08-17drm/amdgpu: fix Vega10 HW config for 2MB pagesChristian König2-4/+4
Those values weren't correct. This should result in quite some speedup. Signed-off-by: Christian König <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Acked-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-17drm/amdgpu: only bind VM shadows after validation v2Christian König1-14/+8
No need to do this on every CS. v2: remove all other bind, reorder code Signed-off-by: Christian König <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Acked-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-17drm/amdgpu: only move VM BOs in the LRU during validation v2Christian König3-59/+16
This should save us a bunch of command submission overhead. v2: move the LRU move to the right place to avoid the move for the root BO and handle the shadow BOs as well. This turned out to be a bug fix because the move needs to happen before the kmap. Signed-off-by: Christian König <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Acked-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-18Merge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie57-1082/+740
into drm-next More features for 4.14. Nothing too major here. I have a few more additional patches for large page support in vega10 among other things, but they require some resevation object patches from drm-misc-next, so I'll send that request once you've pulled the latest drm-misc-next. Highlights: - Fixes for ACP audio on stoney - SR-IOV fixes for vega10 - various powerplay fixes - lots of code clean up * 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux: (62 commits) drm/amdgpu/gfx7: fix function name drm/amd/amdgpu: Disabling Power Gating for Stoney platform drm/amd/amdgpu: Added a quirk for Stoney platform drm/amdgpu: jt_size was wrongly counted twice drm/amdgpu: fix missing endian-safe guard drm/amdgpu: ignore digest_size when loading sdma fw for raven drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind() drm/amd/powerplay: fix coding style in hwmgr.c drm/amd/powerplay: refine dmesg info under powerplay. drm/amdgpu: don't finish the ring if not initialized drm/radeon: Fix preferred typo drm/amdgpu: Fix preferred typo drm/radeon: Fix stolen typo drm/amdgpu: Fix stolen typo drm/amd/powerplay: fix coccinelle warnings in vega10_hwmgr.c drm/amdgpu: set gfx_v9_0_ip_funcs as static drm/radeon: switch to drm_*{get,put} helpers drm/amdgpu: switch to drm_*{get,put} helpers drm/amd/powerplay: add CZ profile support drm/amd/powerplay: fix PSI not enabled by kmd ...
2017-08-15drm/amdkfd: Implement image tiling mode support v2Yong Zhao1-0/+43
v2: Removed hole in ioctl number space Signed-off-by: Yong Zhao <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdgpu: Add kgd kfd interface get_tile_config() v2Yong Zhao3-0/+66
v2: * Removed amdgpu_amdkfd prefix from static functions * Documented get_tile_config in kgd_kfd_interface.h Signed-off-by: Yong Zhao <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Acked-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Adding new IOCTL for scratch memory v2Moses Reuben5-0/+45
v2: * Renamed ALLOC_MEMORY_OF_SCRATCH to SET_SCRATCH_BACKING_VA * Removed size parameter from the ioctl, it was unused * Removed hole in ioctl number space * No more call to write_config_static_mem * Return correct error code from ioctl Signed-off-by: Moses Reuben <[email protected]> Signed-off-by: Ben Goz <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdgpu: Add kgd/kfd interface to support scratch memory v2Moses Reuben3-2/+34
v2: * Shortened headline * Removed write_config_static_mem, it gets initialized by gfx_v?_0_gpu_init * Renamed alloc_memory_of_scratch to set_scratch_backing_va * Made set_scratch_backing_va a void function * Documented set_scratch_backing in kgd_kfd_interface.h Signed-off-by: Moses Reuben <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdgpu: Program SH_STATIC_MEM_CONFIG globally, not per-VMIDFelix Kuehling2-2/+3
This register only has a single instance in the hardware. Its value applies to all VMIDS. Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amd: Update MEC HQD loading code for KFDFelix Kuehling10-65/+314
Various bug fixes and improvements that accumulated over the last two years. Signed-off-by: Felix Kuehling <[email protected]> Acked-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdgpu: Disable GFX PG on CZFelix Kuehling1-2/+1
It's causing problems with user mode queues and the HIQ, and can lead to hard hangs during boot after programming RLC_CP_SCHEDULERS. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Update PM4 packet headersFelix Kuehling4-414/+199
To match current firmware. The map process packet has been extended to support scratch. This is a non-backwards compatible change and it's about two years old. So no point keeping the old version around conditionally. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Clamp EOP queue size correctly on Gfx8Jay Cornwall1-2/+9
Gfx8 HW incorrectly clamps CP_HQD_EOP_CONTROL.EOP_SIZE, which can lead to scheduling deadlock due to SE EOP done counter overflow. Enforce a EOP queue size limit which prevents the CP from sending more than 0xFF events at a time. Signed-off-by: Jay Cornwall <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Acked-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Add more error printing to help bringup v2Yong Zhao1-2/+10
v2: Turned WARN into dev_warn and made the message more helpful Signed-off-by: Yong Zhao <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Handle remaining BUG_ONs more gracefully v2Felix Kuehling14-55/+84
In most cases, BUG_ONs can be replaced with WARN_ON with an error return. In some void functions just turn them into a WARN_ON and possibly an early exit. v2: * Cleaned up error handling in pm_send_unmap_queue * Removed redundant WARN_ON in kfd_process_destroy_delayed Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Allocate gtt_sa_bitmap in long unitsFelix Kuehling1-4/+4
gtt_sa_bitmap is accessed by bitmap functions, which operate on longs. Therefore the array should be allocated in long units. Also round up in case the number of bits is not a multiple of BITS_PER_LONG. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Fix doorbell initialization and finalizationFelix Kuehling3-4/+21
Handle errors in doorbell aperture initialization instead of BUG_ON. iounmap doorbell aperture during finalization. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Remove BUG_ONs for NULL pointer argumentsFelix Kuehling15-212/+4
Remove BUG_ONs that check for NULL pointer arguments that are dereferenced in the same function. Dereferencing the NULL pointer will generate a BUG anyway, so the explicit check is redundant and unnecessary overhead. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Remove usage of alloc(sizeof(struct...Kent Russell6-11/+11
See https://kernel.org/doc/html/latest/process/coding-style.html under "14) Allocating Memory" for rationale behind removing the x=alloc(sizeof(struct) style and using x=alloc(sizeof(*x) instead Signed-off-by: Kent Russell <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Fix goto usage v2Kent Russell5-82/+66
Remove gotos that do not feature any common cleanup, and use gotos instead of repeating cleanup commands. According to kernel.org: "The goto statement comes in handy when a function exits from multiple locations and some common work such as cleanup has to be done. If there is no cleanup needed then just return directly." v2: Applied review suggestions in create_queue_nocpsch Signed-off-by: Kent Russell <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Change x==NULL/false references to !xKent Russell15-87/+85
Upstream prefers the !x notation to x==NULL or x==false. Along those lines change the ==true or !=NULL references as well. Also make the references to !x the same, excluding () for readability. Signed-off-by: Kent Russell <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Consolidate and clean up log commandsKent Russell17-236/+158
Consolidate log commands so that dev_info(NULL, "Error...") uses the more accurate pr_err, remove the module name from the log (can be seen via dynamic debugging with +m), and the function name (can be seen via dynamic debugging with +f). We also don't need debug messages saying what function we're in. Those can be added by devs when needed Don't print vendor and device ID in error messages. They are typically the same for all GPUs in a multi-GPU system. So this doesn't add any value to the message. Lastly, remove parentheses around %d, %i and 0x%llX. According to kernel.org: "Printing numbers in parentheses (%d) adds no value and should be avoided." Signed-off-by: Kent Russell <[email protected]> Signed-off-by: Yong Zhao <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Clean up KFD style errors and warnings v2Kent Russell19-78/+91
Using checkpatch.pl -f <file> showed a number of style issues. This patch addresses as many of them as possible. Some long lines have been left for readability, but attempts to minimize them have been made. v2: Broke long lines in gfx_v7 get_fw_version Signed-off-by: Kent Russell <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdgpu: Remove hard-coded assumptions about compute pipesFelix Kuehling2-3/+3
Remove hard-coded assumption that the first compute pipe is reserved for amdgpu. Pipe 0 actually means pipe 0 now. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Fix allocated_queues bitmap initializationFelix Kuehling1-3/+9
Use shared_resources.queue_bitmap to determine the queues available for KFD in each pipe. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Remove bogus divide-by-sizeof(uint32_t)Felix Kuehling1-8/+0
kfd2kgd->address_watch_get_offset returns dword register offsets. Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdkfd: Fix typo in dbgdev_wave_reset_wavefrontsFelix Kuehling1-1/+1
Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2017-08-15drm/amdgpu/gfx7: fix function nameAlex Deucher1-3/+3
Was using the wrong prefix (gmc rather than gfx). The function is related to the gfx hw, not gmc. This also makes it consistent with the naming in gfx8. Reviewed-by: Harry Wentland <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/amdgpu: Disabling Power Gating for Stoney platformVijendar Mukunda1-23/+28
Power Gating is disabled in Stoney platform. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Vijendar Mukunda <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/amdgpu: Added a quirk for Stoney platformVijendar Mukunda1-3/+18
Added DW_I2S_QUIRK_16BIT_IDX_OVERRIDE quirk for Stoney. Supported format and bus width for I2S controller read from I2S Component Parameter registers. These are ready only registers. For Stoney, I2S Component Parameter registers are programmed to support 32 bit format and 4 bytes bus width only. By setting this quirk,It will override 32 bit format with 16 bit format and 2 bytes as bus width for Stoney. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Vijendar Mukunda <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: jt_size was wrongly counted twiceEvan Quan1-2/+0
Signed-off-by: Evan Quan <[email protected]> Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: fix missing endian-safe guardEvan Quan1-1/+1
Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: ignore digest_size when loading sdma fw for ravenHawking Zhang1-14/+0
digest_size has been retired from sdma v4 fw Signed-off-by: Hawking Zhang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Evan Quan <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()Dan Carpenter1-1/+1
My static checker complains that it's possible for "r" to be uninitialized. It used to be set to zero so this returns it to the old behavior. Fixes: 98a7f88ce9a9 ("drm/amdgpu: bind BOs with GTT space allocated directly v2") Reviewed-by: Christian König <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/powerplay: fix coding style in hwmgr.cRex Zhu1-7/+7
Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/powerplay: refine dmesg info under powerplay.Rex Zhu2-8/+7
Use pr_debug to prevent spamming unimportant dmesg. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: don't finish the ring if not initializedTrigger Huang1-0/+4
If a ring is not initialized, it also should not be finished. For example, in Vega10's SR-IOV environment, UVD's decode ring is not initialized, but will be finnished in amdgpu_uvd_sw_fini, because UVD driver put all the uvd decode ring's finish operation into amdgpu_uvd_sw_fini function, while not uvd_vXXX_0_sw_fini. This will lead to amdgpu module unloading failure. Signed-off-by: Trigger Huang <[email protected]> Reviewed-by: Monk Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: Fix preferred typoKent Russell7-16/+16
Change "prefered" to "preferred" Signed-off-by: Kent Russell <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: Fix stolen typoKent Russell2-7/+7
Change "stollen" to "stolen" Signed-off-by: Kent Russell <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/powerplay: fix coccinelle warnings in vega10_hwmgr.cRex Zhu1-1/+1
delete unneeded semicolon. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: set gfx_v9_0_ip_funcs as staticHuang Rui2-2/+1
We won't use this member in other files, so set it static. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amdgpu: switch to drm_*{get,put} helpersCihangir Akturk9-30/+30
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() and should not be used by new code. So convert all users of compatibility functions to use the new APIs. Reviewed-by: Christian König <[email protected]> Signed-off-by: Cihangir Akturk <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/powerplay: add CZ profile supportAlex Deucher1-2/+80
Support the profiling modes for sclk. v2: delete profileing mode for mclk. Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Rex Zhu <[email protected]> Tested-and-Reviewed-by Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/powerplay: fix PSI not enabled by kmdRex Zhu2-1/+4
cherry-pick from windows driver. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/powerplay: fix set highest mclk level failed on Vega10Rex Zhu1-6/+27
Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-15drm/amd/powerplay: fix force dpm level failed on CZRex Zhu1-16/+21
Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>