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

Commit 6cb8923f 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: Avoid deadlock in dcvs during scale clocks"

parents a020f1c4 2a30c8fb
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1486,6 +1486,9 @@ int buf_ref_get(struct msm_vidc_inst *inst, struct buffer_info *binfo)
		dprintk(VIDC_DBG, "%s: invalid ref_cnt: %d\n", __func__, cnt);
		dprintk(VIDC_DBG, "%s: invalid ref_cnt: %d\n", __func__, cnt);
		cnt = -EINVAL;
		cnt = -EINVAL;
	}
	}
	if (cnt == 2)
		inst->buffers_held_in_driver++;

	dprintk(VIDC_DBG, "REF_GET[%d] fd[0] = %d\n", cnt, binfo->fd[0]);
	dprintk(VIDC_DBG, "REF_GET[%d] fd[0] = %d\n", cnt, binfo->fd[0]);


	return cnt;
	return cnt;
@@ -1533,6 +1536,7 @@ int buf_ref_put(struct msm_vidc_inst *inst, struct buffer_info *binfo)
			binfo->fd[0]);
			binfo->fd[0]);
		binfo->pending_deletion = true;
		binfo->pending_deletion = true;
	} else if (qbuf_again) {
	} else if (qbuf_again) {
		inst->buffers_held_in_driver--;
		rc = qbuf_dynamic_buf(inst, binfo);
		rc = qbuf_dynamic_buf(inst, binfo);
		if (!rc)
		if (!rc)
			return rc;
			return rc;
+1 −12
Original line number Original line Diff line number Diff line
@@ -126,19 +126,8 @@ static inline int get_pending_bufs_fw(struct msm_vidc_inst *inst)


	if (inst->state >= MSM_VIDC_OPEN_DONE &&
	if (inst->state >= MSM_VIDC_OPEN_DONE &&
		inst->state < MSM_VIDC_STOP_DONE) {
		inst->state < MSM_VIDC_STOP_DONE) {
		struct buffer_info *temp = NULL;

		fw_out_qsize = inst->count.ftb - inst->count.fbd;
		fw_out_qsize = inst->count.ftb - inst->count.fbd;

		buffers_in_driver = inst->buffers_held_in_driver;
		mutex_lock(&inst->registeredbufs.lock);
		list_for_each_entry(temp, &inst->registeredbufs.list, list) {
			if (temp->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE &&
				!temp->inactive &&
				atomic_read(&temp->ref_count) == 2) {
				buffers_in_driver++;
			}
		}
		mutex_unlock(&inst->registeredbufs.lock);
	}
	}


	return fw_out_qsize + buffers_in_driver;
	return fw_out_qsize + buffers_in_driver;
+1 −0
Original line number Original line Diff line number Diff line
@@ -298,6 +298,7 @@ struct msm_vidc_inst {
	enum msm_vidc_pixel_depth bit_depth;
	enum msm_vidc_pixel_depth bit_depth;
	struct kref kref;
	struct kref kref;
	unsigned long instant_bitrate;
	unsigned long instant_bitrate;
	u32 buffers_held_in_driver;
};
};


extern struct msm_vidc_drv *vidc_driver;
extern struct msm_vidc_drv *vidc_driver;