Skip to contentSkip to conversation

drm/msm/a6xx: Don't enable GPU state code if dependencies are missing

PATCH New Jordan Crouse 1 participant 1 message Apr 10, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Fixes 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state")

---

 drivers/gpu/drm/msm/Kconfig           | 5 +++++
 drivers/gpu/drm/msm/Makefile          | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 +++-
 drivers/gpu/drm/msm/msm_debugfs.c     | 2 +-
 4 files changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/Kconfig +5 -0
index cf549f1..cf14b2b 100644
@@ -20,6 +20,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
drivers/gpu/drm/msm/Makefile +2 -1
index 56a70c7..72d1bfc 100644
@@ -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
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +3 -1
index fefe773..ddbaba1 100644
@@ -781,14 +781,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,
 };
drivers/gpu/drm/msm/msm_debugfs.c +1 -1
index fb423d3..bcfb7a4 100644
@@ -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);
Signature · 6 lines
2.7.4

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno