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

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

msm: vidc: Free VMEM if core goes in to bad state



If the Venus core goes in to bad state, the video driver
was skipping unset and free of VMEM before firmware was
unloaded. This would cause VMEM to be not set for the
next session, as __alloc_set_imem() would bail out
complaining that VMEM is already allocated. Not setting
VMEM could cause the video session to fail.

Change-Id: I76539bfb34ae50dd07566e50f377d98d51ed6e6f
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 960a45b8
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -1212,10 +1212,8 @@ static int __unset_free_imem(struct venus_hfi_device *device)
		return 0;

	rc = __unset_imem(device);
	if (rc) {
	if (rc)
		dprintk(VIDC_WARN, "Failed to unset imem: %d\n", rc);
		goto unset_failed;
	}

	rc = __free_imem(device);
	if (rc) {
@@ -1223,7 +1221,6 @@ static int __unset_free_imem(struct venus_hfi_device *device)
		goto free_failed;
	}

unset_failed:
free_failed:
	return rc;
}
@@ -2352,13 +2349,11 @@ static int __core_release(struct venus_hfi_device *device)
		return -EIO;
	}

	if (device->state != VENUS_STATE_DEINIT) {
	rc = __unset_free_imem(device);
	if (rc)
		dprintk(VIDC_ERR,
			"Failed to unset and free imem in core release: %d\n",
			rc);
	}

	if (!(device->intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK))
		disable_irq_nosync(device->hal_data->irq);