disp: msm: clear dma done interrupt status for slave controller

When Broadcast is enabled, DMA_DONE bit gets set for slave
controller on command transfer completion but it is not
getting cleared. Due to this, DMA transfer failures on slave
controller are not getting caught. This patch add supports for
clearing DMA_DONE for slave controller on every successful
transfer. This also prints error if transfer fails on slave
controller.

Change-Id: I61ce7b2d8be323adc70d888b5a2416afd9ae9fac
Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
This commit is contained in:
Harigovindan P
2020-09-15 12:50:42 +05:30
committed by Satya Rama Aditya Pinapala
parent aecc86dfb2
commit 98767bf22b
5 changed files with 61 additions and 6 deletions

View File

@@ -410,24 +410,48 @@ static void dsi_ctrl_dma_cmd_wait_for_done(struct dsi_ctrl *dsi_ctrl)
}
/**
* dsi_ctrl_clear_dma_status - API to clear DMA status
* @dsi_ctrl: DSI controller handle.
*/
static void dsi_ctrl_clear_dma_status(struct dsi_ctrl *dsi_ctrl)
{
struct dsi_ctrl_hw_ops dsi_hw_ops;
u32 status = 0;
if (!dsi_ctrl) {
DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n");
return;
}
dsi_hw_ops = dsi_ctrl->hw.ops;
status = dsi_hw_ops.poll_dma_status(&dsi_ctrl->hw);
SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_ENTRY, status);
status |= (DSI_CMD_MODE_DMA_DONE | DSI_BTA_DONE);
dsi_hw_ops.clear_interrupt_status(&dsi_ctrl->hw, status);
}
static void dsi_ctrl_post_cmd_transfer(struct dsi_ctrl *dsi_ctrl)
{
int rc = 0;
struct dsi_clk_ctrl_info clk_info;
bool skip_wait_for_done = false;
u32 mask = BIT(DSI_FIFO_OVERFLOW);
mutex_lock(&dsi_ctrl->ctrl_lock);
SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY, dsi_ctrl->cell_index, dsi_ctrl->pending_cmd_flags);
/* In case of broadcast messages, we needn't wait on the slave controller */
/* In case of broadcast messages, we poll on the slave controller. */
if ((dsi_ctrl->pending_cmd_flags & DSI_CTRL_CMD_BROADCAST) &&
!(dsi_ctrl->pending_cmd_flags & DSI_CTRL_CMD_BROADCAST_MASTER))
skip_wait_for_done = true;
if (!skip_wait_for_done)
!(dsi_ctrl->pending_cmd_flags & DSI_CTRL_CMD_BROADCAST_MASTER)) {
dsi_ctrl_clear_dma_status(dsi_ctrl);
} else {
dsi_ctrl_dma_cmd_wait_for_done(dsi_ctrl);
}
/* Command engine disable, unmask overflow, remove vote on clocks and gdsc */
rc = dsi_ctrl_set_cmd_engine_state(dsi_ctrl, DSI_CTRL_ENGINE_OFF, false);