of_property_read_u32_array(np, "color_aspect_enc", &pdata->color_aspect_enc.support, 2);
of_property_read_u32_array(np, "static_info_enc", &pdata->static_info_enc.support, 2);
+ /* Default 10bit format for decoding */
+ of_property_read_u32(np, "P010_decoding", &pdata->P010_decoding);
+
/* Encoder default parameter */
of_property_read_u32(np, "enc_param_num", &pdata->enc_param_num);
if (pdata->enc_param_num) {
struct s5p_mfc_feature static_info_dec;
struct s5p_mfc_feature color_aspect_enc;
struct s5p_mfc_feature static_info_enc;
+ /* Default 10bit format for decoding */
+ unsigned int P010_decoding;
/* Encoder default parameter */
unsigned int enc_param_num;
unsigned int enc_param_addr[MFC_MAX_DEFAULT_PARAM];
static void mfc_dec_change_format(struct s5p_mfc_ctx *ctx)
{
+ struct s5p_mfc_dev *dev = ctx->dev;
u32 org_fmt = ctx->dst_fmt->fourcc;
if (ctx->is_10bit && ctx->is_422format) {
case V4L2_PIX_FMT_NV16M:
case V4L2_PIX_FMT_NV16M_S10B:
case V4L2_PIX_FMT_NV16M_P210:
- ctx->dst_fmt = mfc_dec_find_format(V4L2_PIX_FMT_NV12M_P010);
+ if (dev->pdata->P010_decoding)
+ ctx->dst_fmt = mfc_dec_find_format(V4L2_PIX_FMT_NV12M_P010);
+ else
+ ctx->dst_fmt = mfc_dec_find_format(V4L2_PIX_FMT_NV12M_S10B);
break;
case V4L2_PIX_FMT_NV21M:
case V4L2_PIX_FMT_NV61M:
ctx->dst_fmt = mfc_dec_find_format(V4L2_PIX_FMT_NV21M_S10B);
break;
default:
- ctx->dst_fmt = mfc_dec_find_format(V4L2_PIX_FMT_NV12M_P010);
+ if (dev->pdata->P010_decoding)
+ ctx->dst_fmt = mfc_dec_find_format(V4L2_PIX_FMT_NV12M_P010);
+ else
+ ctx->dst_fmt = mfc_dec_find_format(V4L2_PIX_FMT_NV12M_S10B);
break;
}
}
.mem_planes = 1,
},
{
- .name = "4:2:0 2 Planes Y/CbCr 10bit",
+ .name = "4:2:0 2 Planes Y/CbCr 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV12M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
.mem_planes = 2,
},
{
- .name = "4:2:0 2 Planes Y/CrCb 10bit",
+ .name = "4:2:0 2 Planes Y/CrCb 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV21M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
.mem_planes = 2,
},
{
- .name = "4:2:2 2 Planes Y/CbCr 10bit",
+ .name = "4:2:2 2 Planes Y/CbCr 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV16M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
.mem_planes = 2,
},
{
- .name = "4:2:2 2 Planes Y/CrCb 10bit",
+ .name = "4:2:2 2 Planes Y/CrCb 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV61M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
.mem_planes = 1,
},
{
- .name = "4:2:0 2 Planes Y/CbCr 10bit",
+ .name = "4:2:0 2 Planes Y/CbCr 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV12M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
.mem_planes = 2,
},
{
- .name = "4:2:0 2 Planes Y/CrCb 10bit",
+ .name = "4:2:0 2 Planes Y/CrCb 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV21M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
.mem_planes = 2,
},
{
- .name = "4:2:2 2 Planes Y/CbCr 10bit",
+ .name = "4:2:2 2 Planes Y/CbCr 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV16M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
.mem_planes = 2,
},
{
- .name = "4:2:2 2 Planes Y/CrCb 10bit",
+ .name = "4:2:2 2 Planes Y/CrCb 8+2 10bit",
.fourcc = V4L2_PIX_FMT_NV61M_S10B,
.codec_mode = MFC_FORMATS_NO_CODEC,
.type = MFC_FMT_RAW,
void s5p_mfc_set_pixel_format(struct s5p_mfc_dev *dev, unsigned int format)
{
unsigned int reg = 0;
- unsigned int pix_val, mem_type_10bit = 1;
+ unsigned int pix_val, mem_type_10bit = 0;
+
+ if (dev->pdata->P010_decoding)
+ mem_type_10bit = 1;
switch (format) {
case V4L2_PIX_FMT_NV12M:
break;
case V4L2_PIX_FMT_NV12M_P010:
case V4L2_PIX_FMT_NV16M_P210:
+ mem_type_10bit = 1;
pix_val = 0;
break;
case V4L2_PIX_FMT_NV21M_S10B:
break;
case V4L2_PIX_FMT_NV21M_P010:
case V4L2_PIX_FMT_NV61M_P210:
+ mem_type_10bit = 1;
pix_val = 1;
break;
default: