aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJai Luthra <j-luthra@ti.com>2024-01-05 10:00:25 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-01-22 17:23:59 +0100
commit5eb0ad467cb0cf8f9a6621d079a1f7ecd804153f (patch)
tree3d1ea8e74a62246c6bb3e0bd107577e84893f416 /drivers/media
parent77759eb0b895e6be7ab1fbbfdf064b6fea62b406 (diff)
downloadlinux-5eb0ad467cb0cf8f9a6621d079a1f7ecd804153f.tar.gz
media: ti: j721e-csi2rx: add support for RGB formats
Add support for RGB565, RGB888 and BGR888 media bus formats. The pixel formats for these have a different byte-order than the MIPI bus formats, given the SHIM IP [1] unpacks them into memory as follows: MIPI RGB888 unpacks to: BYTE3 BYTE2 BYTE1 BYTE0 00000000 RRRRRRRR GGGGGGGG BBBBBBBB MIPI RGB565 unpacks to: BIT 15-11 BIT 10-5 BIT 4-0 RRRRR GGGGGG BBBBB [1]: AM62x TRM: 12.6.1.4.5 "CSI_RX_IF Data Memory Organization Details" Link: https://www.ti.com/lit/pdf/spruiv7 Signed-off-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
index 4048b2bd388547..2b078c5d7f5d23 100644
--- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
+++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
@@ -188,6 +188,24 @@ static const struct ti_csi2rx_fmt ti_csi2rx_formats[] = {
.csi_dt = MIPI_CSI2_DT_RAW10,
.bpp = 16,
.size = SHIM_DMACNTX_SIZE_16,
+ }, {
+ .fourcc = V4L2_PIX_FMT_RGB565X,
+ .code = MEDIA_BUS_FMT_RGB565_1X16,
+ .csi_dt = MIPI_CSI2_DT_RGB565,
+ .bpp = 16,
+ .size = SHIM_DMACNTX_SIZE_16,
+ }, {
+ .fourcc = V4L2_PIX_FMT_XBGR32,
+ .code = MEDIA_BUS_FMT_RGB888_1X24,
+ .csi_dt = MIPI_CSI2_DT_RGB888,
+ .bpp = 32,
+ .size = SHIM_DMACNTX_SIZE_32,
+ }, {
+ .fourcc = V4L2_PIX_FMT_RGBX32,
+ .code = MEDIA_BUS_FMT_BGR888_1X24,
+ .csi_dt = MIPI_CSI2_DT_RGB888,
+ .bpp = 32,
+ .size = SHIM_DMACNTX_SIZE_32,
},
/* More formats can be supported but they are not listed for now. */