Skip to content

Commit

Permalink
drm/imx: Add drm_panic support
Browse files Browse the repository at this point in the history
Add support for the drm_panic module, which displays a user-friendly
message to the screen when a kernel panic occurs.

v7:
 * use drm_panic_gem_get_scanout_buffer() helper

v8:
 * Replace get_scanout_buffer() logic with drm_panic_set_buffer()

v9:
 * Revert to using get_scanout_buffer() (Sima)
 * move get_scanout_buffer() to plane helper functions

v12:
 * Rename drm_panic_gem_get_scanout_buffer to drm_fb_dma_get_scanout_buffer
 (Thomas Zimmermann)

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240409163432.352518-9-jfalempe@redhat.com
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Jocelyn Falempe committed Apr 15, 2024
1 parent 7e64f7c commit 99b6251
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,13 @@ static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = {
.atomic_update = ipu_plane_atomic_update,
};

static const struct drm_plane_helper_funcs ipu_primary_plane_helper_funcs = {
.atomic_check = ipu_plane_atomic_check,
.atomic_disable = ipu_plane_atomic_disable,
.atomic_update = ipu_plane_atomic_update,
.get_scanout_buffer = drm_fb_dma_get_scanout_buffer,
};

bool ipu_plane_atomic_update_pending(struct drm_plane *plane)
{
struct ipu_plane *ipu_plane = to_ipu_plane(plane);
Expand Down Expand Up @@ -916,7 +923,10 @@ struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
ipu_plane->dma = dma;
ipu_plane->dp_flow = dp;

drm_plane_helper_add(&ipu_plane->base, &ipu_plane_helper_funcs);
if (type == DRM_PLANE_TYPE_PRIMARY)
drm_plane_helper_add(&ipu_plane->base, &ipu_primary_plane_helper_funcs);
else
drm_plane_helper_add(&ipu_plane->base, &ipu_plane_helper_funcs);

if (dp == IPU_DP_FLOW_SYNC_BG || dp == IPU_DP_FLOW_SYNC_FG)
ret = drm_plane_create_zpos_property(&ipu_plane->base, zpos, 0,
Expand Down

0 comments on commit 99b6251

Please sign in to comment.