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

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

msm: vidc: change interface for opening driver instance



This change will ensure that vidc clients specify the
core id as venus or q6 to open a driver session.
Without this change, sometimes due to driver probe deferral,
core_id_0 would be taken by q6 and vidc clients intending to open a
venus decode session ended up opening a q6 decode session.

Change-Id: I4f9c862b8057999e4db7ca75be493138737a58a8
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 4a2fbc17
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2264,7 +2264,8 @@ static int mpq_dvb_open_v4l2(
		rc = -ENOMEM;
		goto fail_create_v4l2;
	}
	v4l2_inst->vidc_inst = msm_vidc_open(MSM_VIDC_CORE_0, MSM_VIDC_DECODER);
	v4l2_inst->vidc_inst = msm_vidc_open(MSM_VIDC_CORE_VENUS,
					MSM_VIDC_DECODER);
	if (!v4l2_inst->vidc_inst) {
		ERR("Failed to open VIDC driver\n");
		rc = -EFAULT;
+5 −1
Original line number Diff line number Diff line
@@ -400,7 +400,11 @@ static int msm_vidc_probe(struct platform_device *pdev)
	if (core->hfi_type == VIDC_HFI_Q6) {
		dprintk(VIDC_DBG, "Q6 hfi device probe called\n");
		nr += MSM_VIDC_MAX_DEVICES;
		core->id = MSM_VIDC_CORE_Q6;
	} else {
		core->id = MSM_VIDC_CORE_VENUS;
	}

	rc = v4l2_device_register(&pdev->dev, &core->v4l2_dev);
	if (rc) {
		dprintk(VIDC_ERR, "Failed to register v4l2 device\n");
@@ -455,7 +459,7 @@ static int msm_vidc_probe(struct platform_device *pdev)
				vidc_driver->num_cores);
		goto err_cores_exceeded;
	}
	core->id = vidc_driver->num_cores++;
	vidc_driver->num_cores++;
	mutex_unlock(&vidc_driver->lock);

	core->device = vidc_hfi_initialize(core->hfi_type, core->id,
+2 −1
Original line number Diff line number Diff line
@@ -377,7 +377,8 @@ static long venc_open(struct v4l2_subdev *sd, void *arg)
		goto vidc_wq_create_fail;
	}

	inst->vidc_context = msm_vidc_open(MSM_VIDC_CORE_0, MSM_VIDC_ENCODER);
	inst->vidc_context = msm_vidc_open(MSM_VIDC_CORE_VENUS,
				MSM_VIDC_ENCODER);
	if (!inst->vidc_context) {
		WFD_MSG_ERR("Failed to create vidc context\n");
		rc = -ENXIO;
+2 −2
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ enum smem_cache_ops {
};

enum core_id {
	MSM_VIDC_CORE_0 = 0,
	MSM_VIDC_CORE_1,      /* for Q6 core */
	MSM_VIDC_CORE_VENUS = 0,
	MSM_VIDC_CORE_Q6,
	MSM_VIDC_CORES_MAX,
};
enum session_type {