Loading drivers/media/platform/msm/vidc/Makefile +2 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,8 @@ msm-vidc-objs := msm_v4l2_vidc.o \ vidc_hfi.o \ msm_vidc_clocks.o \ msm_vidc_ar50_dyn_gov.o \ msm_vidc_dyn_gov.o msm_vidc_dyn_gov.o \ msm_vidc_buffer_calculations.o obj-$(CONFIG_MSM_VIDC_V4L2) := msm-vidc.o drivers/media/platform/msm/vidc/msm_vdec.c +1 −0 Original line number Diff line number Diff line Loading @@ -906,6 +906,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst) inst->buff_req.buffer[11].buffer_type = HAL_BUFFER_INTERNAL_PERSIST_1; inst->buff_req.buffer[12].buffer_type = HAL_BUFFER_INTERNAL_CMD_QUEUE; inst->buff_req.buffer[13].buffer_type = HAL_BUFFER_INTERNAL_RECON; msm_vidc_init_buffer_size_calculators(inst); /* By default, initialize OUTPUT port to H264 decoder */ fmt = msm_comm_get_pixel_fmt_fourcc(vdec_formats, Loading drivers/media/platform/msm/vidc/msm_venc.c +1 −0 Original line number Diff line number Diff line Loading @@ -1216,6 +1216,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) inst->buff_req.buffer[11].buffer_type = HAL_BUFFER_INTERNAL_PERSIST_1; inst->buff_req.buffer[12].buffer_type = HAL_BUFFER_INTERNAL_CMD_QUEUE; inst->buff_req.buffer[13].buffer_type = HAL_BUFFER_INTERNAL_RECON; msm_vidc_init_buffer_size_calculators(inst); /* By default, initialize OUTPUT port to UBWC YUV format */ fmt = msm_comm_get_pixel_fmt_fourcc(venc_formats, Loading drivers/media/platform/msm/vidc/msm_vidc_buffer_calculations.c 0 → 100644 +1386 −0 File added.Preview size limit exceeded, changes collapsed. Show changes drivers/media/platform/msm/vidc/msm_vidc_common.c +59 −45 Original line number Diff line number Diff line Loading @@ -4448,27 +4448,42 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst, int msm_comm_try_get_bufreqs(struct msm_vidc_inst *inst) { int rc = 0, i = 0; int rc = -EINVAL, i = 0; union hal_get_property hprop; memset(&hprop, 0x0, sizeof(hprop)); /* * First check if we can calculate bufffer sizes. * If we can calculate then we do it within the driver. * If we cannot then we get buffer requirements from firmware. */ if (inst->buffer_size_calculators) { rc = inst->buffer_size_calculators(inst); if (rc) dprintk(VIDC_ERR, "Failed calculating internal buffer sizes: %d", rc); } /* * Fallback to get buffreq from firmware if internal calculation * is not done or if it fails */ if (rc) { rc = msm_comm_try_get_buff_req(inst, &hprop); if (rc) { dprintk(VIDC_ERR, "Failed getting buffer requirements: %d", rc); dprintk(VIDC_ERR, "Failed getting buffer requirements: %d", rc); return rc; } dprintk(VIDC_DBG, "Buffer requirements from HW:\n"); dprintk(VIDC_DBG, "%15s %8s %8s %8s %8s\n", "buffer type", "count", "mincount_host", "mincount_fw", "size"); for (i = 0; i < HAL_BUFFER_MAX; i++) { struct hal_buffer_requirements req = hprop.buf_req.buffer[i]; struct hal_buffer_requirements req; struct hal_buffer_requirements *curr_req; req = hprop.buf_req.buffer[i]; /* * For decoder we can ignore the buffer counts that firmware * sends for inp/out buffers. * For decoder we can ignore the buffer counts that * firmware sends for inp/out buffers. * FW buffer counts for these are used only in reconfig */ curr_req = get_buff_req_buffer(inst, req.buffer_type); Loading @@ -4479,38 +4494,37 @@ int msm_comm_try_get_bufreqs(struct msm_vidc_inst *inst) req.buffer_type == HAL_BUFFER_OUTPUT || req.buffer_type == HAL_BUFFER_OUTPUT2 || req.buffer_type == HAL_BUFFER_EXTRADATA_INPUT || req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT || req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT2) { req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT || req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT2) { curr_req->buffer_size = req.buffer_size; curr_req->buffer_region_size = req.buffer_region_size; curr_req->buffer_region_size = req.buffer_region_size; curr_req->contiguous = req.contiguous; curr_req->buffer_alignment = req.buffer_alignment; curr_req->buffer_alignment = req.buffer_alignment; } else { memcpy(curr_req, &req, sizeof(struct hal_buffer_requirements)); } if (req.buffer_type != HAL_BUFFER_NONE) { dprintk(VIDC_DBG, "%15s %8d %8d %8d %8d\n", get_buffer_name(req.buffer_type), req.buffer_count_actual, req.buffer_count_min_host, req.buffer_count_min, req.buffer_size); } } dprintk(VIDC_DBG, "Buffer requirements driver adjusted:\n"); dprintk(VIDC_DBG, "Buffer requirements :\n"); dprintk(VIDC_DBG, "%15s %8s %8s %8s %8s\n", "buffer type", "count", "mincount_host", "mincount_fw", "size"); "buffer type", "count", "mincount_host", "mincount_fw", "size", "alignment"); for (i = 0; i < HAL_BUFFER_MAX; i++) { struct hal_buffer_requirements req = inst->buff_req.buffer[i]; if (req.buffer_type != HAL_BUFFER_NONE) { dprintk(VIDC_DBG, "%15s %8d %8d %8d %8d\n", dprintk(VIDC_DBG, "%15s %8d %8d %8d %8d %8d\n", get_buffer_name(req.buffer_type), req.buffer_count_actual, req.buffer_count_min_host, req.buffer_count_min, req.buffer_size); req.buffer_count_min, req.buffer_size, req.buffer_alignment); } } return rc; Loading Loading
drivers/media/platform/msm/vidc/Makefile +2 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,8 @@ msm-vidc-objs := msm_v4l2_vidc.o \ vidc_hfi.o \ msm_vidc_clocks.o \ msm_vidc_ar50_dyn_gov.o \ msm_vidc_dyn_gov.o msm_vidc_dyn_gov.o \ msm_vidc_buffer_calculations.o obj-$(CONFIG_MSM_VIDC_V4L2) := msm-vidc.o
drivers/media/platform/msm/vidc/msm_vdec.c +1 −0 Original line number Diff line number Diff line Loading @@ -906,6 +906,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst) inst->buff_req.buffer[11].buffer_type = HAL_BUFFER_INTERNAL_PERSIST_1; inst->buff_req.buffer[12].buffer_type = HAL_BUFFER_INTERNAL_CMD_QUEUE; inst->buff_req.buffer[13].buffer_type = HAL_BUFFER_INTERNAL_RECON; msm_vidc_init_buffer_size_calculators(inst); /* By default, initialize OUTPUT port to H264 decoder */ fmt = msm_comm_get_pixel_fmt_fourcc(vdec_formats, Loading
drivers/media/platform/msm/vidc/msm_venc.c +1 −0 Original line number Diff line number Diff line Loading @@ -1216,6 +1216,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst) inst->buff_req.buffer[11].buffer_type = HAL_BUFFER_INTERNAL_PERSIST_1; inst->buff_req.buffer[12].buffer_type = HAL_BUFFER_INTERNAL_CMD_QUEUE; inst->buff_req.buffer[13].buffer_type = HAL_BUFFER_INTERNAL_RECON; msm_vidc_init_buffer_size_calculators(inst); /* By default, initialize OUTPUT port to UBWC YUV format */ fmt = msm_comm_get_pixel_fmt_fourcc(venc_formats, Loading
drivers/media/platform/msm/vidc/msm_vidc_buffer_calculations.c 0 → 100644 +1386 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
drivers/media/platform/msm/vidc/msm_vidc_common.c +59 −45 Original line number Diff line number Diff line Loading @@ -4448,27 +4448,42 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst, int msm_comm_try_get_bufreqs(struct msm_vidc_inst *inst) { int rc = 0, i = 0; int rc = -EINVAL, i = 0; union hal_get_property hprop; memset(&hprop, 0x0, sizeof(hprop)); /* * First check if we can calculate bufffer sizes. * If we can calculate then we do it within the driver. * If we cannot then we get buffer requirements from firmware. */ if (inst->buffer_size_calculators) { rc = inst->buffer_size_calculators(inst); if (rc) dprintk(VIDC_ERR, "Failed calculating internal buffer sizes: %d", rc); } /* * Fallback to get buffreq from firmware if internal calculation * is not done or if it fails */ if (rc) { rc = msm_comm_try_get_buff_req(inst, &hprop); if (rc) { dprintk(VIDC_ERR, "Failed getting buffer requirements: %d", rc); dprintk(VIDC_ERR, "Failed getting buffer requirements: %d", rc); return rc; } dprintk(VIDC_DBG, "Buffer requirements from HW:\n"); dprintk(VIDC_DBG, "%15s %8s %8s %8s %8s\n", "buffer type", "count", "mincount_host", "mincount_fw", "size"); for (i = 0; i < HAL_BUFFER_MAX; i++) { struct hal_buffer_requirements req = hprop.buf_req.buffer[i]; struct hal_buffer_requirements req; struct hal_buffer_requirements *curr_req; req = hprop.buf_req.buffer[i]; /* * For decoder we can ignore the buffer counts that firmware * sends for inp/out buffers. * For decoder we can ignore the buffer counts that * firmware sends for inp/out buffers. * FW buffer counts for these are used only in reconfig */ curr_req = get_buff_req_buffer(inst, req.buffer_type); Loading @@ -4479,38 +4494,37 @@ int msm_comm_try_get_bufreqs(struct msm_vidc_inst *inst) req.buffer_type == HAL_BUFFER_OUTPUT || req.buffer_type == HAL_BUFFER_OUTPUT2 || req.buffer_type == HAL_BUFFER_EXTRADATA_INPUT || req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT || req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT2) { req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT || req.buffer_type == HAL_BUFFER_EXTRADATA_OUTPUT2) { curr_req->buffer_size = req.buffer_size; curr_req->buffer_region_size = req.buffer_region_size; curr_req->buffer_region_size = req.buffer_region_size; curr_req->contiguous = req.contiguous; curr_req->buffer_alignment = req.buffer_alignment; curr_req->buffer_alignment = req.buffer_alignment; } else { memcpy(curr_req, &req, sizeof(struct hal_buffer_requirements)); } if (req.buffer_type != HAL_BUFFER_NONE) { dprintk(VIDC_DBG, "%15s %8d %8d %8d %8d\n", get_buffer_name(req.buffer_type), req.buffer_count_actual, req.buffer_count_min_host, req.buffer_count_min, req.buffer_size); } } dprintk(VIDC_DBG, "Buffer requirements driver adjusted:\n"); dprintk(VIDC_DBG, "Buffer requirements :\n"); dprintk(VIDC_DBG, "%15s %8s %8s %8s %8s\n", "buffer type", "count", "mincount_host", "mincount_fw", "size"); "buffer type", "count", "mincount_host", "mincount_fw", "size", "alignment"); for (i = 0; i < HAL_BUFFER_MAX; i++) { struct hal_buffer_requirements req = inst->buff_req.buffer[i]; if (req.buffer_type != HAL_BUFFER_NONE) { dprintk(VIDC_DBG, "%15s %8d %8d %8d %8d\n", dprintk(VIDC_DBG, "%15s %8d %8d %8d %8d %8d\n", get_buffer_name(req.buffer_type), req.buffer_count_actual, req.buffer_count_min_host, req.buffer_count_min, req.buffer_size); req.buffer_count_min, req.buffer_size, req.buffer_alignment); } } return rc; Loading