(V4L2_CID_MPEG_MFC_BASE + 230)
#define V4L2_CID_MPEG_VIDEO_TRANSFER_CHARACTERISTICS \
(V4L2_CID_MPEG_MFC_BASE + 231)
+#define V4L2_CID_MPEG_VIDEO_STATIC_INFO_ENABLE \
+ (V4L2_CID_MPEG_MFC_BASE + 232)
#define V4L2_CID_MPEG_VIDEO_BPG_THUMBNAIL_SIZE \
(V4L2_CID_MPEG_MFC_BASE + 250)
#define ENC_SET_RATIO_OF_INTRA (1 << 8)
#define ENC_SET_COLOR_ASPECT (1 << 9)
#define ENC_SET_HP_BITRATE_CONTROL (1 << 10)
+#define ENC_SET_STATIC_INFO (1 << 11)
#define MFC_VER_MAJOR(dev) ((dev->pdata->ip_ver >> 8) & 0xFF)
#define MFC_VER_MINOR(dev) (dev->pdata->ip_ver & 0xFF)
(dev->fw.date >= 0x171023))
#define FW_HAS_HP_BITRATE_CONTROL(dev) (FROM_MFCV11X(dev) && \
(dev->fw.date >= 0x180314))
+#define FW_HAS_ENC_STATIC_INFO(dev) (IS_MFCV13X(dev) && \
+ (dev->fw.date >= 0x180314))
#endif /* __S5P_MFC_COMMON_H */
u32 transfer_characteristics;
u32 matrix_coefficients;
+ u32 static_info_enable;
+ u32 max_pic_average_light;
+ u32 max_content_light;
+ u32 max_display_luminance;
+ u32 min_display_luminance;
+ u32 white_point;
+ u32 display_primaries_0;
+ u32 display_primaries_1;
+ u32 display_primaries_2;
+
union {
struct s5p_mfc_h264_enc_params h264;
struct s5p_mfc_mpeg4_enc_params mpeg4;
if (FW_HAS_HP_BITRATE_CONTROL(dev))
val |= ENC_SET_HP_BITRATE_CONTROL;
+ if (FW_HAS_ENC_STATIC_INFO(dev))
+ val |= ENC_SET_STATIC_INFO;
+
return val;
}
case V4L2_CID_MPEG_VIDEO_HIERARCHICAL_BITRATE_CTRL:
p->hier_bitrate_ctrl = ctrl->value;
break;
+ case V4L2_CID_MPEG_VIDEO_STATIC_INFO_ENABLE:
+ p->static_info_enable = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_MAX_PIC_AVERAGE_LIGHT:
+ p->max_pic_average_light = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_MAX_CONTENT_LIGHT:
+ p->max_content_light = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_MAX_DISPLAY_LUMINANCE:
+ p->max_display_luminance = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_MIN_DISPLAY_LUMINANCE:
+ p->min_display_luminance = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_WHITE_POINT:
+ p->white_point = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_DISPLAY_PRIMARIES_0:
+ p->display_primaries_0 = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_DISPLAY_PRIMARIES_1:
+ p->display_primaries_1 = ctrl->value;
+ break;
+ case V4L2_CID_MPEG_VIDEO_SEI_DISPLAY_PRIMARIES_2:
+ p->display_primaries_2 = ctrl->value;
+ break;
default:
mfc_err_ctx("Invalid control: 0x%08x\n", ctrl->id);
ret = -EINVAL;
.step = 1,
.default_value = 1,
},
+ {
+ .id = V4L2_CID_MPEG_VIDEO_STATIC_INFO_ENABLE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Static info enable",
+ .minimum = 0,
+ .maximum = 1,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_MAX_PIC_AVERAGE_LIGHT,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Max pic average light",
+ .minimum = 0,
+ .maximum = 0xFFFF,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_MAX_CONTENT_LIGHT,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Max content light",
+ .minimum = 0,
+ .maximum = 0xFFFF,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_MAX_DISPLAY_LUMINANCE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Max display luminance",
+ .minimum = INT_MIN,
+ .maximum = INT_MAX,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_MIN_DISPLAY_LUMINANCE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Min display luminance",
+ .minimum = INT_MIN,
+ .maximum = INT_MAX,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_WHITE_POINT,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "White point",
+ .minimum = INT_MIN,
+ .maximum = INT_MAX,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_DISPLAY_PRIMARIES_0,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Display primaries 0",
+ .minimum = INT_MIN,
+ .maximum = INT_MAX,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_DISPLAY_PRIMARIES_1,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Display primaries 1",
+ .minimum = INT_MIN,
+ .maximum = INT_MAX,
+ .step = 1,
+ .default_value = 0,
+ },
+ {
+ .id = V4L2_CID_MPEG_VIDEO_SEI_DISPLAY_PRIMARIES_2,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Display primaries 2",
+ .minimum = INT_MIN,
+ .maximum = INT_MAX,
+ .step = 1,
+ .default_value = 0,
+ },
};
#define NUM_CTRLS ARRAY_SIZE(controls)
reg &= ~(0x1 << 24);
}
MFC_WRITEL(reg, S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
- mfc_debug(2, "H264 ENC Color aspect: range:%s, pri:%d, trans:%d, mat:%d\n",
+ mfc_debug(2, "[HDR] H264 ENC Color aspect: range(%s), pri(%d), trans(%d), mat(%d)\n",
p->color_range ? "Full" : "Limited", p->colour_primaries,
p->transfer_characteristics, p->matrix_coefficients);
} else {
reg &= ~(0x1 << 25);
reg |= p->color_range << 25;
MFC_WRITEL(reg, S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
- mfc_debug(2, "VP9 ENC Color aspect: range:%s, space: %d\n",
+ mfc_debug(2, "[HDR] VP9 ENC Color aspect: range(%s), space(%d)\n",
p->color_range ? "Full" : "Limited", p->colour_primaries);
} else {
MFC_WRITEL(0, S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
reg &= ~(0x1 << 24);
}
MFC_WRITEL(reg, S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
- mfc_debug(2, "HEVC ENC Color aspect: range:%s, pri:%d, trans:%d, mat:%d\n",
+ mfc_debug(2, "[HDR] HEVC ENC Color aspect: range(%s), pri(%d), trans(%d), mat(%d)\n",
p->color_range ? "Full" : "Limited", p->colour_primaries,
p->transfer_characteristics, p->matrix_coefficients);
} else {
MFC_WRITEL(0, S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
}
+ if (FW_HAS_ENC_STATIC_INFO(dev) && p->static_info_enable && ctx->is_10bit) {
+ reg = MFC_READL(S5P_FIMV_E_HEVC_OPTIONS_2);
+ /* HDR_STATIC_INFO_ENABLE */
+ reg |= p->static_info_enable;
+ MFC_WRITEL(reg, S5P_FIMV_E_HEVC_OPTIONS_2);
+ /* MAX_PIC_AVERAGE_LIGHT & MAX_CONTENT_LIGHT */
+ reg = p->max_pic_average_light;
+ reg |= (p->max_content_light << 16);
+ MFC_WRITEL(reg, S5P_FIMV_E_CONTENT_LIGHT_LEVEL_INFO_SEI);
+ /* MAX_DISPLAY_LUMINANCE */
+ MFC_WRITEL(p->max_display_luminance, S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_0);
+ /* MIN DISPLAY LUMINANCE */
+ MFC_WRITEL(p->min_display_luminance, S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_1);
+ /* WHITE_POINT */
+ MFC_WRITEL(p->white_point, S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_2);
+ /* DISPLAY PRIMARIES_0 */
+ MFC_WRITEL(p->display_primaries_0, S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_3);
+ /* DISPLAY PRIMARIES_1 */
+ MFC_WRITEL(p->display_primaries_1, S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_4);
+ /* DISPLAY PRIMARIES_2 */
+ MFC_WRITEL(p->display_primaries_2, S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_5);
+
+ mfc_debug(2, "[HDR] HEVC ENC static info: enable(%d), max_pic(0x%x), max_content(0x%x)\n",
+ p->static_info_enable, p->max_pic_average_light, p->max_content_light);
+ mfc_debug(2, "[HDR] max_disp(0x%x), min_disp(0x%x), white_point(0x%x)\n",
+ p->max_display_luminance, p->min_display_luminance, p->white_point);
+ mfc_debug(2, "[HDR] disp_pri_0(0x%x), disp_pri_1(0x%x), disp_pri_2(0x%x)\n",
+ p->display_primaries_0, p->display_primaries_1, p->display_primaries_2);
+ } else {
+ reg = MFC_READL(S5P_FIMV_E_HEVC_OPTIONS_2);
+ /* HDR_STATIC_INFO_ENABLE */
+ reg &= ~(0x1);
+ MFC_WRITEL(reg, S5P_FIMV_E_HEVC_OPTIONS_2);
+ }
+
mfc_debug_leave();
}
#define S5P_FIMV_E_VP8_FILTER_OPTION 0xFDB4
#define S5P_FIMV_E_VP8_GOLDEN_FRAME_OPTION 0xFDB8
+#define S5P_FIMV_E_HEVC_OPTIONS_2 0xFDC4
+
#define S5P_FIMV_E_HEVC_OPTIONS 0xFDD4
#define S5P_FIMV_E_HEVC_REFRESH_PERIOD 0xFDD8
#define S5P_FIMV_E_HEVC_CHROMA_QP_OFFSET 0xFDDC
#define S5P_FIMV_E_VP8_NAL_CONTROL 0xFDF0
#define S5P_FIMV_E_VP9_NAL_CONTROL 0xFDF4
+#define S5P_FIMV_E_CONTENT_LIGHT_LEVEL_INFO_SEI 0xFDF8
+#define S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_0 0xFDFC
+#define S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_1 0xFE00
+#define S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_2 0xFE04
+#define S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_3 0xFE08
+#define S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_4 0xFE0C
+#define S5P_FIMV_E_MASTERING_DISPLAY_COLOUR_VOLUME_SEI_5 0xFE10
#define S5P_FIMV_REG_CLEAR_BEGIN 0xf000