Loading drivers/media/platform/msm/vidc/hfi_packetization.c +63 −71 Original line number Diff line number Diff line Loading @@ -998,7 +998,7 @@ int create_pkt_cmd_session_set_property( return -EINVAL; hfi->frame_rate = prop->frame_rate; pkt->size += sizeof(u32) + sizeof(struct hfi_frame_rate); pkt->size += sizeof(struct hfi_frame_rate); break; } case HAL_PARAM_UNCOMPRESSED_FORMAT_SELECT: Loading @@ -1021,8 +1021,7 @@ int create_pkt_cmd_session_set_property( hfi->format = hal_to_hfi_type( HAL_PARAM_UNCOMPRESSED_FORMAT_SELECT, prop->format); pkt->size += sizeof(u32) + sizeof(struct hfi_uncompressed_format_select); pkt->size += sizeof(struct hfi_uncompressed_format_select); break; } case HAL_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO: Loading @@ -1045,7 +1044,7 @@ int create_pkt_cmd_session_set_property( hfi->height = prop->height; hfi->width = prop->width; pkt->size += sizeof(u32) + sizeof(struct hfi_frame_size); pkt->size += sizeof(struct hfi_frame_size); break; } case HAL_CONFIG_REALTIME: Loading @@ -1053,7 +1052,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_CONFIG_REALTIME, (((struct hal_enable *) pdata)->enable)); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_BUFFER_COUNT_ACTUAL: Loading @@ -1076,8 +1075,7 @@ int create_pkt_cmd_session_set_property( else return -EINVAL; pkt->size += sizeof(u32) + sizeof(struct hfi_buffer_count_actual); pkt->size += sizeof(struct hfi_buffer_count_actual); break; } Loading @@ -1096,8 +1094,7 @@ int create_pkt_cmd_session_set_property( hfi->nal_stream_format_select = hal_to_hfi_type( HAL_PARAM_NAL_STREAM_FORMAT_SELECT, prop->nal_stream_format_select); pkt->size += sizeof(u32) + sizeof(struct hfi_nal_stream_format_select); pkt->size += sizeof(struct hfi_nal_stream_format_select); break; } case HAL_PARAM_VDEC_OUTPUT_ORDER: Loading @@ -1118,7 +1115,7 @@ int create_pkt_cmd_session_set_property( *data); break; } pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_PICTURE_TYPE_DECODE: Loading @@ -1130,7 +1127,7 @@ int create_pkt_cmd_session_set_property( hfi = (struct hfi_enable_picture *) &pkt->rg_property_data[1]; hfi->picture_type = ((struct hfi_enable_picture *)pdata)->picture_type; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_OUTPUT2_KEEP_ASPECT_RATIO: Loading @@ -1138,7 +1135,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VDEC_OUTPUT2_KEEP_ASPECT_RATIO, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_MULTI_STREAM: Loading @@ -1158,7 +1155,7 @@ int create_pkt_cmd_session_set_property( else return -EINVAL; hfi->enable = prop->enable; pkt->size += sizeof(u32) + sizeof(struct hfi_multi_stream); pkt->size += sizeof(struct hfi_multi_stream); break; } case HAL_CONFIG_VDEC_MB_ERROR_MAP_REPORTING: Loading @@ -1166,7 +1163,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_CONFIG_VDEC_MB_ERROR_MAP_REPORTING, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_SYNC_FRAME_DECODE: Loading @@ -1174,7 +1171,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VDEC_THUMBNAIL_MODE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_SECURE: Loading @@ -1182,7 +1179,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_SECURE_SESSION, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_SYNC_FRAME_SEQUENCE_HEADER: Loading @@ -1190,13 +1187,12 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_REQUEST_IFRAME: pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME; pkt->size += sizeof(u32); break; case HAL_CONFIG_VENC_TARGET_BITRATE: { Loading @@ -1207,7 +1203,7 @@ int create_pkt_cmd_session_set_property( hfi = (struct hfi_bitrate *) &pkt->rg_property_data[1]; hfi->bit_rate = ((struct hal_bitrate *)pdata)->bit_rate; hfi->layer_id = ((struct hal_bitrate *)pdata)->layer_id; pkt->size += sizeof(u32) + sizeof(struct hfi_bitrate); pkt->size += sizeof(struct hfi_bitrate); break; } case HAL_PARAM_PROFILE_LEVEL_CURRENT: Loading @@ -1233,7 +1229,7 @@ int create_pkt_cmd_session_set_property( prop->profile); } pkt->size += sizeof(u32) + sizeof(struct hfi_profile_level); pkt->size += sizeof(struct hfi_profile_level); break; } case HAL_PARAM_VENC_H264_ENTROPY_CONTROL: Loading @@ -1250,8 +1246,7 @@ int create_pkt_cmd_session_set_property( prop->entropy_mode); hfi->cabac_model = HFI_H264_CABAC_MODEL_0; pkt->size += sizeof(u32) + sizeof( struct hfi_h264_entropy_control); pkt->size += sizeof(struct hfi_h264_entropy_control); break; } case HAL_PARAM_VENC_RATE_CONTROL: Loading @@ -1266,7 +1261,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[1] = HFI_RATE_CONTROL_OFF; break; case HAL_RATE_CONTROL_CBR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_CBR_VFR; pkt->rg_property_data[1] = HFI_RATE_CONTROL_CBR_CFR; break; case HAL_RATE_CONTROL_VBR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_VBR_CFR; Loading @@ -1274,14 +1269,19 @@ int create_pkt_cmd_session_set_property( case HAL_RATE_CONTROL_MBR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_MBR_CFR; break; case HAL_RATE_CONTROL_CBR_VFR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_CBR_VFR; break; case HAL_RATE_CONTROL_MBR_VFR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_MBR_VFR; break; default: dprintk(VIDC_ERR, "Invalid Rate control setting: %pK\n", pdata); break; } pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_H264_DEBLOCK_CONTROL: Loading Loading @@ -1309,8 +1309,7 @@ int create_pkt_cmd_session_set_property( } hfi->slice_alpha_offset = prop->slice_alpha_offset; hfi->slice_beta_offset = prop->slice_beta_offset; pkt->size += sizeof(u32) + sizeof(struct hfi_h264_db_control); pkt->size += sizeof(struct hfi_h264_db_control); break; } case HAL_CONFIG_VENC_FRAME_QP: Loading @@ -1325,7 +1324,7 @@ int create_pkt_cmd_session_set_property( hal_quant->qpb << 16; hfi->layer_id = hal_quant->layer_id; hfi->enable = hal_quant->enable; pkt->size += sizeof(u32) + sizeof(struct hfi_quantization); pkt->size += sizeof(struct hfi_quantization); break; } case HAL_PARAM_VENC_SESSION_QP_RANGE: Loading Loading @@ -1353,8 +1352,7 @@ int create_pkt_cmd_session_set_property( hfi->max_qp.layer_id = hal_range->layer_id; hfi->min_qp.layer_id = hal_range->layer_id; pkt->size += sizeof(u32) + sizeof(struct hfi_quantization_range); pkt->size += sizeof(struct hfi_quantization_range); break; } case HAL_CONFIG_VENC_INTRA_PERIOD: Loading @@ -1366,7 +1364,7 @@ int create_pkt_cmd_session_set_property( hfi = (struct hfi_intra_period *) &pkt->rg_property_data[1]; memcpy(hfi, (struct hfi_intra_period *) pdata, sizeof(struct hfi_intra_period)); pkt->size += sizeof(u32) + sizeof(struct hfi_intra_period); pkt->size += sizeof(struct hfi_intra_period); break; } case HAL_CONFIG_VENC_IDR_PERIOD: Loading @@ -1376,7 +1374,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD; hfi = (struct hfi_idr_period *) &pkt->rg_property_data[1]; hfi->idr_period = ((struct hfi_idr_period *) pdata)->idr_period; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_CONCEAL_COLOR: Loading @@ -1394,7 +1392,7 @@ int create_pkt_cmd_session_set_property( ((struct hfi_conceal_color *) pdata)-> conceal_color_10bit; } pkt->size += sizeof(u32) + sizeof(struct hfi_conceal_color); pkt->size += sizeof(struct hfi_conceal_color); break; } case HAL_PARAM_VPE_ROTATION: Loading Loading @@ -1442,7 +1440,7 @@ int create_pkt_cmd_session_set_property( rc = -EINVAL; break; } pkt->size += sizeof(u32) + sizeof(struct hfi_vpe_rotation_type); pkt->size += sizeof(struct hfi_vpe_rotation_type); break; } case HAL_PARAM_VENC_INTRA_REFRESH: Loading Loading @@ -1472,7 +1470,7 @@ int create_pkt_cmd_session_set_property( prop->mode); break; } pkt->size += sizeof(u32) + sizeof(struct hfi_intra_refresh); pkt->size += sizeof(struct hfi_intra_refresh); break; } case HAL_PARAM_VENC_MULTI_SLICE_CONTROL: Loading Loading @@ -1500,7 +1498,7 @@ int create_pkt_cmd_session_set_property( break; } hfi->slice_size = prop->slice_size; pkt->size += sizeof(u32) + sizeof(struct pkt->size += sizeof(struct hfi_multi_slice_control); break; } Loading @@ -1524,8 +1522,7 @@ int create_pkt_cmd_session_set_property( id); rc = -EINVAL; } pkt->size += sizeof(u32) + sizeof(struct hfi_index_extradata_config); pkt->size += sizeof(struct hfi_index_extradata_config); break; } case HAL_PARAM_VENC_SLICE_DELIVERY_MODE: Loading @@ -1533,7 +1530,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_SLICE_DELIVERY_MODE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_VUI_TIMING_INFO: Loading @@ -1549,8 +1546,7 @@ int create_pkt_cmd_session_set_property( hfi->fixed_frame_rate = timing_info->fixed_frame_rate; hfi->time_scale = timing_info->time_scale; pkt->size += sizeof(u32) + sizeof(struct hfi_vui_timing_info); pkt->size += sizeof(struct hfi_vui_timing_info); break; } case HAL_PARAM_VENC_GENERATE_AUDNAL: Loading @@ -1558,7 +1554,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_GENERATE_AUDNAL, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_PRESERVE_TEXT_QUALITY: Loading @@ -1566,7 +1562,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_PRESERVE_TEXT_QUALITY, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_LTRMODE: Loading @@ -1580,7 +1576,7 @@ int create_pkt_cmd_session_set_property( hfi->ltr_mode = get_hfi_ltr_mode(hal->mode); hfi->ltr_count = hal->count; hfi->trust_mode = hal->trust_mode; pkt->size += sizeof(u32) + sizeof(struct hfi_ltr_mode); pkt->size += sizeof(struct hfi_ltr_mode); break; } case HAL_CONFIG_VENC_USELTRFRAME: Loading @@ -1594,7 +1590,7 @@ int create_pkt_cmd_session_set_property( hfi->frames = hal->frames; hfi->ref_ltr = hal->ref_ltr; hfi->use_constrnt = hal->use_constraint; pkt->size += sizeof(u32) + sizeof(struct hfi_ltr_use); pkt->size += sizeof(struct hfi_ltr_use); break; } case HAL_CONFIG_VENC_MARKLTRFRAME: Loading @@ -1606,7 +1602,7 @@ int create_pkt_cmd_session_set_property( HFI_PROPERTY_CONFIG_VENC_MARKLTRFRAME; hfi = (struct hfi_ltr_mark *) &pkt->rg_property_data[1]; hfi->mark_frame = hal->mark_frame; pkt->size += sizeof(u32) + sizeof(struct hfi_ltr_mark); pkt->size += sizeof(struct hfi_ltr_mark); break; } case HAL_PARAM_VENC_HIER_P_MAX_ENH_LAYERS: Loading @@ -1614,7 +1610,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_VENC_HIER_P_MAX_NUM_ENH_LAYER; pkt->rg_property_data[1] = *(u32 *)pdata; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_HIER_P_NUM_FRAMES: Loading @@ -1622,7 +1618,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER; pkt->rg_property_data[1] = *(u32 *)pdata; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_DISABLE_RC_TIMESTAMP: Loading @@ -1630,7 +1626,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_DISABLE_RC_TIMESTAMP, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VPE_COLOR_SPACE_CONVERSION: Loading @@ -1653,8 +1649,7 @@ int create_pkt_cmd_session_set_property( sizeof(hfi->csc_matrix)); memcpy(hfi->csc_bias, hal->csc_bias, sizeof(hfi->csc_bias)); memcpy(hfi->csc_limit, hal->csc_limit, sizeof(hfi->csc_limit)); pkt->size += sizeof(u32) + sizeof(struct hfi_vpe_color_space_conversion); pkt->size += sizeof(struct hfi_vpe_color_space_conversion); break; } case HAL_PARAM_VENC_VPX_ERROR_RESILIENCE_MODE: Loading @@ -1662,7 +1657,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_VPX_ERROR_RESILIENCE_MODE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_CONFIG_VENC_PERF_MODE: Loading @@ -1683,7 +1678,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_PERF_MODE; pkt->rg_property_data[1] = hfi_perf_mode; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_HIER_P_HYBRID_MODE: Loading @@ -1703,7 +1698,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[1] = hal_to_hfi_type( HAL_PARAM_VENC_MBI_STATISTICS_MODE, *(u32 *)pdata); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_BASELAYER_PRIORITYID: Loading @@ -1711,7 +1706,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_BASELAYER_PRIORITYID; pkt->rg_property_data[1] = *(u32 *)pdata; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PROPERTY_PARAM_VENC_ASPECT_RATIO: Loading @@ -1725,8 +1720,7 @@ int create_pkt_cmd_session_set_property( &pkt->rg_property_data[1]; memcpy(hfi, hal, sizeof(struct hfi_aspect_ratio)); pkt->size += sizeof(u32) + sizeof(struct hfi_aspect_ratio); pkt->size += sizeof(struct hfi_aspect_ratio); break; } case HAL_PARAM_VENC_BITRATE_TYPE: Loading @@ -1734,7 +1728,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_BITRATE_TYPE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_H264_TRANSFORM_8x8: Loading @@ -1742,7 +1736,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_H264_8X8_TRANSFORM, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_VIDEO_SIGNAL_INFO: Loading @@ -1762,7 +1756,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_VENC_VIDEO_SIGNAL_INFO; pkt->size += sizeof(u32) + sizeof(*signal_info); pkt->size += sizeof(*signal_info); break; } case HAL_PARAM_VENC_IFRAMESIZE_TYPE: Loading @@ -1789,7 +1783,7 @@ int create_pkt_cmd_session_set_property( return -ENOTSUPP; } pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_VENC_IFRAMESIZE; pkt->size += sizeof(u32) + sizeof(struct hfi_iframe_size); pkt->size += sizeof(struct hfi_iframe_size); break; } case HAL_PARAM_BUFFER_SIZE_MINIMUM: Loading @@ -1812,8 +1806,7 @@ int create_pkt_cmd_session_set_property( else return -EINVAL; pkt->size += sizeof(u32) + sizeof(struct hfi_buffer_size_minimum); pkt->size += sizeof(struct hfi_buffer_size_minimum); break; } case HAL_PARAM_SYNC_BASED_INTERRUPT: Loading @@ -1821,7 +1814,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_SYNC_BASED_INTERRUPT, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_LOW_LATENCY: Loading @@ -1832,7 +1825,7 @@ int create_pkt_cmd_session_set_property( HFI_PROPERTY_PARAM_VENC_LOW_LATENCY_MODE; hfi = (struct hfi_enable *) &pkt->rg_property_data[1]; hfi->enable = ((struct hal_enable *) pdata)->enable; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_BLUR_RESOLUTION: Loading @@ -1852,7 +1845,7 @@ int create_pkt_cmd_session_set_property( hfi->height = prop->height; hfi->width = prop->width; pkt->size += sizeof(u32) + sizeof(struct hfi_frame_size); pkt->size += sizeof(struct hfi_frame_size); break; } case HAL_PARAM_VIDEO_CORES_USAGE: Loading @@ -1866,7 +1859,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE; pkt->size += sizeof(u32) + sizeof(*core_info); pkt->size += sizeof(*core_info); break; } case HAL_PARAM_VIDEO_WORK_MODE: Loading @@ -1881,7 +1874,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_WORK_MODE; pkt->size += sizeof(u32) + sizeof(*work_mode); pkt->size += sizeof(*work_mode); break; } case HAL_PARAM_VIDEO_WORK_ROUTE: Loading @@ -1894,7 +1887,7 @@ int create_pkt_cmd_session_set_property( hal->video_work_route; pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_WORK_ROUTE; pkt->size += sizeof(u32) + sizeof(*prop); pkt->size += sizeof(*prop); break; } case HAL_PARAM_VENC_HDR10_PQ_SEI: Loading @@ -1909,8 +1902,7 @@ int create_pkt_cmd_session_set_property( &pkt->rg_property_data[1]; memcpy(hfi, prop, sizeof(*hfi)); pkt->size += sizeof(u32) + sizeof(struct hfi_hdr10_pq_sei); pkt->size += sizeof(struct hfi_hdr10_pq_sei); break; } /* FOLLOWING PROPERTIES ARE NOT IMPLEMENTED IN CORE YET */ Loading drivers/media/platform/msm/vidc/msm_venc.c +10 −5 Original line number Diff line number Diff line Loading @@ -44,9 +44,11 @@ static const char *const mpeg_video_rate_control[] = { "VBR CFR", "CBR VFR", "CBR CFR", "MBR CFR", "RC OFF", "CBR VFR", "MBR VFR", NULL }; Loading Loading @@ -330,14 +332,16 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { .name = "Video Framerate and Bitrate Control", .type = V4L2_CTRL_TYPE_MENU, .minimum = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR, .maximum = V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF, .maximum = V4L2_MPEG_VIDEO_BITRATE_MODE_MBR_VFR, .default_value = V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF, .step = 0, .menu_skip_mask = ~( (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_MBR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF) (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_MBR_VFR) ), .qmenu = mpeg_video_rate_control, }, Loading Loading @@ -1312,7 +1316,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) { struct v4l2_ctrl *hybrid_hp = TRY_GET_CTRL( V4L2_CID_MPEG_VIDC_VIDEO_HYBRID_HIERP_MODE); if ((ctrl->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) if ((ctrl->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) && hybrid_hp->val) { dprintk(VIDC_ERR, "CBR_VFR not allowed with Hybrid HP\n"); Loading Loading @@ -1729,7 +1733,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) rate_control = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_BITRATE_MODE); if ((rate_control->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) if ((rate_control->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) && ctrl->val) { dprintk(VIDC_ERR, "Hybrid HP not allowed with CBR_VFR\n"); Loading Loading @@ -2010,6 +2014,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) switch (rc_mode->val) { case V4L2_MPEG_VIDEO_BITRATE_MODE_VBR: case V4L2_MPEG_VIDEO_BITRATE_MODE_CBR: case V4L2_MPEG_VIDEO_BITRATE_MODE_MBR: cfr = true; break; Loading drivers/media/platform/msm/vidc/msm_vidc_clocks.c +4 −1 Original line number Diff line number Diff line Loading @@ -1048,6 +1048,8 @@ int msm_vidc_decide_work_route(struct msm_vidc_inst *inst) V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE); if ((rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) || (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) || (slice_mode == V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES)) { pdata.video_work_route = 1; Loading Loading @@ -1127,7 +1129,8 @@ int msm_vidc_decide_work_mode(struct msm_vidc_inst *inst) V4L2_CID_MPEG_VIDEO_BITRATE_MODE); if ((slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE) && ((rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) || (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR))) (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR) || (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR_VFR))) pdata.video_work_mode = VIDC_WORK_MODE_2; } else { return -EINVAL; Loading drivers/media/platform/msm/vidc/vidc_hfi_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -581,6 +581,8 @@ enum hal_rate_control { HAL_RATE_CONTROL_CBR, HAL_RATE_CONTROL_MBR, HAL_RATE_CONTROL_OFF, HAL_RATE_CONTROL_CBR_VFR, HAL_RATE_CONTROL_MBR_VFR, HAL_UNUSED_RC = 0x10000000, }; Loading drivers/media/platform/msm/vidc/vidc_hfi_helper.h +1 −1 Original line number Diff line number Diff line Loading @@ -942,7 +942,7 @@ struct hfi_cmd_session_set_property_packet { u32 packet_type; u32 session_id; u32 num_properties; u32 rg_property_data[0]; u32 rg_property_data[1]; }; struct hfi_cmd_session_set_buffers_packet { Loading Loading
drivers/media/platform/msm/vidc/hfi_packetization.c +63 −71 Original line number Diff line number Diff line Loading @@ -998,7 +998,7 @@ int create_pkt_cmd_session_set_property( return -EINVAL; hfi->frame_rate = prop->frame_rate; pkt->size += sizeof(u32) + sizeof(struct hfi_frame_rate); pkt->size += sizeof(struct hfi_frame_rate); break; } case HAL_PARAM_UNCOMPRESSED_FORMAT_SELECT: Loading @@ -1021,8 +1021,7 @@ int create_pkt_cmd_session_set_property( hfi->format = hal_to_hfi_type( HAL_PARAM_UNCOMPRESSED_FORMAT_SELECT, prop->format); pkt->size += sizeof(u32) + sizeof(struct hfi_uncompressed_format_select); pkt->size += sizeof(struct hfi_uncompressed_format_select); break; } case HAL_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO: Loading @@ -1045,7 +1044,7 @@ int create_pkt_cmd_session_set_property( hfi->height = prop->height; hfi->width = prop->width; pkt->size += sizeof(u32) + sizeof(struct hfi_frame_size); pkt->size += sizeof(struct hfi_frame_size); break; } case HAL_CONFIG_REALTIME: Loading @@ -1053,7 +1052,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_CONFIG_REALTIME, (((struct hal_enable *) pdata)->enable)); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_BUFFER_COUNT_ACTUAL: Loading @@ -1076,8 +1075,7 @@ int create_pkt_cmd_session_set_property( else return -EINVAL; pkt->size += sizeof(u32) + sizeof(struct hfi_buffer_count_actual); pkt->size += sizeof(struct hfi_buffer_count_actual); break; } Loading @@ -1096,8 +1094,7 @@ int create_pkt_cmd_session_set_property( hfi->nal_stream_format_select = hal_to_hfi_type( HAL_PARAM_NAL_STREAM_FORMAT_SELECT, prop->nal_stream_format_select); pkt->size += sizeof(u32) + sizeof(struct hfi_nal_stream_format_select); pkt->size += sizeof(struct hfi_nal_stream_format_select); break; } case HAL_PARAM_VDEC_OUTPUT_ORDER: Loading @@ -1118,7 +1115,7 @@ int create_pkt_cmd_session_set_property( *data); break; } pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_PICTURE_TYPE_DECODE: Loading @@ -1130,7 +1127,7 @@ int create_pkt_cmd_session_set_property( hfi = (struct hfi_enable_picture *) &pkt->rg_property_data[1]; hfi->picture_type = ((struct hfi_enable_picture *)pdata)->picture_type; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_OUTPUT2_KEEP_ASPECT_RATIO: Loading @@ -1138,7 +1135,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VDEC_OUTPUT2_KEEP_ASPECT_RATIO, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_MULTI_STREAM: Loading @@ -1158,7 +1155,7 @@ int create_pkt_cmd_session_set_property( else return -EINVAL; hfi->enable = prop->enable; pkt->size += sizeof(u32) + sizeof(struct hfi_multi_stream); pkt->size += sizeof(struct hfi_multi_stream); break; } case HAL_CONFIG_VDEC_MB_ERROR_MAP_REPORTING: Loading @@ -1166,7 +1163,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_CONFIG_VDEC_MB_ERROR_MAP_REPORTING, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_SYNC_FRAME_DECODE: Loading @@ -1174,7 +1171,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VDEC_THUMBNAIL_MODE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_SECURE: Loading @@ -1182,7 +1179,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_SECURE_SESSION, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_SYNC_FRAME_SEQUENCE_HEADER: Loading @@ -1190,13 +1187,12 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_REQUEST_IFRAME: pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME; pkt->size += sizeof(u32); break; case HAL_CONFIG_VENC_TARGET_BITRATE: { Loading @@ -1207,7 +1203,7 @@ int create_pkt_cmd_session_set_property( hfi = (struct hfi_bitrate *) &pkt->rg_property_data[1]; hfi->bit_rate = ((struct hal_bitrate *)pdata)->bit_rate; hfi->layer_id = ((struct hal_bitrate *)pdata)->layer_id; pkt->size += sizeof(u32) + sizeof(struct hfi_bitrate); pkt->size += sizeof(struct hfi_bitrate); break; } case HAL_PARAM_PROFILE_LEVEL_CURRENT: Loading @@ -1233,7 +1229,7 @@ int create_pkt_cmd_session_set_property( prop->profile); } pkt->size += sizeof(u32) + sizeof(struct hfi_profile_level); pkt->size += sizeof(struct hfi_profile_level); break; } case HAL_PARAM_VENC_H264_ENTROPY_CONTROL: Loading @@ -1250,8 +1246,7 @@ int create_pkt_cmd_session_set_property( prop->entropy_mode); hfi->cabac_model = HFI_H264_CABAC_MODEL_0; pkt->size += sizeof(u32) + sizeof( struct hfi_h264_entropy_control); pkt->size += sizeof(struct hfi_h264_entropy_control); break; } case HAL_PARAM_VENC_RATE_CONTROL: Loading @@ -1266,7 +1261,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[1] = HFI_RATE_CONTROL_OFF; break; case HAL_RATE_CONTROL_CBR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_CBR_VFR; pkt->rg_property_data[1] = HFI_RATE_CONTROL_CBR_CFR; break; case HAL_RATE_CONTROL_VBR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_VBR_CFR; Loading @@ -1274,14 +1269,19 @@ int create_pkt_cmd_session_set_property( case HAL_RATE_CONTROL_MBR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_MBR_CFR; break; case HAL_RATE_CONTROL_CBR_VFR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_CBR_VFR; break; case HAL_RATE_CONTROL_MBR_VFR: pkt->rg_property_data[1] = HFI_RATE_CONTROL_MBR_VFR; break; default: dprintk(VIDC_ERR, "Invalid Rate control setting: %pK\n", pdata); break; } pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_H264_DEBLOCK_CONTROL: Loading Loading @@ -1309,8 +1309,7 @@ int create_pkt_cmd_session_set_property( } hfi->slice_alpha_offset = prop->slice_alpha_offset; hfi->slice_beta_offset = prop->slice_beta_offset; pkt->size += sizeof(u32) + sizeof(struct hfi_h264_db_control); pkt->size += sizeof(struct hfi_h264_db_control); break; } case HAL_CONFIG_VENC_FRAME_QP: Loading @@ -1325,7 +1324,7 @@ int create_pkt_cmd_session_set_property( hal_quant->qpb << 16; hfi->layer_id = hal_quant->layer_id; hfi->enable = hal_quant->enable; pkt->size += sizeof(u32) + sizeof(struct hfi_quantization); pkt->size += sizeof(struct hfi_quantization); break; } case HAL_PARAM_VENC_SESSION_QP_RANGE: Loading Loading @@ -1353,8 +1352,7 @@ int create_pkt_cmd_session_set_property( hfi->max_qp.layer_id = hal_range->layer_id; hfi->min_qp.layer_id = hal_range->layer_id; pkt->size += sizeof(u32) + sizeof(struct hfi_quantization_range); pkt->size += sizeof(struct hfi_quantization_range); break; } case HAL_CONFIG_VENC_INTRA_PERIOD: Loading @@ -1366,7 +1364,7 @@ int create_pkt_cmd_session_set_property( hfi = (struct hfi_intra_period *) &pkt->rg_property_data[1]; memcpy(hfi, (struct hfi_intra_period *) pdata, sizeof(struct hfi_intra_period)); pkt->size += sizeof(u32) + sizeof(struct hfi_intra_period); pkt->size += sizeof(struct hfi_intra_period); break; } case HAL_CONFIG_VENC_IDR_PERIOD: Loading @@ -1376,7 +1374,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD; hfi = (struct hfi_idr_period *) &pkt->rg_property_data[1]; hfi->idr_period = ((struct hfi_idr_period *) pdata)->idr_period; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VDEC_CONCEAL_COLOR: Loading @@ -1394,7 +1392,7 @@ int create_pkt_cmd_session_set_property( ((struct hfi_conceal_color *) pdata)-> conceal_color_10bit; } pkt->size += sizeof(u32) + sizeof(struct hfi_conceal_color); pkt->size += sizeof(struct hfi_conceal_color); break; } case HAL_PARAM_VPE_ROTATION: Loading Loading @@ -1442,7 +1440,7 @@ int create_pkt_cmd_session_set_property( rc = -EINVAL; break; } pkt->size += sizeof(u32) + sizeof(struct hfi_vpe_rotation_type); pkt->size += sizeof(struct hfi_vpe_rotation_type); break; } case HAL_PARAM_VENC_INTRA_REFRESH: Loading Loading @@ -1472,7 +1470,7 @@ int create_pkt_cmd_session_set_property( prop->mode); break; } pkt->size += sizeof(u32) + sizeof(struct hfi_intra_refresh); pkt->size += sizeof(struct hfi_intra_refresh); break; } case HAL_PARAM_VENC_MULTI_SLICE_CONTROL: Loading Loading @@ -1500,7 +1498,7 @@ int create_pkt_cmd_session_set_property( break; } hfi->slice_size = prop->slice_size; pkt->size += sizeof(u32) + sizeof(struct pkt->size += sizeof(struct hfi_multi_slice_control); break; } Loading @@ -1524,8 +1522,7 @@ int create_pkt_cmd_session_set_property( id); rc = -EINVAL; } pkt->size += sizeof(u32) + sizeof(struct hfi_index_extradata_config); pkt->size += sizeof(struct hfi_index_extradata_config); break; } case HAL_PARAM_VENC_SLICE_DELIVERY_MODE: Loading @@ -1533,7 +1530,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_SLICE_DELIVERY_MODE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_VUI_TIMING_INFO: Loading @@ -1549,8 +1546,7 @@ int create_pkt_cmd_session_set_property( hfi->fixed_frame_rate = timing_info->fixed_frame_rate; hfi->time_scale = timing_info->time_scale; pkt->size += sizeof(u32) + sizeof(struct hfi_vui_timing_info); pkt->size += sizeof(struct hfi_vui_timing_info); break; } case HAL_PARAM_VENC_GENERATE_AUDNAL: Loading @@ -1558,7 +1554,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_GENERATE_AUDNAL, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_PRESERVE_TEXT_QUALITY: Loading @@ -1566,7 +1562,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_PRESERVE_TEXT_QUALITY, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_LTRMODE: Loading @@ -1580,7 +1576,7 @@ int create_pkt_cmd_session_set_property( hfi->ltr_mode = get_hfi_ltr_mode(hal->mode); hfi->ltr_count = hal->count; hfi->trust_mode = hal->trust_mode; pkt->size += sizeof(u32) + sizeof(struct hfi_ltr_mode); pkt->size += sizeof(struct hfi_ltr_mode); break; } case HAL_CONFIG_VENC_USELTRFRAME: Loading @@ -1594,7 +1590,7 @@ int create_pkt_cmd_session_set_property( hfi->frames = hal->frames; hfi->ref_ltr = hal->ref_ltr; hfi->use_constrnt = hal->use_constraint; pkt->size += sizeof(u32) + sizeof(struct hfi_ltr_use); pkt->size += sizeof(struct hfi_ltr_use); break; } case HAL_CONFIG_VENC_MARKLTRFRAME: Loading @@ -1606,7 +1602,7 @@ int create_pkt_cmd_session_set_property( HFI_PROPERTY_CONFIG_VENC_MARKLTRFRAME; hfi = (struct hfi_ltr_mark *) &pkt->rg_property_data[1]; hfi->mark_frame = hal->mark_frame; pkt->size += sizeof(u32) + sizeof(struct hfi_ltr_mark); pkt->size += sizeof(struct hfi_ltr_mark); break; } case HAL_PARAM_VENC_HIER_P_MAX_ENH_LAYERS: Loading @@ -1614,7 +1610,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_VENC_HIER_P_MAX_NUM_ENH_LAYER; pkt->rg_property_data[1] = *(u32 *)pdata; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_HIER_P_NUM_FRAMES: Loading @@ -1622,7 +1618,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER; pkt->rg_property_data[1] = *(u32 *)pdata; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_DISABLE_RC_TIMESTAMP: Loading @@ -1630,7 +1626,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_DISABLE_RC_TIMESTAMP, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VPE_COLOR_SPACE_CONVERSION: Loading @@ -1653,8 +1649,7 @@ int create_pkt_cmd_session_set_property( sizeof(hfi->csc_matrix)); memcpy(hfi->csc_bias, hal->csc_bias, sizeof(hfi->csc_bias)); memcpy(hfi->csc_limit, hal->csc_limit, sizeof(hfi->csc_limit)); pkt->size += sizeof(u32) + sizeof(struct hfi_vpe_color_space_conversion); pkt->size += sizeof(struct hfi_vpe_color_space_conversion); break; } case HAL_PARAM_VENC_VPX_ERROR_RESILIENCE_MODE: Loading @@ -1662,7 +1657,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_VPX_ERROR_RESILIENCE_MODE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_CONFIG_VENC_PERF_MODE: Loading @@ -1683,7 +1678,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_PERF_MODE; pkt->rg_property_data[1] = hfi_perf_mode; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PARAM_VENC_HIER_P_HYBRID_MODE: Loading @@ -1703,7 +1698,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[1] = hal_to_hfi_type( HAL_PARAM_VENC_MBI_STATISTICS_MODE, *(u32 *)pdata); pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_BASELAYER_PRIORITYID: Loading @@ -1711,7 +1706,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VENC_BASELAYER_PRIORITYID; pkt->rg_property_data[1] = *(u32 *)pdata; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_PROPERTY_PARAM_VENC_ASPECT_RATIO: Loading @@ -1725,8 +1720,7 @@ int create_pkt_cmd_session_set_property( &pkt->rg_property_data[1]; memcpy(hfi, hal, sizeof(struct hfi_aspect_ratio)); pkt->size += sizeof(u32) + sizeof(struct hfi_aspect_ratio); pkt->size += sizeof(struct hfi_aspect_ratio); break; } case HAL_PARAM_VENC_BITRATE_TYPE: Loading @@ -1734,7 +1728,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_BITRATE_TYPE, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_H264_TRANSFORM_8x8: Loading @@ -1742,7 +1736,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_VENC_H264_8X8_TRANSFORM, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_VIDEO_SIGNAL_INFO: Loading @@ -1762,7 +1756,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_VENC_VIDEO_SIGNAL_INFO; pkt->size += sizeof(u32) + sizeof(*signal_info); pkt->size += sizeof(*signal_info); break; } case HAL_PARAM_VENC_IFRAMESIZE_TYPE: Loading @@ -1789,7 +1783,7 @@ int create_pkt_cmd_session_set_property( return -ENOTSUPP; } pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_VENC_IFRAMESIZE; pkt->size += sizeof(u32) + sizeof(struct hfi_iframe_size); pkt->size += sizeof(struct hfi_iframe_size); break; } case HAL_PARAM_BUFFER_SIZE_MINIMUM: Loading @@ -1812,8 +1806,7 @@ int create_pkt_cmd_session_set_property( else return -EINVAL; pkt->size += sizeof(u32) + sizeof(struct hfi_buffer_size_minimum); pkt->size += sizeof(struct hfi_buffer_size_minimum); break; } case HAL_PARAM_SYNC_BASED_INTERRUPT: Loading @@ -1821,7 +1814,7 @@ int create_pkt_cmd_session_set_property( create_pkt_enable(pkt->rg_property_data, HFI_PROPERTY_PARAM_SYNC_BASED_INTERRUPT, ((struct hal_enable *)pdata)->enable); pkt->size += sizeof(u32) + sizeof(struct hfi_enable); pkt->size += sizeof(struct hfi_enable); break; } case HAL_PARAM_VENC_LOW_LATENCY: Loading @@ -1832,7 +1825,7 @@ int create_pkt_cmd_session_set_property( HFI_PROPERTY_PARAM_VENC_LOW_LATENCY_MODE; hfi = (struct hfi_enable *) &pkt->rg_property_data[1]; hfi->enable = ((struct hal_enable *) pdata)->enable; pkt->size += sizeof(u32) * 2; pkt->size += sizeof(u32); break; } case HAL_CONFIG_VENC_BLUR_RESOLUTION: Loading @@ -1852,7 +1845,7 @@ int create_pkt_cmd_session_set_property( hfi->height = prop->height; hfi->width = prop->width; pkt->size += sizeof(u32) + sizeof(struct hfi_frame_size); pkt->size += sizeof(struct hfi_frame_size); break; } case HAL_PARAM_VIDEO_CORES_USAGE: Loading @@ -1866,7 +1859,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE; pkt->size += sizeof(u32) + sizeof(*core_info); pkt->size += sizeof(*core_info); break; } case HAL_PARAM_VIDEO_WORK_MODE: Loading @@ -1881,7 +1874,7 @@ int create_pkt_cmd_session_set_property( pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_WORK_MODE; pkt->size += sizeof(u32) + sizeof(*work_mode); pkt->size += sizeof(*work_mode); break; } case HAL_PARAM_VIDEO_WORK_ROUTE: Loading @@ -1894,7 +1887,7 @@ int create_pkt_cmd_session_set_property( hal->video_work_route; pkt->rg_property_data[0] = HFI_PROPERTY_PARAM_WORK_ROUTE; pkt->size += sizeof(u32) + sizeof(*prop); pkt->size += sizeof(*prop); break; } case HAL_PARAM_VENC_HDR10_PQ_SEI: Loading @@ -1909,8 +1902,7 @@ int create_pkt_cmd_session_set_property( &pkt->rg_property_data[1]; memcpy(hfi, prop, sizeof(*hfi)); pkt->size += sizeof(u32) + sizeof(struct hfi_hdr10_pq_sei); pkt->size += sizeof(struct hfi_hdr10_pq_sei); break; } /* FOLLOWING PROPERTIES ARE NOT IMPLEMENTED IN CORE YET */ Loading
drivers/media/platform/msm/vidc/msm_venc.c +10 −5 Original line number Diff line number Diff line Loading @@ -44,9 +44,11 @@ static const char *const mpeg_video_rate_control[] = { "VBR CFR", "CBR VFR", "CBR CFR", "MBR CFR", "RC OFF", "CBR VFR", "MBR VFR", NULL }; Loading Loading @@ -330,14 +332,16 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { .name = "Video Framerate and Bitrate Control", .type = V4L2_CTRL_TYPE_MENU, .minimum = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR, .maximum = V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF, .maximum = V4L2_MPEG_VIDEO_BITRATE_MODE_MBR_VFR, .default_value = V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF, .step = 0, .menu_skip_mask = ~( (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_MBR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF) (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_RC_OFF) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) | (1 << V4L2_MPEG_VIDEO_BITRATE_MODE_MBR_VFR) ), .qmenu = mpeg_video_rate_control, }, Loading Loading @@ -1312,7 +1316,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) { struct v4l2_ctrl *hybrid_hp = TRY_GET_CTRL( V4L2_CID_MPEG_VIDC_VIDEO_HYBRID_HIERP_MODE); if ((ctrl->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) if ((ctrl->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) && hybrid_hp->val) { dprintk(VIDC_ERR, "CBR_VFR not allowed with Hybrid HP\n"); Loading Loading @@ -1729,7 +1733,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) rate_control = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_BITRATE_MODE); if ((rate_control->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) if ((rate_control->val == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) && ctrl->val) { dprintk(VIDC_ERR, "Hybrid HP not allowed with CBR_VFR\n"); Loading Loading @@ -2010,6 +2014,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) switch (rc_mode->val) { case V4L2_MPEG_VIDEO_BITRATE_MODE_VBR: case V4L2_MPEG_VIDEO_BITRATE_MODE_CBR: case V4L2_MPEG_VIDEO_BITRATE_MODE_MBR: cfr = true; break; Loading
drivers/media/platform/msm/vidc/msm_vidc_clocks.c +4 −1 Original line number Diff line number Diff line Loading @@ -1048,6 +1048,8 @@ int msm_vidc_decide_work_route(struct msm_vidc_inst *inst) V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE); if ((rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) || (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR) || (slice_mode == V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES)) { pdata.video_work_route = 1; Loading Loading @@ -1127,7 +1129,8 @@ int msm_vidc_decide_work_mode(struct msm_vidc_inst *inst) V4L2_CID_MPEG_VIDEO_BITRATE_MODE); if ((slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE) && ((rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) || (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR))) (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR) || (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR_VFR))) pdata.video_work_mode = VIDC_WORK_MODE_2; } else { return -EINVAL; Loading
drivers/media/platform/msm/vidc/vidc_hfi_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -581,6 +581,8 @@ enum hal_rate_control { HAL_RATE_CONTROL_CBR, HAL_RATE_CONTROL_MBR, HAL_RATE_CONTROL_OFF, HAL_RATE_CONTROL_CBR_VFR, HAL_RATE_CONTROL_MBR_VFR, HAL_UNUSED_RC = 0x10000000, }; Loading
drivers/media/platform/msm/vidc/vidc_hfi_helper.h +1 −1 Original line number Diff line number Diff line Loading @@ -942,7 +942,7 @@ struct hfi_cmd_session_set_property_packet { u32 packet_type; u32 session_id; u32 num_properties; u32 rg_property_data[0]; u32 rg_property_data[1]; }; struct hfi_cmd_session_set_buffers_packet { Loading