[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200528185717.GA20581@kaaira-HP-Pavilion-Notebook>
Date: Fri, 29 May 2020 00:27:17 +0530
From: Kaaira Gupta <kgupta@...iitr.ac.in>
To: Helen Koike <helen.koike@...labora.com>,
Shuah Khan <skhan@...uxfoundation.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
kieran.bingham@...asonboard.com
Subject: [PATCH] vimc: debayer: Add support for ARGB format
Running qcam for pixelformat 0x34324142 showed that vimc debayer does
not support it. Hence, add the support for Alpha (255).
Signed-off-by: Kaaira Gupta <kgupta@...iitr.ac.in>
---
.../media/test-drivers/vimc/vimc-debayer.c | 27 ++++++++++++-------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/media/test-drivers/vimc/vimc-debayer.c b/drivers/media/test-drivers/vimc/vimc-debayer.c
index c3f6fef34f68..f34148717a40 100644
--- a/drivers/media/test-drivers/vimc/vimc-debayer.c
+++ b/drivers/media/test-drivers/vimc/vimc-debayer.c
@@ -62,6 +62,7 @@ static const u32 vimc_deb_src_mbus_codes[] = {
MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
MEDIA_BUS_FMT_RGB888_1X32_PADHI,
+ MEDIA_BUS_FMT_ARGB8888_1X32
};
static const struct vimc_deb_pix_map vimc_deb_pix_map_list[] = {
@@ -322,15 +323,23 @@ static void vimc_deb_process_rgb_frame(struct vimc_deb_device *vdeb,
unsigned int i, index;
vpix = vimc_pix_map_by_code(vdeb->src_code);
- index = VIMC_FRAME_INDEX(lin, col, vdeb->sink_fmt.width, 3);
- for (i = 0; i < 3; i++) {
- switch (vpix->pixelformat) {
- case V4L2_PIX_FMT_RGB24:
- vdeb->src_frame[index + i] = rgb[i];
- break;
- case V4L2_PIX_FMT_BGR24:
- vdeb->src_frame[index + i] = rgb[2 - i];
- break;
+
+ if (vpix->pixelformat == V4L2_PIX_FMT_ARGB32) {
+ index = VIMC_FRAME_INDEX(lin, col, vdeb->sink_fmt.width, 4);
+ vdeb->src_frame[index] = 255;
+ for (i = 0; i < 3; i++)
+ vdeb->src_frame[index + i + 1] = rgb[i];
+ } else {
+ index = VIMC_FRAME_INDEX(lin, col, vdeb->sink_fmt.width, 3);
+ for (i = 0; i < 3; i++) {
+ switch (vpix->pixelformat) {
+ case V4L2_PIX_FMT_RGB24:
+ vdeb->src_frame[index + i] = rgb[i];
+ break;
+ case V4L2_PIX_FMT_BGR24:
+ vdeb->src_frame[index + i] = rgb[2 - i];
+ break;
+ }
}
}
}
--
2.17.1
Powered by blists - more mailing lists