瀏覽代碼

disp: msm: dsi: flush CMD DMA of all ctrls in case of previous broadcast

We currently wait for the completion of previous ASYNC command
transfers on a controller before initiating a new command transfer
on that controller. However, in the case of split DSI usage, the
controllers can encounter issues if a unicast command transfer
occurs before the previous broadcast is complete on both controller.

To prevent this issue, it’s required to flush the CMD DMA of both
controllers before initiating the unicast command transfer following
a previous broadcast.

Change-Id: If2830bea81e32ab26d3b91754bcdf047c3cba483
Signed-off-by: Srihitha Tangudu <[email protected]>
Srihitha Tangudu 1 年之前
父節點
當前提交
5c4f488f8a
共有 3 個文件被更改,包括 21 次插入3 次删除
  1. 1 1
      msm/dsi/dsi_ctrl.c
  2. 8 1
      msm/dsi/dsi_ctrl.h
  3. 12 1
      msm/dsi/dsi_display.c

+ 1 - 1
msm/dsi/dsi_ctrl.c

@@ -467,7 +467,7 @@ static void dsi_ctrl_post_cmd_transfer_work(struct work_struct *work)
 	dsi_ctrl->post_tx_queued = false;
 	dsi_ctrl->post_tx_queued = false;
 }
 }
 
 
-static void dsi_ctrl_flush_cmd_dma_queue(struct dsi_ctrl *dsi_ctrl)
+void dsi_ctrl_flush_cmd_dma_queue(struct dsi_ctrl *dsi_ctrl)
 {
 {
 	/*
 	/*
 	 * If a command is triggered right after another command,
 	 * If a command is triggered right after another command,

+ 8 - 1
msm/dsi/dsi_ctrl.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
 /*
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -952,4 +952,11 @@ void dsi_ctrl_toggle_error_interrupt_status(struct dsi_ctrl *dsi_ctrl, bool enab
  * @dsi_ctrl:                 DSI controller handle.
  * @dsi_ctrl:                 DSI controller handle.
  */
  */
 void dsi_ctrl_transfer_cleanup(struct dsi_ctrl *dsi_ctrl);
 void dsi_ctrl_transfer_cleanup(struct dsi_ctrl *dsi_ctrl);
+
+/**
+ * dsi_ctrl_flush_cmd_dma_queue() - Wait fot previous command transfer to complete
+ *				and flush any pending post_cmd_transfer works.
+ * @dsi_ctrl:                 DSI controller handle.
+ */
+void dsi_ctrl_flush_cmd_dma_queue(struct dsi_ctrl *dsi_ctrl);
 #endif /* _DSI_CTRL_H_ */
 #endif /* _DSI_CTRL_H_ */

+ 12 - 1
msm/dsi/dsi_display.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -3450,6 +3450,17 @@ int dsi_host_transfer_sub(struct mipi_dsi_host *host, struct dsi_cmd_desc *cmd)
 
 
 	dsi_display_set_cmd_tx_ctrl_flags(display, cmd);
 	dsi_display_set_cmd_tx_ctrl_flags(display, cmd);
 
 
+	/*
+	 * Wait until any previous broadcast commands with ASYNC waits have been scheduled
+	 * and completed on both controllers.
+	 */
+	display_for_each_ctrl(i, display) {
+		ctrl = &display->ctrl[i];
+		if ((ctrl->ctrl->pending_cmd_flags & DSI_CTRL_CMD_BROADCAST) &&
+			ctrl->ctrl->post_tx_queued)
+			dsi_ctrl_flush_cmd_dma_queue(ctrl->ctrl);
+	}
+
 	if (cmd->ctrl_flags & DSI_CTRL_CMD_BROADCAST) {
 	if (cmd->ctrl_flags & DSI_CTRL_CMD_BROADCAST) {
 		rc = dsi_display_broadcast_cmd(display, cmd);
 		rc = dsi_display_broadcast_cmd(display, cmd);
 		if (rc) {
 		if (rc) {