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

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

Merge "mdss: mdp3: Flush fences on dma stop"

parents e3c52fec 3650a56d
Loading
Loading
Loading
Loading
+25 −8
Original line number Diff line number Diff line
@@ -151,10 +151,32 @@ int mdp3_ctrl_notify(struct mdp3_session_data *ses, int event)
	return blocking_notifier_call_chain(&ses->notifier_head, event, ses);
}

static void __mdp3_dispatch_dma_done(struct mdp3_session_data *session)
{
	int cnt;

	cnt = atomic_read(&session->dma_done_cnt);
	MDSS_XLOG(cnt);
	while (cnt > 0) {
		mdp3_ctrl_notify(session, MDP_NOTIFY_FRAME_DONE);
		atomic_dec(&session->dma_done_cnt);
		cnt--;
	}
}

void mdp3_flush_dma_done(struct mdp3_session_data *session)
{
	if (!session)
		return;

	pr_debug("%s\n", __func__);

	__mdp3_dispatch_dma_done(session);
}

static void mdp3_dispatch_dma_done(struct kthread_work *work)
{
	struct mdp3_session_data *session;
	int cnt = 0;

	pr_debug("%s\n", __func__);
	session = container_of(work, struct mdp3_session_data,
@@ -162,13 +184,7 @@ static void mdp3_dispatch_dma_done(struct kthread_work *work)
	if (!session)
		return;

	cnt = atomic_read(&session->dma_done_cnt);
	MDSS_XLOG(cnt);
	while (cnt > 0) {
		mdp3_ctrl_notify(session, MDP_NOTIFY_FRAME_DONE);
		atomic_dec(&session->dma_done_cnt);
		cnt--;
	}
	__mdp3_dispatch_dma_done(session);
}

static void mdp3_dispatch_clk_off(struct work_struct *work)
@@ -3060,6 +3076,7 @@ int mdp3_ctrl_init(struct msm_fb_data_type *mfd)
		pr_err("fail to init dma\n");
		goto init_done;
	}
	mdp3_session->dma->session = mdp3_session;

	intf_type = mdp3_ctrl_get_intf_type(mfd);
	mdp3_session->intf = mdp3_get_display_intf(intf_type);
+1 −0
Original line number Diff line number Diff line
@@ -91,5 +91,6 @@ int mdp3_ctrl_get_source_format(u32 imgType);
int mdp3_ctrl_get_pack_pattern(u32 imgType);
int mdp3_ctrl_reset(struct msm_fb_data_type *mfd);
int mdp3_get_ion_client(struct msm_fb_data_type *mfd);
void mdp3_flush_dma_done(struct mdp3_session_data *mdp3_session);

#endif /* MDP3_CTRL_H */
+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include "mdp3_dma.h"
#include "mdp3_hwio.h"
#include "mdss_debug.h"
#include "mdp3_ctrl.h"

#define DMA_STOP_POLL_SLEEP_US 1000
#define DMA_STOP_POLL_TIMEOUT_US 200000
@@ -1080,6 +1081,16 @@ static int mdp3_dma_stop(struct mdp3_dma *dma, struct mdp3_intf *intf)

	reinit_completion(&dma->dma_comp);
	dma->vsync_client.handler = NULL;

	/*
	 * Interrupts are disabled.
	 * Check for blocked dma done interrupt.
	 * Flush items waiting for dma done interrupt.
	 */
	if (dma->output_config.out_sel == MDP3_DMA_OUTPUT_SEL_DSI_CMD &&
		atomic_read(&dma->session->dma_done_cnt))
		mdp3_flush_dma_done(dma->session);

	return ret;
}

+2 −0
Original line number Diff line number Diff line
@@ -293,6 +293,8 @@ struct mdp3_dma {
	struct fb_cmap *gc_cmap;
	struct fb_cmap *hist_cmap;

	struct mdp3_session_data *session;

	bool (*busy)(void);

	int (*dma_config)(struct mdp3_dma *dma,