Use drm_draw_can_convert_from_xrgb8888() instead of
drm_draw_color_from_xrgb8888() while checking if a color format is
usable. This avoids a WARN in case the first format is not usable.

Reviewed-by: Jocelyn Falempe <[email protected]>
Signed-off-by: Francesco Valla <[email protected]>
---
 drivers/gpu/drm/drm_panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index 
d4b6ea42db0fe65ea010255ff57554baf723e60c..27989a010ace38b18bc047ad87db64128ec25790
 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -833,7 +833,7 @@ 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)

-- 
2.52.0

Reply via email to