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

Commit c64144d1 authored by Adrian Salido-Moreno's avatar Adrian Salido-Moreno
Browse files

msm: mdss: allow asynchronous acquire fence waits



Add optional flag to allow MDP driver to asynchronously wait for fences
instead of doing it at beginning of every commit. This allows the wait
to happen much later in the programming sequence so that, we can use
that time to do everything that is needed and have a smaller window
between the wait for fences and the next frame update.

Change-Id: Ib4f7601ed22670ba235ba86fe3389a5d54d685a9
Signed-off-by: default avatarAdrian Salido-Moreno <adrianm@codeaurora.org>
parent 29d01d47
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1388,6 +1388,10 @@ static int __mdss_fb_sync_buf_done_callback(struct notifier_block *p,
	sync_pt_data = container_of(p, struct msm_sync_pt_data, notifier);

	switch (event) {
	case MDP_NOTIFY_FRAME_READY:
		if (sync_pt_data->async_wait_fences)
			mdss_fb_wait_for_fence(sync_pt_data);
		break;
	case MDP_NOTIFY_FRAME_FLUSHED:
		pr_debug("%s: frame flushed\n", sync_pt_data->fence_name);
		sync_pt_data->flushed = true;
@@ -1536,6 +1540,7 @@ static int __mdss_fb_perform_commit(struct msm_fb_data_type *mfd)
	struct msm_fb_backup_type *fb_backup = &mfd->msm_fb_backup;
	int ret = -ENOSYS;

	if (!sync_pt_data->async_wait_fences)
		mdss_fb_wait_for_fence(sync_pt_data);
	sync_pt_data->flushed = false;

+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,9 @@
 *
 * @MDP_NOTIFY_FRAME_BEGIN:	Frame update has started, the frame is about to
 *				be programmed into hardware.
 * @MDP_NOTIFY_FRAME_READY:	Frame ready to be kicked off, this can be used
 *				as the last point in time to synchronized with
 *				source buffers before kickoff.
 * @MDP_NOTIFY_FRAME_FLUSHED:	Configuration of frame has been flushed and
 *				DMA transfer has started.
 * @MDP_NOTIFY_FRAME_DONE:	Frame DMA transfer has completed.
@@ -61,6 +64,7 @@
 */
enum mdp_notify_event {
	MDP_NOTIFY_FRAME_BEGIN = 1,
	MDP_NOTIFY_FRAME_READY,
	MDP_NOTIFY_FRAME_FLUSHED,
	MDP_NOTIFY_FRAME_DONE,
	MDP_NOTIFY_FRAME_TIMEOUT,
@@ -90,6 +94,7 @@ struct msm_sync_pt_data {

	atomic_t commit_cnt;
	bool flushed;
	bool async_wait_fences;

	struct mutex sync_mutex;
	struct notifier_block notifier;