aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorEric Huang <JinHuiEric.Huang@amd.com>2016-09-12 16:17:44 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-03-29 23:52:48 -0400
commit34bb2734d1bc3c72e4739234481c0efab0941d14 (patch)
treec31583ca0511581253f37aea943ba840d8388bfd /drivers/gpu/drm
parent3f14e6231858f4d9a2e965f54202f7a3f69c79d0 (diff)
drm/amd/amdgpu: add power profile sysfs entry
Add the sysfs entries pp_gfx_power_profile and pp_compute_power_profile which give user a way to set power profile through parameters minimum sclk, minimum mclk, activity threshold, up hysteresis and down hysteresis only when the entry power_dpm_force_performance_level is in default value "auto". It is read and write. Example: echo 500 800 20 0 5 > /sys/class/drm/card0/device/pp_*_power_profile cat /sys/class/drm/card0/device/pp_*_power_profile 500 800 20 0 5 Note: first parameter is sclk in MHz, second is mclk in MHz, third is activity threshold in percentage, fourth is up hysteresis in ms and fifth is down hysteresis in ms. echo set > /sys/class/drm/card0/device/pp_*_power_profile To set power profile state if it exists. echo reset > /sys/class/drm/card0/device/pp_*_power_profile To restore default state and clear previous setting. Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Acked-by: Rex Zhu <Rex.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h24
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c192
-rw-r--r--drivers/gpu/drm/amd/include/amd_shared.h14
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c136
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h8
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/hwmgr.h9
6 files changed, 382 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
index fa2b55681422..5f09893c9674 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
@@ -272,6 +272,14 @@ struct amdgpu_dpm_funcs {
272 bool *equal); 272 bool *equal);
273 273
274 struct amd_vce_state* (*get_vce_clock_state)(struct amdgpu_device *adev, unsigned idx); 274 struct amd_vce_state* (*get_vce_clock_state)(struct amdgpu_device *adev, unsigned idx);
275 int (*reset_power_profile_state)(struct amdgpu_device *adev,
276 struct amd_pp_profile *request);
277 int (*get_power_profile_state)(struct amdgpu_device *adev,
278 struct amd_pp_profile *query);
279 int (*set_power_profile_state)(struct amdgpu_device *adev,
280 struct amd_pp_profile *request);
281 int (*switch_power_profile)(struct amdgpu_device *adev,
282 enum amd_pp_profile_type type);
275}; 283};
276 284
277#define amdgpu_dpm_pre_set_power_state(adev) (adev)->pm.funcs->pre_set_power_state((adev)) 285#define amdgpu_dpm_pre_set_power_state(adev) (adev)->pm.funcs->pre_set_power_state((adev))
@@ -388,6 +396,22 @@ struct amdgpu_dpm_funcs {
388 (adev)->powerplay.pp_funcs->get_performance_level((adev)->powerplay.pp_handle) : \ 396 (adev)->powerplay.pp_funcs->get_performance_level((adev)->powerplay.pp_handle) : \
389 (adev)->pm.dpm.forced_level) 397 (adev)->pm.dpm.forced_level)
390 398
399#define amdgpu_dpm_reset_power_profile_state(adev, request) \
400 ((adev)->powerplay.pp_funcs->reset_power_profile_state(\
401 (adev)->powerplay.pp_handle, request))
402
403#define amdgpu_dpm_get_power_profile_state(adev, query) \
404 ((adev)->powerplay.pp_funcs->get_power_profile_state(\
405 (adev)->powerplay.pp_handle, query))
406
407#define amdgpu_dpm_set_power_profile_state(adev, request) \
408 ((adev)->powerplay.pp_funcs->set_power_profile_state(\
409 (adev)->powerplay.pp_handle, request))
410
411#define amdgpu_dpm_switch_power_profile(adev, type) \
412 ((adev)->powerplay.pp_funcs->switch_power_profile(\
413 (adev)->powerplay.pp_handle, type))
414
391struct amdgpu_dpm { 415struct amdgpu_dpm {
392 struct amdgpu_ps *ps; 416 struct amdgpu_ps *ps;
393 /* number of valid power states */ 417 /* number of valid power states */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 346e80a7119b..fd45212c4b98 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -610,6 +610,174 @@ fail:
610 return count; 610 return count;
611} 611}
612 612
613static ssize_t amdgpu_get_pp_power_profile(struct device *dev,
614 char *buf, struct amd_pp_profile *query)
615{
616 struct drm_device *ddev = dev_get_drvdata(dev);
617 struct amdgpu_device *adev = ddev->dev_private;
618 int ret = 0;
619
620 if (adev->pp_enabled)
621 ret = amdgpu_dpm_get_power_profile_state(
622 adev, query);
623 else if (adev->pm.funcs->get_power_profile_state)
624 ret = adev->pm.funcs->get_power_profile_state(
625 adev, query);
626
627 if (ret)
628 return ret;
629
630 return snprintf(buf, PAGE_SIZE,
631 "%d %d %d %d %d\n",
632 query->min_sclk / 100,
633 query->min_mclk / 100,
634 query->activity_threshold,
635 query->up_hyst,
636 query->down_hyst);
637}
638
639static ssize_t amdgpu_get_pp_gfx_power_profile(struct device *dev,
640 struct device_attribute *attr,
641 char *buf)
642{
643 struct amd_pp_profile query = {0};
644
645 query.type = AMD_PP_GFX_PROFILE;
646
647 return amdgpu_get_pp_power_profile(dev, buf, &query);
648}
649
650static ssize_t amdgpu_get_pp_compute_power_profile(struct device *dev,
651 struct device_attribute *attr,
652 char *buf)
653{
654 struct amd_pp_profile query = {0};
655
656 query.type = AMD_PP_COMPUTE_PROFILE;
657
658 return amdgpu_get_pp_power_profile(dev, buf, &query);
659}
660
661static ssize_t amdgpu_set_pp_power_profile(struct device *dev,
662 const char *buf,
663 size_t count,
664 struct amd_pp_profile *request)
665{
666 struct drm_device *ddev = dev_get_drvdata(dev);
667 struct amdgpu_device *adev = ddev->dev_private;
668 uint32_t loop = 0;
669 char *sub_str, buf_cpy[128], *tmp_str;
670 const char delimiter[3] = {' ', '\n', '\0'};
671 long int value;
672 int ret = 0;
673
674 if (strncmp("reset", buf, strlen("reset")) == 0) {
675 if (adev->pp_enabled)
676 ret = amdgpu_dpm_reset_power_profile_state(
677 adev, request);
678 else if (adev->pm.funcs->reset_power_profile_state)
679 ret = adev->pm.funcs->reset_power_profile_state(
680 adev, request);
681 if (ret) {
682 count = -EINVAL;
683 goto fail;
684 }
685 return count;
686 }
687
688 if (strncmp("set", buf, strlen("set")) == 0) {
689 if (adev->pp_enabled)
690 ret = amdgpu_dpm_set_power_profile_state(
691 adev, request);
692 else if (adev->pm.funcs->set_power_profile_state)
693 ret = adev->pm.funcs->set_power_profile_state(
694 adev, request);
695 if (ret) {
696 count = -EINVAL;
697 goto fail;
698 }
699 return count;
700 }
701
702 if (count + 1 >= 128) {
703 count = -EINVAL;
704 goto fail;
705 }
706
707 memcpy(buf_cpy, buf, count + 1);
708 tmp_str = buf_cpy;
709
710 while (tmp_str[0]) {
711 sub_str = strsep(&tmp_str, delimiter);
712 ret = kstrtol(sub_str, 0, &value);
713 if (ret) {
714 count = -EINVAL;
715 goto fail;
716 }
717
718 switch (loop) {
719 case 0:
720 /* input unit MHz convert to dpm table unit 10KHz*/
721 request->min_sclk = (uint32_t)value * 100;
722 break;
723 case 1:
724 /* input unit MHz convert to dpm table unit 10KHz*/
725 request->min_mclk = (uint32_t)value * 100;
726 break;
727 case 2:
728 request->activity_threshold = (uint16_t)value;
729 break;
730 case 3:
731 request->up_hyst = (uint8_t)value;
732 break;
733 case 4:
734 request->down_hyst = (uint8_t)value;
735 break;
736 default:
737 break;
738 }
739
740 loop++;
741 }
742
743 if (adev->pp_enabled)
744 ret = amdgpu_dpm_set_power_profile_state(
745 adev, request);
746 else if (adev->pm.funcs->set_power_profile_state)
747 ret = adev->pm.funcs->set_power_profile_state(
748 adev, request);
749
750 if (ret)
751 count = -EINVAL;
752
753fail:
754 return count;
755}
756
757static ssize_t amdgpu_set_pp_gfx_power_profile(struct device *dev,
758 struct device_attribute *attr,
759 const char *buf,
760 size_t count)
761{
762 struct amd_pp_profile request = {0};
763
764 request.type = AMD_PP_GFX_PROFILE;
765
766 return amdgpu_set_pp_power_profile(dev, buf, count, &request);
767}
768
769static ssize_t amdgpu_set_pp_compute_power_profile(struct device *dev,
770 struct device_attribute *attr,
771 const char *buf,
772 size_t count)
773{
774 struct amd_pp_profile request = {0};
775
776 request.type = AMD_PP_COMPUTE_PROFILE;
777
778 return amdgpu_set_pp_power_profile(dev, buf, count, &request);
779}
780
613static DEVICE_ATTR(power_dpm_state, S_IRUGO | S_IWUSR, amdgpu_get_dpm_state, amdgpu_set_dpm_state); 781static DEVICE_ATTR(power_dpm_state, S_IRUGO | S_IWUSR, amdgpu_get_dpm_state, amdgpu_set_dpm_state);
614static DEVICE_ATTR(power_dpm_force_performance_level, S_IRUGO | S_IWUSR, 782static DEVICE_ATTR(power_dpm_force_performance_level, S_IRUGO | S_IWUSR,
615 amdgpu_get_dpm_forced_performance_level, 783 amdgpu_get_dpm_forced_performance_level,
@@ -637,6 +805,12 @@ static DEVICE_ATTR(pp_sclk_od, S_IRUGO | S_IWUSR,
637static DEVICE_ATTR(pp_mclk_od, S_IRUGO | S_IWUSR, 805static DEVICE_ATTR(pp_mclk_od, S_IRUGO | S_IWUSR,
638 amdgpu_get_pp_mclk_od, 806 amdgpu_get_pp_mclk_od,
639 amdgpu_set_pp_mclk_od); 807 amdgpu_set_pp_mclk_od);
808static DEVICE_ATTR(pp_gfx_power_profile, S_IRUGO | S_IWUSR,
809 amdgpu_get_pp_gfx_power_profile,
810 amdgpu_set_pp_gfx_power_profile);
811static DEVICE_ATTR(pp_compute_power_profile, S_IRUGO | S_IWUSR,
812 amdgpu_get_pp_compute_power_profile,
813 amdgpu_set_pp_compute_power_profile);
640 814
641static ssize_t amdgpu_hwmon_show_temp(struct device *dev, 815static ssize_t amdgpu_hwmon_show_temp(struct device *dev,
642 struct device_attribute *attr, 816 struct device_attribute *attr,
@@ -1255,6 +1429,20 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
1255 DRM_ERROR("failed to create device file pp_mclk_od\n"); 1429 DRM_ERROR("failed to create device file pp_mclk_od\n");
1256 return ret; 1430 return ret;
1257 } 1431 }
1432 ret = device_create_file(adev->dev,
1433 &dev_attr_pp_gfx_power_profile);
1434 if (ret) {
1435 DRM_ERROR("failed to create device file "
1436 "pp_gfx_power_profile\n");
1437 return ret;
1438 }
1439 ret = device_create_file(adev->dev,
1440 &dev_attr_pp_compute_power_profile);
1441 if (ret) {
1442 DRM_ERROR("failed to create device file "
1443 "pp_compute_power_profile\n");
1444 return ret;
1445 }
1258 1446
1259 ret = amdgpu_debugfs_pm_init(adev); 1447 ret = amdgpu_debugfs_pm_init(adev);
1260 if (ret) { 1448 if (ret) {
@@ -1284,6 +1472,10 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)
1284 device_remove_file(adev->dev, &dev_attr_pp_dpm_pcie); 1472 device_remove_file(adev->dev, &dev_attr_pp_dpm_pcie);
1285 device_remove_file(adev->dev, &dev_attr_pp_sclk_od); 1473 device_remove_file(adev->dev, &dev_attr_pp_sclk_od);
1286 device_remove_file(adev->dev, &dev_attr_pp_mclk_od); 1474 device_remove_file(adev->dev, &dev_attr_pp_mclk_od);
1475 device_remove_file(adev->dev,
1476 &dev_attr_pp_gfx_power_profile);
1477 device_remove_file(adev->dev,
1478 &dev_attr_pp_compute_power_profile);
1287} 1479}
1288 1480
1289void amdgpu_pm_compute_clocks(struct amdgpu_device *adev) 1481void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 43f45adeccd1..f7425c384a3f 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -120,6 +120,20 @@ enum amd_vce_level {
120 AMD_VCE_LEVEL_DC_GP_HIGH = 5, /* DC, general purpose queue, 1080 >= res > 720 */ 120 AMD_VCE_LEVEL_DC_GP_HIGH = 5, /* DC, general purpose queue, 1080 >= res > 720 */
121}; 121};
122 122
123enum amd_pp_profile_type {
124 AMD_PP_GFX_PROFILE,
125 AMD_PP_COMPUTE_PROFILE,
126};
127
128struct amd_pp_profile {
129 enum amd_pp_profile_type type;
130 uint32_t min_sclk;
131 uint32_t min_mclk;
132 uint16_t activity_threshold;
133 uint8_t up_hyst;
134 uint8_t down_hyst;
135};
136
123/* CG flags */ 137/* CG flags */
124#define AMD_CG_SUPPORT_GFX_MGCG (1 << 0) 138#define AMD_CG_SUPPORT_GFX_MGCG (1 << 0)
125#define AMD_CG_SUPPORT_GFX_MGLS (1 << 1) 139#define AMD_CG_SUPPORT_GFX_MGLS (1 << 1)
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index e9cf207b9dcf..8074386da36f 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -917,10 +917,140 @@ pp_dpm_get_vce_clock_state(void *handle, unsigned idx)
917 917
918 if (hwmgr && idx < hwmgr->num_vce_state_tables) 918 if (hwmgr && idx < hwmgr->num_vce_state_tables)
919 return &hwmgr->vce_states[idx]; 919 return &hwmgr->vce_states[idx];
920
921 return NULL; 920 return NULL;
922} 921}
923 922
923static int pp_dpm_reset_power_profile_state(void *handle,
924 struct amd_pp_profile *request)
925{
926 struct pp_hwmgr *hwmgr;
927 struct pp_instance *pp_handle = (struct pp_instance *)handle;
928
929 if (!request || pp_check(pp_handle))
930 return -EINVAL;
931
932 hwmgr = pp_handle->hwmgr;
933
934 if (hwmgr->hwmgr_func->set_power_profile_state == NULL) {
935 pr_info("%s was not implemented.\n", __func__);
936 return 0;
937 }
938
939 if (request->type == AMD_PP_GFX_PROFILE) {
940 hwmgr->gfx_power_profile = hwmgr->default_gfx_power_profile;
941 return hwmgr->hwmgr_func->set_power_profile_state(hwmgr,
942 &hwmgr->gfx_power_profile);
943 } else if (request->type == AMD_PP_COMPUTE_PROFILE) {
944 hwmgr->compute_power_profile =
945 hwmgr->default_compute_power_profile;
946 return hwmgr->hwmgr_func->set_power_profile_state(hwmgr,
947 &hwmgr->compute_power_profile);
948 } else
949 return -EINVAL;
950}
951
952static int pp_dpm_get_power_profile_state(void *handle,
953 struct amd_pp_profile *query)
954{
955 struct pp_hwmgr *hwmgr;
956 struct pp_instance *pp_handle = (struct pp_instance *)handle;
957
958 if (!query || pp_check(pp_handle))
959 return -EINVAL;
960
961 hwmgr = pp_handle->hwmgr;
962
963 if (query->type == AMD_PP_GFX_PROFILE)
964 memcpy(query, &hwmgr->gfx_power_profile,
965 sizeof(struct amd_pp_profile));
966 else if (query->type == AMD_PP_COMPUTE_PROFILE)
967 memcpy(query, &hwmgr->compute_power_profile,
968 sizeof(struct amd_pp_profile));
969 else
970 return -EINVAL;
971
972 return 0;
973}
974
975static int pp_dpm_set_power_profile_state(void *handle,
976 struct amd_pp_profile *request)
977{
978 struct pp_hwmgr *hwmgr;
979 struct pp_instance *pp_handle = (struct pp_instance *)handle;
980 int ret = -1;
981
982 if (!request || pp_check(pp_handle))
983 return -EINVAL;
984
985 hwmgr = pp_handle->hwmgr;
986
987 if (hwmgr->hwmgr_func->set_power_profile_state == NULL) {
988 pr_info("%s was not implemented.\n", __func__);
989 return 0;
990 }
991
992 if (request->min_sclk ||
993 request->min_mclk ||
994 request->activity_threshold ||
995 request->up_hyst ||
996 request->down_hyst) {
997 if (request->type == AMD_PP_GFX_PROFILE)
998 memcpy(&hwmgr->gfx_power_profile, request,
999 sizeof(struct amd_pp_profile));
1000 else if (request->type == AMD_PP_COMPUTE_PROFILE)
1001 memcpy(&hwmgr->compute_power_profile, request,
1002 sizeof(struct amd_pp_profile));
1003 else
1004 return -EINVAL;
1005
1006 if (request->type == hwmgr->current_power_profile)
1007 ret = hwmgr->hwmgr_func->set_power_profile_state(
1008 hwmgr,
1009 request);
1010 } else {
1011 /* set power profile if it exists */
1012 switch (request->type) {
1013 case AMD_PP_GFX_PROFILE:
1014 ret = hwmgr->hwmgr_func->set_power_profile_state(
1015 hwmgr,
1016 &hwmgr->gfx_power_profile);
1017 break;
1018 case AMD_PP_COMPUTE_PROFILE:
1019 ret = hwmgr->hwmgr_func->set_power_profile_state(
1020 hwmgr,
1021 &hwmgr->compute_power_profile);
1022 break;
1023 default:
1024 return -EINVAL;
1025 }
1026 }
1027
1028 if (!ret)
1029 hwmgr->current_power_profile = request->type;
1030
1031 return 0;
1032}
1033
1034static int pp_dpm_switch_power_profile(void *handle,
1035 enum amd_pp_profile_type type)
1036{
1037 struct pp_hwmgr *hwmgr;
1038 struct amd_pp_profile request = {0};
1039 struct pp_instance *pp_handle = (struct pp_instance *)handle;
1040
1041 if (pp_check(pp_handle))
1042 return -EINVAL;
1043
1044 hwmgr = pp_handle->hwmgr;
1045
1046 if (hwmgr->current_power_profile != type) {
1047 request.type = type;
1048 pp_dpm_set_power_profile_state(handle, &request);
1049 }
1050
1051 return 0;
1052}
1053
924const struct amd_powerplay_funcs pp_dpm_funcs = { 1054const struct amd_powerplay_funcs pp_dpm_funcs = {
925 .get_temperature = pp_dpm_get_temperature, 1055 .get_temperature = pp_dpm_get_temperature,
926 .load_firmware = pp_dpm_load_fw, 1056 .load_firmware = pp_dpm_load_fw,
@@ -949,6 +1079,10 @@ const struct amd_powerplay_funcs pp_dpm_funcs = {
949 .set_mclk_od = pp_dpm_set_mclk_od, 1079 .set_mclk_od = pp_dpm_set_mclk_od,
950 .read_sensor = pp_dpm_read_sensor, 1080 .read_sensor = pp_dpm_read_sensor,
951 .get_vce_clock_state = pp_dpm_get_vce_clock_state, 1081 .get_vce_clock_state = pp_dpm_get_vce_clock_state,
1082 .reset_power_profile_state = pp_dpm_reset_power_profile_state,
1083 .get_power_profile_state = pp_dpm_get_power_profile_state,
1084 .set_power_profile_state = pp_dpm_set_power_profile_state,
1085 .switch_power_profile = pp_dpm_switch_power_profile,
952}; 1086};
953 1087
954int amd_powerplay_create(struct amd_pp_init *pp_init, 1088int amd_powerplay_create(struct amd_pp_init *pp_init,
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h
index 6dd5f0e9ef87..4b4f5ff2f039 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h
@@ -361,6 +361,14 @@ struct amd_powerplay_funcs {
361 int (*set_mclk_od)(void *handle, uint32_t value); 361 int (*set_mclk_od)(void *handle, uint32_t value);
362 int (*read_sensor)(void *handle, int idx, int32_t *value); 362 int (*read_sensor)(void *handle, int idx, int32_t *value);
363 struct amd_vce_state* (*get_vce_clock_state)(void *handle, unsigned idx); 363 struct amd_vce_state* (*get_vce_clock_state)(void *handle, unsigned idx);
364 int (*reset_power_profile_state)(void *handle,
365 struct amd_pp_profile *request);
366 int (*get_power_profile_state)(void *handle,
367 struct amd_pp_profile *query);
368 int (*set_power_profile_state)(void *handle,
369 struct amd_pp_profile *request);
370 int (*switch_power_profile)(void *handle,
371 enum amd_pp_profile_type type);
364}; 372};
365 373
366struct amd_powerplay { 374struct amd_powerplay {
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index 7275a29293eb..768f81f365ca 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -358,6 +358,8 @@ struct pp_hwmgr_func {
358 int (*read_sensor)(struct pp_hwmgr *hwmgr, int idx, int32_t *value); 358 int (*read_sensor)(struct pp_hwmgr *hwmgr, int idx, int32_t *value);
359 int (*request_firmware)(struct pp_hwmgr *hwmgr); 359 int (*request_firmware)(struct pp_hwmgr *hwmgr);
360 int (*release_firmware)(struct pp_hwmgr *hwmgr); 360 int (*release_firmware)(struct pp_hwmgr *hwmgr);
361 int (*set_power_profile_state)(struct pp_hwmgr *hwmgr,
362 struct amd_pp_profile *request);
361}; 363};
362 364
363struct pp_table_func { 365struct pp_table_func {
@@ -650,6 +652,13 @@ struct pp_hwmgr {
650 struct pp_power_state *uvd_ps; 652 struct pp_power_state *uvd_ps;
651 struct amd_pp_display_configuration display_config; 653 struct amd_pp_display_configuration display_config;
652 uint32_t feature_mask; 654 uint32_t feature_mask;
655
656 /* power profile */
657 struct amd_pp_profile gfx_power_profile;
658 struct amd_pp_profile compute_power_profile;
659 struct amd_pp_profile default_gfx_power_profile;
660 struct amd_pp_profile default_compute_power_profile;
661 enum amd_pp_profile_type current_power_profile;
653}; 662};
654 663
655extern int hwmgr_early_init(struct pp_instance *handle); 664extern int hwmgr_early_init(struct pp_instance *handle);