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

Commit 66d44ae8 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 6602b657 on remote branch

Change-Id: I97e55e81dfacabd31c9b3c877a9c93cb8a3cf9cf
parents 45517566 6602b657
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -677,6 +677,7 @@ static int msm_vidc_pm_suspend(struct device *dev)
	int rc = 0;
	struct msm_vidc_core *core;

	d_vpr_h("%s\n", __func__);
	/*
	 * Bail out if
	 * - driver possibly not probed yet
@@ -698,14 +699,33 @@ static int msm_vidc_pm_suspend(struct device *dev)
		rc = 0;
	else if (rc)
		d_vpr_e("Failed to suspend: %d\n", rc);

	else
		core->pm_suspended  = true;

	return rc;
}

static int msm_vidc_pm_resume(struct device *dev)
{
	struct msm_vidc_core *core;

	d_vpr_h("%s\n", __func__);
	/*
	 * Bail out if
	 * - driver possibly not probed yet
	 * - not the main device. We don't support power management on
	 *   subdevices (e.g. context banks)
	 */
	if (!dev || !dev->driver ||
		!of_device_is_compatible(dev->of_node, "qcom,msm-vidc"))
		return 0;

	core = dev_get_drvdata(dev);
	if (!core) {
		d_vpr_e("%s: invalid core\n", __func__);
		return -EINVAL;
	}
	core->pm_suspended  = false;
	return 0;
}

+9 −2
Original line number Diff line number Diff line
@@ -3054,6 +3054,7 @@ static int msm_comm_init_core(struct msm_vidc_inst *inst)
	core->state = VIDC_CORE_INIT;
	core->smmu_fault_handled = false;
	core->trigger_ssr = false;
	core->pm_suspended = false;
	core->resources.max_secure_inst_count =
		core->resources.max_secure_inst_count ?
		core->resources.max_secure_inst_count :
@@ -4540,10 +4541,11 @@ void msm_vidc_batch_handler(struct work_struct *work)
{
	int rc = 0;
	struct msm_vidc_inst *inst;
	struct msm_vidc_core *core;

	inst = container_of(work, struct msm_vidc_inst, batch_work.work);
	inst = get_inst(get_vidc_core(MSM_VIDC_CORE_VENUS), inst);
	if (!inst) {
	if (!inst || !inst->core) {
		d_vpr_e("%s: invalid params\n", __func__);
		return;
	}
@@ -4553,9 +4555,14 @@ void msm_vidc_batch_handler(struct work_struct *work)
		goto exit;
	}

	core = inst->core;
	if (core->pm_suspended) {
		s_vpr_h(inst->sid, "%s: device in pm suspend state\n", __func__);
		goto exit;
	}

	s_vpr_h(inst->sid, "%s: queue pending batch buffers\n",
		__func__);

	rc = msm_comm_qbufs_batch(inst, NULL);
	if (rc) {
		s_vpr_e(inst->sid, "%s: batch qbufs failed\n", __func__);
+1 −0
Original line number Diff line number Diff line
@@ -508,6 +508,7 @@ struct msm_vidc_core {
	unsigned long min_freq;
	unsigned long curr_freq;
	struct msm_vidc_core_ops *core_ops;
	bool pm_suspended;
};

struct msm_vidc_inst;