[PATCH] drm/amdgpu/display: check if ppfuncs exists before using it

Zhu, Rex Rex.Zhu at amd.com
Wed May 30 16:32:55 UTC 2018


Reviewed-by: Rex Zhu<rezhu at amd.com>


Best Regards

Rex


________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Alex Deucher <alexdeucher at gmail.com>
Sent: Wednesday, May 30, 2018 10:37 PM
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander
Subject: [PATCH] drm/amdgpu/display: check if ppfuncs exists before using it

Fixes a crash on asics without powerplay yet (e.g., vega20).

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
index d5e6b45fd6e6..5a3346124a01 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
@@ -343,7 +343,7 @@ bool dm_pp_get_clock_levels_by_type_with_latency(
         struct pp_clock_levels_with_latency pp_clks = { 0 };
         const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;

-       if (!pp_funcs->get_clock_by_type_with_latency)
+       if (!pp_funcs || !pp_funcs->get_clock_by_type_with_latency)
                 return false;

         if (pp_funcs->get_clock_by_type_with_latency(pp_handle,
--
2.13.6

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of Conduct.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180530/a9e83302/attachment-0001.html>


More information about the amd-gfx mailing list