summaryrefslogtreecommitdiff
path: root/drivers/video/b2r2/b2r2_node_split.c
diff options
context:
space:
mode:
authorMaciej Socha <maciej.socha@stericsson.com>2011-06-17 15:09:02 +0200
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 15:15:49 +0200
commit24e081cbc0607d01b0f0761008b488d14f6679d7 (patch)
treea49de8f19d0ac214fa08964df9ea80f2316ef086 /drivers/video/b2r2/b2r2_node_split.c
parent120f212a32bacf646199d56ae5186f1a12772ba2 (diff)
b2r2: Correct support for 24/32bit (A)YUV(8)888
Order of the color components has been corrected to match the specification of the formats. ST-Ericsson ID: 341178 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I9211ccce6a099b89fe247bc2ed486aa2bc6c6ac8 Signed-off-by: Maciej Socha <maciej.socha@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25429 Reviewed-by: QATOOLS Reviewed-by: QATEST Reviewed-by: Robert FEKETE <robert.fekete@stericsson.com> Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Diffstat (limited to 'drivers/video/b2r2/b2r2_node_split.c')
-rw-r--r--drivers/video/b2r2/b2r2_node_split.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/video/b2r2/b2r2_node_split.c b/drivers/video/b2r2/b2r2_node_split.c
index c2b7e048dd5..90674e0e540 100644
--- a/drivers/video/b2r2/b2r2_node_split.c
+++ b/drivers/video/b2r2/b2r2_node_split.c
@@ -46,6 +46,13 @@ static const u32 vmx_rgb_to_yuv[] = {
B2R2_VMX3_RGB_TO_YUV_601_VIDEO,
};
+static const u32 vmx_rgb_to_blt_yuv888[] = {
+ B2R2_VMX0_RGB_TO_BLT_YUV888_601_VIDEO,
+ B2R2_VMX1_RGB_TO_BLT_YUV888_601_VIDEO,
+ B2R2_VMX2_RGB_TO_BLT_YUV888_601_VIDEO,
+ B2R2_VMX3_RGB_TO_BLT_YUV888_601_VIDEO,
+};
+
static const u32 vmx_yuv_to_rgb[] = {
B2R2_VMX0_YUV_TO_RGB_601_VIDEO,
B2R2_VMX1_YUV_TO_RGB_601_VIDEO,
@@ -53,6 +60,13 @@ static const u32 vmx_yuv_to_rgb[] = {
B2R2_VMX3_YUV_TO_RGB_601_VIDEO,
};
+static const u32 vmx_blt_yuv888_to_rgb[] = {
+ B2R2_VMX0_BLT_YUV888_TO_RGB_601_VIDEO,
+ B2R2_VMX1_BLT_YUV888_TO_RGB_601_VIDEO,
+ B2R2_VMX2_BLT_YUV888_TO_RGB_601_VIDEO,
+ B2R2_VMX3_BLT_YUV888_TO_RGB_601_VIDEO,
+};
+
static const u32 vmx_yvu_to_rgb[] = {
B2R2_VMX0_YVU_TO_RGB_601_VIDEO,
B2R2_VMX1_YVU_TO_RGB_601_VIDEO,
@@ -252,6 +266,32 @@ int b2r2_node_split_analyze(const struct b2r2_blt_request *req,
goto unsupported;
}
+ /* Unsupported formats on src */
+ switch (req->user_req.src_img.fmt) {
+ case B2R2_BLT_FMT_24_BIT_YUV888:
+ case B2R2_BLT_FMT_32_BIT_AYUV8888:
+ if (!is_rgb_fmt(req->user_req.dst_img.fmt)) {
+ ret = -ENOSYS;
+ goto unsupported;
+ }
+ break;
+ default:
+ break;
+ }
+
+ /* Unsupported formats on dst */
+ switch (req->user_req.dst_img.fmt) {
+ case B2R2_BLT_FMT_24_BIT_YUV888:
+ case B2R2_BLT_FMT_32_BIT_AYUV8888:
+ if (!is_rgb_fmt(req->user_req.src_img.fmt)) {
+ ret = -ENOSYS;
+ goto unsupported;
+ }
+ break;
+ default:
+ break;
+ }
+
if ((this->flags & B2R2_BLT_FLAG_SOURCE_COLOR_KEY) &&
(is_yuv_fmt(req->user_req.src_img.fmt) ||
req->user_req.src_img.fmt == B2R2_BLT_FMT_1_BIT_A1 ||
@@ -651,6 +691,9 @@ static int analyze_fmt_conv(struct b2r2_node_split_buf *src,
if (is_rgb_fmt(src->fmt)) {
if (is_yvu_fmt(dst->fmt))
*vmx = &vmx_rgb_to_yvu[0];
+ else if (dst->fmt == B2R2_BLT_FMT_24_BIT_YUV888 ||
+ dst->fmt == B2R2_BLT_FMT_32_BIT_AYUV8888)
+ *vmx = &vmx_rgb_to_blt_yuv888[0];
else if (is_yuv_fmt(dst->fmt))
*vmx = &vmx_rgb_to_yuv[0];
else if (is_bgr_fmt(dst->fmt))
@@ -660,14 +703,30 @@ static int analyze_fmt_conv(struct b2r2_node_split_buf *src,
*vmx = &vmx_yvu_to_rgb[0];
else if (is_bgr_fmt(dst->fmt))
*vmx = &vmx_yvu_to_bgr[0];
+ else if (dst->fmt == B2R2_BLT_FMT_24_BIT_YUV888 ||
+ dst->fmt == B2R2_BLT_FMT_32_BIT_AYUV8888)
+ BUG_ON(1);
else if (is_yuv_fmt(dst->fmt) &&
!is_yvu_fmt(dst->fmt))
*vmx = &vmx_yvu_to_yuv[0];
+ } else if (src->fmt == B2R2_BLT_FMT_24_BIT_YUV888 ||
+ src->fmt == B2R2_BLT_FMT_32_BIT_AYUV8888) {
+ if (is_rgb_fmt(dst->fmt))
+ *vmx = &vmx_blt_yuv888_to_rgb[0];
+ else
+ /*
+ * not supported, b2r2_node_split_analyze()
+ * should have returned ENOSYS.
+ */
+ BUG_ON(1);
} else if (is_yuv_fmt(src->fmt)) {
if (is_rgb_fmt(dst->fmt))
*vmx = &vmx_yuv_to_rgb[0];
else if (is_bgr_fmt(dst->fmt))
*vmx = &vmx_yuv_to_bgr[0];
+ else if (dst->fmt == B2R2_BLT_FMT_24_BIT_YUV888 ||
+ dst->fmt == B2R2_BLT_FMT_32_BIT_AYUV8888)
+ BUG_ON(1);
else if (is_yvu_fmt(dst->fmt))
*vmx = &vmx_yvu_to_yuv[0];
} else if (is_bgr_fmt(src->fmt)) {
@@ -675,6 +734,9 @@ static int analyze_fmt_conv(struct b2r2_node_split_buf *src,
*vmx = &vmx_rgb_to_bgr[0];
else if (is_yvu_fmt(dst->fmt))
*vmx = &vmx_bgr_to_yvu[0];
+ else if (dst->fmt == B2R2_BLT_FMT_24_BIT_YUV888 ||
+ dst->fmt == B2R2_BLT_FMT_32_BIT_AYUV8888)
+ BUG_ON(1);
else if (is_yuv_fmt(dst->fmt))
*vmx = &vmx_bgr_to_yuv[0];
}