Loading drivers/media/platform/msm/vidc/msm_vdec.c +12 −50 Original line number Diff line number Diff line Loading @@ -1090,23 +1090,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.num_planes = fmt->num_planes; if (inst->in_reconfig) { bool ds_enabled = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_KEEP_ASPECT_RATIO); /* * 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); if (rc) { Loading @@ -1133,6 +1118,12 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) f->fmt.pix_mp.plane_fmt[i].sizeimage = 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 { switch (fmt->fourcc) { case V4L2_PIX_FMT_NV12: Loading Loading @@ -1170,34 +1161,15 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) for (i = 0; i < fmt->num_planes; ++i) inst->bufq[CAPTURE_PORT].vb2_bufq.plane_sizes[i] = 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 = (__u16)stride; f->fmt.pix_mp.plane_fmt[0].reserved[0] = (__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: return rc; } Loading Loading @@ -1263,13 +1235,8 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) inst->prop.width[CAPTURE_PORT] = f->fmt.pix_mp.width; inst->prop.height[CAPTURE_PORT] = f->fmt.pix_mp.height; if (msm_comm_get_stream_output_mode(inst) == HAL_VIDEO_DECODER_PRIMARY) { inst->prop.width[OUTPUT_PORT] = f->fmt.pix_mp.width; inst->prop.height[OUTPUT_PORT] = f->fmt.pix_mp.height; msm_comm_set_color_format(inst, HAL_BUFFER_OUTPUT, f->fmt.pix_mp.pixelformat); } inst->fmts[fmt->type] = fmt; if (msm_comm_get_stream_output_mode(inst) == Loading Loading @@ -1311,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) { inst->prop.width[OUTPUT_PORT] = f->fmt.pix_mp.width; 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, ARRAY_SIZE(vdec_formats), Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +12 −10 Original line number Diff line number Diff line Loading @@ -284,8 +284,12 @@ static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst) u32 fps; struct v4l2_control ctrl; output_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[OUTPUT_PORT], output_port_mbs = inst->in_reconfig ? 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], inst->prop.height[CAPTURE_PORT]); Loading Loading @@ -1231,8 +1235,6 @@ static void handle_event_change(enum hal_command_response cmd, void *data) "event_notify->height = %d event_notify->width = %d\n", event_notify->height, event_notify->width); inst->prop.height[CAPTURE_PORT] = event_notify->height; inst->prop.width[CAPTURE_PORT] = event_notify->width; inst->prop.height[OUTPUT_PORT] = event_notify->height; inst->prop.width[OUTPUT_PORT] = event_notify->width; } Loading Loading
drivers/media/platform/msm/vidc/msm_vdec.c +12 −50 Original line number Diff line number Diff line Loading @@ -1090,23 +1090,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.num_planes = fmt->num_planes; if (inst->in_reconfig) { bool ds_enabled = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_KEEP_ASPECT_RATIO); /* * 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); if (rc) { Loading @@ -1133,6 +1118,12 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) f->fmt.pix_mp.plane_fmt[i].sizeimage = 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 { switch (fmt->fourcc) { case V4L2_PIX_FMT_NV12: Loading Loading @@ -1170,34 +1161,15 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) for (i = 0; i < fmt->num_planes; ++i) inst->bufq[CAPTURE_PORT].vb2_bufq.plane_sizes[i] = 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 = (__u16)stride; f->fmt.pix_mp.plane_fmt[0].reserved[0] = (__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: return rc; } Loading Loading @@ -1263,13 +1235,8 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) inst->prop.width[CAPTURE_PORT] = f->fmt.pix_mp.width; inst->prop.height[CAPTURE_PORT] = f->fmt.pix_mp.height; if (msm_comm_get_stream_output_mode(inst) == HAL_VIDEO_DECODER_PRIMARY) { inst->prop.width[OUTPUT_PORT] = f->fmt.pix_mp.width; inst->prop.height[OUTPUT_PORT] = f->fmt.pix_mp.height; msm_comm_set_color_format(inst, HAL_BUFFER_OUTPUT, f->fmt.pix_mp.pixelformat); } inst->fmts[fmt->type] = fmt; if (msm_comm_get_stream_output_mode(inst) == Loading Loading @@ -1311,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) { inst->prop.width[OUTPUT_PORT] = f->fmt.pix_mp.width; 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, ARRAY_SIZE(vdec_formats), Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +12 −10 Original line number Diff line number Diff line Loading @@ -284,8 +284,12 @@ static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst) u32 fps; struct v4l2_control ctrl; output_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[OUTPUT_PORT], output_port_mbs = inst->in_reconfig ? 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], inst->prop.height[CAPTURE_PORT]); Loading Loading @@ -1231,8 +1235,6 @@ static void handle_event_change(enum hal_command_response cmd, void *data) "event_notify->height = %d event_notify->width = %d\n", event_notify->height, event_notify->width); inst->prop.height[CAPTURE_PORT] = event_notify->height; inst->prop.width[CAPTURE_PORT] = event_notify->width; inst->prop.height[OUTPUT_PORT] = event_notify->height; inst->prop.width[OUTPUT_PORT] = event_notify->width; } Loading