Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 612a31d1 authored by Vikash Garodia's avatar Vikash Garodia Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: update video resolution during reconfig event



Video port resolution can be updated during reconfig event itself.
With this, reconfig height and width was removed. Also relevant
code cleanup was made accordingly.

Change-Id: I4fb38563b4c747eb356f28b7df7e99bd397ff8d1
Signed-off-by: default avatarVikash Garodia <vgarodia@codeaurora.org>
parent a0fbf77b
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -670,10 +670,6 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
		memcpy(f, fmt, sizeof(struct v4l2_format));
	} else if (f->type == INPUT_MPLANE) {
		fmt = &inst->fmts[INPUT_PORT].v4l2_fmt;
		if (inst->in_reconfig) {
			fmt->fmt.pix_mp.width = inst->reconfig_width;
			fmt->fmt.pix_mp.height = inst->reconfig_height;
		}
		fmt->fmt.pix_mp.plane_fmt[0].sizeimage =
			msm_vidc_calculate_dec_input_frame_size(inst);
		memcpy(f, fmt, sizeof(struct v4l2_format));
+2 −7
Original line number Diff line number Diff line
@@ -124,15 +124,10 @@ int msm_vidc_get_mbs_per_frame(struct msm_vidc_inst *inst)

	out_f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
	inp_f = &inst->fmts[INPUT_PORT].v4l2_fmt;
	if (!inst->in_reconfig) {
	height = max(out_f->fmt.pix_mp.height,
			inp_f->fmt.pix_mp.height);
	width = max(out_f->fmt.pix_mp.width,
			inp_f->fmt.pix_mp.width);
	} else {
		height = inst->reconfig_height;
		width = inst->reconfig_width;
	}

	return NUM_MBS_PER_FRAME(height, width);
}
+8 −14
Original line number Diff line number Diff line
@@ -732,10 +732,7 @@ static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst)
	struct v4l2_format *f;

	f = &inst->fmts[INPUT_PORT].v4l2_fmt;
	input_port_mbs = inst->in_reconfig ?
			NUM_MBS_PER_FRAME(inst->reconfig_width,
				inst->reconfig_height) :
			NUM_MBS_PER_FRAME(f->fmt.pix_mp.width,
	input_port_mbs = NUM_MBS_PER_FRAME(f->fmt.pix_mp.width,
		f->fmt.pix_mp.height);

	f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
@@ -1730,11 +1727,14 @@ static void handle_event_change(enum hal_command_response cmd, void *data)

	mutex_lock(&inst->lock);
	inst->in_reconfig = true;
	inst->reconfig_height = event_notify->height;
	inst->reconfig_width = event_notify->width;
	fmt = &inst->fmts[INPUT_PORT];
	fmt->v4l2_fmt.fmt.pix_mp.height = event_notify->height;
	fmt->v4l2_fmt.fmt.pix_mp.width = event_notify->width;
	inst->bit_depth = event_notify->bit_depth;

	fmt = &inst->fmts[OUTPUT_PORT];
	fmt->v4l2_fmt.fmt.pix_mp.height = event_notify->height;
	fmt->v4l2_fmt.fmt.pix_mp.width = event_notify->width;
	extra_buff_count = msm_vidc_get_extra_buff_count(inst,
					HAL_BUFFER_OUTPUT);
	fmt->count_min = event_notify->capture_buf_count;
@@ -5762,7 +5762,6 @@ int msm_comm_session_continue(void *instance)
	struct msm_vidc_inst *inst = instance;
	int rc = 0;
	struct hfi_device *hdev;
	struct v4l2_format *f;

	if (!inst || !inst->core || !inst->core->device)
		return -EINVAL;
@@ -5786,12 +5785,7 @@ int msm_comm_session_continue(void *instance)
			goto sess_continue_fail;
		}
		inst->in_reconfig = false;
		f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
		f->fmt.pix_mp.height = inst->reconfig_height;
		f->fmt.pix_mp.width = inst->reconfig_width;
		f = &inst->fmts[INPUT_PORT].v4l2_fmt;
		f->fmt.pix_mp.height = inst->reconfig_height;
		f->fmt.pix_mp.width = inst->reconfig_width;

		if (msm_comm_get_stream_output_mode(inst) ==
			HAL_VIDEO_DECODER_SECONDARY) {
			rc = msm_comm_queue_dpb_only_buffers(inst);
+0 −2
Original line number Diff line number Diff line
@@ -483,8 +483,6 @@ struct msm_vidc_inst {
	struct v4l2_fh event_handler;
	struct msm_smem *extradata_handle;
	bool in_reconfig;
	u32 reconfig_width;
	u32 reconfig_height;
	struct dentry *debugfs_root;
	void *priv;
	struct msm_vidc_debug debug;