video: driver: Add support for VIDIOC_S_PARM and VIDIOC_G_PARM
Add support for S_PARM and G_PARM to enable client to set and get frame rate and operating rate to driver. Also includes some inst database grooming changes. Change-Id: I5b39537662faa56effa0ac63acdfc100d83bf403 Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
这个提交包含在:
@@ -194,10 +194,10 @@ static u32 msm_vidc_encoder_bin_size_iris2(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_core *core;
|
||||
u32 size = 0;
|
||||
u32 width, height, num_vpp_pipes;
|
||||
u32 width, height, num_vpp_pipes, stage;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -207,14 +207,15 @@ static u32 msm_vidc_encoder_bin_size_iris2(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
stage = inst->capabilities->cap[STAGE].value;
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
HFI_BUFFER_BIN_H264E(size, width, height, inst->stage, num_vpp_pipes);
|
||||
HFI_BUFFER_BIN_H264E(size, width, height, stage, num_vpp_pipes);
|
||||
else if (inst->codec == MSM_VIDC_HEVC)
|
||||
HFI_BUFFER_BIN_H265E(size, width, height, inst->stage, num_vpp_pipes);
|
||||
HFI_BUFFER_BIN_H265E(size, width, height, stage, num_vpp_pipes);
|
||||
|
||||
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
|
||||
return size;
|
||||
|
@@ -65,13 +65,14 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
|
||||
/* VSP */
|
||||
/* bitrate is based on fps, scale it using operating rate */
|
||||
operating_rate = inst->prop.operating_rate >> 16;
|
||||
if (operating_rate > (inst->prop.frame_rate >> 16) &&
|
||||
(inst->prop.frame_rate >> 16)) {
|
||||
operating_rate = inst->capabilities->cap[OPERATING_RATE].value >> 16;
|
||||
if (operating_rate >
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16) &&
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16)) {
|
||||
vsp_factor_num = operating_rate;
|
||||
vsp_factor_den = inst->prop.frame_rate >> 16;
|
||||
vsp_factor_den = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
}
|
||||
vsp_cycles = div_u64(((u64)inst->prop.bitrate *
|
||||
vsp_cycles = div_u64(((u64)inst->capabilities->cap[BIT_RATE].value *
|
||||
vsp_factor_num), vsp_factor_den);
|
||||
|
||||
base_cycles = core->capabilities[MB_CYCLES_VSP].value;
|
||||
|
在新工单中引用
屏蔽一个用户