aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd
AgeCommit message (Collapse)AuthorFilesLines
2016-03-02drm/amd/powerplay: send event to notify powerplay all modules are initialized.Rex Zhu1-1/+3
with this event, powerplay can adjust current power state if needed. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-03-02drm/amd/powerplay: export AMD_PP_EVENT_COMPLETE_INIT task to amdgpu.Rex Zhu2-1/+5
This is needed to init the dynamic states without a display. To be used in the next commit. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-03-02drm/amdgpu/pm: update current crtc info after setting the powerstateAlex Deucher1-3/+3
On CI, we need to see if the number of crtcs changes to determine whether or not we need to upload the mclk table again. In practice we don't currently upload the mclk table again after the initial load. The only reason you would would be to add new states, e.g., for arbitrary mclk setting which is not currently supported. Acked-by: Jordan Lazare <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2016-02-29drm/amdgpu: trace the pd_addr in vm_grab_id as wellChristian König2-10/+14
Makes matching it to the flushes much easier. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-29drm/amdgpu: fix VM faults caused by vm_grab_id() v4Christian König9-80/+91
The owner must be per ring as long as we don't support sharing VMIDs per process. Also move the assigned VMID and page directory address into the IB structure. v3: assign the VMID to all IBs, not just the first one. v4: use correct pointer for owner Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-27drm/amdgpu: Return -EPROBE_DEFER when amdkfd not loadedOded Gabbay3-39/+30
amdgpu must load only after amdkfd's loading has been completed. If that is not enforced, then amdgpu's call into amdkfd's functions will cause a kernel BUG. When amdgpu and amdkfd are built as kernel modules, that rule is enforced by the kernel's modules loading mechanism. When amdgpu and amdkfd are built inside the kernel image, that rule is enforced by ordering in the drm Makefile (amdkfd before amdgpu). Instead of using drm Makefile ordering, we can now use deferred loading as amdkfd now returns -EPROBE_DEFER in kgd2kfd_init() when it is not yet loaded. This patch defers amdgpu loading by propagating -EPROBE_DEFER to the kernel's drivers loading infrastructure. That will put amdgpu into the pending drivers list (see description in dd.c). Once amdkfd is loaded, a call to kgd2kfd_init() will return successfully and amdgpu will be able to load. Signed-off-by: Oded Gabbay <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-27drm/amdkfd: Track when module's init is completeOded Gabbay3-6/+15
Current dependencies between amdkfd and radeon/amdgpu force the loading of amdkfd _before_ radeon and/or amdgpu are loaded. When all these kernel drivers are built as modules, this ordering is enforced by the kernel built-in mechanism of loading dependent modules. However, there is no such mechanism in case where all these drivers are compiled inside the kernel image (not as modules). The current way to enforce loading of amdkfd before radeon/amdgpu, is to put amdkfd before radeon/amdgpu in the drm Makefile, but that method is way too fragile. In addition, there is no kernel mechanism to check whether a kernel driver that is built inside the kernel image, has already been loaded. To solve this, this patch adds to kfd_module.c a new static variable, amdkfd_init_completed, that is set to 1 only when amdkfd's module initialization function has been completed (successfully). kgd2kfd_init(), which is the initialization function of the kgd-->kfd interface, and which is the first function in amdkfd called by radeon/amdgpu, will return successfully only if amdkfd_init_completed is equal 1. If amdkfd_init_completed is not equal to 1, kgd2kfd_init() will return -EPROBE_DEFER to signal radeon/amdgpu they need to defer their loading until amdkfd is loaded. Signed-off-by: Oded Gabbay <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-26drm/amdgpu: update radeon acpi headerAlex Deucher1-0/+2
Add some new defs for ATPX. Signed-off-by: Alex Deucher <[email protected]>
2016-02-26drm/amd: cleanup get_mfd_cell_dev()Dan Carpenter1-4/+2
It's simpler to just use snprintf() to print this to one buffer instead of using strcpy() and strcat(). Also using snprintf() is slightly safer than using sprintf(). Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-26drm/amdgpu: fix error handling in amdgpu_bo_list_setChristian König1-0/+3
Don't leak BOs in case of some error. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-26drm/amd/powerplay: fix code style warning.Rex Zhu1-2/+2
Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-25drm/amd: Do not make DRM_AMD_ACP default to yGeert Uytterhoeven1-1/+0
By default, not only this driver is enabled on all platforms, but also generic PM Domains and Multi-Function Devices. Drop the "default y" to fix this. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-25drm/amdgpu/gfx: fix off by one in rb rework (v2)Alex Deucher2-10/+4
When I reworked this code, I messed up num rb count. v2: use hweight32 Reviewed-by: Ken Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-24drm/amdgpu: disable direct VM updates when vm_debug is setChristian König1-1/+2
That should make user space bugs more obvious. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-24amdgpu: fix NULL pointer dereference at tonga_check_states_equalBradley Pankow1-2/+2
The event_data passed from pem_fini was not cleared upon initialization. This caused NULL checks to pass and cast_const_phw_tonga_power_state to attempt to dereference an invalid pointer. Clear the event_data in pem_init and pem_fini before calling pem_handle_event. Reviewed-by: Rex Zhu <[email protected]> Signed-off-by: Bradley Pankow <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-22drm/amdgpu/pm: adjust display configuration after powerstateAlex Deucher1-2/+3
set_power_state defaults to no displays, so we need to update the display configuration after setting up the powerstate on the first call. In most cases this is not an issue since ends up getting called multiple times at any given modeset and the proper order is achieved in the display changed handling at the top of the function. Reviewed-by: Christian König <[email protected]> Acked-by: Jordan Lazare <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2016-02-22drm/amdgpu/pm: add some checks for PXAlex Deucher1-1/+20
I.e., doesn't make sense to change power states or check the temperature when the asic is powered off. Reviewed-by: Christian König <[email protected]> Acked-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-22drm/amdgpu: fix locking in force performance levelAlex Deucher1-2/+1
Looks like a copy paste typo when we added powerplay support. Reviewed-by: Christian König <[email protected]> Acked-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-22drm/amdgpu/gfx8: fix priv reg interrupt enableAlex Deucher1-1/+1
Looks like a copy/paste typo. Reviewed-by: Christian König <[email protected]> Noticed-by: David Panariti <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-19drm/amdgpu: Don't hang in amdgpu_flip_work_func on disabled crtc.Mario Kleiner1-3/+15
This fixes a regression introduced in Linux 4.4. This is a port of the same fix for radeon-kms in the patch "drm/radeon: Don't hang in radeon_flip_work_func on disabled crtc. (v2)" Limit the amount of time amdgpu_flip_work_func can delay programming a page flip, by both limiting the maximum amount of time per wait cycle and the maximum number of wait cycles. Continue the flip if the limit is exceeded, even if that may result in a visual or timing glitch. This is to prevent a hang of page flips, as reported in fdo bug #93746: Disconnecting a DisplayPort display in parallel to a kms pageflip getting queued can cause the following hang of page flips and thereby an unusable desktop: 1. kms pageflip ioctl() queues pageflip -> queues execution of amdgpu_flip_work_func. 2. Hotunplug of display causes the driver to DPMS OFF the unplugged display. Display engine shuts down, scanout no longer moves, but stays at its resting position at start line of vblank. 3. amdgpu_flip_work_func executes while crtc is off, and due to the non-moving scanout position, the new flip delay code introduced into Linux 4.4 by commit 8e36f9d33c13 ("drm/amdgpu: Fixup hw vblank counter/ts..") enters an infinite wait loop. 4. After reconnecting the display, the pageflip continues to hang in 3. and the display doesn't update its view of the desktop. This patch fixes the Linux 4.4 regression from fdo bug #93746 <https://bugs.freedesktop.org/show_bug.cgi?id=93746> Reported-by: Bernd Steinhauser <[email protected]> Signed-off-by: Mario Kleiner <[email protected]> Cc: <[email protected]> # 4.4+ Cc: Michel Dänzer <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-19Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie75-4340/+5392
into drm-next First radeon and amdgpu pull request for 4.6. Highlights: - ACP support for APUs with i2s audio - CS ioctl optimizations - GPU scheduler optimizations - GPUVM optimizations - Initial GPU reset support (not enabled yet) - New powerplay sysfs interface for manually selecting clocks - Powerplay fixes - Virtualization fixes - Removal of hw semaphore support - Lots of other misc fixes and cleanups * 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux: (118 commits) drm/amdgpu: Don't call interval_tree_remove in amdgpu_mn_destroy drm/amdgpu: Fix race condition in amdgpu_mn_unregister drm/amdgpu: cleanup gem init/finit drm/amdgpu: rework GEM info printing drm/amdgpu: print the GPU offset as well in gem_info drm/amdgpu: optionally print the pin count in gem_info as well drm/amdgpu: print the BO size only once in amdgpu_gem_info drm/amdgpu: print pid as integer drm/amdgpu: remove page flip work queue v3 drm/amdgpu: stop blocking for page filp fences drm/amdgpu: stop calling amdgpu_gpu_reset from the flip code drm/amdgpu: remove fence reset detection leftovers drm/amdgpu: Fix race condition in MMU notifier release drm/radeon: Fix WARN_ON if DRM_DP_AUX_CHARDEV is enabled drm/amdgpu/vi: move uvd tiling config setup into uvd code drm/amdgpu/vi: move sdma tiling config setup into sdma code drm/amdgpu/cik: move uvd tiling config setup into uvd code drm/amdgpu/cik: move sdma tiling config setup into sdma code drm/amdgpu/gfx7: rework gpu_init() drm/amdgpu/gfx: clean up harvest configuration (v2) ...
2016-02-17drm/amdgpu: Don't call interval_tree_remove in amdgpu_mn_destroyFelix Kuehling1-1/+0
rbtree_postorder_for_each_entry_safe can skip over some entries if the tree is rebalanced in interval_tree_remove. interval_tree_remove is also redundant when the tree is just about to be freed. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]>
2016-02-17drm/amdgpu: Fix race condition in amdgpu_mn_unregisterFelix Kuehling1-10/+13
Exchange locking order of adev->mn_lock and mm_sem, so that rmn->mm->mmap_sem can be taken safely, protected by adev->mn_lock, when amdgpu_mn_destroy runs concurrently. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]>
2016-02-16drm/amdgpu: cleanup gem init/finitChristian König8-58/+23
Remove the double housekeeping and use something sane to forcefuly delete BOs on unload. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: rework GEM info printingChristian König2-34/+61
Print BOs grouped per client. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: print the GPU offset as well in gem_infoChristian König1-2/+3
To easily find which memory is used. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: optionally print the pin count in gem_info as wellChristian König1-1/+7
Usefull when debugging page flipping. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: print the BO size only once in amdgpu_gem_infoChristian König1-3/+2
Splitting it into KB/MB is just confusing. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: print pid as integerChristian König1-2/+2
Not sure why somebody thought that this is a long. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: remove page flip work queue v3Christian König5-13/+4
Just use the system queue now that we don't block any more. v2: handle DAL as well. v3: agd: split DAL changes out Signed-off-by: Christian König <[email protected]> Reviewed-by: Mykola Lysenko <[email protected]> Acked-by: Alex Deucher <[email protected]> (v1)
2016-02-16drm/amdgpu: stop blocking for page filp fencesChristian König2-16/+28
Just register an callback and reschedule the work item if necessary. Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: stop calling amdgpu_gpu_reset from the flip codeChristian König1-9/+1
We don't return -EDEADLK any more. Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: remove fence reset detection leftoversChristian König1-10/+4
wait_event() never returns before the fence was signaled. Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
2016-02-16drm/amdgpu: Fix race condition in MMU notifier releaseFelix Kuehling1-1/+1
The release notifier can get called a second time from mmu_notifier_unregister depending on a race between __mmu_notifier_release and amdgpu_mn_destroy. Use mmu_notifier_unregister_no_release to avoid this. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]>
2016-02-16drm/amdgpu: use post-decrement in error handlingRasmus Villemoes1-1/+1
We need to use post-decrement to get the pci_map_page undone also for i==0, and to avoid some very unpleasant behaviour if pci_map_page failed already at i==0. Reviewed-by: Christian König <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2016-02-16drm/amdgpu: removed optional dummy encoder mode_fixup function.Carlos Palminha3-24/+0
mode_fixup function for encoder drivers became optional with patch http://patchwork.freedesktop.org/patch/msgid/[email protected] This patch set nukes all the dummy mode_fixup implementations. (made on top of Daniel topic/drm-misc branch) Signed-off-by: Carlos Palminha <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/8c4710ee930d2ab3a505b8d3cd724f4f4c79b3df.1455540137.git.palminha@synopsys.com
2016-02-16mm/gup: Switch all callers of get_user_pages() to not pass tsk/mmDave Hansen1-2/+1
We will soon modify the vanilla get_user_pages() so it can no longer be used on mm/tasks other than 'current/current->mm', which is by far the most common way it is called. For now, we allow the old-style calls, but warn when they are used. (implemented in previous patch) This patch switches all callers of: get_user_pages() get_user_pages_unlocked() get_user_pages_locked() to stop passing tsk/mm so they will no longer see the warnings. Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Srikar Dronamraju <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2016-02-12drm/amdgpu/vi: move uvd tiling config setup into uvd codeAlex Deucher3-12/+20
Split uvd and gfx programming. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu/vi: move sdma tiling config setup into sdma codeAlex Deucher3-8/+10
Split sdma and gfx programming. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu/cik: move uvd tiling config setup into uvd codeAlex Deucher2-11/+11
Split uvd and gfx programming. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu/cik: move sdma tiling config setup into sdma codeAlex Deucher2-6/+5
Split sdma and gfx programming. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu/gfx7: rework gpu_init()Alex Deucher1-176/+182
Split the sw and hw parts into separate functions. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu/gfx: clean up harvest configuration (v2)Alex Deucher4-180/+82
Read back harvest configuration from registers and simplify calculations. No need to program the raster config registers. These are programmed as golden registers and the user mode drivers program them as well. v2: rebase on Tom's patches Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu: fix coding style in amdgpu_ctx.cChristian König1-16/+15
Don't use pointer arithmetic and fix the indentation. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu: nuke the kernel contextChristian König4-29/+7
Not used any more. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu: use separate scheduler entity for VCE submissionsChristian König2-1/+16
This allows us to remove the kernel context and use a better priority for the submissions. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu: use separate scheduler entity for UVD submissionsChristian König2-1/+15
This allows us to remove the kernel context and use a better priority for the submissions. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu: use separate scheduler entitiy for buffer movesChristian König2-1/+20
This allows us to remove the global kernel context. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu: use SDMA round robin for VM updates v3Christian König6-11/+43
Distribute the load on both rings. v2: use a loop for the initialization v3: agd: rebase on upstream Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2016-02-12drm/amdgpu: remove is_pte_ringChristian König4-4/+0
Not used for anything. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>