Replace the deprecated cpp field from struct drm_format_info with the
format's 4CC code when setting the hiprilvl field in CRTCEXT6.
Using a bpp of 32 for RGB888 is a bit dubious, but we keep it for now
to avoid changing behavior. Otherwise, bpp could also be retrieved by
calling drm_format_info_bpp().
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patch.msgid.link/20260415152625.101710-5-tzimmermann@suse.de
unsigned int bpp;
unsigned long mb;
- if (format->cpp[0] * 8 > 16)
+ switch (format->format) {
+ case DRM_FORMAT_XRGB8888:
+ case DRM_FORMAT_RGB888:
bpp = 32;
- else if (format->cpp[0] * 8 > 8)
+ break;
+ case DRM_FORMAT_RGB565:
bpp = 16;
- else
+ break;
+ case DRM_FORMAT_C8:
bpp = 8;
+ break;
+ }
mb = (mode->clock * bpp) / 1000;
if (mb > 3100)