Skip to contentSkip to conversation

gpu: ipu-cpmem: add bayer formats to ipu_cpmem_set_image

PATCH New Philipp Zabel 1 participant 1 message Feb 27, 2017

Subsystems (2)
lore
Share & tools
lore

Philipp Zabel

author maintainer
#0 lore raw

PATCH 1/1 gpu: ipu-cpmem: add bayer formats to ipu_cpmem_set_image

The IPU does not natively understand bayer formats, but it can pass them through unchanged. Add support for setting the image base address and cropping offset to ipu_cpmem_set_image.

---
 drivers/gpu/ipu-v3/ipu-cpmem.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/ipu-v3/ipu-cpmem.c +13 -0
index f29aa7b0853c9..b72f725e00b59 100644
@@ -720,6 +720,19 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image)
 		offset = image->rect.left * 3 +
 			image->rect.top * pix->bytesperline;
 		break;
+	case V4L2_PIX_FMT_SBGGR8:
+	case V4L2_PIX_FMT_SGBRG8:
+	case V4L2_PIX_FMT_SGRBG8:
+	case V4L2_PIX_FMT_SRGGB8:
+		offset = image->rect.left + image->rect.top * pix->bytesperline;
+		break;
+	case V4L2_PIX_FMT_SBGGR16:
+	case V4L2_PIX_FMT_SGBRG16:
+	case V4L2_PIX_FMT_SGRBG16:
+	case V4L2_PIX_FMT_SRGGB16:
+		offset = image->rect.left * 2 +
+			 image->rect.top * pix->bytesperline;
+		break;
 	default:
 		/* This should not happen */
 		WARN_ON(1);
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel