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

Commit 359d85b4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Handle encoder input in true dynamic mode"

parents 04a6f948 1681bd42
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -385,6 +385,13 @@ static inline bool is_dynamic_output_buffer_mode(struct v4l2_buffer *b,
}


static inline bool is_encoder_input_buffer(struct v4l2_buffer *b,
				struct msm_vidc_inst *inst)
{
	return b->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE &&
			inst->session_type == MSM_VIDC_ENCODER;
}

static inline void save_v4l2_buffer(struct v4l2_buffer *b,
						struct buffer_info *binfo)
{
@@ -935,8 +942,8 @@ int msm_vidc_dqbuf(void *instance, struct v4l2_buffer *b)
	if (rc)
		return rc;


	if (is_dynamic_output_buffer_mode(b, inst)) {
	if (is_dynamic_output_buffer_mode(b, inst) ||
		is_encoder_input_buffer(b, inst)) {
		buffer_info->dequeued = true;

		dprintk(VIDC_DBG, "[DEQUEUED]: fd[0] = %d\n",
+32 −0
Original line number Diff line number Diff line
@@ -1650,6 +1650,36 @@ static struct vb2_buffer *get_vb_from_device_addr(struct buf_queue *bufq,
	return vb;
}


static void handle_dynamic_input_buffer(struct msm_vidc_inst *inst,
		ion_phys_addr_t device_addr)
{
	struct buffer_info *binfo = NULL, *temp = NULL;

	if (inst->session_type == MSM_VIDC_ENCODER) {
		binfo = device_to_uvaddr(&inst->registeredbufs, device_addr);
		if (!binfo) {
			dprintk(VIDC_ERR,
				"%s buffer not found in registered list\n",
				__func__);
			return;
		}
		dprintk(VIDC_DBG,
			"EBD fd[0] = %d -> EBD_ref_released, addr: %pa\n",
			binfo->fd[0], &device_addr);

		mutex_lock(&inst->registeredbufs.lock);
		list_for_each_entry(temp, &inst->registeredbufs.list,
				list) {
			if (temp == binfo) {
				binfo->pending_deletion = true;
				break;
			}
		}
		mutex_unlock(&inst->registeredbufs.lock);
	}
}

static void handle_ebd(enum hal_command_response cmd, void *data)
{
	struct msm_vidc_cb_data_done *response = data;
@@ -1669,6 +1699,8 @@ static void handle_ebd(enum hal_command_response cmd, void *data)
		return;
	}

	handle_dynamic_input_buffer(inst, response->input_done.packet_buffer);

	vb = get_vb_from_device_addr(&inst->bufq[OUTPUT_PORT],
			response->input_done.packet_buffer);
	if (vb) {