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

Commit a989b669 authored by Peter Liu's avatar Peter Liu
Browse files

msm: camera: isp: use proper buffer manager lock



Buffer manager is shared by 2 VFE, so buffer operation
need to acuire lock on buf mgr instead of on each vfe dev.

Use original buffer manager lock to protect instead of
new per vfe device buf manager lock.

Change-Id: I39a4f31b8769b867850babd29b64f785bcbc4374
Signed-off-by: default avatarPeter Liu <pingchie@codeaurora.org>
parent 1d6b7340
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -573,7 +573,6 @@ int vfe_hw_probe(struct platform_device *pdev)
	platform_set_drvdata(pdev, &vfe_dev->subdev.sd);
	mutex_init(&vfe_dev->realtime_mutex);
	mutex_init(&vfe_dev->core_mutex);
	mutex_init(&vfe_dev->buf_mgr_mutex);
	spin_lock_init(&vfe_dev->tasklet_lock);
	spin_lock_init(&vfe_dev->shared_data_lock);
	spin_lock_init(&vfe_dev->reg_update_lock);
+0 −1
Original line number Diff line number Diff line
@@ -665,7 +665,6 @@ struct vfe_device {
	struct completion stats_config_complete;
	struct mutex realtime_mutex;
	struct mutex core_mutex;
	struct mutex buf_mgr_mutex;
	spinlock_t shared_data_lock;
	spinlock_t reg_update_lock;
	spinlock_t tasklet_lock;
+2 −4
Original line number Diff line number Diff line
@@ -965,9 +965,9 @@ static long msm_isp_ioctl_unlocked(struct v4l2_subdev *sd,
		/* fallthrough */
	case VIDIOC_MSM_ISP_DEQUEUE_BUF: {
		/* fallthrough */
		mutex_lock(&vfe_dev->buf_mgr_mutex);
		mutex_lock(&vfe_dev->buf_mgr->lock);
		rc = msm_isp_proc_buf_cmd(vfe_dev->buf_mgr, cmd, arg);
		mutex_unlock(&vfe_dev->buf_mgr_mutex);
		mutex_unlock(&vfe_dev->buf_mgr->lock);
		break;
	}
	case VIDIOC_MSM_ISP_RELEASE_BUF: {
@@ -977,9 +977,7 @@ static long msm_isp_ioctl_unlocked(struct v4l2_subdev *sd,
			return rc;
		}
		mutex_lock(&vfe_dev->buf_mgr->lock);
		mutex_lock(&vfe_dev->buf_mgr_mutex);
		rc = msm_isp_proc_buf_cmd(vfe_dev->buf_mgr, cmd, arg);
		mutex_unlock(&vfe_dev->buf_mgr_mutex);
		mutex_unlock(&vfe_dev->buf_mgr->lock);
		break;
	}