mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/panic: Miscellaneous fixes
@ 2024-06-26  8:41 Geert Uytterhoeven
  2024-06-26  8:41 ` [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-06-26  8:41 UTC (permalink / raw)
  To: Jocelyn Falempe, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, Geert Uytterhoeven

	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(-)

-- 
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER
  2024-06-26  8:41 [PATCH 0/2] drm/panic: Miscellaneous fixes Geert Uytterhoeven
@ 2024-06-26  8:41 ` Geert Uytterhoeven
  2024-06-26 14:19   ` Jocelyn Falempe
  2024-06-26  8:41 ` [PATCH 2/2] drm/panic: Restrict graphical logo handling to built-in Geert Uytterhoeven
  2024-06-27  9:46 ` [PATCH 0/2] drm/panic: Miscellaneous fixes Jocelyn Falempe
  2 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-06-26  8:41 UTC (permalink / raw)
  To: Jocelyn Falempe, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, 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")).

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

Fixes: bf9fb17c6672868d ("drm/panic: Add a drm panic handler")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/gpu/drm/Kconfig     | 1 -
 drivers/gpu/drm/drm_panic.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index b903a2c0b5e8f95c..ce9bf2b6e9d332d4 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index 8d2eded1fd19ff6c..67f78b5a76b61e3d 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -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>
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] drm/panic: Restrict graphical logo handling to built-in
  2024-06-26  8:41 [PATCH 0/2] drm/panic: Miscellaneous fixes Geert Uytterhoeven
  2024-06-26  8:41 ` [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER Geert Uytterhoeven
@ 2024-06-26  8:41 ` Geert Uytterhoeven
  2024-06-26 14:20   ` Jocelyn Falempe
  2024-06-27  9:46 ` [PATCH 0/2] drm/panic: Miscellaneous fixes Jocelyn Falempe
  2 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-06-26  8:41 UTC (permalink / raw)
  To: Jocelyn Falempe, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, Geert Uytterhoeven, kernel test robot

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")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406261341.GYsbLpN1-lkp@intel.com/
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/gpu/drm/drm_panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index 67f78b5a76b61e3d..948aed00595eb6dd 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -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)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER
  2024-06-26  8:41 ` [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER Geert Uytterhoeven
@ 2024-06-26 14:19   ` Jocelyn Falempe
  0 siblings, 0 replies; 6+ messages in thread
From: Jocelyn Falempe @ 2024-06-26 14:19 UTC (permalink / raw)
  To: Geert Uytterhoeven, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel



On 26/06/2024 10:41, Geert Uytterhoeven wrote:
> 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,

Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>

> 
> Remove the unneeded include of <drm/drm_format_helper.h>.
> 
> Fixes: bf9fb17c6672868d ("drm/panic: Add a drm panic handler")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>   drivers/gpu/drm/Kconfig     | 1 -
>   drivers/gpu/drm/drm_panic.c | 1 -
>   2 files changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index b903a2c0b5e8f95c..ce9bf2b6e9d332d4 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
> index 8d2eded1fd19ff6c..67f78b5a76b61e3d 100644
> --- a/drivers/gpu/drm/drm_panic.c
> +++ b/drivers/gpu/drm/drm_panic.c
> @@ -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>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drm/panic: Restrict graphical logo handling to built-in
  2024-06-26  8:41 ` [PATCH 2/2] drm/panic: Restrict graphical logo handling to built-in Geert Uytterhoeven
@ 2024-06-26 14:20   ` Jocelyn Falempe
  0 siblings, 0 replies; 6+ messages in thread
From: Jocelyn Falempe @ 2024-06-26 14:20 UTC (permalink / raw)
  To: Geert Uytterhoeven, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, kernel test robot



On 26/06/2024 10:41, Geert Uytterhoeven wrote:
> 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.

Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>

> 
> Fixes: 294bbd1f2697ff28 ("drm/panic: Add support for drawing a monochrome graphical logo")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202406261341.GYsbLpN1-lkp@intel.com/
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>   drivers/gpu/drm/drm_panic.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
> index 67f78b5a76b61e3d..948aed00595eb6dd 100644
> --- a/drivers/gpu/drm/drm_panic.c
> +++ b/drivers/gpu/drm/drm_panic.c
> @@ -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)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] drm/panic: Miscellaneous fixes
  2024-06-26  8:41 [PATCH 0/2] drm/panic: Miscellaneous fixes Geert Uytterhoeven
  2024-06-26  8:41 ` [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER Geert Uytterhoeven
  2024-06-26  8:41 ` [PATCH 2/2] drm/panic: Restrict graphical logo handling to built-in Geert Uytterhoeven
@ 2024-06-27  9:46 ` Jocelyn Falempe
  2 siblings, 0 replies; 6+ messages in thread
From: Jocelyn Falempe @ 2024-06-27  9:46 UTC (permalink / raw)
  To: Geert Uytterhoeven, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel


On 26/06/2024 10:41, Geert Uytterhoeven wrote:
> 	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,

-- 

Jocelyn

> 
> 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(-)
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-27  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  8:41 [PATCH 0/2] drm/panic: Miscellaneous fixes Geert Uytterhoeven
2024-06-26  8:41 ` [PATCH 1/2] drm/panic: Do not select DRM_KMS_HELPER Geert Uytterhoeven
2024-06-26 14:19   ` Jocelyn Falempe
2024-06-26  8:41 ` [PATCH 2/2] drm/panic: Restrict graphical logo handling to built-in Geert Uytterhoeven
2024-06-26 14:20   ` Jocelyn Falempe
2024-06-27  9:46 ` [PATCH 0/2] drm/panic: Miscellaneous fixes Jocelyn Falempe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®