Use drm_draw_can_convert_from_xrgb8888() instead of
drm_draw_color_from_xrgb8888() while searching for a usable color
format. 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/clients/drm_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/clients/drm_log.c 
b/drivers/gpu/drm/clients/drm_log.c
index 
4d3005273b278e8c4c0ff7a411165efb7684316e..2bd5189c967e1952f9e6ad17120b2cd920c79a96
 100644
--- a/drivers/gpu/drm/clients/drm_log.c
+++ b/drivers/gpu/drm/clients/drm_log.c
@@ -182,7 +182,7 @@ static u32 drm_log_find_usable_format(struct drm_plane 
*plane)
        int i;
 
        for (i = 0; i < plane->format_count; i++)
-               if (drm_draw_color_from_xrgb8888(0xffffff, 
plane->format_types[i]) != 0)
+               if (drm_draw_can_convert_from_xrgb8888(plane->format_types[i]))
                        return plane->format_types[i];
        return DRM_FORMAT_INVALID;
 }

-- 
2.52.0

Reply via email to