]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/msm/a6xx: Don't enable GPU state code if dependencies are missing
authorJordan Crouse <jcrouse@codeaurora.org>
Wed, 10 Apr 2019 16:58:16 +0000 (10:58 -0600)
committerRob Clark <robdclark@chromium.org>
Sun, 21 Apr 2019 14:52:36 +0000 (07:52 -0700)
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: 240fc49ac950 ("drm/msm/a6xx: Add a6xx gpu state")
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/Kconfig
drivers/gpu/drm/msm/Makefile
drivers/gpu/drm/msm/adreno/a6xx_gpu.c
drivers/gpu/drm/msm/msm_debugfs.c

index 78c9e5a5e79336cd004b9cd4524a7fdc764c9b5d..9f2029eca39fee38ca4b7f37f0251cb781de1a21 100644 (file)
@@ -21,6 +21,11 @@ config DRM_MSM
        help
          DRM/KMS driver for MSM/snapdragon.
 
+config DRM_MSM_GPU_STATE
+       bool
+       depends on DRM_MSM && (DEBUG_FS || DEV_COREDUMP)
+       default y
+
 config DRM_MSM_REGISTER_LOGGING
        bool "MSM DRM register logging"
        depends on DRM_MSM
index 56a70c74af4ed2e275da7255ed66907519bd5e6a..72d1bfcaab7ac1e4536af0eeac19ba376d087714 100644 (file)
@@ -15,7 +15,6 @@ msm-y := \
        adreno/a6xx_gpu.o \
        adreno/a6xx_gmu.o \
        adreno/a6xx_hfi.o \
-       adreno/a6xx_gpu_state.o \
        hdmi/hdmi.o \
        hdmi/hdmi_audio.o \
        hdmi/hdmi_bridge.o \
@@ -96,6 +95,8 @@ msm-y := \
 
 msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o
 
+msm-$(CONFIG_DRM_MSM_GPU_STATE)        += adreno/a6xx_gpu_state.o
+
 msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
 msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
 msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
index 7028bb784427e2a2326acf27b125607a3f9d28a4..ec24508b9d680c4f7428a3f4cc5e33b190d881fd 100644 (file)
@@ -807,14 +807,16 @@ static const struct adreno_gpu_funcs funcs = {
                .active_ring = a6xx_active_ring,
                .irq = a6xx_irq,
                .destroy = a6xx_destroy,
-#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
+#if defined(CONFIG_DRM_MSM_GPU_STATE)
                .show = a6xx_show,
 #endif
                .gpu_busy = a6xx_gpu_busy,
                .gpu_get_freq = a6xx_gmu_get_freq,
                .gpu_set_freq = a6xx_gmu_set_freq,
+#if defined(CONFIG_DRM_MSM_GPU_STATE)
                .gpu_state_get = a6xx_gpu_state_get,
                .gpu_state_put = a6xx_gpu_state_put,
+#endif
        },
        .get_timestamp = a6xx_get_timestamp,
 };
index fb423d309e91b9c0bd356b4c91740ba101adfc01..67ef300559cf584d32ffe7fb8d345629519b8a63 100644 (file)
@@ -75,7 +75,7 @@ static int msm_gpu_open(struct inode *inode, struct file *file)
        struct msm_gpu_show_priv *show_priv;
        int ret;
 
-       if (!gpu)
+       if (!gpu || !gpu->funcs->gpu_state_get)
                return -ENODEV;
 
        show_priv = kmalloc(sizeof(*show_priv), GFP_KERNEL);