[PATCH v7 8/9] drm/ast: Add drm_panic support
Thomas Zimmermann
tzimmermann at suse.de
Wed Jan 17 15:16:44 UTC 2024
Hi
Am 04.01.24 um 17:00 schrieb Jocelyn Falempe:
> Add support for the drm_panic module, which displays a message to
> the screen when a kernel panic occurs.
>
> v7
> * Use drm_for_each_primary_visible_plane()
>
> Signed-off-by: Jocelyn Falempe <jfalempe at redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
> drivers/gpu/drm/ast/ast_drv.c | 26 ++++++++++++++++++++++++--
> 1 file changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
> index 90bcb1eb9cd9..8ddce3d7fda9 100644
> --- a/drivers/gpu/drm/ast/ast_drv.c
> +++ b/drivers/gpu/drm/ast/ast_drv.c
> @@ -35,6 +35,7 @@
> #include <drm/drm_fbdev_generic.h>
> #include <drm/drm_gem_shmem_helper.h>
> #include <drm/drm_module.h>
> +#include <drm/drm_panic.h>
> #include <drm/drm_probe_helper.h>
>
> #include "ast_drv.h"
> @@ -48,6 +49,27 @@ module_param_named(modeset, ast_modeset, int, 0400);
> * DRM driver
> */
>
> +static int ast_get_scanout_buffer(struct drm_device *dev,
> + struct drm_scanout_buffer *sb)
> +{
> + struct drm_plane *plane;
> + struct ast_plane *ast_plane;
> +
> + drm_for_each_primary_visible_plane(plane, dev) {
> + ast_plane = to_ast_plane(plane);
> + if (!ast_plane->vaddr)
> + continue;
> +
> + sb->format = plane->state->fb->format;
> + sb->width = plane->state->fb->width;
> + sb->height = plane->state->fb->height;
> + sb->pitch = plane->state->fb->pitches[0];
> + iosys_map_set_vaddr_iomem(&sb->map, ast_plane->vaddr);
> + return 0;
> + }
> + return -ENODEV;
> +}
> +
> DEFINE_DRM_GEM_FOPS(ast_fops);
>
> static const struct drm_driver ast_driver = {
> @@ -62,8 +84,8 @@ static const struct drm_driver ast_driver = {
> .major = DRIVER_MAJOR,
> .minor = DRIVER_MINOR,
> .patchlevel = DRIVER_PATCHLEVEL,
> -
> - DRM_GEM_SHMEM_DRIVER_OPS
> + .get_scanout_buffer = ast_get_scanout_buffer,
> + DRM_GEM_SHMEM_DRIVER_OPS,
> };
>
> /*
--
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20240117/9456e4a9/attachment.sig>
More information about the dri-devel
mailing list