From: Felix Kuehling <[email protected]>

Set the virtual pod configuration to PSP in the commit store callback.

Signed-off-by: Felix Kuehling <[email protected]>
Reviewed-by: Mukul Joshi <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
index 6fd1238a50691..657323427f0ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
@@ -705,6 +705,7 @@ static ssize_t ualink_vpod_config_commit_store(struct 
kobject *kobj,
        struct device *dev = kobj_to_dev(info->kobj.parent);
        struct drm_device *ddev = dev_get_drvdata(dev);
        struct amdgpu_device *adev = drm_to_adev(ddev);
+       int r;
 
        if (!sysfs_streq(buf, "true"))
                return -EINVAL;
@@ -713,10 +714,13 @@ static ssize_t ualink_vpod_config_commit_store(struct 
kobject *kobj,
                return -EINVAL;
        }
 
-       /* TODO: instead of just copying the info, call ASP vpod config API
-        * and query ASP for the updated info
-        */
-       info->vpod = config->vpod;
+       r = psp_ual_set_vpod_config(&adev->psp, adev->ualink.psp_if_ver,
+                                   config);
+       if (r)
+               return r;
+       r = psp_ual_query_info(&adev->psp, adev->ualink.psp_if_ver, info);
+       if (r)
+               return r;
 
        /* The integrity check makes sure each new GPU is consistent with the
         * other GPUs already in the vPod. All known local GPUs can become
-- 
2.55.0

Reply via email to