File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,14 @@ static u32 convert_xrgb8888_to_argb2101010(u32 pix)
209
209
return GENMASK (31 , 30 ) /* set alpha bits */ | pix | ((pix >> 8 ) & 0x00300C03 );
210
210
}
211
211
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
+
212
220
/*
213
221
* convert_from_xrgb8888 - convert one pixel from xrgb8888 to the desired format
214
222
* @color: input color, in xrgb8888 format
@@ -242,6 +250,8 @@ static u32 convert_from_xrgb8888(u32 color, u32 format)
242
250
return convert_xrgb8888_to_xrgb2101010 (color );
243
251
case DRM_FORMAT_ARGB2101010 :
244
252
return convert_xrgb8888_to_argb2101010 (color );
253
+ case DRM_FORMAT_ABGR2101010 :
254
+ return convert_xrgb8888_to_abgr2101010 (color );
245
255
default :
246
256
WARN_ONCE (1 , "Can't convert to %p4cc\n" , & format );
247
257
return 0 ;
You can’t perform that action at this time.
0 commit comments