|
|
@@ -254,6 +254,15 @@ static struct vpe_fmt vpe_formats[] = {
|
|
|
&vpdma_yuv_fmts[VPDMA_DATA_FMT_C420],
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ .name = "NV21 YUV 420 co-planar",
|
|
|
+ .fourcc = V4L2_PIX_FMT_NV21,
|
|
|
+ .types = VPE_FMT_TYPE_CAPTURE | VPE_FMT_TYPE_OUTPUT,
|
|
|
+ .coplanar = 1,
|
|
|
+ .vpdma_fmt = { &vpdma_yuv_fmts[VPDMA_DATA_FMT_Y420],
|
|
|
+ &vpdma_yuv_fmts[VPDMA_DATA_FMT_CB420],
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
.name = "YUYV 422 packed",
|
|
|
.fourcc = V4L2_PIX_FMT_YUYV,
|
|
|
@@ -700,7 +709,8 @@ static void set_cfg_modes(struct vpe_ctx *ctx)
|
|
|
* Cfg Mode 1: YUV422 source, disable upsampler, DEI is de-interlacing.
|
|
|
*/
|
|
|
|
|
|
- if (fmt->fourcc == V4L2_PIX_FMT_NV12)
|
|
|
+ if (fmt->fourcc == V4L2_PIX_FMT_NV12 ||
|
|
|
+ fmt->fourcc == V4L2_PIX_FMT_NV21)
|
|
|
cfg_mode = 0;
|
|
|
|
|
|
write_field(us1_reg0, cfg_mode, VPE_US_MODE_MASK, VPE_US_MODE_SHIFT);
|
|
|
@@ -715,7 +725,8 @@ static void set_line_modes(struct vpe_ctx *ctx)
|
|
|
struct vpe_fmt *fmt = ctx->q_data[Q_DATA_SRC].fmt;
|
|
|
int line_mode = 1;
|
|
|
|
|
|
- if (fmt->fourcc == V4L2_PIX_FMT_NV12)
|
|
|
+ if (fmt->fourcc == V4L2_PIX_FMT_NV12 ||
|
|
|
+ fmt->fourcc == V4L2_PIX_FMT_NV21)
|
|
|
line_mode = 0; /* double lines to line buffer */
|
|
|
|
|
|
/* regs for now */
|
|
|
@@ -777,7 +788,8 @@ static void set_dst_registers(struct vpe_ctx *ctx)
|
|
|
*/
|
|
|
val |= VPE_DS_SRC_DEI_SCALER | VPE_CSC_SRC_DEI_SCALER;
|
|
|
|
|
|
- if (fmt->fourcc != V4L2_PIX_FMT_NV12)
|
|
|
+ if (fmt->fourcc != V4L2_PIX_FMT_NV12 &&
|
|
|
+ fmt->fourcc != V4L2_PIX_FMT_NV21)
|
|
|
val |= VPE_DS_BYPASS;
|
|
|
|
|
|
mmr_adb->out_fmt_reg[0] = val;
|
|
|
@@ -1143,8 +1155,13 @@ static void add_in_dtd(struct vpe_ctx *ctx, int port)
|
|
|
|
|
|
if (field) {
|
|
|
int height = q_data->height / 2;
|
|
|
- int bpp = fmt->fourcc == V4L2_PIX_FMT_NV12 ?
|
|
|
- 1 : (vpdma_fmt->depth >> 3);
|
|
|
+ int bpp;
|
|
|
+
|
|
|
+ if (fmt->fourcc == V4L2_PIX_FMT_NV12 ||
|
|
|
+ fmt->fourcc == V4L2_PIX_FMT_NV21)
|
|
|
+ bpp = 1;
|
|
|
+ else
|
|
|
+ bpp = vpdma_fmt->depth >> 3;
|
|
|
|
|
|
if (plane)
|
|
|
height /= 2;
|
|
|
@@ -1162,7 +1179,8 @@ static void add_in_dtd(struct vpe_ctx *ctx, int port)
|
|
|
frame_width = q_data->c_rect.width;
|
|
|
frame_height = q_data->c_rect.height;
|
|
|
|
|
|
- if (p_data->vb_part && fmt->fourcc == V4L2_PIX_FMT_NV12)
|
|
|
+ if (p_data->vb_part && (fmt->fourcc == V4L2_PIX_FMT_NV12 ||
|
|
|
+ fmt->fourcc == V4L2_PIX_FMT_NV21))
|
|
|
frame_height /= 2;
|
|
|
|
|
|
vpdma_add_in_dtd(&ctx->desc_list, q_data->width, stride,
|