build/patch/kernel/archive/sunxi-6.1/patches.megous/media-sun6i-csi-Add-support-for-RGB565-and-RGB555.patch

64 lines
2.5 KiB
Diff

From 6284440abd1bb36de9ceda7ec7aa6d36fe2213ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 8 Dec 2018 06:09:20 +0100
Subject: [PATCH 028/389] media: sun6i-csi: Add support for RGB565 and RGB555
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 5 ++++-
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h | 1 +
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 2 ++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
index 8b99c17e8403..f1ad134c2211 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
@@ -108,7 +108,8 @@ bool sun6i_csi_is_format_supported(struct sun6i_csi_device *csi_dev,
return (mbus_code == MEDIA_BUS_FMT_UYVY8_2X8);
case V4L2_PIX_FMT_VYUY:
return (mbus_code == MEDIA_BUS_FMT_VYUY8_2X8);
-
+ case V4L2_PIX_FMT_RGB555:
+ return mbus_code == MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE;
case V4L2_PIX_FMT_NV12_16L16:
case V4L2_PIX_FMT_NV12:
case V4L2_PIX_FMT_NV21:
@@ -465,6 +466,8 @@ static void sun6i_csi_set_window(struct sun6i_csi_device *csi_dev)
case V4L2_PIX_FMT_YVYU:
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_VYUY:
+ case V4L2_PIX_FMT_RGB565:
+ case V4L2_PIX_FMT_RGB555:
dev_dbg(csi_dev->dev,
"Horizontal length should be 2 times of width for packed YUV formats!\n");
hor_len = width * 2;
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h
index bab705678280..5559c1b7d6f0 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h
@@ -143,6 +143,7 @@ static inline int sun6i_csi_get_bpp(unsigned int pixformat)
case V4L2_PIX_FMT_YVYU:
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_VYUY:
+ case V4L2_PIX_FMT_RGB555:
case V4L2_PIX_FMT_NV16:
case V4L2_PIX_FMT_NV61:
case V4L2_PIX_FMT_YUV422P:
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
index 791583d23a65..1d1755c1e18d 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
@@ -60,6 +60,8 @@ static const u32 sun6i_video_formats[] = {
V4L2_PIX_FMT_YVYU,
V4L2_PIX_FMT_UYVY,
V4L2_PIX_FMT_VYUY,
+ V4L2_PIX_FMT_RGB565,
+ V4L2_PIX_FMT_RGB555,
V4L2_PIX_FMT_NV12_16L16,
V4L2_PIX_FMT_NV12,
V4L2_PIX_FMT_NV21,
--
2.35.3