Begin to remove cgs interface
Subsystems (3)
cover Begin to remove cgs interface
Rex Zhu (7):
drm/amd/pp: Simply powerplay create code
drm/amd/dc: Use forward declaration instand of include header file drm/amd/pp: Refine powerplay instance
drm/amdgpu: Notify sbios device ready before send request drm/amd/pp: Use amdgpu acpi helper functions in powerplay drm/amd/pp: Remove the wrap functions for acpi in powerplay drm/amd/pp: Remove cgs_query_system_info
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 293 --------------------- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 4 +- drivers/gpu/drm/amd/display/dc/dm_services_types.h | 2 +- drivers/gpu/drm/amd/include/cgs_common.h | 85 ------ drivers/gpu/drm/amd/include/kgd_pp_interface.h | 8 - drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 28 +- drivers/gpu/drm/amd/powerplay/hwmgr/Makefile | 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 22 +- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 65 ++--- drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c | 114 -------- .../amd/powerplay/hwmgr/smu7_clockpowergating.c | 17 +- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 61 ++--- .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 9 +- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 19 +- .../gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 28 +- .../amd/powerplay/hwmgr/vega10_processpptables.c | 13 +- drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 2 +- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h | 26 -- drivers/gpu/drm/amd/powerplay/inc/pp_instance.h | 8 +- drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c | 14 +- .../gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 7 +- .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 13 +- .../gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c | 13 +- 25 files changed, 108 insertions(+), 749 deletions(-) delete mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c delete mode 100644 drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1519730848-6973-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
PATCH 1/7 drm/amd/pp: Simply powerplay create code
use adev as input parameter to create powerplay handle directly. remove cgs support of powerplay create.
Change-Id: Ie3b91e8f67b8e8307ec678df7e8b6d6a6e0c52ae
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 22 ----------------- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 4 +-- drivers/gpu/drm/amd/include/cgs_common.h | 7 ------ drivers/gpu/drm/amd/include/kgd_pp_interface.h | 8 ------ drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 30 ++++++++++++++--------- drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 2 +- 6 files changed, 20 insertions(+), 53 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -22
@@ -42,27 +42,6 @@ struct amdgpu_cgs_device {struct amdgpu_device *adev = \ ((struct amdgpu_cgs_device *)cgs_device)->adev -static void *amdgpu_cgs_register_pp_handle (struct cgs_device *cgs_device, -int (*call_back_func)(struct amd_pp_init *,void **)) -{ -CGS_FUNC_ADEV ; -struct amd_pp_init pp_init; -struct amd_powerplay *amd_pp; - -if (call_back_func ==NULL ) -return NULL ; - - amd_pp = &(adev->powerplay); - pp_init.chip_family = adev->family; - pp_init.chip_id = adev->asic_type; - pp_init.pm_en = (amdgpu_dpm !=0 && !amdgpu_sriov_vf (adev)) ? true : false; - pp_init.feature_mask = amdgpu_pp_feature_mask; - pp_init.device = cgs_device; -if (call_back_func (&pp_init, &(amd_pp->pp_handle))) -return NULL ; - -return adev->powerplay.pp_handle; -} static int amdgpu_cgs_alloc_gpu_mem(struct cgs_device *cgs_device, enum cgs_gpu_mem_type type,
@@ -1233,7 +1212,6 @@ static int amdgpu_cgs_set_temperature_range(struct cgs_device *cgs_device, .is_virtualization_enabled = amdgpu_cgs_is_virtualization_enabled, .enter_safe_mode = amdgpu_cgs_enter_safe_mode, .lock_grbm_idx = amdgpu_cgs_lock_grbm_idx, - .register_pp_handle = amdgpu_cgs_register_pp_handle, .set_temperature_range = amdgpu_cgs_set_temperature_range, };
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +1 -3
@@ -94,9 +94,7 @@ static int amdgpu_pp_early_init(void *handle) }if (adev->powerplay.ip_funcs->early_init) - ret = adev->powerplay.ip_funcs->early_init ( - amd_pp->cgs_device ? amd_pp->cgs_device : - amd_pp->pp_handle); + ret = adev->powerplay.ip_funcs->early_init (adev);return ret; }
drivers/gpu/drm/amd/include/cgs_common.h +0 -7
@@ -424,10 +424,6 @@ typedef int (*cgs_query_system_info)(struct cgs_device *cgs_device,typedef void (*cgs_lock_grbm_idx )(struct cgs_device *cgs_device,bool lock); -struct amd_pp_init ; -typedef void * (*cgs_register_pp_handle )(struct cgs_device *cgs_device, -int (*call_back_func)(struct amd_pp_init *,void **)); -typedef int (*cgs_set_temperature_range )(struct cgs_device *cgs_device,int min_temperature,int max_temperature);
@@ -467,7 +463,6 @@ struct cgs_ops {cgs_is_virtualization_enabled_t is_virtualization_enabled;cgs_enter_safe_mode enter_safe_mode;cgs_lock_grbm_idx lock_grbm_idx; -cgs_register_pp_handle register_pp_handle;cgs_set_temperature_range set_temperature_range; };
@@ -547,8 +542,6 @@ struct cgs_device#define cgs_lock_grbm_idx (cgs_device, lock) \ CGS_CALL(lock_grbm_idx, cgs_device, lock) -#define cgs_register_pp_handle (cgs_device, call_back_func) \ - CGS_CALL(register_pp_handle, cgs_device, call_back_func)#define cgs_set_temperature_range (dev, min_temp, max_temp) \ CGS_CALL(set_temperature_range, dev, min_temp, max_temp)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +0 -8
@@ -136,14 +136,6 @@ enum amd_pp_task {AMD_PP_TASK_MAX }; -struct amd_pp_init { -struct cgs_device *device; -uint32_t chip_family; -uint32_t chip_id; -bool pm_en; -uint32_t feature_mask; -}; -enum PP_SMC_POWER_PROFILE {PP_SMC_POWER_PROFILE_FULLSCREEN3D =0x0 ,PP_SMC_POWER_PROFILE_POWERSAVING =0x1 ,
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +18 -12
@@ -29,6 +29,7 @@#include "amd_powerplay.h" #include "pp_instance.h" #include "power_state.h" +#include "amdgpu.h" #define PP_DPM_DISABLED 0xCCCC
@@ -52,28 +53,30 @@ static inline int pp_check(struct pp_instance *handle)return 0 ; } -static int amd_powerplay_create (struct amd_pp_init *pp_init, -void **handle) +static int amd_powerplay_create (struct amdgpu_device *adev) {struct pp_instance *instance; -if (pp_init ==NULL || handle ==NULL ) +if (adev ==NULL )return -EINVAL ; instance =kzalloc (sizeof (struct pp_instance ),GFP_KERNEL );if (instance ==NULL )return -ENOMEM ; - instance->chip_family = pp_init->chip_family; - instance->chip_id = pp_init->chip_id; - instance->pm_en = pp_init->pm_en; - instance->feature_mask = pp_init->feature_mask; - instance->device = pp_init->device; + instance->chip_family = adev->family; + instance->chip_id = adev->asic_type; + instance->pm_en = (amdgpu_dpm !=0 && !amdgpu_sriov_vf (adev)) ? true : false; + instance->feature_mask = amdgpu_pp_feature_mask; + instance->device = adev->powerplay.cgs_device;mutex_init (&instance->pp_lock); - *handle = instance; + + adev->powerplay.pp_handle = instance; +return 0 ; } +static int amd_powerplay_destroy (void *handle) {struct pp_instance *instance = (struct pp_instance *)handle;
@@ -93,11 +96,14 @@ static int pp_early_init(void *handle) {int ret;struct pp_instance *pp_handle =NULL ; +struct amdgpu_device *adev = (struct amdgpu_device *)handle; - pp_handle =cgs_register_pp_handle (handle, amd_powerplay_create); + ret =amd_powerplay_create (adev); -if (!pp_handle) -return -EINVAL ; +if (ret !=0 ) +return ret; + + pp_handle = adev->powerplay.pp_handle; ret =hwmgr_early_init (pp_handle);if (ret)
drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h +1 -1
@@ -30,6 +30,6 @@#include "cgs_common.h" #include "dm_pp_interface.h" #include "kgd_pp_interface.h" - +#include "amdgpu.h" #endif /* _AMD_POWERPLAY_H_ */
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/7 drm/amd/dc: Use forward declaration instand of include header file
In reply to a message not in the archiveavoid build error:
drivers/gpu/drm/amd/amdgpu/../powerplay/inc/smu9_driver_if.h:342:3: error: redeclaration of enumerator ‘WM_COUNT’
WM_COUNT,
^
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:32:0,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
from drivers/gpu/drm/amd/amdgpu/../display/modules/inc/mod_freesync.h:57,
from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_mode.h:48,
from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:55,
from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/amd_powerplay.h:33,
from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/smumgr.h:26,
from drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vega10_smumgr.c:24:drivers/gpu/drm/amd/amdgpu/../display/dc/dm_pp_smu.h:43:2: note: previous definition of ‘WM_COUNT’ was here
WM_COUNT,
--- drivers/gpu/drm/amd/display/dc/dm_services_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dm_services_types.h +1 -1
@@ -29,7 +29,7 @@#include "os_types.h" #include "dc_types.h" -#include "dm_pp_smu.h" +struct pp_smu_funcs_rv ;struct dm_pp_clock_range {int min_khz;
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1519730848-6973-3-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Harry Wentland
Reviewed-byRe: [PATCH 2/7] drm/amd/dc: Use forward declaration instand of include header file
Quoted 13 lines · Rex Zhu
avoid build error:
drivers/gpu/drm/amd/amdgpu/../powerplay/inc/smu9_driver_if.h:342:3: error: redeclaration of enumerator ‘WM_COUNT’
WM_COUNT,
^
In file included fromdrivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:32:0,from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35, from drivers/gpu/drm/amd/amdgpu/../display/modules/inc/mod_freesync.h:57, from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_mode.h:48, from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:55, from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/amd_powerplay.h:33, from drivers/gpu/drm/amd/amdgpu/../powerplay/inc/smumgr.h:26, from drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vega10_smumgr.c:24:
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/../display/dc/dm_pp_smu.h:43:2: note: previous definition of ‘WM_COUNT’ was here
WM_COUNT,Change-Id If1bc3c268594bd571afcd2c032cc1295d048369fSigned-off-by Rex Zhu <[email protected]>
Harry
Quoted 10 lines
--- drivers/gpu/drm/amd/display/dc/dm_services_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dm_services_types.h +0
-0
drivers/gpu/drm/amd/display/dc/dm_services_types.h line 35
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dm_services_types.h +1
-1@@ -29,7 +29,7 @@#include "os_types.h" #include "dc_types.h" -#include "dm_pp_smu.h" +struct pp_smu_funcs_rv ;struct dm_pp_clock_range {int min_khz;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/7 drm/amd/pp: Refine powerplay instance
In reply to a message not in the archiveInclude adev in powerplay instance directly.
so we can remove cgs interface.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 6 ++---- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 7 ++++--- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + drivers/gpu/drm/amd/powerplay/inc/pp_instance.h | 8 +++----- 4 files changed, 10 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +2 -4
@@ -30,6 +30,7 @@#include "pp_instance.h" #include "power_state.h" #include "amdgpu.h" +#include "hwmgr.h" #define PP_DPM_DISABLED 0xCCCC
@@ -64,13 +65,10 @@ static int amd_powerplay_create(struct amdgpu_device *adev)if (instance ==NULL )return -ENOMEM ; - instance->chip_family = adev->family; - instance->chip_id = adev->asic_type; + instance->parent = adev; instance->pm_en = (amdgpu_dpm !=0 && !amdgpu_sriov_vf (adev)) ? true : false; - instance->feature_mask = amdgpu_pp_feature_mask; instance->device = adev->powerplay.cgs_device;mutex_init (&instance->pp_lock); - adev->powerplay.pp_handle = instance;return 0 ;
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +4 -3
@@ -162,10 +162,11 @@ int hwmgr_early_init(struct pp_instance *handle)return -ENOMEM ; handle->hwmgr = hwmgr; + hwmgr->adev = handle->parent; hwmgr->device = handle->device; - hwmgr->chip_family = handle->chip_family; - hwmgr->chip_id = handle->chip_id; - hwmgr->feature_mask = handle->feature_mask; + hwmgr->chip_family = ((struct amdgpu_device *)handle->parent)->family; + hwmgr->chip_id = ((struct amdgpu_device *)handle->parent)->asic_type; + hwmgr->feature_mask = amdgpu_pp_feature_mask; hwmgr->usec_timeout =AMD_MAX_USEC_TIMEOUT ; hwmgr->power_source = PP_PowerSource_AC; hwmgr->pp_table_version =PP_TABLE_V1 ;
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
@@ -700,6 +700,7 @@ enum PP_TABLE_VERSION {* The main hardware manager structure. */ struct pp_hwmgr { +void *adev;uint32_t chip_family;uint32_t chip_id;uint32_t smu_version;
drivers/gpu/drm/amd/powerplay/inc/pp_instance.h +3 -5
@@ -23,14 +23,12 @@#ifndef _PP_INSTANCE_H_#define _PP_INSTANCE_H_ -#include "hwmgr.h" +struct pp_hwmgr ;struct pp_instance { -uint32_t chip_family; -uint32_t chip_id; +void *parent;/* e.g. amdgpu_device */ +void *device;/* e.g. cgs_device */ bool pm_en; -uint32_t feature_mask; -void *device;struct pp_hwmgr *hwmgr;struct mutex pp_lock; };
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/7 drm/amdgpu: Notify sbios device ready before send request
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +3 -0
@@ -540,6 +540,9 @@ int amdgpu_acpi_pcie_performance_request(struct amdgpu_device *adev,size_t size;u32 retry =3 ; +if (amdgpu_acpi_pcie_notify_device_ready (adev)) +return -EINVAL ; +/* Get the device handle */ handle =ACPI_HANDLE (&adev->pdev->dev);if (!handle)
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1519730848-6973-5-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byRe: [PATCH 4/7] drm/amdgpu: Notify sbios device ready before send request
Quoted 2 lines · Rex Zhu
Change-Id Id7f674c7faba8d51864353a3a7ea96ba471a60d8Signed-off-by Rex Zhu <[email protected]>
Please include a description of why this is needed as we discussed offline in the patch description. With that fixed:
Quoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +3
-1@@ -540,6 +540,9 @@ int amdgpu_acpi_pcie_performance_request(struct amdgpu_device *adev,size_t size;u32 retry =3 ; +if (amdgpu_acpi_pcie_notify_device_ready (adev)) +return -EINVAL ; +/* Get the device handle */ handle =ACPI_HANDLE (&adev->pdev->dev);if (!handle) --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 drm/amd/pp: Use amdgpu acpi helper functions in powerplay
In reply to a message not in the archive--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 +--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 7 +++---- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 1 - 3 files changed, 4 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +1 -3
@@ -33,7 +33,6 @@#include "pppcielanes.h" #include "ppatomctrl.h" #include "ppsmc.h" -#include "pp_acpi.h" #include "amd_acpi.h" #include "pp_psm.h"
@@ -931,8 +930,7 @@ void hwmgr_init_default_caps(struct pp_hwmgr *hwmgr)phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_UVDDPM);phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_VCEDPM); -if (acpi_atcs_functions_supported (hwmgr->device,ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST ) && -acpi_atcs_functions_supported (hwmgr->device,ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION )) +if (amdgpu_acpi_is_pcie_performance_request_supported (hwmgr->adev))phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_PCIEPerformanceRequest); phm_cap_set(hwmgr->platform_descriptor.platformCaps,
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +3 -4
@@ -27,7 +27,6 @@#include <linux/slab.h> #include <asm/div64.h> #include <drm/amdgpu_drm.h> -#include "pp_acpi.h" #include "ppatomctrl.h" #include "atombios.h" #include "pptable_v1_0.h"
@@ -3652,13 +3651,13 @@ static int smu7_request_link_speed_change_before_state_change(if (target_link_speed > current_link_speed) {switch (target_link_speed) {case PP_PCIEGen3: -if (0 ==acpi_pcie_perf_request (hwmgr->device,PCIE_PERF_REQ_GEN3 , false)) +if (0 ==amdgpu_acpi_pcie_performance_request (hwmgr->adev,PCIE_PERF_REQ_GEN3 , false))break ; data->force_pcie_gen = PP_PCIEGen2;if (current_link_speed == PP_PCIEGen2)break ;case PP_PCIEGen2: -if (0 ==acpi_pcie_perf_request (hwmgr->device,PCIE_PERF_REQ_GEN2 , false)) +if (0 ==amdgpu_acpi_pcie_performance_request (hwmgr->adev,PCIE_PERF_REQ_GEN2 , false))break ;default : data->force_pcie_gen =smu7_get_current_pcie_speed (hwmgr);
@@ -3880,7 +3879,7 @@ static int smu7_notify_link_speed_change_after_state_change( smu7_get_current_pcie_speed(hwmgr) > 0)return 0 ; -if (acpi_pcie_perf_request (hwmgr->device, request, false)) { +if (amdgpu_acpi_pcie_performance_request (hwmgr->adev, request, false)) {if (PP_PCIEGen2 == target_link_speed)pr_info ("PSPP request to switch to Gen2 from Gen3 Failed!" );else
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0 -1
@@ -44,7 +44,6 @@#include "vega10_pptable.h" #include "vega10_thermal.h" #include "pp_debug.h" -#include "pp_acpi.h" #include "amd_pcie_helpers.h" #include "cgs_linux.h" #include "ppinterrupt.h"
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 drm/amd/pp: Remove the wrap functions for acpi in powerplay
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 212 -------------------------- drivers/gpu/drm/amd/include/cgs_common.h | 44 ------ drivers/gpu/drm/amd/powerplay/hwmgr/Makefile | 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c | 114 -------------- drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h | 26 ---- 5 files changed, 1 insertion(+), 397 deletions(-) delete mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c delete mode 100644 drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -212
@@ -24,7 +24,6 @@#include <linux/list.h> #include <linux/slab.h> #include <linux/pci.h> -#include <linux/acpi.h> #include <drm/drmP.h> #include <linux/firmware.h> #include <drm/amdgpu_drm.h>
@@ -964,216 +963,6 @@ static int amdgpu_cgs_notify_dpm_enabled(struct cgs_device *cgs_device, bool enareturn 0 ; } -/** \brief evaluate acpi namespace object, handle or pathname must be valid -* \param cgs_device -* \param info input/output arguments for the control method -* \return status -*/ - -#if defined(CONFIG_ACPI ) -static int amdgpu_cgs_acpi_eval_object (struct cgs_device *cgs_device, -struct cgs_acpi_method_info *info) -{ -CGS_FUNC_ADEV ; -acpi_handle handle; -struct acpi_object_list input; -struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER ,NULL }; -union acpi_object *params, *obj; -uint8_t name[5 ] = {'\0' }; -struct cgs_acpi_method_argument *argument; -uint32_t i, count; -acpi_status status; -int result; - - handle =ACPI_HANDLE (&adev->pdev->dev); -if (!handle) -return -ENODEV ; - -memset (&input,0 ,sizeof (struct acpi_object_list )); - -/* validate input info */ -if (info->size !=sizeof (struct cgs_acpi_method_info )) -return -EINVAL ; - - input.count = info->input_count; -if (info->input_count >0 ) { -if (info->pinput_argument ==NULL ) -return -EINVAL ; - argument = info->pinput_argument; -for (i =0 ; i < info->input_count; i++) { -if (((argument->type ==ACPI_TYPE_STRING ) || - (argument->type ==ACPI_TYPE_BUFFER )) && - (argument->pointer ==NULL )) -return -EINVAL ; - argument++; - } - } - -if (info->output_count >0 ) { -if (info->poutput_argument ==NULL ) -return -EINVAL ; - argument = info->poutput_argument; -for (i =0 ; i < info->output_count; i++) { -if (((argument->type ==ACPI_TYPE_STRING ) || - (argument->type ==ACPI_TYPE_BUFFER )) - && (argument->pointer ==NULL )) -return -EINVAL ; - argument++; - } - } - -/* The path name passed to acpi_evaluate_object should be null terminated */ -if ((info->field &CGS_ACPI_FIELD_METHOD_NAME ) !=0 ) { -strncpy (name, (char *)&(info->name),sizeof (uint32_t )); - name[4 ] ='\0' ; - } - -/* parse input parameters */ -if (input.count >0 ) { - input.pointer = params = -kzalloc (sizeof (union acpi_object ) * input.count,GFP_KERNEL ); -if (params ==NULL ) -return -EINVAL ; - - argument = info->pinput_argument; - -for (i =0 ; i < input.count; i++) { - params->type = argument->type; -switch (params->type) { -case ACPI_TYPE_INTEGER : - params->integer.value = argument->value; -break ; -case ACPI_TYPE_STRING : - params->string.length = argument->data_length; - params->string.pointer = argument->pointer; -break ; -case ACPI_TYPE_BUFFER : - params->buffer.length = argument->data_length; - params->buffer.pointer = argument->pointer; -break ; -default : -break ; - } - params++; - argument++; - } - } - -/* parse output info */ - count = info->output_count; - argument = info->poutput_argument; - -/* evaluate the acpi method */ - status =acpi_evaluate_object (handle, name, &input, &output); - -if (ACPI_FAILURE (status)) { - result = -EIO ; - goto free_input; - } - -/* return the output info */ - obj = output.pointer; - -if (count >1 ) { -if ((obj->type !=ACPI_TYPE_PACKAGE ) || - (obj->package.count != count)) { - result = -EIO ; - goto free_obj; - } - params = obj->package.elements; - }else - params = obj; - -if (params ==NULL ) { - result = -EIO ; - goto free_obj; - } - -for (i =0 ; i < count; i++) { -if (argument->type != params->type) { - result = -EIO ; - goto free_obj; - } -switch (params->type) { -case ACPI_TYPE_INTEGER : - argument->value = params->integer.value; -break ; -case ACPI_TYPE_STRING : -if ((params->string.length != argument->data_length) || - (params->string.pointer ==NULL )) { - result = -EIO ; - goto free_obj; - } -strncpy (argument->pointer, - params->string.pointer, - params->string.length); -break ; -case ACPI_TYPE_BUFFER : -if (params->buffer.pointer ==NULL ) { - result = -EIO ; - goto free_obj; - } -memcpy (argument->pointer, - params->buffer.pointer, - argument->data_length); -break ; -default : -break ; - } - argument++; - params++; - } - - result =0 ; -free_obj: -kfree (obj); -free_input: -kfree ((void *)input.pointer); -return result; -} -#else -static int amdgpu_cgs_acpi_eval_object (struct cgs_device *cgs_device, -struct cgs_acpi_method_info *info) -{ -return -EIO ; -} -#endif - -static int amdgpu_cgs_call_acpi_method (struct cgs_device *cgs_device, -uint32_t acpi_method, -uint32_t acpi_function, -void *pinput,void *poutput, -uint32_t output_count, -uint32_t input_size, -uint32_t output_size) -{ -struct cgs_acpi_method_argument acpi_input[2 ] = { {0 }, {0 } }; -struct cgs_acpi_method_argument acpi_output = {0 }; -struct cgs_acpi_method_info info = {0 }; - - acpi_input[0 ].type =CGS_ACPI_TYPE_INTEGER ; - acpi_input[0 ].data_length =sizeof (uint32_t ); - acpi_input[0 ].value = acpi_function; - - acpi_input[1 ].type =CGS_ACPI_TYPE_BUFFER ; - acpi_input[1 ].data_length = input_size; - acpi_input[1 ].pointer = pinput; - - acpi_output.type =CGS_ACPI_TYPE_BUFFER ; - acpi_output.data_length = output_size; - acpi_output.pointer = poutput; - - info.size =sizeof (struct cgs_acpi_method_info ); - info.field =CGS_ACPI_FIELD_METHOD_NAME |CGS_ACPI_FIELD_INPUT_ARGUMENT_COUNT ; - info.input_count =2 ; - info.name = acpi_method; - info.pinput_argument = acpi_input; - info.output_count = output_count; - info.poutput_argument = &acpi_output; - -return amdgpu_cgs_acpi_eval_object (cgs_device, &info); -} -static int amdgpu_cgs_set_temperature_range (struct cgs_device *cgs_device,int min_temperature,int max_temperature)
@@ -1207,7 +996,6 @@ static int amdgpu_cgs_set_temperature_range(struct cgs_device *cgs_device, .set_clockgating_state = amdgpu_cgs_set_clockgating_state, .get_active_displays_info = amdgpu_cgs_get_active_displays_info, .notify_dpm_enabled = amdgpu_cgs_notify_dpm_enabled, - .call_acpi_method = amdgpu_cgs_call_acpi_method, .query_system_info = amdgpu_cgs_query_system_info, .is_virtualization_enabled = amdgpu_cgs_is_virtualization_enabled, .enter_safe_mode = amdgpu_cgs_enter_safe_mode,
drivers/gpu/drm/amd/include/cgs_common.h +0 -44
68 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +1 -1
@@ -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 \
drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c deleted +0 -114
114 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h deleted +0 -26
@@ -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);
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 drm/amd/pp: Remove cgs_query_system_info
In reply to a message not in the archiveGet gpu info through adev directly in powerplay
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 59 ---------------------- drivers/gpu/drm/amd/include/cgs_common.h | 34 ------------- drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 22 ++++---- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 54 ++++++-------------- .../amd/powerplay/hwmgr/smu7_clockpowergating.c | 17 ++----- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 54 ++++++-------------- .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 9 +--- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 18 ++----- .../gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 28 +++------- .../amd/powerplay/hwmgr/vega10_processpptables.c | 13 ++--- drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c | 14 ++--- .../gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 7 +-- .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 13 ++--- .../gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c | 13 ++--- 14 files changed, 73 insertions(+), 282 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +0 -59
@@ -835,64 +835,6 @@ static int amdgpu_cgs_is_virtualization_enabled(void *cgs_device)return amdgpu_sriov_vf (adev); } -static int amdgpu_cgs_query_system_info (struct cgs_device *cgs_device, -struct cgs_system_info *sys_info) -{ -CGS_FUNC_ADEV ; - -if (NULL == sys_info) -return -ENODEV ; - -if (sizeof (struct cgs_system_info ) != sys_info->size) -return -ENODEV ; - -switch (sys_info->info_id) { -case CGS_SYSTEM_INFO_ADAPTER_BDF_ID : - sys_info->value = adev->pdev->devfn | (adev->pdev->bus->number <<8 ); -break ; -case CGS_SYSTEM_INFO_PCIE_GEN_INFO : - sys_info->value = adev->pm.pcie_gen_mask; -break ; -case CGS_SYSTEM_INFO_PCIE_MLW : - sys_info->value = adev->pm.pcie_mlw_mask; -break ; -case CGS_SYSTEM_INFO_PCIE_DEV : - sys_info->value = adev->pdev->device; -break ; -case CGS_SYSTEM_INFO_PCIE_REV : - sys_info->value = adev->pdev->revision; -break ; -case CGS_SYSTEM_INFO_CG_FLAGS : - sys_info->value = adev->cg_flags; -break ; -case CGS_SYSTEM_INFO_PG_FLAGS : - sys_info->value = adev->pg_flags; -break ; -case CGS_SYSTEM_INFO_GFX_CU_INFO : - sys_info->value = adev->gfx.cu_info.number; -break ; -case CGS_SYSTEM_INFO_GFX_SE_INFO : - sys_info->value = adev->gfx.config.max_shader_engines; -break ; -case CGS_SYSTEM_INFO_PCIE_SUB_SYS_ID : - sys_info->value = adev->pdev->subsystem_device; -break ; -case CGS_SYSTEM_INFO_PCIE_SUB_SYS_VENDOR_ID : - sys_info->value = adev->pdev->subsystem_vendor; -break ; -case CGS_SYSTEM_INFO_PCIE_BUS_DEVFN : - sys_info->value = adev->pdev->devfn; -break ; -case CGS_SYSTEM_INFO_VRAM_WIDTH : - sys_info->value = adev->gmc.vram_width; -break ; -default : -return -ENODEV ; - } - -return 0 ; -} -static int amdgpu_cgs_get_active_displays_info (struct cgs_device *cgs_device,struct cgs_display_info *info) {
@@ -996,7 +938,6 @@ static int amdgpu_cgs_set_temperature_range(struct cgs_device *cgs_device, .set_clockgating_state = amdgpu_cgs_set_clockgating_state, .get_active_displays_info = amdgpu_cgs_get_active_displays_info, .notify_dpm_enabled = amdgpu_cgs_notify_dpm_enabled, - .query_system_info = amdgpu_cgs_query_system_info, .is_virtualization_enabled = amdgpu_cgs_is_virtualization_enabled, .enter_safe_mode = amdgpu_cgs_enter_safe_mode, .lock_grbm_idx = amdgpu_cgs_lock_grbm_idx,
drivers/gpu/drm/amd/include/cgs_common.h +0 -34
@@ -88,33 +88,6 @@ enum cgs_ucode_id { CGS_UCODE_ID_MAXIMUM, }; -enum cgs_system_info_id { -CGS_SYSTEM_INFO_ADAPTER_BDF_ID =1 , -CGS_SYSTEM_INFO_PCIE_GEN_INFO , -CGS_SYSTEM_INFO_PCIE_MLW , -CGS_SYSTEM_INFO_PCIE_DEV , -CGS_SYSTEM_INFO_PCIE_REV , -CGS_SYSTEM_INFO_CG_FLAGS , -CGS_SYSTEM_INFO_PG_FLAGS , -CGS_SYSTEM_INFO_GFX_CU_INFO , -CGS_SYSTEM_INFO_GFX_SE_INFO , -CGS_SYSTEM_INFO_PCIE_SUB_SYS_ID , -CGS_SYSTEM_INFO_PCIE_SUB_SYS_VENDOR_ID , -CGS_SYSTEM_INFO_PCIE_BUS_DEVFN , -CGS_SYSTEM_INFO_VRAM_WIDTH , -CGS_SYSTEM_INFO_ID_MAXIMUM , -}; - -struct cgs_system_info { -uint64_t size; -enum cgs_system_info_id info_id; -union { -void *ptr; -uint64_t value; - }; -uint64_t padding[13 ]; -}; -/* * enum cgs_resource_type - GPU resource type */
@@ -375,9 +348,6 @@ typedef int(*cgs_get_active_displays_info)(typedef int (*cgs_notify_dpm_enabled )(struct cgs_device *cgs_device,bool enabled); -typedef int (*cgs_query_system_info )(struct cgs_device *cgs_device, -struct cgs_system_info *sys_info); -typedef int (*cgs_is_virtualization_enabled_t )(void *cgs_device);typedef int (*cgs_enter_safe_mode )(struct cgs_device *cgs_device,bool en);
@@ -416,8 +386,6 @@ struct cgs_ops {cgs_get_active_displays_info get_active_displays_info;/* notify dpm enabled */ cgs_notify_dpm_enabled notify_dpm_enabled; -/* get system info */ -cgs_query_system_info query_system_info;cgs_is_virtualization_enabled_t is_virtualization_enabled;cgs_enter_safe_mode enter_safe_mode;cgs_lock_grbm_idx lock_grbm_idx;
@@ -483,8 +451,6 @@ struct cgs_device#define cgs_get_active_displays_info (dev, info) \ CGS_CALL(get_active_displays_info, dev, info) -#define cgs_query_system_info (dev, sys_info) \ - CGS_CALL(query_system_info, dev, sys_info)#define cgs_get_pci_resource (cgs_device, resource_type, size, offset, \ resource_base) \ CGS_CALL(get_pci_resource, cgs_device, resource_type, size, offset, \
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +9 -13
@@ -173,8 +173,7 @@ static uint32_t cz_get_max_sclk_level(struct pp_hwmgr *hwmgr)static int cz_initialize_dpm_defaults (struct pp_hwmgr *hwmgr) {struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); -struct cgs_system_info sys_info = {0 }; -int result; +struct amdgpu_device *adev = hwmgr->adev; cz_hwmgr->gfx_ramp_step =256 *25 /100 ; cz_hwmgr->gfx_ramp_delay =1 ;/* by default, we delay 1us */
@@ -234,17 +233,14 @@ static int cz_initialize_dpm_defaults(struct pp_hwmgr *hwmgr) PHM_PlatformCaps_UVDPowerGating);phm_cap_unset (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_VCEPowerGating); - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PG_FLAGS ; - result =cgs_query_system_info (hwmgr->device, &sys_info); -if (!result) { -if (sys_info.value &AMD_PG_SUPPORT_UVD ) -phm_cap_set (hwmgr->platform_descriptor.platformCaps, - PHM_PlatformCaps_UVDPowerGating); -if (sys_info.value &AMD_PG_SUPPORT_VCE ) -phm_cap_set (hwmgr->platform_descriptor.platformCaps, - PHM_PlatformCaps_VCEPowerGating); - } + +if (adev->pg_flags &AMD_PG_SUPPORT_UVD ) +phm_cap_set (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_UVDPowerGating); +if (adev->pg_flags &AMD_PG_SUPPORT_VCE ) +phm_cap_set (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_VCEPowerGating); +return 0 ; }
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +15 -39
79 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +3 -14
@@ -472,23 +472,12 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,*/ int smu7_enable_per_cu_power_gating (struct pp_hwmgr *hwmgr,bool enable) { -struct cgs_system_info sys_info = {0 }; -uint32_t active_cus; -int result; - - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_GFX_CU_INFO ; - - result =cgs_query_system_info (hwmgr->device, &sys_info); - -if (result) -return -EINVAL ; - - active_cus = sys_info.value; +struct amdgpu_device *adev = hwmgr->adev;if (enable)return smum_send_msg_to_smc_with_parameter (hwmgr, -PPSMC_MSG_GFX_CU_PG_ENABLE , active_cus); +PPSMC_MSG_GFX_CU_PG_ENABLE , + adev->gfx.cu_info.number);else return smum_send_msg_to_smc (hwmgr,PPSMC_MSG_GFX_CU_PG_DISABLE );
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +16 -38
102 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c +2 -7
@@ -731,14 +731,9 @@ int smu7_enable_didt_config(struct pp_hwmgr *hwmgr)int result;uint32_t num_se =0 ;uint32_t count, value, value2; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_GFX_SE_INFO ; - result =cgs_query_system_info (hwmgr->device, &sys_info); - -if (result ==0 ) - num_se = sys_info.value; + num_se = adev->gfx.config.max_shader_engines; if (PP_CAP(PHM_PlatformCaps_SQRamping) || PP_CAP(PHM_PlatformCaps_DBRamping) ||
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +5 -13
@@ -190,8 +190,7 @@ static int vega10_set_features_platform_caps(struct pp_hwmgr *hwmgr) (struct vega10_hwmgr *)(hwmgr->backend);struct phm_ppt_v2_information *table_info = (struct phm_ppt_v2_information *)hwmgr->pptable; -struct cgs_system_info sys_info = {0 }; -int result; +struct amdgpu_device *adev = hwmgr->adev;phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep);
@@ -206,15 +205,11 @@ static int vega10_set_features_platform_caps(struct pp_hwmgr *hwmgr)phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_EnableSMU7ThermalManagement); - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PG_FLAGS ; - result =cgs_query_system_info (hwmgr->device, &sys_info); - -if (!result && (sys_info.value &AMD_PG_SUPPORT_UVD )) +if (adev->pg_flags &AMD_PG_SUPPORT_UVD )phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_UVDPowerGating); -if (!result && (sys_info.value &AMD_PG_SUPPORT_VCE )) +if (adev->pg_flags &AMD_PG_SUPPORT_VCE )phm_cap_set (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_VCEPowerGating);
@@ -750,7 +745,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)struct vega10_hwmgr *data;uint32_t config_telemetry =0 ;struct pp_atomfwctrl_voltage_table vol_table; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t reg; data =kzalloc (sizeof (struct vega10_hwmgr ),GFP_KERNEL );
@@ -843,10 +838,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) hwmgr->platform_descriptor.clockStep.engineClock =500 ; hwmgr->platform_descriptor.clockStep.memoryClock =500 ; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_GFX_CU_INFO ; - result =cgs_query_system_info (hwmgr->device, &sys_info); - data->total_active_cus = sys_info.value; + data->total_active_cus = adev->gfx.cu_info.number;/* Setup default Overdrive Fan control settings */ data->odn_fan_table.target_fan_speed = hwmgr->thermal_controller.advanceFanControlParameters.usMaxFanRPM;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +8 -20
@@ -933,13 +933,10 @@ static int vega10_enable_cac_driving_se_didt_config(struct pp_hwmgr *hwmgr) {int result;uint32_t num_se =0 , count, data; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t reg; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_GFX_SE_INFO ; -if (cgs_query_system_info (hwmgr->device, &sys_info) ==0 ) - num_se = sys_info.value; + num_se = adev->gfx.config.max_shader_engines;cgs_enter_safe_mode (hwmgr->device, true);
@@ -987,13 +984,10 @@ static int vega10_enable_psm_gc_didt_config(struct pp_hwmgr *hwmgr) {int result;uint32_t num_se =0 , count, data; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t reg; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_GFX_SE_INFO ; -if (cgs_query_system_info (hwmgr->device, &sys_info) ==0 ) - num_se = sys_info.value; + num_se = adev->gfx.config.max_shader_engines;cgs_enter_safe_mode (hwmgr->device, true);
@@ -1052,13 +1046,10 @@ static int vega10_enable_se_edc_config(struct pp_hwmgr *hwmgr) {int result;uint32_t num_se =0 , count, data; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t reg; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_GFX_SE_INFO ; -if (cgs_query_system_info (hwmgr->device, &sys_info) ==0 ) - num_se = sys_info.value; + num_se = adev->gfx.config.max_shader_engines;cgs_enter_safe_mode (hwmgr->device, true);
@@ -1103,13 +1094,10 @@ static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr)int result;uint32_t num_se =0 ;uint32_t count, data; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t reg; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_GFX_SE_INFO ; -if (cgs_query_system_info (hwmgr->device, &sys_info) ==0 ) - num_se = sys_info.value; + num_se = adev->gfx.config.max_shader_engines;cgs_enter_safe_mode (hwmgr->device, true);
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c +3 -10
@@ -688,9 +688,9 @@ static int get_dcefclk_voltage_dependency_table(uint8_t num_entries;struct phm_ppt_v1_clock_voltage_dependency_table *clk_table; -struct cgs_system_info sys_info = {0 };uint32_t dev_id;uint32_t rev_id; +struct amdgpu_device *adev = hwmgr->adev;PP_ASSERT_WITH_CODE ((clk_dep_table->ucNumEntries !=0 ),"Invalid PowerPlay Table!" , return -1 );
@@ -701,15 +701,8 @@ static int get_dcefclk_voltage_dependency_table(* This DPM level was added to support 3DPM monitors @ 4K120Hz * */ - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_DEV ; -cgs_query_system_info (hwmgr->device, &sys_info); - dev_id = (uint32_t )sys_info.value; - - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_REV ; -cgs_query_system_info (hwmgr->device, &sys_info); - rev_id = (uint32_t )sys_info.value; + dev_id = adev->pdev->device; + rev_id = adev->pdev->revision;if (dev_id ==0x6863 && rev_id ==0 && clk_dep_table->entries[clk_dep_table->ucNumEntries -1 ].ulClk <90000 )
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c +4 -10
@@ -236,13 +236,10 @@ static int ci_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,static void ci_initialize_power_tune_defaults (struct pp_hwmgr *hwmgr) {struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend); -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t dev_id; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_DEV ; -cgs_query_system_info (hwmgr->device, &sys_info); - dev_id = (uint32_t )sys_info.value; + dev_id = adev->pdev->device;switch (dev_id) {case 0x67BA :
@@ -1309,7 +1306,7 @@ static int ci_populate_all_memory_levels(struct pp_hwmgr *hwmgr)struct ci_smumgr *smu_data = (struct ci_smumgr *)(hwmgr->smu_backend);struct smu7_dpm_table *dpm_table = &data->dpm_table;int result; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t dev_id;uint32_t level_array_address = smu_data->dpm_table_start + offsetof(SMU7_Discrete_DpmTable , MemoryLevel);
@@ -1330,10 +1327,7 @@ static int ci_populate_all_memory_levels(struct pp_hwmgr *hwmgr) smu_data->smc_state_table.MemoryLevel[0 ].EnabledForActivity =1 ; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_DEV ; -cgs_query_system_info (hwmgr->device, &sys_info); - dev_id = (uint32_t )sys_info.value; + dev_id = adev->pdev->device;if ((dpm_table->mclk_table.count >=2 ) && ((dev_id ==0x67B0 ) || (dev_id ==0x67B1 ))) {
drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c +2 -5
@@ -281,13 +281,10 @@ static int iceland_smu_init(struct pp_hwmgr *hwmgr)static void iceland_initialize_power_tune_defaults (struct pp_hwmgr *hwmgr) {struct iceland_smumgr *smu_data = (struct iceland_smumgr *)(hwmgr->smu_backend); -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t dev_id; - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_DEV ; -cgs_query_system_info (hwmgr->device, &sys_info); - dev_id = (uint32_t )sys_info.value; + dev_id = adev->pdev->device;switch (dev_id) {case DEVICE_ID_VI_ICELAND_M_6900 :
drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c +3 -10
@@ -1623,19 +1623,12 @@ static int tonga_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr)struct phm_ppt_v1_clock_voltage_dependency_table *sclk_table = table_info->vdd_dep_on_sclk;uint32_t hw_revision, dev_id; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev; stretch_amount = (uint8_t )table_info->cac_dtp_table->usClockStretchAmount; - sys_info.size =sizeof (struct cgs_system_info ); - - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_REV ; -cgs_query_system_info (hwmgr->device, &sys_info); - hw_revision = (uint32_t )sys_info.value; - - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_DEV ; -cgs_query_system_info (hwmgr->device, &sys_info); - dev_id = (uint32_t )sys_info.value; + hw_revision = adev->pdev->revision; + dev_id = adev->pdev->device;/* Read SMU_Eefuse to read and calculate RO and determine * if the part is SS or FF. if RO >= 1660MHz, part is FF.
drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c +3 -10
@@ -349,7 +349,7 @@ int vega10_set_tools_address(struct pp_hwmgr *hwmgr)static int vega10_verify_smc_interface (struct pp_hwmgr *hwmgr) {uint32_t smc_driver_if_version; -struct cgs_system_info sys_info = {0 }; +struct amdgpu_device *adev = hwmgr->adev;uint32_t dev_id;uint32_t rev_id;
@@ -359,15 +359,8 @@ static int vega10_verify_smc_interface(struct pp_hwmgr *hwmgr) return -EINVAL);vega10_read_arg_from_smc (hwmgr, &smc_driver_if_version); - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_DEV ; -cgs_query_system_info (hwmgr->device, &sys_info); - dev_id = (uint32_t )sys_info.value; - - sys_info.size =sizeof (struct cgs_system_info ); - sys_info.info_id =CGS_SYSTEM_INFO_PCIE_REV ; -cgs_query_system_info (hwmgr->device, &sys_info); - rev_id = (uint32_t )sys_info.value; + dev_id = adev->pdev->device; + rev_id = adev->pdev->revision; if (!((dev_id == 0x687f) && ((rev_id == 0xc0) ||
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
Reviewed-byQuoted 10 lines · Rex Zhu
Rex Zhu (7):
drm/amd/pp: Simply powerplay create code
drm/amd/dc: Use forward declaration instand of include header file drm/amd/pp: Refine powerplay instance
drm/amdgpu: Notify sbios device ready before send request drm/amd/pp: Use amdgpu acpi helper functions in powerplay drm/amd/pp: Remove the wrap functions for acpi in powerplay drm/amd/pp: Removecgs_query_system_info
Just a comment on patch 4. With that addressed, the whole series is:
Alex
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx