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

Commit 4831a060 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: add different mutex lock for QBUF/DQBUF"

parents 7fc57d25 1e1d507e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -223,9 +223,9 @@ static int camera_v4l2_reqbufs(struct file *filep, void *fh,
	session = msm_session_find(session_id);
	if (WARN_ON(!session))
		return -EIO;
	mutex_lock(&session->lock);
	mutex_lock(&session->lock_q);
	ret = vb2_reqbufs(&sp->vb2_q, req);
	mutex_unlock(&session->lock);
	mutex_unlock(&session->lock_q);
	return ret;
}

@@ -246,9 +246,9 @@ static int camera_v4l2_qbuf(struct file *filep, void *fh,
	session = msm_session_find(session_id);
	if (WARN_ON(!session))
		return -EIO;
	mutex_lock(&session->lock);
	mutex_lock(&session->lock_q);
	ret = vb2_qbuf(&sp->vb2_q, pb);
	mutex_unlock(&session->lock);
	mutex_unlock(&session->lock_q);
	return ret;
}

@@ -263,9 +263,9 @@ static int camera_v4l2_dqbuf(struct file *filep, void *fh,
	session = msm_session_find(session_id);
	if (WARN_ON(!session))
		return -EIO;
	mutex_lock(&session->lock);
	mutex_lock(&session->lock_q);
	ret = vb2_dqbuf(&sp->vb2_q, pb, filep->f_flags & O_NONBLOCK);
	mutex_unlock(&session->lock);
	mutex_unlock(&session->lock_q);
	return ret;
}

+2 −0
Original line number Diff line number Diff line
@@ -461,6 +461,7 @@ int msm_create_session(unsigned int session_id, struct video_device *vdev)
	msm_init_queue(&session->stream_q);
	msm_enqueue(msm_session_q, &session->list);
	mutex_init(&session->lock);
	mutex_init(&session->lock_q);
	return 0;
}

@@ -618,6 +619,7 @@ int msm_destroy_session(unsigned int session_id)
	msm_destroy_session_streams(session);
	msm_remove_session_cmd_ack_q(session);
	mutex_destroy(&session->lock);
	mutex_destroy(&session->lock_q);
	msm_delete_entry(msm_session_q, struct msm_session,
		list, session);
	buf_mgr_subdev = msm_buf_mngr_get_subdev();
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -99,6 +99,7 @@ struct msm_session {
	 * session struct msm_stream */
	struct msm_queue_head stream_q;
	struct mutex lock;
	struct mutex lock_q;
};

int msm_post_event(struct v4l2_event *event, int timeout);