Merge "msm: vidc: Fix multistream issues"

This commit is contained in:
Linux Build Service Account 2016-08-27 03:35:36 -07:00 committed by Gerrit - the friendly Code Review server
commit 1adaeeae92
2 changed files with 22 additions and 53 deletions

View file

@ -1095,23 +1095,8 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
f->fmt.pix_mp.pixelformat = fmt->fourcc; f->fmt.pix_mp.pixelformat = fmt->fourcc;
f->fmt.pix_mp.num_planes = fmt->num_planes; f->fmt.pix_mp.num_planes = fmt->num_planes;
if (inst->in_reconfig) { if (inst->in_reconfig) {
bool ds_enabled = msm_comm_g_ctrl_for_id(inst, inst->prop.height[OUTPUT_PORT] = inst->reconfig_height;
V4L2_CID_MPEG_VIDC_VIDEO_KEEP_ASPECT_RATIO); inst->prop.width[OUTPUT_PORT] = inst->reconfig_width;
/*
* Do not update height and width on capture port, if
* downscalar is explicitly enabled from v4l2 client.
*/
if (msm_comm_get_stream_output_mode(inst) ==
HAL_VIDEO_DECODER_SECONDARY && ds_enabled) {
inst->prop.height[OUTPUT_PORT] = inst->reconfig_height;
inst->prop.width[OUTPUT_PORT] = inst->reconfig_width;
} else {
inst->prop.height[CAPTURE_PORT] = inst->reconfig_height;
inst->prop.width[CAPTURE_PORT] = inst->reconfig_width;
inst->prop.height[OUTPUT_PORT] = inst->reconfig_height;
inst->prop.width[OUTPUT_PORT] = inst->reconfig_width;
}
rc = msm_vidc_check_session_supported(inst); rc = msm_vidc_check_session_supported(inst);
if (rc) { if (rc) {
@ -1138,6 +1123,12 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
f->fmt.pix_mp.plane_fmt[i].sizeimage = f->fmt.pix_mp.plane_fmt[i].sizeimage =
plane_sizes[i]; plane_sizes[i];
} }
f->fmt.pix_mp.height = inst->prop.height[OUTPUT_PORT];
f->fmt.pix_mp.width = inst->prop.width[OUTPUT_PORT];
f->fmt.pix_mp.plane_fmt[0].bytesperline =
(__u16)inst->prop.width[OUTPUT_PORT];
f->fmt.pix_mp.plane_fmt[0].reserved[0] =
(__u16)inst->prop.height[OUTPUT_PORT];
} else { } else {
switch (fmt->fourcc) { switch (fmt->fourcc) {
case V4L2_PIX_FMT_NV12: case V4L2_PIX_FMT_NV12:
@ -1176,34 +1167,15 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
for (i = 0; i < fmt->num_planes; ++i) for (i = 0; i < fmt->num_planes; ++i)
inst->bufq[CAPTURE_PORT].vb2_bufq.plane_sizes[i] = inst->bufq[CAPTURE_PORT].vb2_bufq.plane_sizes[i] =
f->fmt.pix_mp.plane_fmt[i].sizeimage; f->fmt.pix_mp.plane_fmt[i].sizeimage;
}
if (stride && scanlines) { f->fmt.pix_mp.height = inst->prop.height[CAPTURE_PORT];
f->fmt.pix_mp.width = inst->prop.width[CAPTURE_PORT];
f->fmt.pix_mp.plane_fmt[0].bytesperline = f->fmt.pix_mp.plane_fmt[0].bytesperline =
(__u16)stride; (__u16)stride;
f->fmt.pix_mp.plane_fmt[0].reserved[0] = f->fmt.pix_mp.plane_fmt[0].reserved[0] =
(__u16)scanlines; (__u16)scanlines;
} else {
f->fmt.pix_mp.plane_fmt[0].bytesperline =
(__u16)inst->prop.width[CAPTURE_PORT];
f->fmt.pix_mp.plane_fmt[0].reserved[0] =
(__u16)inst->prop.height[CAPTURE_PORT];
} }
if (msm_comm_get_stream_output_mode(inst) ==
HAL_VIDEO_DECODER_SECONDARY) {
if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
f->fmt.pix_mp.height = inst->prop.height[CAPTURE_PORT];
f->fmt.pix_mp.width = inst->prop.width[CAPTURE_PORT];
} else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
f->fmt.pix_mp.height = inst->prop.height[OUTPUT_PORT];
f->fmt.pix_mp.width = inst->prop.width[OUTPUT_PORT];
f->fmt.pix_mp.plane_fmt[0].bytesperline =
(__u16)inst->prop.width[OUTPUT_PORT];
f->fmt.pix_mp.plane_fmt[0].reserved[0] =
(__u16)inst->prop.height[OUTPUT_PORT];
}
}
exit: exit:
return rc; return rc;
} }
@ -1306,11 +1278,6 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
} else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { } else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
inst->prop.width[OUTPUT_PORT] = f->fmt.pix_mp.width; inst->prop.width[OUTPUT_PORT] = f->fmt.pix_mp.width;
inst->prop.height[OUTPUT_PORT] = f->fmt.pix_mp.height; inst->prop.height[OUTPUT_PORT] = f->fmt.pix_mp.height;
if (msm_comm_get_stream_output_mode(inst) ==
HAL_VIDEO_DECODER_PRIMARY) {
inst->prop.width[CAPTURE_PORT] = f->fmt.pix_mp.width;
inst->prop.height[CAPTURE_PORT] = f->fmt.pix_mp.height;
}
fmt = msm_comm_get_pixel_fmt_fourcc(vdec_formats, fmt = msm_comm_get_pixel_fmt_fourcc(vdec_formats,
ARRAY_SIZE(vdec_formats), ARRAY_SIZE(vdec_formats),

View file

@ -284,8 +284,12 @@ static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst)
int fps, rc; int fps, rc;
struct v4l2_control ctrl; struct v4l2_control ctrl;
output_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[OUTPUT_PORT], output_port_mbs = inst->in_reconfig ?
inst->prop.height[OUTPUT_PORT]); NUM_MBS_PER_FRAME(inst->reconfig_width,
inst->reconfig_height) :
NUM_MBS_PER_FRAME(inst->prop.width[OUTPUT_PORT],
inst->prop.height[OUTPUT_PORT]);
capture_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[CAPTURE_PORT], capture_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[CAPTURE_PORT],
inst->prop.height[CAPTURE_PORT]); inst->prop.height[CAPTURE_PORT]);
@ -1227,14 +1231,12 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
inst->in_reconfig = true; inst->in_reconfig = true;
} else { } else {
dprintk(VIDC_DBG, "V4L2_EVENT_SEQ_CHANGED_SUFFICIENT\n"); dprintk(VIDC_DBG, "V4L2_EVENT_SEQ_CHANGED_SUFFICIENT\n");
dprintk(VIDC_DBG, dprintk(VIDC_DBG,
"event_notify->height = %d event_notify->width = %d\n", "event_notify->height = %d event_notify->width = %d\n",
event_notify->height, event_notify->height,
event_notify->width); event_notify->width);
inst->prop.height[CAPTURE_PORT] = event_notify->height; inst->prop.height[OUTPUT_PORT] = event_notify->height;
inst->prop.width[CAPTURE_PORT] = event_notify->width; inst->prop.width[OUTPUT_PORT] = event_notify->width;
inst->prop.height[OUTPUT_PORT] = event_notify->height;
inst->prop.width[OUTPUT_PORT] = event_notify->width;
} }
inst->seqchanged_count++; inst->seqchanged_count++;