[PATCH 2/3] drm/format-helper: Add RGB888-to-XRGB8888 conversion

Javier Martinez Canillas javierm at redhat.com
Fri Apr 22 12:26:03 UTC 2022


On 4/21/22 20:17, Thomas Zimmermann wrote:
> Add a format helper that converts RGB888 to XRGB8888. Use this
> function in drm_fb_blit_toio(). Fixes simpledrm output for this
> combination of formats.
>

I think the examples you have in the cover letter are quite illustrative,
maybe I would mention an example in the commit description as well.

> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---

[snip]

> +
> +static void drm_fb_rgb888_to_xrgb8888_toio(void __iomem *dst, unsigned int dst_pitch,
> +					   const void *vaddr, const struct drm_framebuffer *fb,
> +					   const struct drm_rect *clip)
> +{
> +	size_t linepixels = clip->x2 - clip->x1;

drm_rect_width(clip) instead ?

> +	size_t dst_len = linepixels * 4;
> +	unsigned int y, lines = clip->y2 - clip->y1;
and drm_rect_height(clip) ?

> +	void *dbuf;
> +
Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat



More information about the dri-devel mailing list