All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jocelyn Falempe <jfalempe@redhat.com>
Cc: bluescreen_avenger@verizon.net, tzimmermann@suse.de,
	javierm@redhat.com, mripard@kernel.org, gpiccoli@igalia.com,
	noralf@tronnes.org, dri-devel@lists.freedesktop.org,
	airlied@redhat.com
Subject: Re: [PATCH v7 6/9] drm/simpledrm: Add drm_panic support
Date: Fri, 12 Jan 2024 14:44:57 +0100	[thread overview]
Message-ID: <ZaFCWUwxpxv5B0AM@phenom.ffwll.local> (raw)
In-Reply-To: <20240104160301.185915-7-jfalempe@redhat.com>

On Thu, Jan 04, 2024 at 05:00:50PM +0100, Jocelyn Falempe wrote:
> 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 | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
> index 7ce1c4617675..6dd2afee84d4 100644
> --- a/drivers/gpu/drm/tiny/simpledrm.c
> +++ b/drivers/gpu/drm/tiny/simpledrm.c
> @@ -25,6 +25,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_probe_helper.h>
>  
>  #define DRIVER_NAME	"simpledrm"
> @@ -985,6 +986,19 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
>  	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);

So I guess simpledrm is the reason why the get_scanout_buffer hook is at
the device level and not at the plane level. Even from the few drivers you
have in your series it seems very much the exception, so I'm not sure
whether that's the best design.

I guess we'll know when we see the plane iterator code with the right
locking, whether it's ok to have that in driver hooks or it's better to
pull it out into shared code.
-Sima

> +
> +	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
>   */
> @@ -1000,6 +1014,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,
>  };
>  
>  /*
> -- 
> 2.43.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2024-01-12 13:45 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 16:00 [RFC][PATCH v7 0/9] drm/panic: Add a drm panic handler Jocelyn Falempe
2024-01-04 16:00 ` [PATCH v7 1/9] drm/format-helper: Add drm_fb_blit_from_r1 and drm_fb_fill Jocelyn Falempe
2024-01-17 15:06   ` Thomas Zimmermann
2024-01-17 16:40     ` Jocelyn Falempe
2024-01-19 10:58       ` Thomas Zimmermann
2024-01-19 12:25         ` Pekka Paalanen
2024-01-19 13:31           ` Thomas Zimmermann
2024-01-23 12:56         ` Thomas Zimmermann
2024-01-23 14:56           ` Jocelyn Falempe
2024-01-30 11:20             ` Thomas Zimmermann
2024-01-17 15:26   ` Jani Nikula
2024-01-17 16:43     ` Jocelyn Falempe
2024-01-04 16:00 ` [PATCH v7 2/9] drm/panic: Add a drm panic handler Jocelyn Falempe
2024-01-12 13:31   ` Daniel Vetter
2024-01-16 10:54     ` Jocelyn Falempe
2024-01-18 13:36       ` Daniel Vetter
2024-01-12 13:50   ` Daniel Vetter
2024-01-19 17:20     ` Jocelyn Falempe
2024-01-17 15:49   ` Thomas Zimmermann
2024-01-18 10:17     ` Jocelyn Falempe
2024-01-19  9:46       ` Thomas Zimmermann
2024-01-04 16:00 ` [PATCH v7 3/9] drm/plane: Add drm_for_each_primary_visible_plane macro Jocelyn Falempe
2024-01-08 10:24   ` Jocelyn Falempe
2024-01-08 10:30     ` Joe Perches
2024-01-04 16:00 ` [PATCH v7 4/9] drm/panic: Add drm_panic_is_format_supported() Jocelyn Falempe
2024-01-05  5:45   ` kernel test robot
2024-01-05  5:45     ` kernel test robot
2024-01-04 16:00 ` [PATCH v7 5/9] drm/fb_dma: Add generic get_scanout_buffer() for drm_panic Jocelyn Falempe
2024-01-06  2:54   ` kernel test robot
2024-01-06  2:54     ` kernel test robot
2024-01-08 10:20   ` Maxime Ripard
2024-01-12 12:29     ` Jocelyn Falempe
2024-01-12 13:41   ` Daniel Vetter
2024-01-12 13:56     ` Maxime Ripard
2024-01-18 13:38       ` Daniel Vetter
2024-01-26 12:39         ` Maxime Ripard
2024-01-17 14:28     ` Jocelyn Falempe
2024-01-18 13:51       ` Daniel Vetter
2024-01-04 16:00 ` [PATCH v7 6/9] drm/simpledrm: Add drm_panic support Jocelyn Falempe
2024-01-12 13:44   ` Daniel Vetter [this message]
2024-01-12 13:58     ` Maxime Ripard
2024-01-17 15:22       ` Thomas Zimmermann
2024-01-18 10:33         ` Maxime Ripard
2024-01-17 15:17   ` Thomas Zimmermann
2024-01-04 16:00 ` [PATCH v7 7/9] drm/mgag200: " Jocelyn Falempe
2024-01-17 15:15   ` Thomas Zimmermann
2024-01-04 16:00 ` [PATCH v7 8/9] drm/ast: " Jocelyn Falempe
2024-01-17 15:16   ` Thomas Zimmermann
2024-01-04 16:00 ` [PATCH v7 9/9] drm/imx: " Jocelyn Falempe
2024-01-12 14:00 ` [RFC][PATCH v7 0/9] drm/panic: Add a drm panic handler Daniel Vetter
2024-01-12 14:36   ` Jocelyn Falempe

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=ZaFCWUwxpxv5B0AM@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@redhat.com \
    --cc=bluescreen_avenger@verizon.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gpiccoli@igalia.com \
    --cc=javierm@redhat.com \
    --cc=jfalempe@redhat.com \
    --cc=mripard@kernel.org \
    --cc=noralf@tronnes.org \
    --cc=tzimmermann@suse.de \
    /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.