Skip to contentSkip to conversation

drm/panic: Miscellaneous fixes

PATCH In review Geert Uytterhoeven 2 participants 6 messages Jun 26, 2024 – Jun 27, 2024

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

cover drm/panic: Miscellaneous fixes

Hi all,

Here are two more fixes for the DRM panic code.

Thanks for your comments!

Geert Uytterhoeven (2):
drm/panic: Do not select DRM_KMS_HELPER drm/panic: Restrict graphical logo handling to built-in

 drivers/gpu/drm/Kconfig     | 1 -
 drivers/gpu/drm/drm_panic.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw

PATCH 1/2 drm/panic: Do not select DRM_KMS_HELPER

DRM core code cannot call into DRM helper code, as this would lead to circular references in the modular case. Hence drop the selection of DRM_KMS_HELPER. It was unused anyway, as v10 switched from using the DRM format helpers to its own color format conversion, cfr. commit 9544309775c334c9 ("drm/panic: Add support for color format conversion")).

Remove the unneeded include of <drm/drm_format_helper.h>.

Fixes bf9fb17c6672868d ("drm/panic: Add a drm panic handler")
---
 drivers/gpu/drm/Kconfig     | 1 -
 drivers/gpu/drm/drm_panic.c | 1 -
 2 files changed, 2 deletions(-)
drivers/gpu/drm/Kconfig +0 -1
index b903a2c0b5e8f95c..ce9bf2b6e9d332d4 100644
@@ -108,7 +108,6 @@ config DRM_KMS_HELPER
 config DRM_PANIC
 	bool "Display a user-friendly message when a kernel panic occurs"
 	depends on DRM && !(FRAMEBUFFER_CONSOLE && VT_CONSOLE)
-	select DRM_KMS_HELPER
 	select FONT_SUPPORT
 	help
 	  Enable a drm panic handler, which will display a user-friendly message
drivers/gpu/drm/drm_panic.c +0 -1
index 8d2eded1fd19ff6c..67f78b5a76b61e3d 100644
@@ -20,7 +20,6 @@
 #include <linux/types.h>
 
 #include <drm/drm_drv.h>
-#include <drm/drm_format_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_modeset_helper_vtables.h>
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER

Quoted 6 lines · Geert Uytterhoeven

DRM core code cannot call into DRM helper code, as this would lead to circular references in the modular case. Hence drop the selection of DRM_KMS_HELPER. It was unused anyway, as v10 switched from using the DRM format helpers to its own color format conversion, cfr. commit 9544309775c334c9 ("drm/panic: Add support for color format conversion")).

Thanks a lot for this cleanup,

Quoted 34 lines

Remove the unneeded include of <drm/drm_format_helper.h>.

Fixes bf9fb17c6672868d ("drm/panic: Add a drm panic handler")
---
  drivers/gpu/drm/Kconfig     | 1 -
  drivers/gpu/drm/drm_panic.c | 1 -
  2 files changed, 2 deletions(-)
drivers/gpu/drm/Kconfig +0 -1
index b903a2c0b5e8f95c..ce9bf2b6e9d332d4 100644
@@ -108,7 +108,6 @@ config DRM_KMS_HELPER
  config DRM_PANIC
  	bool "Display a user-friendly message when a kernel panic occurs"
  	depends on DRM && !(FRAMEBUFFER_CONSOLE && VT_CONSOLE)
-	select DRM_KMS_HELPER
  	select FONT_SUPPORT
  	help
  	  Enable a drm panic handler, which will display a user-friendly message
drivers/gpu/drm/drm_panic.c +0 -1
index 8d2eded1fd19ff6c..67f78b5a76b61e3d 100644
@@ -20,7 +20,6 @@
  #include <linux/types.h>
 
  #include <drm/drm_drv.h>
-#include <drm/drm_format_helper.h>
  #include <drm/drm_fourcc.h>
  #include <drm/drm_framebuffer.h>
  #include <drm/drm_modeset_helper_vtables.h>
#3 lore raw

PATCH 2/2 drm/panic: Restrict graphical logo handling to built-in

In reply to Geert Uytterhoeven

When CONFIG_DRM_PANIC=y, but CONFIG_DRM=m:

ld: drivers/gpu/drm/drm_panic.o: in function `drm_panic_setup_logo':
drivers/gpu/drm/drm_panic.c:99: multiple definition of `init_module'; drivers/gpu/drm/drm_drv.o:drivers/gpu/drm/drm_drv.c:1079: first defined here

Fix this by restricting the graphical logo handling and its device_initcall() to the built-in case. Logos are freed during late kernel initialization, so they are no longer available at module load time anyway.

Fixes 294bbd1f2697ff28 ("drm/panic: Add support for drawing a monochrome graphical logo")
---
 drivers/gpu/drm/drm_panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic.c +1 -1
index 67f78b5a76b61e3d..948aed00595eb6dd 100644
@@ -91,7 +91,7 @@ static const struct drm_panic_line logo_ascii[] = {
 	PANIC_LINE(" \\___)=(___/"),
 };
 
-#ifdef CONFIG_LOGO
+#if defined(CONFIG_LOGO) && !defined(MODULE)
 static const struct linux_logo *logo_mono;
 
 static int drm_panic_setup_logo(void)
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] drm/panic: Restrict graphical logo handling to built-in

Quoted 9 lines · Geert Uytterhoeven

When CONFIG_DRM_PANIC=y, but CONFIG_DRM=m:

ld: drivers/gpu/drm/drm_panic.o: in function `drm_panic_setup_logo':
drivers/gpu/drm/drm_panic.c:99: multiple definition of `init_module'; drivers/gpu/drm/drm_drv.o:drivers/gpu/drm/drm_drv.c:1079: first defined here

Fix this by restricting the graphical logo handling and its device_initcall() to the built-in case. Logos are freed during late kernel initialization, so they are no longer available at module load time anyway.

Thanks a lot for this fix.

Quoted 22 lines
Fixes 294bbd1f2697ff28 ("drm/panic: Add support for drawing a monochrome graphical logo")
---
  drivers/gpu/drm/drm_panic.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic.c +1 -1
index 67f78b5a76b61e3d..948aed00595eb6dd 100644
@@ -91,7 +91,7 @@ static const struct drm_panic_line logo_ascii[] = {
  	PANIC_LINE(" \\___)=(___/"),
  };
 
-#ifdef CONFIG_LOGO
+#if defined(CONFIG_LOGO) && !defined(MODULE)
  static const struct linux_logo *logo_mono;
 
  static int drm_panic_setup_logo(void)
maintainer
#5 lore raw
In reply to Geert Uytterhoeven
Quoted 5 lines · Geert Uytterhoeven

Hi all,

Here are two more fixes for the DRM panic code.

Thanks for your comments!

Thanks for your fixes, they are now in drm-misc-next.

Best regards,

Signature · 1 line
Jocelyn
Quoted 9 lines

Geert Uytterhoeven (2):
drm/panic: Do not select DRM_KMS_HELPER drm/panic: Restrict graphical logo handling to built-in

  drivers/gpu/drm/Kconfig     | 1 -
  drivers/gpu/drm/drm_panic.c | 3 +--
  2 files changed, 1 insertion(+), 3 deletions(-)