All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/draw: add check API to avoid spurious WARN
@ 2025-10-05 20:21 Francesco Valla
  2025-10-05 20:21 ` [PATCH 1/3] drm/draw: add drm_draw_can_convert_from_xrgb8888 Francesco Valla
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Francesco Valla @ 2025-10-05 20:21 UTC (permalink / raw)
  To: Jocelyn Falempe, Javier Martinez Canillas, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, Francesco Valla

When using the DRM draw support, the only way to check if a color can be
converted from XRGB8888 to a target format is currently to attempt an
actual conversion using drm_draw_color_from_xrgb8888(). This function
however will print a WARN the first time a conversion cannot be
performed, leading to two potential issues:

 - a WARN is emitted without a real reason if the caller is only
   attempting a conversion to check if a format can be supported (which
   is the case for two of the current user of this API);
 - a failing call following the first one is not emitting a WARN, but a
   "valid" color value (0x00000000) is returned nevertheless.

The first issue was observed while using drm_log on a Beagleplay, which
lists AR12 as the first format for its HDMI modesets.

The target of this patch set is to improve this situation; the first
patch introduces a new API devoted only to check if a conversion from
XRGB8888 to the specified format can be performed, while the other two
substitute drm_draw_color_from_xrgb8888() with this new API in the
current users (drm_panic and drm_log) where relevant.

Signed-off-by: Francesco Valla <francesco@valla.it>
---
Francesco Valla (3):
      drm/draw: add drm_draw_can_convert_from_xrgb8888
      drm/log: avoid WARN when searching for usable format
      drm/log: avoid WARN when checking format support

 drivers/gpu/drm/clients/drm_log.c   |  2 +-
 drivers/gpu/drm/drm_draw.c          | 84 +++++++++++++++++++++++++++----------
 drivers/gpu/drm/drm_draw_internal.h |  2 +
 drivers/gpu/drm/drm_panic.c         |  2 +-
 4 files changed, 65 insertions(+), 25 deletions(-)
---
base-commit: 7a405dbb0f036f8d1713ab9e7df0cd3137987b07
change-id: 20251003-drm_draw_conv_check-9cc3050ebd57

Best regards,
-- 
Francesco Valla <francesco@valla.it>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-10-06 21:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-05 20:21 [PATCH 0/3] drm/draw: add check API to avoid spurious WARN Francesco Valla
2025-10-05 20:21 ` [PATCH 1/3] drm/draw: add drm_draw_can_convert_from_xrgb8888 Francesco Valla
2025-10-06  6:48   ` Jani Nikula
2025-10-06  8:06     ` Jocelyn Falempe
2025-10-06  9:05       ` Jani Nikula
2025-10-06 21:38     ` Francesco Valla
2025-10-05 20:21 ` [PATCH 2/3] drm/log: avoid WARN when searching for usable format Francesco Valla
2025-10-05 20:21 ` [PATCH 3/3] drm/log: avoid WARN when checking format support Francesco Valla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.