Merge bb47cc0740 on remote branch

Change-Id: I150ef166dee563c0c127fa9686e1ebfe6ff8135f
This commit is contained in:
Linux Build Service Account 2021-01-02 02:14:46 -08:00
commit ea9f18dff4
6 changed files with 34 additions and 20 deletions

View file

@ -87,7 +87,6 @@
#define VIDC_WRAPPER_INTR_MASK_A2HCPU_BMSK_AR50_LT 0x4
#define VIDC_WRAPPER_INTR_MASK_A2HCPU_SHFT_AR50_LT 0x2
#define VIDC_WRAPPER_INTR_CLEAR_AR50_LT (VIDC_WRAPPER_BASE_OFFS_AR50_LT + 0x14)
#define VIDC_WRAPPER_INTR_CLEAR_A2HWD_BMSK_AR50_LT 0x10
#define VIDC_WRAPPER_INTR_CLEAR_A2HWD_SHFT_AR50_LT 0x4
#define VIDC_WRAPPER_INTR_CLEAR_A2H_BMSK_AR50_LT 0x4
@ -246,7 +245,6 @@ void __core_clear_interrupt_ar50_lt(struct venus_hfi_device *device)
}
__write_register(device, VIDC_CPU_CS_A2HSOFTINTCLR_AR50_LT, 1, DEFAULT_SID);
__write_register(device, VIDC_WRAPPER_INTR_CLEAR_AR50_LT, intr_status, DEFAULT_SID);
}
int __boot_firmware_ar50_lt(struct venus_hfi_device *device, u32 sid)

View file

@ -904,7 +904,9 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
case V4L2_CID_MPEG_VIDC_VIDEO_DECODE_ORDER:
case V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR_8BIT:
case V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR_10BIT:
break;
case V4L2_CID_MPEG_VIDC_VIDEO_FRAME_RATE:
inst->clk_data.frame_rate = ctrl->val;
break;
case V4L2_CID_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE:
inst->flags &= ~VIDC_THUMBNAIL;

View file

@ -3810,6 +3810,12 @@ int msm_venc_set_hp_max_layer(struct msm_vidc_inst *inst)
__func__);
return rc;
}
if (!inst->hybrid_hp && max_layer->val > 4) {
update_ctrl(max_layer, 0, inst->sid);
s_vpr_h(inst->sid,
"%s: Hier-P requested beyond max capability\n", __func__);
return 0;
}
/*
* We send enhancement layer count to FW,

View file

@ -264,6 +264,7 @@
#define HFI_VENUS_HEIGHT_ALIGNMENT 32
#define SYSTEM_LAL_TILE10 192
#define NUM_MBS_360P (((480 + 15) >> 4) * ((360 + 15) >> 4))
#define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4))
#define NUM_MBS_4k (((4096 + 15) >> 4) * ((2304 + 15) >> 4))
#define MB_SIZE_IN_PIXEL (16 * 16)
@ -493,17 +494,17 @@ int msm_vidc_get_num_ref_frames(struct msm_vidc_inst *inst)
max_layer = get_ctrl(inst,
V4L2_CID_MPEG_VIDC_VIDEO_HEVC_MAX_HIER_CODING_LAYER);
if (frame_t->val == V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P &&
max_layer->val > 0) {
max_layer->val > 1) {
codec = get_v4l2_codec(inst);
/* LTR and B - frame not supported with hybrid HP */
if (inst->hybrid_hp)
num_ref = (max_layer->val - 1);
num_ref = (max_layer->val + 1) >> 1;
else if (codec == V4L2_PIX_FMT_HEVC)
num_ref = ((max_layer->val + 1) / 2) + ltr_count;
else if ((codec == V4L2_PIX_FMT_H264) && (max_layer->val <= 4))
num_ref = ((1 << (max_layer->val - 1)) - 1) + ltr_count;
else if ((codec == V4L2_PIX_FMT_H264) && (max_layer->val < 4))
num_ref = (max_layer->val - 1) + ltr_count;
else
num_ref = ((max_layer->val + 1) / 2) + ltr_count;
num_ref = max_layer->val + ltr_count;
}
if (is_hier_b_session(inst)) {
@ -985,8 +986,8 @@ u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst)
/*
* Encoder output size calculation: 32 Align width/height
* For CQ or heic session : YUVsize * 2
* For resolution < 720p : YUVsize * 4
* For resolution > 720p & <= 4K : YUVsize / 2
* For resolution <= 480x360p : YUVsize * 2
* For resolution > 360p & <= 4K : YUVsize / 2
* For resolution > 4k : YUVsize / 4
* Initially frame_size = YUVsize * 2;
*/
@ -1003,8 +1004,8 @@ u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst)
is_grid_session(inst) || is_image_session(inst))
goto calc_done;
if (mbs_per_frame < NUM_MBS_720P)
frame_size = frame_size << 1;
if (mbs_per_frame <= NUM_MBS_360P)
goto calc_done; /* Default frame_size = YUVsize * 2 */
else if (mbs_per_frame <= NUM_MBS_4k)
frame_size = frame_size >> 2;
else

