summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/powerplay/inc
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2015-12-29 08:56:03 +0300
committerAlex Deucher <alexander.deucher@amd.com>2016-01-08 23:39:23 +0300
commita969e163a4ac1b0cfa2dc7ab890aaa9ab092951c (patch)
treee3efd3937e624d2e96cf5e5557fb9bbd376e0867 /drivers/gpu/drm/amd/powerplay/inc
parentc15c8d70207d467bb4312d6ac5536c101246fdc6 (diff)
downloadlinux-a969e163a4ac1b0cfa2dc7ab890aaa9ab092951c.tar.xz
drm/amd/powerplay: add powerplay valid check to avoid null point. (v2)
In case CONFIG_DRM_AMD_POWERPLAY is defined and amdgpu.powerplay=0. some functions in powrplay can also be called by DAL. and the input parameter is *adev. if just check point not NULL was not enough and will lead to NULL point error. V2: AGD: rebase on upstream Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/inc')
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/pp_instance.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/inc/pp_instance.h b/drivers/gpu/drm/amd/powerplay/inc/pp_instance.h
index 7b60b617dff6..4d8ed1f33de4 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/pp_instance.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/pp_instance.h
@@ -27,7 +27,10 @@
#include "hwmgr.h"
#include "eventmgr.h"
+#define PP_VALID 0x1F1F1F1F
+
struct pp_instance {
+ uint32_t pp_valid;
struct pp_smumgr *smu_mgr;
struct pp_hwmgr *hwmgr;
struct pp_eventmgr *eventmgr;