drm/mgag200: Enable DRM_FORMAT_XRGB1555 on the primary plane

The driver already sets the format for the depth value in the XMULCTRL
register. Add the format to the other switch statements, set the helpers
for gamma correction and export the XRGB1555 in the primary plane's
format array.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patch.msgid.link/20260415152625.101710-7-tzimmermann@suse.de
This commit is contained in:
Thomas Zimmermann 2026-04-15 17:23:40 +02:00
parent 8f18922567
commit 3f9357c30a
2 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,7 @@ static void mgag200_g200se_set_hiprilvl(struct mga_device *mdev,
bpp = 32;
break;
case DRM_FORMAT_RGB565:
case DRM_FORMAT_XRGB1555:
bpp = 16;
break;
case DRM_FORMAT_C8:

View File

@ -59,6 +59,9 @@ void mgag200_crtc_fill_gamma(struct mga_device *mdev,
case DRM_FORMAT_C8:
drm_crtc_fill_palette_8(crtc, mgag200_set_gamma_lut);
break;
case DRM_FORMAT_XRGB1555:
drm_crtc_fill_gamma_555(crtc, mgag200_set_gamma_lut);
break;
case DRM_FORMAT_RGB565:
drm_crtc_fill_gamma_565(crtc, mgag200_set_gamma_lut);
break;
@ -83,6 +86,9 @@ void mgag200_crtc_load_gamma(struct mga_device *mdev,
case DRM_FORMAT_C8:
drm_crtc_load_palette_8(crtc, lut, mgag200_set_gamma_lut);
break;
case DRM_FORMAT_XRGB1555:
drm_crtc_load_gamma_555_from_888(crtc, lut, mgag200_set_gamma_lut);
break;
case DRM_FORMAT_RGB565:
drm_crtc_load_gamma_565_from_888(crtc, lut, mgag200_set_gamma_lut);
break;
@ -180,6 +186,7 @@ static void mgag200_set_datasiz(struct mga_device *mdev, u32 format)
/* Big-endian byte-swapping */
switch (format) {
case DRM_FORMAT_XRGB1555:
case DRM_FORMAT_RGB565:
opmode |= 0x10100;
break;
@ -443,6 +450,7 @@ static void mgag200_handle_damage(struct mga_device *mdev, const struct iosys_ma
const uint32_t mgag200_primary_plane_formats[] = {
DRM_FORMAT_XRGB8888,
DRM_FORMAT_RGB565,
DRM_FORMAT_XRGB1555,
DRM_FORMAT_RGB888,
DRM_FORMAT_C8,
};