All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jocelyn Falempe <jfalempe@redhat.com>,
	dri-devel@lists.freedesktop.org, airlied@redhat.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	daniel@ffwll.ch, javierm@redhat.com,
	bluescreen_avenger@verizon.net
Cc: gpiccoli@igalia.com
Subject: Re: [PATCH v3 3/3] drm/simpledrm: Add drm_panic support
Date: Thu, 28 Sep 2023 11:33:14 +0200	[thread overview]
Message-ID: <330a87cf-45d3-4a2f-ae51-1fecb359b3c0@suse.de> (raw)
In-Reply-To: <20230927172849.193996-4-jfalempe@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2410 bytes --]

Hi

Am 27.09.23 um 19:22 schrieb Jocelyn Falempe:
> Add support for the drm_panic module, which displays a user-friendly
> message to the screen when a kernel panic occurs.
> 
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
>   drivers/gpu/drm/tiny/simpledrm.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
> index 25e11ef11c4c..f0454b58ead3 100644
> --- a/drivers/gpu/drm/tiny/simpledrm.c
> +++ b/drivers/gpu/drm/tiny/simpledrm.c
> @@ -23,6 +23,7 @@
>   #include <drm/drm_gem_shmem_helper.h>
>   #include <drm/drm_managed.h>
>   #include <drm/drm_modeset_helper_vtables.h>
> +#include <drm/drm_panic.h>
>   #include <drm/drm_plane_helper.h>
>   #include <drm/drm_probe_helper.h>
>   
> @@ -838,10 +839,24 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
>   		return ERR_PTR(ret);
>   
>   	drm_mode_config_reset(dev);
> +	drm_panic_register(dev);

These calls should be part of drm_device_register(). Everything should 
work transparently to the driver until DRM panic actually calls the 
get_scanout_buffer callback.

Best regards
Thomas

>   
>   	return sdev;
>   }
>   
> +static int simpledrm_get_scanout_buffer(struct drm_device *dev,
> +					struct drm_scanout_buffer *sb)
> +{
> +	struct simpledrm_device *sdev = simpledrm_device_of_dev(dev);
> +
> +	sb->width = sdev->mode.hdisplay;
> +	sb->height = sdev->mode.vdisplay;
> +	sb->pitch = sdev->pitch;
> +	sb->format = sdev->format;
> +	sb->map = sdev->screen_base;
> +	return 0;
> +}
> +
>   /*
>    * DRM driver
>    */
> @@ -857,6 +872,7 @@ static struct drm_driver simpledrm_driver = {
>   	.minor			= DRIVER_MINOR,
>   	.driver_features	= DRIVER_ATOMIC | DRIVER_GEM | DRIVER_MODESET,
>   	.fops			= &simpledrm_fops,
> +	.get_scanout_buffer	= simpledrm_get_scanout_buffer,
>   };
>   
>   /*
> @@ -894,6 +910,7 @@ static int simpledrm_remove(struct platform_device *pdev)
>   	struct drm_device *dev = &sdev->dev;
>   
>   	drm_dev_unplug(dev);
> +	drm_panic_unregister(dev);
>   
>   	return 0;
>   }

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

      reply	other threads:[~2023-09-28  9:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27 17:22 [RFC][PATCH v3 0/3] drm/panic: Add a drm panic handler Jocelyn Falempe
2023-09-27 17:22 ` [PATCH v3 1/3] drm/format-helper: Export drm_fb_xrgb8888_to_rgb565_line Jocelyn Falempe
2023-09-28  8:45   ` Thomas Zimmermann
2023-09-27 17:22 ` [PATCH v3 2/3] drm/panic: Add a drm panic handler Jocelyn Falempe
2023-09-28  9:30   ` Thomas Zimmermann
2023-09-28 15:41     ` Jocelyn Falempe
2023-09-29  9:58   ` kernel test robot
2023-09-29  9:58     ` kernel test robot
2023-09-27 17:22 ` [PATCH v3 3/3] drm/simpledrm: Add drm_panic support Jocelyn Falempe
2023-09-28  9:33   ` Thomas Zimmermann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=330a87cf-45d3-4a2f-ae51-1fecb359b3c0@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@redhat.com \
    --cc=bluescreen_avenger@verizon.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gpiccoli@igalia.com \
    --cc=javierm@redhat.com \
    --cc=jfalempe@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.