drm/mgag200: g200se: Set hiprilvl from DRM format

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
This commit is contained in:
Thomas Zimmermann 2026-04-15 17:23:38 +02:00
parent 0bfc9fbd8e
commit 2d9bd1f58b

View File

@ -76,12 +76,18 @@ static void mgag200_g200se_set_hiprilvl(struct mga_device *mdev,
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)