mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-01 04:53:09 -04:00
drm/amd/display: add DC drm_panic support
Add support for the drm_panic module, which displays a pretty user friendly message on the screen when a Linux kernel panic occurs. It doesn't work yet on laptop panels, maybe due to PSR. Adapted from Jocelyn's original patch to add DC drm_panic support. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Lu Yao <yaolu@kylinos.cn> Cc: Jocelyn Falempe <jfalempe@redhat.com> Cc: Harry Wentland <harry.wentland@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
1ad5bdc28b
commit
736692c3b7
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_blend.h>
|
||||
#include "drm/drm_framebuffer.h"
|
||||
#include <drm/drm_gem_atomic_helper.h>
|
||||
#include <drm/drm_plane_helper.h>
|
||||
#include <drm/drm_gem_framebuffer_helper.h>
|
||||
@@ -1421,6 +1422,20 @@ static void amdgpu_dm_plane_atomic_async_update(struct drm_plane *plane,
|
||||
amdgpu_dm_plane_handle_cursor_update(plane, old_state);
|
||||
}
|
||||
|
||||
static void amdgpu_dm_plane_panic_flush(struct drm_plane *plane)
|
||||
{
|
||||
struct dm_plane_state *dm_plane_state = to_dm_plane_state(plane->state);
|
||||
struct drm_framebuffer *fb = plane->state->fb;
|
||||
struct dc_plane_state *dc_plane_state;
|
||||
|
||||
if (!dm_plane_state || !dm_plane_state->dc_state)
|
||||
return;
|
||||
|
||||
dc_plane_state = dm_plane_state->dc_state;
|
||||
|
||||
dc_plane_force_update_for_panic(dc_plane_state, fb->modifier ? true : false);
|
||||
}
|
||||
|
||||
static const struct drm_plane_helper_funcs dm_plane_helper_funcs = {
|
||||
.prepare_fb = amdgpu_dm_plane_helper_prepare_fb,
|
||||
.cleanup_fb = amdgpu_dm_plane_helper_cleanup_fb,
|
||||
@@ -1429,6 +1444,16 @@ static const struct drm_plane_helper_funcs dm_plane_helper_funcs = {
|
||||
.atomic_async_update = amdgpu_dm_plane_atomic_async_update
|
||||
};
|
||||
|
||||
static const struct drm_plane_helper_funcs dm_primary_plane_helper_funcs = {
|
||||
.prepare_fb = amdgpu_dm_plane_helper_prepare_fb,
|
||||
.cleanup_fb = amdgpu_dm_plane_helper_cleanup_fb,
|
||||
.atomic_check = amdgpu_dm_plane_atomic_check,
|
||||
.atomic_async_check = amdgpu_dm_plane_atomic_async_check,
|
||||
.atomic_async_update = amdgpu_dm_plane_atomic_async_update,
|
||||
.get_scanout_buffer = amdgpu_display_get_scanout_buffer,
|
||||
.panic_flush = amdgpu_dm_plane_panic_flush,
|
||||
};
|
||||
|
||||
static void amdgpu_dm_plane_drm_plane_reset(struct drm_plane *plane)
|
||||
{
|
||||
struct dm_plane_state *amdgpu_state = NULL;
|
||||
@@ -1855,7 +1880,10 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
|
||||
plane->type != DRM_PLANE_TYPE_CURSOR)
|
||||
drm_plane_enable_fb_damage_clips(plane);
|
||||
|
||||
drm_plane_helper_add(plane, &dm_plane_helper_funcs);
|
||||
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
|
||||
drm_plane_helper_add(plane, &dm_primary_plane_helper_funcs);
|
||||
else
|
||||
drm_plane_helper_add(plane, &dm_plane_helper_funcs);
|
||||
|
||||
#ifdef AMD_PRIVATE_COLOR
|
||||
dm_atomic_plane_attach_color_mgmt_properties(dm, plane);
|
||||
|
||||
Reference in New Issue
Block a user