[AMD Official Use Only - Internal Distribution Only]

Good catch. I think we should probably just return 0 at the end to keep the 
semantics of the original code before this was broken out into a separate 
helper function.

Alex

________________________________
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> on behalf of Victor Zhao 
<victor.z...@amd.com>
Sent: Tuesday, April 27, 2021 5:58 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Zhao, Victor <victor.z...@amd.com>
Subject: [PATCH] drm/amdgpu: fix r initial values

Give initial values otherwise sriov will get suspend of
IP block <dce_virtual> failed

Signed-off-by: Victor Zhao <victor.z...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 0f17984fdea4..36fdffd103c0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -1384,7 +1384,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device 
*adev)
         struct drm_crtc *crtc;
         struct drm_connector *connector;
         struct drm_connector_list_iter iter;
-       int r;
+       int r = 0;

         /* turn off display hw */
         drm_modeset_lock_all(dev);
@@ -1431,7 +1431,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device 
*adev)
         struct drm_connector *connector;
         struct drm_connector_list_iter iter;
         struct drm_crtc *crtc;
-       int r;
+       int r = 0;

         /* pin cursors */
         list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
--
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C9611bd0b8cb74a8ac81308d909631004%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637551143345597240%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=okT4wUuJysPl1Fm%2BtdHtw4VgXoLJUhir%2BTa6Uuqpg20%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to