On 26/01/2026 11:07, luyuantao01 wrote:
From: luyuantao <[email protected]>
When kmsg_buf completes drawing the screen and yoffset is less than 0,
kmsg_dump_get_buffer continues to obtain the buffer. This potential loop may
cause panic_flush not to be executed immediately or even not to be executed
at all, resulting in a garbled screen display instead of normal logs
So, the loop should be exited immediately after drawing kmsg_buf
Thanks, for sending a v2.
I will push it to drm-misc-next in a few days if no other comment.
Reviewed-by: Jocelyn Falempe <[email protected]>
Signed-off-by: luyuantao <[email protected]>
---
drivers/gpu/drm/drm_panic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index d4b6ea42db0f..f7289dbf2ef9 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -574,7 +574,8 @@ static void draw_panic_static_kmsg(struct
drm_scanout_buffer *sb)
drm_panic_fill(sb, &r_screen, bg_color);
kmsg_dump_rewind(&iter);
- while (kmsg_dump_get_buffer(&iter, false, kmsg_buf, sizeof(kmsg_buf),
&kmsg_len)) {
+ while (yoffset >= 0 && kmsg_dump_get_buffer(&iter, false, kmsg_buf,
+ sizeof(kmsg_buf), &kmsg_len)) {
char *start;
char *end;