Re: [PATCH v2 2/3] drm/log: avoid WARN when searching for usable format

From: Jocelyn Falempe

Date: Wed Oct 15 2025 - 03:40:07 EST


On 14/10/2025 22:08, Francesco Valla wrote:
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.

Thanks, it looks good to me.

Reviewed-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>


Signed-off-by: Francesco Valla <francesco@xxxxxxxx>
---
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 d239f1e3c456397ad64007b20dde716f5d3d0881..c0150f0c3b4b395e6e2126cf0d9660c967c182ec 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;
}