Merge d8e78d23c3 on remote branch

Change-Id: I2a28934698886330f7ce014fb3e408578a0949d0
This commit is contained in:
Linux Build Service Account 2021-06-22 23:53:37 -07:00
commit 8cd4f38697
3 changed files with 23 additions and 1 deletions

View file

@ -261,6 +261,8 @@ enum v4l2_mpeg_vidc_video_bitrate_savings_type {
(V4L2_CID_MPEG_MSM_VIDC_BASE + 135)
#define V4L2_CID_MPEG_VIDC_VIDEO_DISABLE_TIMESTAMP_REORDER \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 136)
#define V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 137)
#define V4L2_CID_MPEG_VIDC_VIDEO_UNKNOWN \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 0xFFF)

View file

@ -596,6 +596,16 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
.step = 1,
.menu_skip_mask = 0,
},
{
.id = V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY,
.name = "Encoder complexity",
.type = V4L2_CTRL_TYPE_INTEGER,
.minimum = 0,
.maximum = 100,
.default_value = 100,
.step = 1,
.qmenu = NULL,
},
{
.id = V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE,
.name = "Set Hier coding type",
@ -1976,6 +1986,11 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
case V4L2_CID_MPEG_VIDC_VENC_BITRATE_BOOST:
inst->boost_enabled = true;
break;
case V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY:
if (is_realtime_session(inst)) {
s_vpr_h(sid, "Client is setting complexity for RT session\n");
}
break;
case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
inst->entropy_mode = msm_comm_v4l2_to_hfi(
V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE,
@ -2501,7 +2516,8 @@ int msm_venc_set_intra_period(struct msm_vidc_inst *inst)
intra_period.pframes = gop_size->val;
if (!max_layer->val && codec == V4L2_PIX_FMT_H264) {
/* max_layer 0/1 indicates absence of layer encoding */
if (max_layer->val < 2) {
/*
* At this point we've already made decision on bframe.
* Control value gives updated bframe value.

View file

@ -1434,6 +1434,7 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst,
void *pdata = NULL;
struct hfi_device *hdev = NULL;
u32 hfi_perf_mode;
struct v4l2_ctrl *ctrl;
hdev = inst->core->device;
if (inst->session_type != MSM_VIDC_ENCODER) {
@ -1443,6 +1444,9 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst,
return 0;
}
ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY);
if (!is_realtime_session(inst) && !ctrl->val)
enable = true;
prop_id = HFI_PROPERTY_CONFIG_VENC_PERF_MODE;
hfi_perf_mode = enable ? HFI_VENC_PERFMODE_POWER_SAVE :
HFI_VENC_PERFMODE_MAX_QUALITY;