[PATCH 3/6] drm: fourcc byteorder: add bigendian support to drm_mode_legacy_fb_format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 	uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
> 	{
> 		uint32_t fmt;
> 	#ifdef __BIG_ENDIAN
> 		enum { LITTLE_ENDIAN = 0 };
> 	#else
> 		enum { LITTLE_ENDIAN = 1 };
> 	#endif
> 	/* ... */
> 
> (using an enum for compile-time constness)
> 
> and then
> 	fmt = DRM_FORMAT_ARGB8888;
> becomes
> 	fmt = LITTLE_ENDIAN ? DRM_FORMAT_ARGB8888 : DRM_FORMAT_BGRA8888;
> 
> Might be easier to read than duplicating the whole switch?

Well, there are more differences, like rgb565 and xrgb2101010 not being
supported for bigendian, so it isn't *that* simple.

cheers,
  Gerd



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux