Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1261207 > unrolled thread

[PATCH v2 4/5] media: atmel-isi: setup YCC_SWAP correctly when using preview path

Started byJosh Wu <josh.wu@atmel.com>
First post2015-11-03 06:50 +0100
Last post2015-11-03 06:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 4/5] media: atmel-isi: setup YCC_SWAP correctly when using preview path Josh Wu <josh.wu@atmel.com> - 2015-11-03 06:50 +0100

#1261207 — [PATCH v2 4/5] media: atmel-isi: setup YCC_SWAP correctly when using preview path

FromJosh Wu <josh.wu@atmel.com>
Date2015-11-03 06:50 +0100
Subject[PATCH v2 4/5] media: atmel-isi: setup YCC_SWAP correctly when using preview path
Message-ID<qqCDL-6X8-7@gated-at.bofh.it>
The preview path only can convert UYVY format to RGB data.

To make preview path work correctly, we need to set up YCC_SWAP
according to sensor output and convert them to UYVY.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---

Changes in v2:
- remove cfg2_yuv_swap for rgb format
- correct the comment style

 drivers/media/platform/soc_camera/atmel-isi.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index ae82068..826d04e 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -117,6 +117,20 @@ static u32 setup_cfg2_yuv_swap(struct atmel_isi *isi,
 		case MEDIA_BUS_FMT_YVYU8_2X8:
 			return ISI_CFG2_YCC_SWAP_MODE_1;
 		}
+	} else if (xlate->host_fmt->fourcc == V4L2_PIX_FMT_RGB565) {
+		/*
+		 * Preview path is enabled, it will convert UYVY to RGB format.
+		 * But if sensor output format is not UYVY, we need to set
+		 * YCC_SWAP_MODE to convert it as UYVY.
+		 */
+		switch (xlate->code) {
+		case MEDIA_BUS_FMT_VYUY8_2X8:
+			return ISI_CFG2_YCC_SWAP_MODE_1;
+		case MEDIA_BUS_FMT_YUYV8_2X8:
+			return ISI_CFG2_YCC_SWAP_MODE_2;
+		case MEDIA_BUS_FMT_YVYU8_2X8:
+			return ISI_CFG2_YCC_SWAP_MODE_3;
+		}
 	}
 
 	/*
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web