diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-02-06 12:44:08 +0100 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2017-03-15 15:28:27 +0100 |
commit | 1762ed65c700efb843df8d19a55742566872aade (patch) | |
tree | 47b527e9e690060ab002d97148b5b8e579f52900 /drivers | |
parent | 5cd4337135f5d79bf655fa421980e467d76ba125 (diff) | |
download | blackbird-obmc-linux-1762ed65c700efb843df8d19a55742566872aade.tar.gz blackbird-obmc-linux-1762ed65c700efb843df8d19a55742566872aade.zip |
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.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-cpmem.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c index f29aa7b0853c..b72f725e00b5 100644 --- a/drivers/gpu/ipu-v3/ipu-cpmem.c +++ b/drivers/gpu/ipu-v3/ipu-cpmem.c @@ -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); |