Commit e8a95b27 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amdgpu: add cgs interface for enter/exit rlc safe mode.

Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 919db4c1
...@@ -763,6 +763,23 @@ static uint16_t amdgpu_get_firmware_version(struct cgs_device *cgs_device, ...@@ -763,6 +763,23 @@ static uint16_t amdgpu_get_firmware_version(struct cgs_device *cgs_device,
return fw_version; return fw_version;
} }
static int amdgpu_cgs_enter_safe_mode(struct cgs_device *cgs_device,
bool en)
{
CGS_FUNC_ADEV;
if (adev->gfx.rlc.funcs->enter_safe_mode == NULL ||
adev->gfx.rlc.funcs->exit_safe_mode == NULL)
return 0;
if (en)
adev->gfx.rlc.funcs->enter_safe_mode(adev);
else
adev->gfx.rlc.funcs->exit_safe_mode(adev);
return 0;
}
static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
enum cgs_ucode_id type, enum cgs_ucode_id type,
struct cgs_firmware_info *info) struct cgs_firmware_info *info)
...@@ -1243,6 +1260,7 @@ static const struct cgs_ops amdgpu_cgs_ops = { ...@@ -1243,6 +1260,7 @@ static const struct cgs_ops amdgpu_cgs_ops = {
.call_acpi_method = amdgpu_cgs_call_acpi_method, .call_acpi_method = amdgpu_cgs_call_acpi_method,
.query_system_info = amdgpu_cgs_query_system_info, .query_system_info = amdgpu_cgs_query_system_info,
.is_virtualization_enabled = amdgpu_cgs_is_virtualization_enabled, .is_virtualization_enabled = amdgpu_cgs_is_virtualization_enabled,
.enter_safe_mode = amdgpu_cgs_enter_safe_mode,
}; };
static const struct cgs_os_ops amdgpu_cgs_os_ops = { static const struct cgs_os_ops amdgpu_cgs_os_ops = {
......
...@@ -622,6 +622,8 @@ typedef int (*cgs_query_system_info)(struct cgs_device *cgs_device, ...@@ -622,6 +622,8 @@ typedef int (*cgs_query_system_info)(struct cgs_device *cgs_device,
typedef int (*cgs_is_virtualization_enabled_t)(void *cgs_device); typedef int (*cgs_is_virtualization_enabled_t)(void *cgs_device);
typedef int (*cgs_enter_safe_mode)(struct cgs_device *cgs_device, bool en);
struct cgs_ops { struct cgs_ops {
/* memory management calls (similar to KFD interface) */ /* memory management calls (similar to KFD interface) */
cgs_gpu_mem_info_t gpu_mem_info; cgs_gpu_mem_info_t gpu_mem_info;
...@@ -674,6 +676,7 @@ struct cgs_ops { ...@@ -674,6 +676,7 @@ struct cgs_ops {
/* get system info */ /* get system info */
cgs_query_system_info query_system_info; cgs_query_system_info query_system_info;
cgs_is_virtualization_enabled_t is_virtualization_enabled; cgs_is_virtualization_enabled_t is_virtualization_enabled;
cgs_enter_safe_mode enter_safe_mode;
}; };
struct cgs_os_ops; /* To be define in OS-specific CGS header */ struct cgs_os_ops; /* To be define in OS-specific CGS header */
...@@ -779,4 +782,8 @@ struct cgs_device ...@@ -779,4 +782,8 @@ struct cgs_device
#define cgs_is_virtualization_enabled(cgs_device) \ #define cgs_is_virtualization_enabled(cgs_device) \
CGS_CALL(is_virtualization_enabled, cgs_device) CGS_CALL(is_virtualization_enabled, cgs_device)
#define cgs_enter_safe_mode(cgs_device, en) \
CGS_CALL(enter_safe_mode, cgs_device, en)
#endif /* _CGS_COMMON_H */ #endif /* _CGS_COMMON_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment