mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/tidss: Add drm_panic support
@ 2024-06-15  8:53 Javier Martinez Canillas
  2024-06-17 11:38 ` Jocelyn Falempe
  2024-06-17 12:36 ` Aradhya Bhatia
  0 siblings, 2 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2024-06-15  8:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jocelyn Falempe, Geert Uytterhoeven, Javier Martinez Canillas,
	Daniel Vetter, David Airlie, Jyri Sarha, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Tomi Valkeinen, dri-devel

Add support for the drm_panic module, which displays a pretty user
friendly message on the screen when a Linux kernel panic occurs.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
Tested on an AM625 BeaglePlay board by triggering a panic using the
`echo c > /proc/sysrq-trigger` command.

 drivers/gpu/drm/tidss/tidss_plane.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
index 68fed531f6a7..a5d86822c9e3 100644
--- a/drivers/gpu/drm/tidss/tidss_plane.c
+++ b/drivers/gpu/drm/tidss/tidss_plane.c
@@ -8,6 +8,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -166,6 +167,14 @@ static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
 	.atomic_disable = tidss_plane_atomic_disable,
 };
 
+static const struct drm_plane_helper_funcs tidss_primary_plane_helper_funcs = {
+	.atomic_check = tidss_plane_atomic_check,
+	.atomic_update = tidss_plane_atomic_update,
+	.atomic_enable = tidss_plane_atomic_enable,
+	.atomic_disable = tidss_plane_atomic_disable,
+	.get_scanout_buffer = drm_fb_dma_get_scanout_buffer,
+};
+
 static const struct drm_plane_funcs tidss_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
@@ -211,7 +220,10 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss,
 	if (ret < 0)
 		goto err;
 
-	drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs);
+	if (type == DRM_PLANE_TYPE_PRIMARY)
+		drm_plane_helper_add(&tplane->plane, &tidss_primary_plane_helper_funcs);
+	else
+		drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs);
 
 	drm_plane_create_zpos_property(&tplane->plane, tidss->num_planes, 0,
 				       num_planes - 1);
-- 
2.45.1


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

* Re: [PATCH] drm/tidss: Add drm_panic support
  2024-06-15  8:53 [PATCH] drm/tidss: Add drm_panic support Javier Martinez Canillas
@ 2024-06-17 11:38 ` Jocelyn Falempe
  2024-06-17 12:36 ` Aradhya Bhatia
  1 sibling, 0 replies; 4+ messages in thread
From: Jocelyn Falempe @ 2024-06-17 11:38 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel
  Cc: Geert Uytterhoeven, Daniel Vetter, David Airlie, Jyri Sarha,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Tomi Valkeinen, dri-devel



On 15/06/2024 10:53, Javier Martinez Canillas wrote:
> Add support for the drm_panic module, which displays a pretty user
> friendly message on the screen when a Linux kernel panic occurs.

Thanks for enabling drm panic on another hardware.
It looks good to me.

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


> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
> Tested on an AM625 BeaglePlay board by triggering a panic using the
> `echo c > /proc/sysrq-trigger` command.
> 
>   drivers/gpu/drm/tidss/tidss_plane.c | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
> index 68fed531f6a7..a5d86822c9e3 100644
> --- a/drivers/gpu/drm/tidss/tidss_plane.c
> +++ b/drivers/gpu/drm/tidss/tidss_plane.c
> @@ -8,6 +8,7 @@
>   #include <drm/drm_atomic_helper.h>
>   #include <drm/drm_blend.h>
>   #include <drm/drm_crtc.h>
> +#include <drm/drm_fb_dma_helper.h>
>   #include <drm/drm_fourcc.h>
>   #include <drm/drm_framebuffer.h>
>   #include <drm/drm_gem_atomic_helper.h>
> @@ -166,6 +167,14 @@ static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
>   	.atomic_disable = tidss_plane_atomic_disable,
>   };
>   
> +static const struct drm_plane_helper_funcs tidss_primary_plane_helper_funcs = {
> +	.atomic_check = tidss_plane_atomic_check,
> +	.atomic_update = tidss_plane_atomic_update,
> +	.atomic_enable = tidss_plane_atomic_enable,
> +	.atomic_disable = tidss_plane_atomic_disable,
> +	.get_scanout_buffer = drm_fb_dma_get_scanout_buffer,
> +};
> +
>   static const struct drm_plane_funcs tidss_plane_funcs = {
>   	.update_plane = drm_atomic_helper_update_plane,
>   	.disable_plane = drm_atomic_helper_disable_plane,
> @@ -211,7 +220,10 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss,
>   	if (ret < 0)
>   		goto err;
>   
> -	drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs);
> +	if (type == DRM_PLANE_TYPE_PRIMARY)
> +		drm_plane_helper_add(&tplane->plane, &tidss_primary_plane_helper_funcs);
> +	else
> +		drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs);
>   
>   	drm_plane_create_zpos_property(&tplane->plane, tidss->num_planes, 0,
>   				       num_planes - 1);


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

* Re: [PATCH] drm/tidss: Add drm_panic support
  2024-06-15  8:53 [PATCH] drm/tidss: Add drm_panic support Javier Martinez Canillas
  2024-06-17 11:38 ` Jocelyn Falempe
@ 2024-06-17 12:36 ` Aradhya Bhatia
  2024-06-18  8:10   ` Javier Martinez Canillas
  1 sibling, 1 reply; 4+ messages in thread
From: Aradhya Bhatia @ 2024-06-17 12:36 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel
  Cc: Jocelyn Falempe, Geert Uytterhoeven, Daniel Vetter, David Airlie,
	Jyri Sarha, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Tomi Valkeinen, dri-devel

Hi Javier,

I tested the patch, and it was good to see the panic screen on SK-AM62.
Thanks for adding this feature in tidss. =)

On 15/06/24 14:23, Javier Martinez Canillas wrote:
> Add support for the drm_panic module, which displays a pretty user
> friendly message on the screen when a Linux kernel panic occurs.
> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>

> ---
> Tested on an AM625 BeaglePlay board by triggering a panic using the
> `echo c > /proc/sysrq-trigger` command.
> 
>  drivers/gpu/drm/tidss/tidss_plane.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 

[...]

--
Regards
Aradhya

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

* Re: [PATCH] drm/tidss: Add drm_panic support
  2024-06-17 12:36 ` Aradhya Bhatia
@ 2024-06-18  8:10   ` Javier Martinez Canillas
  0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2024-06-18  8:10 UTC (permalink / raw)
  To: Aradhya Bhatia, linux-kernel
  Cc: Jocelyn Falempe, Geert Uytterhoeven, Daniel Vetter, David Airlie,
	Jyri Sarha, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Tomi Valkeinen, dri-devel

Aradhya Bhatia <a-bhatia1@ti.com> writes:

> Hi Javier,
>
> I tested the patch, and it was good to see the panic screen on SK-AM62.
> Thanks for adding this feature in tidss. =)
>
> On 15/06/24 14:23, Javier Martinez Canillas wrote:
>> Add support for the drm_panic module, which displays a pretty user
>> friendly message on the screen when a Linux kernel panic occurs.
>> 
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>
> Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
>

Thanks Jocelyn and Aradhya for the review and test! I've pushed this
patch to drm-misc (drm-misc-next).

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


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

end of thread, other threads:[~2024-06-18  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-15  8:53 [PATCH] drm/tidss: Add drm_panic support Javier Martinez Canillas
2024-06-17 11:38 ` Jocelyn Falempe
2024-06-17 12:36 ` Aradhya Bhatia
2024-06-18  8:10   ` Javier Martinez Canillas

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®