Commit 4cabfedc authored by Noralf Trønnes's avatar Noralf Trønnes
Browse files

drm/gud: Add GUD_PIXEL_FORMAT_R8

parent bcf80d6e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -523,6 +523,8 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
		switch (format) {
		case GUD_DRM_FORMAT_R1:
			fallthrough;
		case DRM_FORMAT_R8:
			fallthrough;
		case GUD_DRM_FORMAT_XRGB1111:
			if (!xrgb8888_emulation_format)
				xrgb8888_emulation_format = info;
+4 −0
Original line number Diff line number Diff line
@@ -80,6 +80,8 @@ static inline u8 gud_from_fourcc(u32 fourcc)
	switch (fourcc) {
	case GUD_DRM_FORMAT_R1:
		return GUD_PIXEL_FORMAT_R1;
	case DRM_FORMAT_R8:
		return GUD_PIXEL_FORMAT_R8;
	case GUD_DRM_FORMAT_XRGB1111:
		return GUD_PIXEL_FORMAT_XRGB1111;
	case DRM_FORMAT_RGB565:
@@ -98,6 +100,8 @@ static inline u32 gud_to_fourcc(u8 format)
	switch (format) {
	case GUD_PIXEL_FORMAT_R1:
		return GUD_DRM_FORMAT_R1;
	case GUD_PIXEL_FORMAT_R8:
		return DRM_FORMAT_R8;
	case GUD_PIXEL_FORMAT_XRGB1111:
		return GUD_DRM_FORMAT_XRGB1111;
	case GUD_PIXEL_FORMAT_RGB565:
+2 −0
Original line number Diff line number Diff line
@@ -189,6 +189,8 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
				ret = -ENOMEM;
				goto end_cpu_access;
			}
		} else if (format->format == DRM_FORMAT_R8) {
			drm_fb_xrgb8888_to_gray8(buf, vaddr, fb, rect);
		} else if (format->format == DRM_FORMAT_RGB565) {
			drm_fb_xrgb8888_to_rgb565(buf, vaddr, fb, rect, gud_is_big_endian());
		} else {
+2 −2
Original line number Diff line number Diff line
@@ -246,8 +246,8 @@ struct gud_state_req {
/* Get supported pixel formats as a byte array of GUD_PIXEL_FORMAT_* */
#define GUD_REQ_GET_FORMATS				0x40
  #define GUD_FORMATS_MAX_NUM			32
  /* R1 is a 1-bit monochrome transfer format presented to userspace as XRGB8888 */
  #define GUD_PIXEL_FORMAT_R1			0x01
  #define GUD_PIXEL_FORMAT_R1			0x01 /* 1-bit monochrome */
  #define GUD_PIXEL_FORMAT_R8			0x08 /* 8-bit greyscale */
  #define GUD_PIXEL_FORMAT_XRGB1111		0x20
  #define GUD_PIXEL_FORMAT_RGB565		0x40
  #define GUD_PIXEL_FORMAT_XRGB8888		0x80