diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-02-27 18:28:54 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-05 15:38:57 -0500 |
commit | 6848d73e889bb29cfede51df8c1d0496c9787454 (patch) | |
tree | f2491bfde0fea7a333dcde13c9f573136be1ee57 /drivers/gpu/drm/amd/powerplay | |
parent | e1deba285156fb4023bb48f22068de5b60e34e15 (diff) |
drm/amd/pp: Remove the wrap functions for acpi in powerplay
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>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c | 114 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h | 26 |
3 files changed, 1 insertions, 141 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/Makefile b/drivers/gpu/drm/amd/powerplay/hwmgr/Makefile index a212c27f2e17..e8c5a4f84324 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/Makefile @@ -24,7 +24,7 @@ # It provides the hardware management services for the driver. HARDWARE_MGR = hwmgr.o processpptables.o \ - hardwaremanager.o pp_acpi.o cz_hwmgr.o \ + hardwaremanager.o cz_hwmgr.o \ cz_clockpowergating.o pppcielanes.o\ process_pptables_v1_0.o ppatomctrl.o ppatomfwctrl.o \ smu7_hwmgr.o smu7_powertune.o smu7_thermal.o \ diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c deleted file mode 100644 index f6b4dd96c0ec..000000000000 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2016 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -#include <linux/delay.h> -#include <linux/errno.h> -#include "hwmgr.h" -#include "amd_acpi.h" -#include "pp_acpi.h" - -bool acpi_atcs_functions_supported(void *device, uint32_t index) -{ - int32_t result; - struct atcs_verify_interface output_buf = {0}; - - int32_t temp_buffer = 1; - - result = cgs_call_acpi_method(device, CGS_ACPI_METHOD_ATCS, - ATCS_FUNCTION_VERIFY_INTERFACE, - &temp_buffer, - &output_buf, - 1, - sizeof(temp_buffer), - sizeof(output_buf)); - - return result == 0 ? (output_buf.function_bits & (1 << (index - 1))) != 0 : false; -} - -bool acpi_atcs_notify_pcie_device_ready(void *device) -{ - int32_t temp_buffer = 1; - - return cgs_call_acpi_method(device, CGS_ACPI_METHOD_ATCS, - ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION, - &temp_buffer, - NULL, - 0, - sizeof(temp_buffer), - 0); -} - - -int acpi_pcie_perf_request(void *device, uint8_t perf_req, bool advertise) -{ - struct atcs_pref_req_input atcs_input; - struct atcs_pref_req_output atcs_output; - u32 retry = 3; - int result; - struct cgs_system_info info = {0}; - - if (acpi_atcs_notify_pcie_device_ready(device)) - return -EINVAL; - - info.size = sizeof(struct cgs_system_info); - info.info_id = CGS_SYSTEM_INFO_ADAPTER_BDF_ID; - result = cgs_query_system_info(device, &info); - if (result != 0) - return -EINVAL; - atcs_input.client_id = (uint16_t)info.value; - atcs_input.size = sizeof(struct atcs_pref_req_input); - atcs_input.valid_flags_mask = ATCS_VALID_FLAGS_MASK; - atcs_input.flags = ATCS_WAIT_FOR_COMPLETION; - if (advertise) - atcs_input.flags |= ATCS_ADVERTISE_CAPS; - atcs_input.req_type = ATCS_PCIE_LINK_SPEED; - atcs_input.perf_req = perf_req; - - atcs_output.size = sizeof(struct atcs_pref_req_input); - - while (retry--) { - result = cgs_call_acpi_method(device, - CGS_ACPI_METHOD_ATCS, - ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST, - &atcs_input, - &atcs_output, - 1, - sizeof(atcs_input), - sizeof(atcs_output)); - if (result != 0) - return -EIO; - - switch (atcs_output.ret_val) { - case ATCS_REQUEST_REFUSED: - default: - return -EINVAL; - case ATCS_REQUEST_COMPLETE: - return 0; - case ATCS_REQUEST_IN_PROGRESS: - udelay(10); - break; - } - } - - return 0; -} diff --git a/drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h b/drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h deleted file mode 100644 index 8fe8ba9434ff..000000000000 --- a/drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -bool acpi_atcs_functions_supported(void *device, uint32_t index); -int acpi_pcie_perf_request(void *device, uint8_t perf_req, bool advertise); -bool acpi_atcs_notify_pcie_device_ready(void *device); |