Skip to content

Commit 0459696

Browse files
author
Jocelyn Falempe
committed
drm/panic: Add ABGR2101010 support
Add support for ABGR2101010, used by the nouveau driver. Signed-off-by: Jocelyn Falempe <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1d43ddd commit 0459696

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/drm_panic.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,14 @@ static u32 convert_xrgb8888_to_argb2101010(u32 pix)
209209
return GENMASK(31, 30) /* set alpha bits */ | pix | ((pix >> 8) & 0x00300C03);
210210
}
211211

212+
static u32 convert_xrgb8888_to_abgr2101010(u32 pix)
213+
{
214+
pix = ((pix & 0x00FF0000) >> 14) |
215+
((pix & 0x0000FF00) << 4) |
216+
((pix & 0x000000FF) << 22);
217+
return GENMASK(31, 30) /* set alpha bits */ | pix | ((pix >> 8) & 0x00300C03);
218+
}
219+
212220
/*
213221
* convert_from_xrgb8888 - convert one pixel from xrgb8888 to the desired format
214222
* @color: input color, in xrgb8888 format
@@ -242,6 +250,8 @@ static u32 convert_from_xrgb8888(u32 color, u32 format)
242250
return convert_xrgb8888_to_xrgb2101010(color);
243251
case DRM_FORMAT_ARGB2101010:
244252
return convert_xrgb8888_to_argb2101010(color);
253+
case DRM_FORMAT_ABGR2101010:
254+
return convert_xrgb8888_to_abgr2101010(color);
245255
default:
246256
WARN_ONCE(1, "Can't convert to %p4cc\n", &format);
247257
return 0;

0 commit comments

Comments
 (0)