Skip to content

Commit 179753a

Browse files
author
Jocelyn Falempe
committed
drm/panic: Fix drawing the logo on a small narrow screen
If the logo width is bigger than the framebuffer width, and the height is big enough to hold the logo and the message, it will draw at x coordinate that are higher than the width, and ends up in a corrupted image. Fixes: 4b570ac ("drm/rect: Add drm_rect_overlap()") Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jocelyn Falempe <[email protected]>
1 parent 4eabd0d commit 179753a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/drm_panic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ static void drm_panic_logo_rect(struct drm_rect *rect, const struct font_desc *f
429429
static void drm_panic_logo_draw(struct drm_scanout_buffer *sb, struct drm_rect *rect,
430430
const struct font_desc *font, u32 fg_color)
431431
{
432+
if (rect->x2 > sb->width || rect->y2 > sb->height)
433+
return;
434+
432435
if (logo_mono)
433436
drm_panic_blit(sb, rect, logo_mono->data,
434437
DIV_ROUND_UP(drm_rect_width(rect), 8), 1, fg_color);

0 commit comments

Comments
 (0)