aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd
AgeCommit message (Collapse)AuthorFilesLines
2019-03-19drm/amdgpu: move get_index_into_master_table macro into atomfirmware headerHuang Rui2-2/+2
This patchs move get_index_into_master_table macro into atomfirmware header for future use on smu. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add get atom data table helperHuang Rui2-0/+21
This patch adds get atom data table helper for smu future use. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add smu table context structureHuang Rui1-0/+8
This patch adds smu table context. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: update new members in atomfirmwareHuang Rui1-5/+5
This patch updates new members for fields to meet new atomfirmware header. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: update atomfirmware header for smu11Huang Rui2-7/+38
This patch updates atomfirmware header on smu11 for future use. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add pptable header for smu11Huang Rui2-0/+148
This patch adds the pptable header for smu11. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: implement check_fw_version function for smu11Kevin Wang1-0/+29
Add function of check firmware version for smu11 Signed-off-by: Kevin Wang <[email protected]> Reviewed-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: implement check_fw_status function for smu11Kevin Wang2-1/+23
Add function of check firmware status funtions for smu11 Signed-off-by: Kevin Wang <[email protected]> Reviewed-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: implement smu send message functions for smu11 (v3)Kevin Wang2-1/+91
Add function of smu send message for smu11 v2: fix the missing ) in define of smu_send_smc_msg_with_param v3: Use adev usec timeout for smu as well, the origin time 10 us is not enough. (Ray) Signed-off-by: Huang Rui <[email protected]> Signed-off-by: Likun Gao <[email protected]> Signed-off-by: Kevin Wang <[email protected]> Reviewed-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add new ppsmc header for smu11 (v2)Huang Rui2-0/+129
This header will be used for smc message handling. v2: add a license to the top of the header file (Alex) Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: init microcode for smu11Likun Gao1-1/+46
Add function of init mircrocode for smu11. Signed-off-by: Likun Gao <[email protected]> Reviewed-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: enable new smu ip block for vega20Huang Rui1-2/+7
Switch to new smu ip block since vega20. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add resume sequence placeholder for smu ip blockHuang Rui1-1/+38
This patch adds resume sequence placeholder for smu ip block. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interfaces for smu resumeHuang Rui1-0/+9
SMU resume needs three more interfaces such as write_watermarks_table, set_last_dcef_min_deep_sleep_clk, and system_features_control. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to notify memory pool location (v2)Huang Rui2-0/+11
This patch adds interface to notify memory pool location for smu. It's to use msg SetSystemVirtualDramAddr and DramLogSetDramAddr can notify pool location. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to allocate memory pool (v2)Huang Rui1-0/+19
This patch adds interface to allocate memory pool for smu. This memory pool will be used for SMC use and msg SetSystemVirtualDramAddr and DramLogSetDramAddr can notify it changed. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to set tool table location (v2)Huang Rui2-1/+9
This patch adds interface to set tool table location for smu. Set PMSTATUSLOG table bo address with SetToolsDramAddr MSG for tools. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to set min dcef deep sleep (v2)Huang Rui2-0/+11
This patch adds interface to set min dcef deep sleep for smu. It's to set min deep sleep dce fclk with bootup value from vbios via SetMinDeepSleepDcefclk MSG. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to write pptable (v2)Huang Rui2-0/+11
This patch adds interface to write pptable for smu. It's to copy pptable bo in the vram to smc with SMU MSGs such as SetDriverDramAddr and TransferTableDram2Smu. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to check fw version (v2)Huang Rui2-0/+11
This patch adds interface to check fw version for smu. It's to send msg GetDriverIfVersion to check if the return value is equal with DRIVER_IF_VERSION of smc header. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to populate smc pptable (v2)Huang Rui2-0/+12
This patch adds interface to populate smc pptable for smu. It's to set initialized values (get from vbios) to dpm tables context such as gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each type of clks. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to parse pptable (v2)Huang Rui2-0/+13
This patch adds interface to parse pptable for smu. It's to parse pptable format and fill PPTable_t smc_pptable to smu_table_context structure. And read the smc_dpm_table from vbios, then fill it into smc_pptable. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to init fb allocations (v2)Huang Rui1-0/+13
This patch adds interface to init fb allocations for smu. It's to allocate vram bos to store smc table contents. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to check pptable (v2)Huang Rui2-0/+11
This patch adds interface to check pptable function for smu. It's to check if the format_revision in vbios is up to pptable header version, and the structure size is not 0. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to get vbios bootup values (v2)Huang Rui2-0/+8
This patch adds interface to get vbios bootup values for smu. It's to get boot_values from vbios to set revision, gfxclk, and etc. v2: add detailed info to describe this function. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to init power (v2)Huang Rui2-0/+13
This patch adds interface to init power function for smu. It's to create smu_power_context structure, and allocate smu_dpm_context and context size to fill the smu_power_context data. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to init smc tables (v2)Huang Rui2-0/+13
This patch adds interface to init smc tables for smu. It is to create smu_table structure, and init smc tables such as TABLE_PPTABLE, TABLE_WATERMARKS, TABLE_SMU_METRICS, and etc. v2: add detailed info to describe this function Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add placeholder of smu_initialize_pptableHuang Rui1-0/+25
This patch adds placeholder of smu_initialize_pptable for smu. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add interface to read pptable from vbiosHuang Rui2-1/+21
This patch adds interface to read pptable from vbios for smu. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add fw load checking interfaceHuang Rui3-0/+16
This patch adds fw load checking interface for smu. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add firmware loading interfaceHuang Rui3-0/+15
This patch adds firmware loading interface for smu. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add smu11 sub block for SMU IPHuang Rui5-1/+95
This patch add smu11 sub ip block skeleton as placeholder Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amd/powerplay: add new smu ip blockHuang Rui4-1/+216
This patch add amdgpu_smu ip block skeleton as placeholder. We plan use new smu ip block from Vega20. Signed-off-by: Huang Rui <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: remove set but not used variable 'vbi_time_out'YueHaibing1-2/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/amdgpu/si_dpm.c: In function 'si_program_response_times': drivers/gpu/drm/amd/amdgpu/si_dpm.c:4101:29: warning: variable 'backbias_response_time' set but not used [-Wunused-but-set-variable] It's never used since introduction in 841686df9f7d ("drm/amdgpu: add SI DPM support (v4)"), so can be removed Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: remove set but not used variables 'vm, bo'YueHaibing1-7/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c: In function 'update_gpuvm_pte': drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:840:20: warning: variable 'bo' set but not used [-Wunused-but-set-variable] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:838:20: warning: variable 'vm' set but not used [-Wunused-but-set-variable] They're never used since introduction in a46a2cd103a8 ("drm/amdgpu: Add GPUVM memory management functions for KFD") Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: Set VM_L2_CNTL.PDE_FAULT_CLASSIFICATION to 0Yong Zhao2-2/+2
This is recommended by HW designers. Previously when it was set to 1, the PDE walk error in VM fault will be treated as PERMISSION_OR_INVALID_PAGE_FAULT rather than usually expected OTHER_FAULT. As a result, the retry control in VM_CONTEXT*_CNTL will change accordingly. The above behavior is kind of abnormal. Furthermore, the PDE_FAULT_CLASSIFICATION == 1 feature was targeted for very old ASICs and it never made it way to production. Therefore, we should set it to 0. Signed-off-by: Yong Zhao <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: Eliminate the set_pde_pte function pointer in amdgpu_gmc_funcsYong Zhao6-148/+77
All the gmc_*_set_pde_pte functions are the same across different ASICs, so we can eliminate the set_pde_pte function pointer and instead use a generic function. Signed-off-by: Yong Zhao <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/ttm: Quick-test mmap offset in ttm_bo_mmap()Thomas Zimmermann1-7/+2
A BO's address has to be at least the minimum offset. Sharing this test in ttm_bo_mmap() removes code from drivers. A full buffer-address validation is still done within drm_vma_offset_lockup_locked(). Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Christian König <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/ttm: Remove file_page_offset parameter from ttm_bo_device_init()Thomas Zimmermann1-1/+0
The parameter file_page_offset is a constant shared by all drivers. Just replace it with the constant itself. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Christian König <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/ttm: Define a single DRM_FILE_PAGE_OFFSET constantThomas Zimmermann1-2/+0
Most TTM drivers define the constant DRM_FILE_PAGE_OFFSET of the same value. The only exception is vboxvideo, which is being converted to the new offset by this patch. Unifying the constants in a single place simplifies the driver code. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Christian König <[email protected]> Acked-by: Hans de Goede <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: fix HMM config dependency issuePhilip Yang3-24/+19
Only select HMM_MIRROR will get kernel config dependency warnings if CONFIG_HMM is missing in the config. Add depends on HMM will solve the issue. Add conditional compilation to fix compilation errors if HMM_MIRROR is not enabled as HMM config is not enabled. Remove unused function amdgpu_ttm_tt_mark_user_pages. Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: replace get_user_pages with HMM mirror helpersPhilip Yang9-278/+182
Use HMM helper function hmm_vma_fault() to get physical pages backing userptr and start CPU page table update track of those pages. Then use hmm_vma_range_done() to check if those pages are updated before amdgpu_cs_submit for gfx or before user queues are resumed for kfd. If userptr pages are updated, for gfx, amdgpu_cs_ioctl will restart from scratch, for kfd, restore worker is rescheduled to retry. HMM simplify the CPU page table concurrent update check, so remove guptasklock, mmu_invalidations, last_set_pages fields from amdgpu_ttm_tt struct. HMM does not pin the page (increase page ref count), so remove related operations like release_pages(), put_page(), mark_page_dirty(). Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdkfd: avoid HMM change cause circular lockPhilip Yang1-15/+17
There is circular lock between gfx and kfd path with HMM change: lock(dqm) -> bo::reserve -> amdgpu_mn_lock To avoid this, move init/unint_mqd() out of lock(dqm), to remove nested locking between mmap_sem and bo::reserve. The locking order is: bo::reserve -> amdgpu_mn_lock(p->mn) Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: use HMM callback to replace mmu notifierPhilip Yang4-98/+72
Replace our MMU notifier with hmm_mirror_ops.sync_cpu_device_pagetables callback. Enable CONFIG_HMM and CONFIG_HMM_MIRROR as a dependency in DRM_AMDGPU_USERPTR Kconfig. It supports both KFD userptr and gfx userptr paths. Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: fix invalid use of change_bitChristian König1-1/+1
We only need to clear the bit in a 32bit integer. This fixes a crah on ARM64 and PPC64LE caused by "drm/amdgpu: update the vm invalidation engine layout V2" Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]>
2019-03-19drm/amdgpu: revert "cleanup setting bulk_movable"Christian König1-0/+2
This reverts commit 8466cc61da89d33441e0d7a98de1ba98697cd465. It can trigger a reference counter bug in TTM. Need to investigate further, but for now revert the offending change. Signed-off-by: Christian König <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Tested-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-14Merge branch 'drm-next-5.1' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie3-3/+21
into drm-next - Update golden regs for gfx9 - Powerplay fixes Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-03-12Merge branch 'drm-next-5.1' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie20-210/+227
into drm-next Fixes for 5.1: - Powerplay fixes - DC fixes - Fix locking around indirect register access in some cases - KFD MQD fix - Disable BACO for vega20 for now (fixes pending) Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-03-11drm/amdgpu: Update gc golden setting for vega familyshaoyunl1-0/+1
GC owner suggested the setting should be applied which is missed by HW default Signed-off-by: shaoyunl <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-03-11drm/amd/powerplay: correct power reading on fijiEvan Quan1-3/+3
Set sampling period as 500ms to provide a smooth power reading output. Also, correct the register for power reading. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Feifei Xu <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]