mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 14:02:06 -04:00
drm/amdgpu: Add PSP interface for NPS switch
Implement PSP ring command interface for memory partitioning on the fly on the supported asics. Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com> Reviewed-by: Feifei Xu <Feifei.Xu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
82e2ccaa46
commit
212cc24119
@@ -1045,6 +1045,31 @@ static int psp_rl_load(struct amdgpu_device *adev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int psp_memory_partition(struct psp_context *psp, int mode)
|
||||
{
|
||||
struct psp_gfx_cmd_resp *cmd;
|
||||
int ret;
|
||||
|
||||
if (amdgpu_sriov_vf(psp->adev))
|
||||
return 0;
|
||||
|
||||
cmd = acquire_psp_cmd_buf(psp);
|
||||
|
||||
cmd->cmd_id = GFX_CMD_ID_FB_NPS_MODE;
|
||||
cmd->cmd.cmd_memory_part.mode = mode;
|
||||
|
||||
dev_info(psp->adev->dev,
|
||||
"Requesting %d memory partition change through PSP", mode);
|
||||
ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr);
|
||||
if (ret)
|
||||
dev_err(psp->adev->dev,
|
||||
"PSP request failed to change to NPS%d mode\n", mode);
|
||||
|
||||
release_psp_cmd_buf(psp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int psp_spatial_partition(struct psp_context *psp, int mode)
|
||||
{
|
||||
struct psp_gfx_cmd_resp *cmd;
|
||||
|
||||
Reference in New Issue
Block a user