diff options
Diffstat (limited to 'drivers/gpu/drm/drm_panic.c')
| -rw-r--r-- | drivers/gpu/drm/drm_panic.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index f42be7f1d8c2..eb7ef17b9c71 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -476,7 +476,7 @@ static void drm_panic_logo_draw(struct drm_scanout_buffer *sb, struct drm_rect * fg_color); } -static void draw_panic_static_user(struct drm_scanout_buffer *sb) +static void draw_panic_screen_user(struct drm_scanout_buffer *sb) { u32 fg_color = drm_draw_color_from_xrgb8888(CONFIG_DRM_PANIC_FOREGROUND_COLOR, sb->format->format); @@ -545,7 +545,7 @@ static int draw_line_with_wrap(struct drm_scanout_buffer *sb, const struct font_ * Draw the kmsg buffer to the screen, starting from the youngest message at the bottom, * and going up until reaching the top of the screen. */ -static void draw_panic_static_kmsg(struct drm_scanout_buffer *sb) +static void draw_panic_screen_kmsg(struct drm_scanout_buffer *sb) { u32 fg_color = drm_draw_color_from_xrgb8888(CONFIG_DRM_PANIC_FOREGROUND_COLOR, sb->format->format); @@ -733,7 +733,7 @@ static int drm_panic_get_qr_code(u8 **qr_image) /* * Draw the panic message at the center of the screen, with a QR Code */ -static int _draw_panic_static_qr_code(struct drm_scanout_buffer *sb) +static int _draw_panic_screen_qr_code(struct drm_scanout_buffer *sb) { u32 fg_color = drm_draw_color_from_xrgb8888(CONFIG_DRM_PANIC_FOREGROUND_COLOR, sb->format->format); @@ -801,10 +801,10 @@ static int _draw_panic_static_qr_code(struct drm_scanout_buffer *sb) return 0; } -static void draw_panic_static_qr_code(struct drm_scanout_buffer *sb) +static void draw_panic_screen_qr_code(struct drm_scanout_buffer *sb) { - if (_draw_panic_static_qr_code(sb)) - draw_panic_static_user(sb); + if (_draw_panic_screen_qr_code(sb)) + draw_panic_screen_user(sb); } #else static void drm_panic_qr_init(void) {}; @@ -872,25 +872,25 @@ static bool drm_panic_is_format_supported(const struct drm_format_info *format) { if (format->num_planes != 1) return false; - return drm_draw_color_from_xrgb8888(0xffffff, format->format) != 0; + return drm_draw_can_convert_from_xrgb8888(format->format); } static void draw_panic_dispatch(struct drm_scanout_buffer *sb) { switch (drm_panic_type) { case DRM_PANIC_TYPE_KMSG: - draw_panic_static_kmsg(sb); + draw_panic_screen_kmsg(sb); break; #if IS_ENABLED(CONFIG_DRM_PANIC_SCREEN_QR_CODE) case DRM_PANIC_TYPE_QR: - draw_panic_static_qr_code(sb); + draw_panic_screen_qr_code(sb); break; #endif case DRM_PANIC_TYPE_USER: default: - draw_panic_static_user(sb); + draw_panic_screen_user(sb); } } @@ -1084,3 +1084,7 @@ void drm_panic_exit(void) { drm_panic_qr_exit(); } + +#ifdef CONFIG_DRM_KUNIT_TEST +#include "tests/drm_panic_test.c" +#endif |
