[PATCH v3 1/3] drm/format-helper: Add conversion from XRGB8888 to BGR888

andriy.shevchenko at linux.intel.com andriy.shevchenko at linux.intel.com
Fri Feb 21 15:51:12 UTC 2025


On Fri, Feb 21, 2025 at 11:36:00AM +0000, Aditya Garg wrote:
> From: Kerem Karabay <kekrby at gmail.com>
> 
> Add XRGB8888 emulation helper for devices that only support BGR888.

...

> +	for (x = 0; x < pixels; x++) {
> +		pix = le32_to_cpu(sbuf32[x]);
> +		/* write red-green-blue to output in little endianness */
> +		*dbuf8++ = (pix & 0x00ff0000) >> 16;
> +		*dbuf8++ = (pix & 0x0000ff00) >> 8;
> +		*dbuf8++ = (pix & 0x000000ff) >> 0;

put_unaligned_be24()

> +	}

...

> +	static const u8 dst_pixsize[DRM_FORMAT_MAX_PLANES] = {
> +		3,
> +	};

One line?

	static const u8 dst_pixsize[DRM_FORMAT_MAX_PLANES] = { 3 };

-- 
With Best Regards,
Andy Shevchenko




More information about the dri-devel mailing list