View file

@ -1777,7 +1777,7 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
} else if (rc == -ENOTSUPP) {
msm_vidc_queue_v4l2_event(inst,
V4L2_EVENT_MSM_VIDC_HW_UNSUPPORTED);
} else if (rc == -EBUSY) {
} else if (rc == -ENOMEM) {
msm_vidc_queue_v4l2_event(inst,
V4L2_EVENT_MSM_VIDC_HW_OVERLOAD);
}
@ -5765,8 +5765,9 @@ static int msm_vidc_check_mbpf_supported(struct msm_vidc_inst *inst)
mutex_lock(&core->lock);
list_for_each_entry(temp, &core->instances, list) {
/* ignore invalid session */
if (temp->state == MSM_VIDC_CORE_INVALID)
/* ignore invalid and completed session */
if (temp->state == MSM_VIDC_CORE_INVALID ||
temp->state >= MSM_VIDC_STOP_DONE)
continue;
/* ignore thumbnail session */
if (is_thumbnail_session(temp))
@ -5782,7 +5783,7 @@ static int msm_vidc_check_mbpf_supported(struct msm_vidc_inst *inst)
if (mbpf > core->resources.max_mbpf) {
msm_vidc_print_running_insts(inst->core);
return -EBUSY;
return -ENOMEM;
}
return 0;
@ -5933,7 +5934,7 @@ static int msm_vidc_check_mbps_supported(struct msm_vidc_inst *inst)
"H/W is overloaded. needed: %d max: %d\n",
video_load, max_video_load);
msm_vidc_print_running_insts(inst->core);
return -EBUSY;
return -ENOMEM;
}
if (video_load + image_load > max_video_load + max_image_load) {
@ -5942,7 +5943,7 @@ static int msm_vidc_check_mbps_supported(struct msm_vidc_inst *inst)
video_load, image_load,
max_video_load, max_image_load);
msm_vidc_print_running_insts(inst->core);
return -EBUSY;
return -ENOMEM;
}
}
return 0;
@ -7768,6 +7769,8 @@ u32 msm_comm_calc_framerate(struct msm_vidc_inst *inst,
{
u32 framerate = inst->clk_data.frame_rate;
u32 interval;
struct msm_vidc_capability *capability;
capability = &inst->capability;
if (timestamp_us <= prev_ts) {
s_vpr_e(inst->sid, "%s: invalid ts %lld, prev ts %lld\n",
@ -7775,8 +7778,12 @@ u32 msm_comm_calc_framerate(struct msm_vidc_inst *inst,
return framerate;
}
interval = (u32)(timestamp_us - prev_ts);
framerate = ((1000000 + interval / 2) / interval) << 16;
return framerate;
framerate = (1000000 + interval / 2) / interval;
if (framerate > capability->cap[CAP_FRAMERATE].max)
framerate = capability->cap[CAP_FRAMERATE].max;
if (framerate < 1)
framerate = 1;
return framerate << 16;
}
u32 msm_comm_get_max_framerate(struct msm_vidc_inst *inst)

View file

@ -289,7 +289,7 @@ static struct msm_vidc_codec_capability holi_capabilities[] = {
{CAP_SECURE_BITRATE, DOMAINS_ALL, CODECS_ALL, 1, 35000000, 1, 20000000},
/* All intra encoding usecase specific */
{CAP_ALLINTRA_MAX_FPS, ENC, H264|HEVC, 1, 30, 1, 30},
{CAP_ALLINTRA_MAX_FPS, ENC, H264|HEVC, 1, 60, 1, 30},
/* Image specific */
{CAP_HEVC_IMAGE_FRAME_WIDTH, ENC, HEVC, 128, 512, 2, 512},