Added to check the supported F/W version of each feature.
It is possible to check whether each feature is supported by using the command below.
echo 1 > d/mfc/mfc_info
Change-Id: I7b28ac5136951c8bac0c4ae5856bb9e9c37a0b3f
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
s5p_mfc_release_hwlock_dev(dev);
- if (dev->pdata->nal_q) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->nal_q)) {
dev->nal_q_handle = s5p_mfc_nal_q_create(dev);
if (dev->nal_q_handle == NULL)
mfc_err_dev("NAL Q: Can't create nal q\n");
if (!np)
return;
+ /* MFC version */
of_property_read_u32(np, "ip_ver", &pdata->ip_ver);
+
+ /* Debug mode */
of_property_read_u32(np, "debug_mode", &pdata->debug_mode);
+
+ /* Sysmmu check */
of_property_read_u32(np, "share_sysmmu", &pdata->share_sysmmu);
of_property_read_u32(np, "axid_mask", &pdata->axid_mask);
of_property_read_u32(np, "mfc_fault_num", &pdata->mfc_fault_num);
- of_property_read_u32(np, "nal_q", &pdata->nal_q);
- of_property_read_u32(np, "skype", &pdata->skype);
- of_property_read_u32(np, "black_bar", &pdata->black_bar);
- of_property_read_u32(np, "color_aspect_dec", &pdata->color_aspect_dec);
- of_property_read_u32(np, "static_info_dec", &pdata->static_info_dec);
- of_property_read_u32(np, "color_aspect_enc", &pdata->color_aspect_enc);
- of_property_read_u32(np, "static_info_enc", &pdata->static_info_enc);
+
+ /* Features */
+ of_property_read_u32_array(np, "nal_q", &pdata->nal_q.support, 2);
+ of_property_read_u32_array(np, "skype", &pdata->skype.support, 2);
+ of_property_read_u32_array(np, "black_bar", &pdata->black_bar.support, 2);
+ of_property_read_u32_array(np, "color_aspect_dec", &pdata->color_aspect_dec.support, 2);
+ of_property_read_u32_array(np, "static_info_dec", &pdata->static_info_dec.support, 2);
+ 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);
+
+ /* Encoder default parameter */
of_property_read_u32(np, "enc_param_num", &pdata->enc_param_num);
if (pdata->enc_param_num) {
of_property_read_u32_array(np, "enc_param_addr",
- &pdata->enc_param_addr[0], pdata->enc_param_num);
+ pdata->enc_param_addr, pdata->enc_param_num);
of_property_read_u32_array(np, "enc_param_val",
- &pdata->enc_param_val[0], pdata->enc_param_num);
+ pdata->enc_param_val, pdata->enc_param_num);
}
+
#ifdef CONFIG_MFC_USE_BUS_DEVFREQ
+ /* QoS */
of_property_read_u32(np, "num_qos_steps", &pdata->num_qos_steps);
of_property_read_u32(np, "max_qos_steps", &pdata->max_qos_steps);
of_property_read_u32(np, "max_mb", &pdata->max_mb);
#define MFC_VER_MAJOR(dev) ((dev->pdata->ip_ver >> 8) & 0xFF)
#define MFC_VER_MINOR(dev) (dev->pdata->ip_ver & 0xFF)
+#define MFC_FEATURE_SUPPORT(dev, f) ((f).support && ((dev)->fw.date >= (f).version))
+
#endif /* __S5P_MFC_COMMON_H */
};
#endif
+struct s5p_mfc_feature {
+ unsigned int support;
+ unsigned int version;
+};
+
struct s5p_mfc_platdata {
+ /* MFC version */
unsigned int ip_ver;
+ /* Debug mode */
unsigned int debug_mode;
+ /* Sysmmu check */
unsigned int share_sysmmu;
unsigned int axid_mask;
unsigned int mfc_fault_num;
- unsigned int nal_q;
- unsigned int skype;
- unsigned int black_bar;
- unsigned int color_aspect_dec;
- unsigned int static_info_dec;
- unsigned int color_aspect_enc;
- unsigned int static_info_enc;
+ /* Features */
+ struct s5p_mfc_feature nal_q;
+ struct s5p_mfc_feature skype;
+ struct s5p_mfc_feature black_bar;
+ struct s5p_mfc_feature color_aspect_dec;
+ struct s5p_mfc_feature static_info_dec;
+ struct s5p_mfc_feature color_aspect_enc;
+ struct s5p_mfc_feature static_info_enc;
+ /* Encoder default parameter */
unsigned int enc_param_num;
unsigned int enc_param_addr[MFC_MAX_DEFAULT_PARAM];
unsigned int enc_param_val[MFC_MAX_DEFAULT_PARAM];
#ifdef CONFIG_MFC_USE_BUS_DEVFREQ
+ /* QoS */
unsigned int num_qos_steps;
unsigned int max_qos_steps;
unsigned int max_mb;
seq_printf(s, "[HWLOCK] bits: %#lx, dev: %#lx, owned_by_irq = %d, wl_count = %d\n",
dev->hwlock.bits, dev->hwlock.dev,
dev->hwlock.owned_by_irq, dev->hwlock.wl_count);
+ seq_printf(s, "[DEBUG MODE] %s\n", dev->pdata->debug_mode ? "enabled" : "disabled");
seq_printf(s, "[MMCACHE] %s(%s)\n",
dev->has_mmcache ? "supported" : "not supported",
dev->mmcache.is_on_status ? "enabled" : "disabled");
+ seq_printf(s, "[FEATURES] nal_q: %d(0x%x), skype: %d(0x%x), black_bar: %d(0x%x)\n",
+ dev->pdata->nal_q.support, dev->pdata->nal_q.version,
+ dev->pdata->skype.support, dev->pdata->skype.version,
+ dev->pdata->black_bar.support, dev->pdata->black_bar.version);
+ seq_printf(s, " color_aspect_dec: %d(0x%x), enc: %d(0x%x)\n",
+ dev->pdata->color_aspect_dec.support, dev->pdata->color_aspect_dec.version,
+ dev->pdata->color_aspect_enc.support, dev->pdata->color_aspect_enc.version);
+ seq_printf(s, " static_info_dec: %d(0x%x), enc: %d(0x%x)\n",
+ dev->pdata->static_info_dec.support, dev->pdata->static_info_dec.version,
+ dev->pdata->static_info_enc.support, dev->pdata->static_info_enc.version);
if (dev->nal_q_handle)
seq_printf(s, "[NAL-Q] state: %d\n", dev->nal_q_handle->nal_q_state);
int val = 0;
val |= DEC_SET_DYNAMIC_DPB;
- if (dev->pdata->skype)
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->skype))
val |= DEC_SET_SKYPE_FLAG;
return val;
val |= ENC_SET_SPARE_SIZE;
val |= ENC_SET_TEMP_SVC_CH;
- if (dev->pdata->skype)
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->skype))
val |= ENC_SET_SKYPE_FLAG;
val |= ENC_SET_ROI_CONTROL;
val |= ENC_SET_PVC_MODE;
val |= ENC_SET_RATIO_OF_INTRA;
- if (dev->pdata->color_aspect_enc)
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_enc))
val |= ENC_SET_COLOR_ASPECT;
val |= ENC_SET_HP_BITRATE_CONTROL;
- if (dev->pdata->static_info_enc)
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->static_info_enc))
val |= ENC_SET_STATIC_INFO;
return val;
MFC_WRITEL(reg, S5P_FIMV_E_H264_FRAME_PACKING_SEI_INFO);
}
- if (dev->pdata->color_aspect_enc && p->check_color_range) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_enc) && p->check_color_range) {
reg = MFC_READL(S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
/* VIDEO_SIGNAL_TYPE_FLAG */
reg |= 0x1 << 31;
reg |= p_vp9->rc_min_qp_p & 0xFF;
MFC_WRITEL(reg, S5P_FIMV_E_RC_QP_BOUND_PB);
- if (dev->pdata->color_aspect_enc && p->check_color_range) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_enc) && p->check_color_range) {
reg = MFC_READL(S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
/* VIDEO_SIGNAL_TYPE_FLAG */
reg |= 0x1 << 31;
MFC_WRITEL(reg, S5P_FIMV_E_RC_ROI_CTRL);
mfc_debug(3, "ROI: HEVC ROI enable\n");
- if (dev->pdata->color_aspect_enc && p->check_color_range) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_enc) && p->check_color_range) {
reg = MFC_READL(S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
/* VIDEO_SIGNAL_TYPE_FLAG */
reg |= 0x1 << 31;
MFC_WRITEL(0, S5P_FIMV_E_VIDEO_SIGNAL_TYPE);
}
- if (dev->pdata->static_info_enc && p->static_info_enable && ctx->is_10bit) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->static_info_enc) &&
+ 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;
/* Enable realloc interface if SEI is enabled */
if (dec->sei_parse)
reg |= (0x1 << S5P_FIMV_D_SEI_ENABLE_NEED_INIT_BUFFER_SHIFT);
- if (dev->pdata->static_info_dec) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->static_info_dec)) {
reg |= (0x1 << S5P_FIMV_D_SEI_ENABLE_CONTENT_LIGHT_SHIFT);
reg |= (0x1 << S5P_FIMV_D_SEI_ENABLE_MASTERING_DISPLAY_SHIFT);
}
unsigned int is_content_light = 0, is_display_colour = 0;
unsigned int i, index;
- if (dev->pdata->color_aspect_dec) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_dec)) {
is_video_signal_type = s5p_mfc_get_video_signal_type();
is_colour_description = s5p_mfc_get_colour_description();
}
- if (dev->pdata->static_info_dec) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->static_info_dec)) {
is_content_light = s5p_mfc_get_sei_avail_content_light();
is_display_colour = s5p_mfc_get_sei_avail_mastering_display();
}
- if (dev->pdata->black_bar && dec->detect_black_bar)
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->black_bar) && dec->detect_black_bar)
mfc_handle_black_bar_info(dev, ctx);
else
dec->black_bar_updated = 0;
}
}
- if (IS_VP9_DEC(ctx) && dev->pdata->color_aspect_dec) {
+ if (IS_VP9_DEC(ctx) && MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_dec)) {
if (dec->color_space != S5P_FIMV_D_COLOR_UNKNOWN) {
ref_mb->vb.reserved2 |= (1 << 3);
mfc_debug(2, "color space parsed\n");
unsigned int disp_err;
int i, index;
- if (dev->pdata->color_aspect_dec) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_dec)) {
is_video_signal_type = ((pOutStr->VideoSignalType
>> S5P_FIMV_D_VIDEO_SIGNAL_TYPE_FLAG_SHIFT)
& S5P_FIMV_D_VIDEO_SIGNAL_TYPE_FLAG_MASK);
& S5P_FIMV_D_COLOUR_DESCRIPTION_FLAG_MASK);
}
- if (dev->pdata->static_info_dec) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->static_info_dec)) {
is_content_light = ((pOutStr->SeiAvail >> S5P_FIMV_D_SEI_AVAIL_CONTENT_LIGHT_SHIFT)
& S5P_FIMV_D_SEI_AVAIL_CONTENT_LIGHT_MASK);
is_display_colour = ((pOutStr->SeiAvail >> S5P_FIMV_D_SEI_AVAIL_MASTERING_DISPLAY_SHIFT)
}
}
- if (IS_VP9_DEC(ctx) && dev->pdata->color_aspect_dec) {
+ if (IS_VP9_DEC(ctx) && MFC_FEATURE_SUPPORT(dev, dev->pdata->color_aspect_dec)) {
if (dec->color_space != S5P_FIMV_D_COLOR_UNKNOWN) {
ref_mb->vb.reserved2 |= (1 << 3);
mfc_debug(2, "NAL Q: color space parsed\n");
mfc_debug(2, "Dst addr [%d] = 0x%08llx\n", dst_index, dst_mb->addr[0][0]);
/* for debugging about black bar detection */
- if (dev->pdata->black_bar && dec->detect_black_bar) {
+ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->black_bar) && dec->detect_black_bar) {
for (i = 0; i < raw->num_planes; i++) {
dec->frame_vaddr[i][dec->frame_cnt] = vb2_plane_vaddr(&dst_mb->vb.vb2_buf, i);
dec->frame_daddr[i][dec->frame_cnt] = dst_mb->addr[0][i];