Browse Source

disp: msm: dsi: batch max packet size command with read command

Change batches max packet size and read command together, so that
for each esd read, there will not be two independent command transfers.
Without batching sometimes esd thread can hold the panel mutex for
longer time, which can cause framedrops as crtc thread can be blocked on
panel lock to send partial update command and kickoff next frame.

Change-Id: I101283a2559b616911f4312421acb00a8f154dba
Signed-off-by: Vara Reddy <[email protected]>
Vara Reddy 6 years ago
parent
commit
6c456bad33
1 changed files with 6 additions and 0 deletions
  1. 6 0
      msm/dsi/dsi_ctrl.c

+ 6 - 0
msm/dsi/dsi_ctrl.c

@@ -1335,6 +1335,8 @@ static int dsi_set_max_return_size(struct dsi_ctrl *dsi_ctrl,
 	int rc = 0;
 	int rc = 0;
 	u8 tx[2] = { (u8)(size & 0xFF), (u8)(size >> 8) };
 	u8 tx[2] = { (u8)(size & 0xFF), (u8)(size >> 8) };
 	u32 flags = DSI_CTRL_CMD_FETCH_MEMORY;
 	u32 flags = DSI_CTRL_CMD_FETCH_MEMORY;
+	u16 dflags = rx_msg->flags;
+
 	struct mipi_dsi_msg msg = {
 	struct mipi_dsi_msg msg = {
 		.channel = rx_msg->channel,
 		.channel = rx_msg->channel,
 		.type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE,
 		.type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE,
@@ -1343,6 +1345,10 @@ static int dsi_set_max_return_size(struct dsi_ctrl *dsi_ctrl,
 		.flags = rx_msg->flags,
 		.flags = rx_msg->flags,
 	};
 	};
 
 
+	/* remove last message flag to batch max packet cmd to read command */
+	dflags &= ~BIT(3);
+	msg.flags = dflags;
+
 	rc = dsi_message_tx(dsi_ctrl, &msg, flags);
 	rc = dsi_message_tx(dsi_ctrl, &msg, flags);
 	if (rc)
 	if (rc)
 		pr_err("failed to send max return size packet, rc=%d\n", rc);
 		pr_err("failed to send max return size packet, rc=%d\n", rc);