@@ -7,6 +7,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -217,6 +218,7 @@ static int mgag200_g200_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200_crtc_funcs, NULL);
@@ -7,6 +7,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -216,6 +217,7 @@ static int mgag200_g200eh_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200eh_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200eh_crtc_funcs, NULL);
@@ -6,6 +6,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -120,6 +121,7 @@ static int mgag200_g200eh3_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200eh3_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200eh3_crtc_funcs, NULL);
@@ -7,6 +7,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -259,6 +260,7 @@ static int mgag200_g200er_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200er_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200er_crtc_funcs, NULL);
@@ -7,6 +7,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -260,6 +261,7 @@ static int mgag200_g200ev_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200ev_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200ev_crtc_funcs, NULL);
@@ -6,6 +6,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -129,6 +130,7 @@ static int mgag200_g200ew3_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200ew3_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200ew3_crtc_funcs, NULL);
@@ -7,6 +7,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -391,6 +392,7 @@ static int mgag200_g200se_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200se_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200se_crtc_funcs, NULL);
@@ -7,6 +7,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_probe_helper.h>
#include "mgag200_drv.h"
@@ -263,6 +264,7 @@ static int mgag200_g200wb_pipeline_init(struct mga_device *mdev)
}
drm_plane_helper_add(primary_plane, &mgag200_g200wb_primary_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(primary_plane);
+ drm_panic_register(primary_plane);
ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
&mgag200_g200wb_crtc_funcs, NULL);
@@ -21,6 +21,7 @@
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_panic.h>
#include <drm/drm_print.h>
#include "mgag200_drv.h"
@@ -510,6 +511,12 @@ void mgag200_primary_plane_helper_atomic_update(struct drm_plane *plane,
struct drm_atomic_helper_damage_iter iter;
struct drm_rect damage;
+ if (old_plane_state->fb != plane_state->fb) {
+ struct iosys_map map = IOSYS_MAP_INIT_VADDR_IOMEM(mdev->vram);
+
+ drm_panic_set_buffer(plane->panic_scanout, plane->state->fb, &map);
+ }
+
drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state);
drm_atomic_for_each_plane_damage(&iter, &damage) {
mgag200_handle_damage(mdev, shadow_plane_state->data, fb, &damage);
Add support for the drm_panic module, which displays a message to the screen when a kernel panic occurs. v5: * Also check that the plane is visible and primary. (Thomas Zimmermann) v7: * use drm_for_each_primary_visible_plane() v8: * Replace get_scanout_buffer() logic with drm_panic_set_buffer() (Thomas Zimmermann) Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> --- drivers/gpu/drm/mgag200/mgag200_g200.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200eh.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200eh3.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200er.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200ev.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200ew3.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200se.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_g200wb.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_mode.c | 7 +++++++ 9 files changed, 23 insertions(+)