On 26/01/2026 06:40, 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
You're right, the loop should stop when the screen is filled.
I would prefer writing it like this:
while (yoffset >= 0 && kmsg_dump_get_buffer(&iter, false, kmsg_buf,
sizeof(kmsg_buf), &kmsg_len)) {
Can you send a v2 with this changed?
Best regards,
--
Jocelyn
Signed-off-by: luyuantao <[email protected]>
---
drivers/gpu/drm/drm_panic.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index d4b6ea42db0f..4b44011b4be1 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -592,6 +592,9 @@ static void draw_panic_static_kmsg(struct
drm_scanout_buffer *sb)
end = start;
start--;
}
+
+ if (yoffset < 0)
+ break;
}
}