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

Commit e30a02e0 authored by Arun Menon's avatar Arun Menon
Browse files

msm: vidc: set ctrl to request sequence header for encoder



The encoder depended on a debug variable i.e. ftb_count, to
request firmware to send sequence header. Remove this
dependency and make the request only when the encoder
client requests using the provided set ctrl.

Change-Id: Iac4104c33eef62da553066c736b7adc87834d2ac
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 745417f2
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -770,6 +770,18 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.menu_skip_mask = 0,
		.qmenu = NULL,
		.cluster = 0,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_SEQ_HEADER,
		.name = "Request Seq Header",
		.type = V4L2_CTRL_TYPE_BUTTON,
		.minimum = 0,
		.maximum = 0,
		.default_value = 0,
		.step = 0,
		.menu_skip_mask = 0,
		.qmenu = NULL,
		.cluster = 0,
	}
};

@@ -1998,9 +2010,7 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		time_res.time_increment_resolution = ctrl->val;
		pdata = &time_res;
		break;
	default:
		rc = -ENOTSUPP;
		break;

	case V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE:
	{
		struct v4l2_ctrl *rotation = NULL;
@@ -2032,6 +2042,12 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		pdata = &enable;
		break;
	}
	case V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_SEQ_HEADER:
		atomic_inc(&inst->get_seq_hdr_cnt);
		break;
	default:
		rc = -ENOTSUPP;
		break;
	}
#undef TRY_GET_CTRL

+2 −1
Original line number Diff line number Diff line
@@ -2482,7 +2482,7 @@ int msm_comm_qbuf(struct vb2_buffer *vb)
			dprintk(VIDC_DBG,
				" extradata_addr: %d\n",
				frame_data.extradata_addr);
			if (!inst->ftb_count &&
			if (atomic_read(&inst->get_seq_hdr_cnt) &&
			   inst->session_type == MSM_VIDC_ENCODER) {
				seq_hdr.seq_hdr = (u8 *) vb->v4l2_planes[0].
					m.userptr;
@@ -2494,6 +2494,7 @@ int msm_comm_qbuf(struct vb2_buffer *vb)
					dprintk(VIDC_DBG, "Seq_hdr: %p\n",
						inst->vb2_seq_hdr);
				}
				atomic_dec(&inst->get_seq_hdr_cnt);
			} else {
				rc = call_hfi_op(hdev, session_ftb,
					(void *) inst->session, &frame_data);
+1 −0
Original line number Diff line number Diff line
@@ -244,6 +244,7 @@ struct msm_vidc_inst {
	enum buffer_mode_type buffer_mode_set[MAX_PORT_NUM];
	struct list_head registered_bufs;
	bool map_output_buffer;
	atomic_t get_seq_hdr_cnt;
};

extern struct msm_vidc_drv *vidc_driver;
+3 −0
Original line number Diff line number Diff line
@@ -834,6 +834,9 @@ enum v4l2_mpeg_vidc_video_mpeg2_profile {
	V4L2_MPEG_VIDC_VIDEO_MPEG2_PROFILE_HIGH			= 5,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_SEQ_HEADER \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 42)

/*  Camera class control IDs */

#define V4L2_CID_CAMERA_CLASS_BASE 	(V4L2_CTRL_CLASS_CAMERA | 0x900)