drm/gud: Add GUD_PIXEL_FORMAT_RGB888
Add support for the RGB888 pixel format. Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210929191201.34456-7-noralf@tronnes.org
This commit is contained in:
parent
1f25d00542
commit
83d7b6d54b
|
@ -528,6 +528,8 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||||
case GUD_DRM_FORMAT_XRGB1111:
|
case GUD_DRM_FORMAT_XRGB1111:
|
||||||
fallthrough;
|
fallthrough;
|
||||||
case DRM_FORMAT_RGB332:
|
case DRM_FORMAT_RGB332:
|
||||||
|
fallthrough;
|
||||||
|
case DRM_FORMAT_RGB888:
|
||||||
if (!xrgb8888_emulation_format)
|
if (!xrgb8888_emulation_format)
|
||||||
xrgb8888_emulation_format = info;
|
xrgb8888_emulation_format = info;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -88,6 +88,8 @@ static inline u8 gud_from_fourcc(u32 fourcc)
|
||||||
return GUD_PIXEL_FORMAT_RGB332;
|
return GUD_PIXEL_FORMAT_RGB332;
|
||||||
case DRM_FORMAT_RGB565:
|
case DRM_FORMAT_RGB565:
|
||||||
return GUD_PIXEL_FORMAT_RGB565;
|
return GUD_PIXEL_FORMAT_RGB565;
|
||||||
|
case DRM_FORMAT_RGB888:
|
||||||
|
return GUD_PIXEL_FORMAT_RGB888;
|
||||||
case DRM_FORMAT_XRGB8888:
|
case DRM_FORMAT_XRGB8888:
|
||||||
return GUD_PIXEL_FORMAT_XRGB8888;
|
return GUD_PIXEL_FORMAT_XRGB8888;
|
||||||
case DRM_FORMAT_ARGB8888:
|
case DRM_FORMAT_ARGB8888:
|
||||||
|
@ -110,6 +112,8 @@ static inline u32 gud_to_fourcc(u8 format)
|
||||||
return DRM_FORMAT_RGB332;
|
return DRM_FORMAT_RGB332;
|
||||||
case GUD_PIXEL_FORMAT_RGB565:
|
case GUD_PIXEL_FORMAT_RGB565:
|
||||||
return DRM_FORMAT_RGB565;
|
return DRM_FORMAT_RGB565;
|
||||||
|
case GUD_PIXEL_FORMAT_RGB888:
|
||||||
|
return DRM_FORMAT_RGB888;
|
||||||
case GUD_PIXEL_FORMAT_XRGB8888:
|
case GUD_PIXEL_FORMAT_XRGB8888:
|
||||||
return DRM_FORMAT_XRGB8888;
|
return DRM_FORMAT_XRGB8888;
|
||||||
case GUD_PIXEL_FORMAT_ARGB8888:
|
case GUD_PIXEL_FORMAT_ARGB8888:
|
||||||
|
|
|
@ -195,6 +195,8 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
|
||||||
drm_fb_xrgb8888_to_rgb332(buf, vaddr, fb, rect);
|
drm_fb_xrgb8888_to_rgb332(buf, vaddr, fb, rect);
|
||||||
} else if (format->format == DRM_FORMAT_RGB565) {
|
} else if (format->format == DRM_FORMAT_RGB565) {
|
||||||
drm_fb_xrgb8888_to_rgb565(buf, vaddr, fb, rect, gud_is_big_endian());
|
drm_fb_xrgb8888_to_rgb565(buf, vaddr, fb, rect, gud_is_big_endian());
|
||||||
|
} else if (format->format == DRM_FORMAT_RGB888) {
|
||||||
|
drm_fb_xrgb8888_to_rgb888(buf, vaddr, fb, rect);
|
||||||
} else {
|
} else {
|
||||||
len = gud_xrgb8888_to_color(buf, format, vaddr, fb, rect);
|
len = gud_xrgb8888_to_color(buf, format, vaddr, fb, rect);
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,7 @@ struct gud_state_req {
|
||||||
#define GUD_PIXEL_FORMAT_XRGB1111 0x20
|
#define GUD_PIXEL_FORMAT_XRGB1111 0x20
|
||||||
#define GUD_PIXEL_FORMAT_RGB332 0x30
|
#define GUD_PIXEL_FORMAT_RGB332 0x30
|
||||||
#define GUD_PIXEL_FORMAT_RGB565 0x40
|
#define GUD_PIXEL_FORMAT_RGB565 0x40
|
||||||
|
#define GUD_PIXEL_FORMAT_RGB888 0x50
|
||||||
#define GUD_PIXEL_FORMAT_XRGB8888 0x80
|
#define GUD_PIXEL_FORMAT_XRGB8888 0x80
|
||||||
#define GUD_PIXEL_FORMAT_ARGB8888 0x81
|
#define GUD_PIXEL_FORMAT_ARGB8888 0x81
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue