Skip to contentSkip to conversation

drm/msm/a6xx: Fix build with !CONFIG_DEBUG_FS

PATCH In review Yue Haibing 3 participants 5 messages Apr 3, 2019 – Apr 10, 2019

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

PATCH 1/1 drm/msm/a6xx: Fix build with !CONFIG_DEBUG_FS

From: YueHaibing <[email protected]>

When building CONFIG_DEBUG_FS is not set
gcc warn this:

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c: In function a6xx_show:
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:1124:2: error: implicit declaration of function adreno_show; did you mean adreno_dump? [-Werror=implicit-function-declaration]
adreno_show(gpu, state, p);
^~~~~~~~~~~

Fixes 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state")
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +2 -0
index e686331..d327eb5 100644
@@ -1121,7 +1121,9 @@ void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
 	if (IS_ERR_OR_NULL(state))
 		return;
 
+#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
 	adreno_show(gpu, state, p);
+#endif
 
 	drm_puts(p, "registers:\n");
 	for (i = 0; i < a6xx_state->nr_registers; i++) {
Signature · 1 line
2.7.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Yue Haibing

From: YueHaibing <[email protected]>

When building CONFIG_DEBUG_FS is not set
gcc warn this:

Quoted 8 lines

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c: In function a6xx_show:
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:1124:2: error: implicit declaration of function adreno_show; did you mean adreno_dump? [-Werror=implicit-function-declaration]

   adreno_show(gpu, state, p);
   ^~~~~~~~~~~
Fixes 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state")

Cheers,
-Mukesh

Quoted 18 lines
---
  drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +2 -0
index e686331..d327eb5 100644
@@ -1121,7 +1121,9 @@ void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
  	if (IS_ERR_OR_NULL(state))
  		return;
 
+#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
  	adreno_show(gpu, state, p);
+#endif
 
  	drm_puts(p, "registers:\n");
  	for (i = 0; i < a6xx_state->nr_registers; i++) {
#2 lore raw
In reply to Yue Haibing
Quoted 22 lines · Yue Haibing

From: YueHaibing <[email protected]>

When building CONFIG_DEBUG_FS is not set
gcc warn this:

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c: In function a6xx_show:
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:1124:2: error: implicit declaration of function adreno_show; did you mean adreno_dump? [-Werror=implicit-function-declaration]
adreno_show(gpu, state, p);
^~~~~~~~~~~

Fixes 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state")
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +0 -0
index e686331..d327eb5 100644

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state, · line 1126

Quoted 6 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +2 -0
@@ -1121,7 +1121,9 @@ void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
 	if (IS_ERR_OR_NULL(state))
 		return;
 
+#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
 	adreno_show(gpu, state, p);
+#endif

I agree that this is a problem, but I think I would prefer if we just made a stub function for adreno_show instead of doing a inline ifdef, so in adreno_gpu.c:

#ifdef defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
...
#else
void adreno_show(struct msm_gpu *gpu, msm_gpu_state *state,
struct drm_printer *p)
{
}
#endif

If you want, I can do a quick patch.

Jordan

Signature · 6 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
author
#3 lore raw
Quoted 43 lines · Jordan Crouse
Quoted 22 lines · Yue Haibing

From: YueHaibing <[email protected]>

When building CONFIG_DEBUG_FS is not set
gcc warn this:

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c: In function a6xx_show:
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:1124:2: error: implicit declaration of function adreno_show; did you mean adreno_dump? [-Werror=implicit-function-declaration]
adreno_show(gpu, state, p);
^~~~~~~~~~~

Fixes 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state")
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +0 -0
index e686331..d327eb5 100644

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state, · line 1126

Quoted 6 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +2 -0
@@ -1121,7 +1121,9 @@ void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
 	if (IS_ERR_OR_NULL(state))
 		return;
 
+#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
 	adreno_show(gpu, state, p);
+#endif

I agree that this is a problem, but I think I would prefer if we just made a stub function for adreno_show instead of doing a inline ifdef, so in adreno_gpu.c:

#ifdef defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
...
#else
void adreno_show(struct msm_gpu *gpu, msm_gpu_state *state,
struct drm_printer *p)
{
}
#endif

Quoted 1 line

If you want, I can do a quick patch.

Sure, it's ok for me.

Quoted 3 lines

Jordan

#4 lore raw
Quoted 44 lines · YueHaibing
Quoted 43 lines · Jordan Crouse
Quoted 22 lines · Yue Haibing

From: YueHaibing <[email protected]>

When building CONFIG_DEBUG_FS is not set
gcc warn this:

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c: In function a6xx_show:
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:1124:2: error: implicit declaration of function adreno_show; did you mean adreno_dump? [-Werror=implicit-function-declaration]
adreno_show(gpu, state, p);
^~~~~~~~~~~

Fixes 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state")
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +0 -0
index e686331..d327eb5 100644

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state, · line 1126

Quoted 6 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +2 -0
@@ -1121,7 +1121,9 @@ void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
 	if (IS_ERR_OR_NULL(state))
 		return;
 
+#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
 	adreno_show(gpu, state, p);
+#endif

I agree that this is a problem, but I think I would prefer if we just made a stub function for adreno_show instead of doing a inline ifdef, so in adreno_gpu.c:

#ifdef defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
...
#else
void adreno_show(struct msm_gpu *gpu, msm_gpu_state *state,
struct drm_printer *p)
{
}
#endif

Quoted 3 lines
Quoted 1 line

If you want, I can do a quick patch.

Sure, it's ok for me.

Sorry for the delay. I went back and looked at this and discovered that the problem was a bit more extensive - none of a6xx_gpu_state.c is useful without the dependencies, so I made a bit more extensive patch to handle the root of that:

https://patchwork.freedesktop.org/series/59297/

Jordan

Signature · 6 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno