Loading drivers/media/platform/msm/vidc/hfi_packetization.c +29 −9 Original line number Diff line number Diff line Loading @@ -439,6 +439,8 @@ static int get_hfi_extradata_index(enum hal_extradata_id index) ret = HFI_PROPERTY_PARAM_VDEC_NUM_CONCEALED_MB; break; case HAL_EXTRADATA_ASPECT_RATIO: case HAL_EXTRADATA_INPUT_CROP: case HAL_EXTRADATA_DIGITAL_ZOOM: ret = HFI_PROPERTY_PARAM_INDEX_EXTRADATA; break; case HAL_EXTRADATA_MPEG2_SEQDISP: Loading @@ -460,6 +462,26 @@ static int get_hfi_extradata_index(enum hal_extradata_id index) return ret; } static int get_hfi_extradata_id(enum hal_extradata_id index) { int ret = 0; switch (index) { case HAL_EXTRADATA_ASPECT_RATIO: ret = MSM_VIDC_EXTRADATA_ASPECT_RATIO; break; case HAL_EXTRADATA_INPUT_CROP: ret = MSM_VIDC_EXTRADATA_INPUT_CROP; break; case HAL_EXTRADATA_DIGITAL_ZOOM: ret = MSM_VIDC_EXTRADATA_DIGITAL_ZOOM; break; default: ret = get_hfi_extradata_index(index); break; } return ret; } static u32 get_hfi_buf_mode(enum buffer_mode_type hal_buf_mode) { u32 buf_mode; Loading Loading @@ -615,6 +637,7 @@ int create_pkt_cmd_session_etb_encoder( pkt->filled_len = input_frame->filled_len; pkt->input_tag = input_frame->clnt_data; pkt->packet_buffer = (u8 *) input_frame->device_addr; pkt->extra_data_buffer = (u8 *) input_frame->extradata_addr; if (!pkt->packet_buffer) return -EINVAL; Loading Loading @@ -1430,23 +1453,20 @@ int create_pkt_cmd_session_set_property( { struct hfi_index_extradata_config *hfi; struct hal_extradata_enable *extra = pdata; int index = 0; int id = 0; pkt->rg_property_data[0] = get_hfi_extradata_index(extra->index); hfi = (struct hfi_index_extradata_config *) &pkt->rg_property_data[1]; hfi->enable = extra->enable; if (extra->index == HAL_EXTRADATA_ASPECT_RATIO) index = MSM_VIDC_EXTRADATA_ASPECT_RATIO; else index = get_hfi_extradata_index(extra->index); if (index) hfi->index_extra_data_id = index; id = get_hfi_extradata_id(extra->index); if (id) hfi->index_extra_data_id = id; else { dprintk(VIDC_WARN, "Failed to find extradata index: %d\n", index); "Failed to find extradata id: %d\n", id); rc = -EINVAL; } pkt->size += sizeof(u32) + Loading drivers/media/platform/msm/vidc/hfi_response_handler.c +1 −0 Original line number Diff line number Diff line Loading @@ -971,6 +971,7 @@ static void hfi_process_session_etb_done( data_done.input_done.offset = pkt->offset; data_done.input_done.filled_len = pkt->filled_len; data_done.input_done.packet_buffer = pkt->packet_buffer; data_done.input_done.extra_data_buffer = pkt->extra_data_buffer; data_done.input_done.status = hfi_map_err_status((u32) pkt->error_type); callback(SESSION_ETB_DONE, &data_done); Loading drivers/media/platform/msm/vidc/msm_venc.c +44 −10 Original line number Diff line number Diff line Loading @@ -866,7 +866,9 @@ static int msm_venc_queue_setup(struct vb2_queue *q, struct hfi_device *hdev; struct hal_buffer_requirements *buff_req; struct v4l2_ctrl *ctrl = NULL; u32 extradata = 0; u32 extradata = 0, extra_idx = 0; struct hal_buffer_requirements *buff_req_buffer = NULL; if (!q || !q->drv_priv) { dprintk(VIDC_ERR, "Invalid input\n"); return -EINVAL; Loading Loading @@ -901,7 +903,7 @@ static int msm_venc_queue_setup(struct vb2_queue *q, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); if (ctrl) extradata = v4l2_ctrl_g_ctrl(ctrl); if (extradata) if (extradata == V4L2_MPEG_VIDC_EXTRADATA_MULTISLICE_INFO) *num_planes = *num_planes + 1; inst->fmts[CAPTURE_PORT]->num_planes = *num_planes; for (i = 0; i < *num_planes; i++) { Loading Loading @@ -936,16 +938,30 @@ static int msm_venc_queue_setup(struct vb2_queue *q, property_id = HAL_PARAM_BUFFER_COUNT_ACTUAL; new_buf_count.buffer_type = HAL_BUFFER_INPUT; new_buf_count.buffer_count_actual = *num_buffers; ctrl = v4l2_ctrl_find(&inst->ctrl_handler, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); if (ctrl) extradata = v4l2_ctrl_g_ctrl(ctrl); if (extradata == V4L2_MPEG_VIDC_INDEX_EXTRADATA_INPUT_CROP) *num_planes = *num_planes + 1; inst->fmts[OUTPUT_PORT]->num_planes = *num_planes; rc = call_hfi_op(hdev, session_set_property, inst->session, property_id, &new_buf_count); dprintk(VIDC_DBG, "size = %d, alignment = %d, count = %d\n", inst->buff_req.buffer[0].buffer_size, inst->buff_req.buffer[0].buffer_alignment, inst->buff_req.buffer[0].buffer_count_actual); for (i = 0; i < *num_planes; i++) { sizes[i] = inst->fmts[OUTPUT_PORT]->get_frame_size( i, inst->prop.height[OUTPUT_PORT], sizes[0] = inst->fmts[OUTPUT_PORT]->get_frame_size( 0, inst->prop.height[OUTPUT_PORT], inst->prop.width[OUTPUT_PORT]); extra_idx = EXTRADATA_IDX(inst->fmts[OUTPUT_PORT]->num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); sizes[extra_idx] = buff_req_buffer ? buff_req_buffer->buffer_size : 0; } break; default: Loading Loading @@ -2429,6 +2445,18 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) "Failed to set OUTPUT framesize\n"); goto exit; } } else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { struct hal_buffer_requirements *buff_req_buffer = NULL; int extra_idx = 0; extra_idx = EXTRADATA_IDX(fmt->num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); f->fmt.pix_mp.plane_fmt[extra_idx].sizeimage = buff_req_buffer ? buff_req_buffer->buffer_size : 0; } } } else { dprintk(VIDC_ERR, "Buf type not recognized, type = %d\n", Loading @@ -2446,7 +2474,7 @@ int msm_venc_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) int i; u32 height, width; int extra_idx = 0; struct hal_buffer_requirements *buff_req_buffer; struct hal_buffer_requirements *buff_req_buffer = NULL; if (!inst || !f) { dprintk(VIDC_ERR, Loading Loading @@ -2474,9 +2502,15 @@ int msm_venc_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) } extra_idx = EXTRADATA_IDX(fmt->num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_OUTPUT); else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); f->fmt.pix_mp.plane_fmt[extra_idx].sizeimage = buff_req_buffer ? buff_req_buffer->buffer_size : 0; Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +17 −1 Original line number Diff line number Diff line Loading @@ -2380,6 +2380,8 @@ int msm_comm_qbuf(struct vb2_buffer *vb) struct vidc_frame_data frame_data; struct msm_vidc_core *core; struct hfi_device *hdev; int extra_idx = 0; q = vb->vb2_queue; inst = q->drv_priv; if (!inst || !vb) { Loading Loading @@ -2475,6 +2477,15 @@ int msm_comm_qbuf(struct vb2_buffer *vb) dprintk(VIDC_DBG, "Received TS_ERROR on output cap\n"); } extra_idx = EXTRADATA_IDX(inst->fmts[OUTPUT_PORT]-> num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES) && vb->v4l2_planes[extra_idx].m.userptr) { frame_data.extradata_addr = vb->v4l2_planes[extra_idx].m.userptr; frame_data.flags |= HAL_BUFFERFLAG_EXTRADATA; } dprintk(VIDC_DBG, "Sending etb to hal: device_addr: 0x%x, alloc: %d, filled: %d, offset: %d, ts: %lld, flags = 0x%x\n", frame_data.device_addr, frame_data.alloc_len, Loading @@ -2488,7 +2499,6 @@ int msm_comm_qbuf(struct vb2_buffer *vb) dprintk(VIDC_DBG, "Sent etb to HAL\n"); } else if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { struct vidc_seq_hdr seq_hdr; int extra_idx = 0; frame_data.filled_len = 0; frame_data.offset = 0; frame_data.alloc_len = vb->v4l2_planes[0].length; Loading Loading @@ -3203,6 +3213,12 @@ enum hal_extradata_id msm_comm_get_hal_extradata_index( case V4L2_MPEG_VIDC_INDEX_EXTRADATA_ASPECT_RATIO: ret = HAL_EXTRADATA_ASPECT_RATIO; break; case V4L2_MPEG_VIDC_INDEX_EXTRADATA_INPUT_CROP: ret = HAL_EXTRADATA_INPUT_CROP; break; case V4L2_MPEG_VIDC_INDEX_EXTRADATA_DIGITAL_ZOOM: ret = HAL_EXTRADATA_DIGITAL_ZOOM; break; case V4L2_MPEG_VIDC_EXTRADATA_MPEG2_SEQDISP: ret = HAL_EXTRADATA_MPEG2_SEQDISP; break; Loading drivers/media/platform/msm/vidc/vidc_hfi_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,8 @@ enum hal_extradata_id { HAL_EXTRADATA_STREAM_USERDATA, HAL_EXTRADATA_FRAME_QP, HAL_EXTRADATA_FRAME_BITS_INFO, HAL_EXTRADATA_INPUT_CROP, HAL_EXTRADATA_DIGITAL_ZOOM, }; enum hal_property { Loading Loading
drivers/media/platform/msm/vidc/hfi_packetization.c +29 −9 Original line number Diff line number Diff line Loading @@ -439,6 +439,8 @@ static int get_hfi_extradata_index(enum hal_extradata_id index) ret = HFI_PROPERTY_PARAM_VDEC_NUM_CONCEALED_MB; break; case HAL_EXTRADATA_ASPECT_RATIO: case HAL_EXTRADATA_INPUT_CROP: case HAL_EXTRADATA_DIGITAL_ZOOM: ret = HFI_PROPERTY_PARAM_INDEX_EXTRADATA; break; case HAL_EXTRADATA_MPEG2_SEQDISP: Loading @@ -460,6 +462,26 @@ static int get_hfi_extradata_index(enum hal_extradata_id index) return ret; } static int get_hfi_extradata_id(enum hal_extradata_id index) { int ret = 0; switch (index) { case HAL_EXTRADATA_ASPECT_RATIO: ret = MSM_VIDC_EXTRADATA_ASPECT_RATIO; break; case HAL_EXTRADATA_INPUT_CROP: ret = MSM_VIDC_EXTRADATA_INPUT_CROP; break; case HAL_EXTRADATA_DIGITAL_ZOOM: ret = MSM_VIDC_EXTRADATA_DIGITAL_ZOOM; break; default: ret = get_hfi_extradata_index(index); break; } return ret; } static u32 get_hfi_buf_mode(enum buffer_mode_type hal_buf_mode) { u32 buf_mode; Loading Loading @@ -615,6 +637,7 @@ int create_pkt_cmd_session_etb_encoder( pkt->filled_len = input_frame->filled_len; pkt->input_tag = input_frame->clnt_data; pkt->packet_buffer = (u8 *) input_frame->device_addr; pkt->extra_data_buffer = (u8 *) input_frame->extradata_addr; if (!pkt->packet_buffer) return -EINVAL; Loading Loading @@ -1430,23 +1453,20 @@ int create_pkt_cmd_session_set_property( { struct hfi_index_extradata_config *hfi; struct hal_extradata_enable *extra = pdata; int index = 0; int id = 0; pkt->rg_property_data[0] = get_hfi_extradata_index(extra->index); hfi = (struct hfi_index_extradata_config *) &pkt->rg_property_data[1]; hfi->enable = extra->enable; if (extra->index == HAL_EXTRADATA_ASPECT_RATIO) index = MSM_VIDC_EXTRADATA_ASPECT_RATIO; else index = get_hfi_extradata_index(extra->index); if (index) hfi->index_extra_data_id = index; id = get_hfi_extradata_id(extra->index); if (id) hfi->index_extra_data_id = id; else { dprintk(VIDC_WARN, "Failed to find extradata index: %d\n", index); "Failed to find extradata id: %d\n", id); rc = -EINVAL; } pkt->size += sizeof(u32) + Loading
drivers/media/platform/msm/vidc/hfi_response_handler.c +1 −0 Original line number Diff line number Diff line Loading @@ -971,6 +971,7 @@ static void hfi_process_session_etb_done( data_done.input_done.offset = pkt->offset; data_done.input_done.filled_len = pkt->filled_len; data_done.input_done.packet_buffer = pkt->packet_buffer; data_done.input_done.extra_data_buffer = pkt->extra_data_buffer; data_done.input_done.status = hfi_map_err_status((u32) pkt->error_type); callback(SESSION_ETB_DONE, &data_done); Loading
drivers/media/platform/msm/vidc/msm_venc.c +44 −10 Original line number Diff line number Diff line Loading @@ -866,7 +866,9 @@ static int msm_venc_queue_setup(struct vb2_queue *q, struct hfi_device *hdev; struct hal_buffer_requirements *buff_req; struct v4l2_ctrl *ctrl = NULL; u32 extradata = 0; u32 extradata = 0, extra_idx = 0; struct hal_buffer_requirements *buff_req_buffer = NULL; if (!q || !q->drv_priv) { dprintk(VIDC_ERR, "Invalid input\n"); return -EINVAL; Loading Loading @@ -901,7 +903,7 @@ static int msm_venc_queue_setup(struct vb2_queue *q, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); if (ctrl) extradata = v4l2_ctrl_g_ctrl(ctrl); if (extradata) if (extradata == V4L2_MPEG_VIDC_EXTRADATA_MULTISLICE_INFO) *num_planes = *num_planes + 1; inst->fmts[CAPTURE_PORT]->num_planes = *num_planes; for (i = 0; i < *num_planes; i++) { Loading Loading @@ -936,16 +938,30 @@ static int msm_venc_queue_setup(struct vb2_queue *q, property_id = HAL_PARAM_BUFFER_COUNT_ACTUAL; new_buf_count.buffer_type = HAL_BUFFER_INPUT; new_buf_count.buffer_count_actual = *num_buffers; ctrl = v4l2_ctrl_find(&inst->ctrl_handler, V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA); if (ctrl) extradata = v4l2_ctrl_g_ctrl(ctrl); if (extradata == V4L2_MPEG_VIDC_INDEX_EXTRADATA_INPUT_CROP) *num_planes = *num_planes + 1; inst->fmts[OUTPUT_PORT]->num_planes = *num_planes; rc = call_hfi_op(hdev, session_set_property, inst->session, property_id, &new_buf_count); dprintk(VIDC_DBG, "size = %d, alignment = %d, count = %d\n", inst->buff_req.buffer[0].buffer_size, inst->buff_req.buffer[0].buffer_alignment, inst->buff_req.buffer[0].buffer_count_actual); for (i = 0; i < *num_planes; i++) { sizes[i] = inst->fmts[OUTPUT_PORT]->get_frame_size( i, inst->prop.height[OUTPUT_PORT], sizes[0] = inst->fmts[OUTPUT_PORT]->get_frame_size( 0, inst->prop.height[OUTPUT_PORT], inst->prop.width[OUTPUT_PORT]); extra_idx = EXTRADATA_IDX(inst->fmts[OUTPUT_PORT]->num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); sizes[extra_idx] = buff_req_buffer ? buff_req_buffer->buffer_size : 0; } break; default: Loading Loading @@ -2429,6 +2445,18 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) "Failed to set OUTPUT framesize\n"); goto exit; } } else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { struct hal_buffer_requirements *buff_req_buffer = NULL; int extra_idx = 0; extra_idx = EXTRADATA_IDX(fmt->num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); f->fmt.pix_mp.plane_fmt[extra_idx].sizeimage = buff_req_buffer ? buff_req_buffer->buffer_size : 0; } } } else { dprintk(VIDC_ERR, "Buf type not recognized, type = %d\n", Loading @@ -2446,7 +2474,7 @@ int msm_venc_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) int i; u32 height, width; int extra_idx = 0; struct hal_buffer_requirements *buff_req_buffer; struct hal_buffer_requirements *buff_req_buffer = NULL; if (!inst || !f) { dprintk(VIDC_ERR, Loading Loading @@ -2474,9 +2502,15 @@ int msm_venc_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) } extra_idx = EXTRADATA_IDX(fmt->num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_OUTPUT); else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) buff_req_buffer = get_buff_req_buffer(inst, HAL_BUFFER_EXTRADATA_INPUT); f->fmt.pix_mp.plane_fmt[extra_idx].sizeimage = buff_req_buffer ? buff_req_buffer->buffer_size : 0; Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +17 −1 Original line number Diff line number Diff line Loading @@ -2380,6 +2380,8 @@ int msm_comm_qbuf(struct vb2_buffer *vb) struct vidc_frame_data frame_data; struct msm_vidc_core *core; struct hfi_device *hdev; int extra_idx = 0; q = vb->vb2_queue; inst = q->drv_priv; if (!inst || !vb) { Loading Loading @@ -2475,6 +2477,15 @@ int msm_comm_qbuf(struct vb2_buffer *vb) dprintk(VIDC_DBG, "Received TS_ERROR on output cap\n"); } extra_idx = EXTRADATA_IDX(inst->fmts[OUTPUT_PORT]-> num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES) && vb->v4l2_planes[extra_idx].m.userptr) { frame_data.extradata_addr = vb->v4l2_planes[extra_idx].m.userptr; frame_data.flags |= HAL_BUFFERFLAG_EXTRADATA; } dprintk(VIDC_DBG, "Sending etb to hal: device_addr: 0x%x, alloc: %d, filled: %d, offset: %d, ts: %lld, flags = 0x%x\n", frame_data.device_addr, frame_data.alloc_len, Loading @@ -2488,7 +2499,6 @@ int msm_comm_qbuf(struct vb2_buffer *vb) dprintk(VIDC_DBG, "Sent etb to HAL\n"); } else if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { struct vidc_seq_hdr seq_hdr; int extra_idx = 0; frame_data.filled_len = 0; frame_data.offset = 0; frame_data.alloc_len = vb->v4l2_planes[0].length; Loading Loading @@ -3203,6 +3213,12 @@ enum hal_extradata_id msm_comm_get_hal_extradata_index( case V4L2_MPEG_VIDC_INDEX_EXTRADATA_ASPECT_RATIO: ret = HAL_EXTRADATA_ASPECT_RATIO; break; case V4L2_MPEG_VIDC_INDEX_EXTRADATA_INPUT_CROP: ret = HAL_EXTRADATA_INPUT_CROP; break; case V4L2_MPEG_VIDC_INDEX_EXTRADATA_DIGITAL_ZOOM: ret = HAL_EXTRADATA_DIGITAL_ZOOM; break; case V4L2_MPEG_VIDC_EXTRADATA_MPEG2_SEQDISP: ret = HAL_EXTRADATA_MPEG2_SEQDISP; break; Loading
drivers/media/platform/msm/vidc/vidc_hfi_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,8 @@ enum hal_extradata_id { HAL_EXTRADATA_STREAM_USERDATA, HAL_EXTRADATA_FRAME_QP, HAL_EXTRADATA_FRAME_BITS_INFO, HAL_EXTRADATA_INPUT_CROP, HAL_EXTRADATA_DIGITAL_ZOOM, }; enum hal_property { Loading