accel/habanalabs: add HL_GET_P_STATE passthrough type

Add a new passthrough type HL_GET_P_STATE to the cpucp generic ioctl
to allow userspace to read the device performance state via firmware.

Signed-off-by: Ariel Aviad <ariel.aviad@intel.com>
Reviewed-by: Koby Elbaz <koby.elbaz@intel.com>
Signed-off-by: Koby Elbaz <koby.elbaz@intel.com>
This commit is contained in:
Ariel Aviad 2024-09-24 11:02:49 +03:00 committed by Koby Elbaz
parent eeb38d0e91
commit 65a3f5bc33
2 changed files with 5 additions and 0 deletions

View File

@ -964,6 +964,9 @@ static int send_fw_generic_request(struct hl_device *hdev, struct hl_info_args *
case HL_GET_ERR_COUNTERS_CMD:
need_input_buff = true;
break;
case HL_GET_P_STATE:
need_input_buff = false;
break;
default:
return -EINVAL;
}

View File

@ -1426,10 +1426,12 @@ struct cpucp_monitor_dump {
*
* HL_PASSTHROUGHT_VERSIONS - Fetch all firmware versions.
* HL_GET_ERR_COUNTERS_CMD - Command to get error counters
* HL_GET_P_STATE - get performance state
*/
enum hl_passthrough_type {
HL_PASSTHROUGH_VERSIONS,
HL_GET_ERR_COUNTERS_CMD,
HL_GET_P_STATE,
};
#endif /* CPUCP_IF_H */