Skip to contentSkip to conversation

drm/panic: Fix panic logo alignment

PATCH In review Dileep Sankhla 2 participants 2 messages Mar 29 – Mar 31

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/panic: Fix panic logo alignment

Display the panic logo at the top center of the screen when drm_panic_type is set to DRM_PANIC_TYPE_USER to keep the layout properly aligned.

---
 drivers/gpu/drm/drm_panic.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_panic.c +2 -0
index d6d3b8d85dea..c7fecc5e857a 100644
@@ -491,6 +491,8 @@ static void draw_panic_screen_user(struct drm_scanout_buffer *sb)
 
 	r_screen = DRM_RECT_INIT(0, 0, sb->width, sb->height);
 	drm_panic_logo_rect(&r_logo, font);
+	/* Center the panic logo */
+	drm_rect_translate(&r_logo, (sb->width - r_logo.x2) / 2, 0);
 
 	msg_width = min(get_max_line_len(panic_msg, panic_msg_lines) * font->width, sb->width);
 	msg_height = min(panic_msg_lines * font->height, sb->height);
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 3 lines · Dileep Sankhla

Display the panic logo at the top center of the screen when drm_panic_type is set to DRM_PANIC_TYPE_USER to keep the layout properly aligned.

Hi,

I think this is more a preference, than a fix.
At boot the logo is at the top left corner, and I choose to let it at the same place.
Additionally, on low resolution (like 800x600) the logo has less chance to overlap the text, so the user is more likely to see it.

Best regards,

Signature · 1 line
Jocelyn
Quoted 19 lines
---
  drivers/gpu/drm/drm_panic.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_panic.c +2 -0
index d6d3b8d85dea..c7fecc5e857a 100644
@@ -491,6 +491,8 @@ static void draw_panic_screen_user(struct drm_scanout_buffer *sb)
 
  	r_screen = DRM_RECT_INIT(0, 0, sb->width, sb->height);
  	drm_panic_logo_rect(&r_logo, font);
+	/* Center the panic logo */
+	drm_rect_translate(&r_logo, (sb->width - r_logo.x2) / 2, 0);
 
  	msg_width = min(get_max_line_len(panic_msg, panic_msg_lines) * font->width, sb->width);
  	msg_height = min(panic_msg_lines * font->height, sb->height);