#include "pp_instance.h"
#include "power_state.h"
#include "amdgpu.h"
+#include "hwmgr.h"
#define PP_DPM_DISABLED 0xCCCC
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;
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;