On Wed, Oct 01, 2025 at 04:22:13PM +0300, Tomi Valkeinen wrote:
> drm_format_info_bpp() cannot be used for formats which do not have an
> integer bits-per-pixel in a pixel block.
> 
> E.g. DRM_FORMAT_XV15's (not yet in upstream) plane 0 has three 10-bit
> pixels (Y components), and two padding bits, in a 4 byte block. That is
> 10.666... bits per pixel when considering the whole 4 byte block, which
> is what drm_format_info_bpp() does. Thus a driver that supports such
> formats cannot use drm_format_info_bpp(),
> 
> It is a driver bug if this happens, but so handle wrong calls by
> printing a warning and returning 0.
> 
> Reviewed-by: Laurent Pinchart <[email protected]>
> Signed-off-by: Tomi Valkeinen <[email protected]>
> ---
>  drivers/gpu/drm/drm_fourcc.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <[email protected]>


-- 
With best wishes
Dmitry

Reply via email to