summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorJocelyn Falempe <jfalempe@redhat.com>2024-08-22 09:33:55 +0200
committerJocelyn Falempe <jfalempe@redhat.com>2024-08-23 16:47:56 +0200
commit4b570ac2eb54f66ff64f2864be6303b8d67cc7f9 (patch)
treec754858277a4e1c493a600efa0d65d07b03568dc /drivers/gpu/drm
parentdrm/panic: Add integer scaling to blit() (diff)
downloadlinux-4b570ac2eb54f66ff64f2864be6303b8d67cc7f9.tar.xz
linux-4b570ac2eb54f66ff64f2864be6303b8d67cc7f9.zip
drm/rect: Add drm_rect_overlap()
Check if two rectangles overlap. It's a bit similar to drm_rect_intersect() but this won't modify the rectangle. Simplifies a bit drm_panic. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240822073852.562286-3-jfalempe@redhat.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_panic.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index 0a047152f88b..59fba23e5fd7 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -529,8 +529,7 @@ static void draw_panic_static_user(struct drm_scanout_buffer *sb)
/* Fill with the background color, and draw text on top */
drm_panic_fill(sb, &r_screen, bg_color);
- if ((r_msg.x1 >= logo_width || r_msg.y1 >= logo_height) &&
- logo_width <= sb->width && logo_height <= sb->height) {
+ if (!drm_rect_overlap(&r_logo, &r_msg)) {
if (logo_mono)
drm_panic_blit(sb, &r_logo, logo_mono->data, DIV_ROUND_UP(logo_width, 8),
fg_color);