diff options
author | Jordan Crouse <jcrouse@codeaurora.org> | 2019-04-10 12:58:16 -0400 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2019-04-21 10:52:36 -0400 |
commit | b02872df58aca66d0e7af3ec5065dbc6f0630dd1 (patch) | |
tree | 43ee9969171994ebdc9f490aa97fc1e6546e781b | |
parent | b55ee6b243bd2743b9cb20b6aa812091748c4304 (diff) |
drm/msm/a6xx: Don't enable GPU state code if dependencies are missing
Add CONFIG_DRM_MSM_GPU_STATE to conditionally compile Adreno GPU state
code depending on the availability of the dependencies.
Reported-by: Hulk Robot <hulkci@huawei.com>
Reported-by: YueHaibing <yuehaibing@huawei.com>
Fixes: 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state")
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
-rw-r--r-- | drivers/gpu/drm/msm/Kconfig | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/Makefile | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_debugfs.c | 2 |
4 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig index 78c9e5a5e793..9f2029eca39f 100644 --- a/drivers/gpu/drm/msm/Kconfig +++ b/drivers/gpu/drm/msm/Kconfig | |||
@@ -21,6 +21,11 @@ config DRM_MSM | |||
21 | help | 21 | help |
22 | DRM/KMS driver for MSM/snapdragon. | 22 | DRM/KMS driver for MSM/snapdragon. |
23 | 23 | ||
24 | config DRM_MSM_GPU_STATE | ||
25 | bool | ||
26 | depends on DRM_MSM && (DEBUG_FS || DEV_COREDUMP) | ||
27 | default y | ||
28 | |||
24 | config DRM_MSM_REGISTER_LOGGING | 29 | config DRM_MSM_REGISTER_LOGGING |
25 | bool "MSM DRM register logging" | 30 | bool "MSM DRM register logging" |
26 | depends on DRM_MSM | 31 | depends on DRM_MSM |
diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index 56a70c74af4e..72d1bfcaab7a 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile | |||
@@ -15,7 +15,6 @@ msm-y := \ | |||
15 | adreno/a6xx_gpu.o \ | 15 | adreno/a6xx_gpu.o \ |
16 | adreno/a6xx_gmu.o \ | 16 | adreno/a6xx_gmu.o \ |
17 | adreno/a6xx_hfi.o \ | 17 | adreno/a6xx_hfi.o \ |
18 | adreno/a6xx_gpu_state.o \ | ||
19 | hdmi/hdmi.o \ | 18 | hdmi/hdmi.o \ |
20 | hdmi/hdmi_audio.o \ | 19 | hdmi/hdmi_audio.o \ |
21 | hdmi/hdmi_bridge.o \ | 20 | hdmi/hdmi_bridge.o \ |
@@ -96,6 +95,8 @@ msm-y := \ | |||
96 | 95 | ||
97 | msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o | 96 | msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o |
98 | 97 | ||
98 | msm-$(CONFIG_DRM_MSM_GPU_STATE) += adreno/a6xx_gpu_state.o | ||
99 | |||
99 | msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o | 100 | msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o |
100 | msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o | 101 | msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o |
101 | msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o | 102 | msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o |
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 7028bb784427..ec24508b9d68 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c | |||
@@ -807,14 +807,16 @@ static const struct adreno_gpu_funcs funcs = { | |||
807 | .active_ring = a6xx_active_ring, | 807 | .active_ring = a6xx_active_ring, |
808 | .irq = a6xx_irq, | 808 | .irq = a6xx_irq, |
809 | .destroy = a6xx_destroy, | 809 | .destroy = a6xx_destroy, |
810 | #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) | 810 | #if defined(CONFIG_DRM_MSM_GPU_STATE) |
811 | .show = a6xx_show, | 811 | .show = a6xx_show, |
812 | #endif | 812 | #endif |
813 | .gpu_busy = a6xx_gpu_busy, | 813 | .gpu_busy = a6xx_gpu_busy, |
814 | .gpu_get_freq = a6xx_gmu_get_freq, | 814 | .gpu_get_freq = a6xx_gmu_get_freq, |
815 | .gpu_set_freq = a6xx_gmu_set_freq, | 815 | .gpu_set_freq = a6xx_gmu_set_freq, |
816 | #if defined(CONFIG_DRM_MSM_GPU_STATE) | ||
816 | .gpu_state_get = a6xx_gpu_state_get, | 817 | .gpu_state_get = a6xx_gpu_state_get, |
817 | .gpu_state_put = a6xx_gpu_state_put, | 818 | .gpu_state_put = a6xx_gpu_state_put, |
819 | #endif | ||
818 | }, | 820 | }, |
819 | .get_timestamp = a6xx_get_timestamp, | 821 | .get_timestamp = a6xx_get_timestamp, |
820 | }; | 822 | }; |
diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index fb423d309e91..67ef300559cf 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c | |||
@@ -75,7 +75,7 @@ static int msm_gpu_open(struct inode *inode, struct file *file) | |||
75 | struct msm_gpu_show_priv *show_priv; | 75 | struct msm_gpu_show_priv *show_priv; |
76 | int ret; | 76 | int ret; |
77 | 77 | ||
78 | if (!gpu) | 78 | if (!gpu || !gpu->funcs->gpu_state_get) |
79 | return -ENODEV; | 79 | return -ENODEV; |
80 | 80 | ||
81 | show_priv = kmalloc(sizeof(*show_priv), GFP_KERNEL); | 81 | show_priv = kmalloc(sizeof(*show_priv), GFP_KERNEL); |