public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu: drm/panel: Optimize the workflow of s6d7aa0_lock
@ 2023-05-31 11:07 Lu Hongfei
  2023-05-31 11:55 ` Neil Armstrong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lu Hongfei @ 2023-05-31 11:07 UTC (permalink / raw)
  To: Artur Weber, Neil Armstrong, Sam Ravnborg, David Airlie,
	Daniel Vetter, open list:DRM PANEL DRIVERS, open list
  Cc: opensource.kernel, luhongfei

This patch optimized s6d7aa0_lock's workflow.
Once mipi_dsi_dcs_write_seq failed, s6d7aa0_lock return immediately
and no further actions will be taken.

Fixes: 6810bb390282 ("drm/panel: Add Samsung S6D7AA0 panel controller driver")

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
 drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 30 ++++++++++++++-----
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
index 102e1fc7ee38..f98df32d1c55
--- a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
@@ -69,15 +69,29 @@ static int s6d7aa0_lock(struct s6d7aa0 *ctx, bool lock)
 	int ret = 0;
 
 	if (lock) {
-		mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0xa5, 0xa5);
-		mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0xa5, 0xa5);
-		if (ctx->desc->use_passwd3)
-			mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0x5a, 0x5a);
+		ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0xa5, 0xa5);
+		if (ret < 0)
+			return ret;
+		ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0xa5, 0xa5);
+		if (ret < 0)
+			return ret;
+		if (ctx->desc->use_passwd3) {
+			ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0x5a, 0x5a);
+			if (ret < 0)
+				return ret;
+		}
 	} else {
-		mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0x5a, 0x5a);
-		mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0x5a, 0x5a);
-		if (ctx->desc->use_passwd3)
-			mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0xa5, 0xa5);
+		ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0x5a, 0x5a);
+		if (ret < 0)
+			return ret;
+		ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0x5a, 0x5a);
+		if (ret < 0)
+			return ret;
+		if (ctx->desc->use_passwd3) {
+			ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0xa5, 0xa5);
+			if (ret < 0)
+				return ret;
+		}
 	}
 
 	return ret;
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-01 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-31 11:07 [PATCH] gpu: drm/panel: Optimize the workflow of s6d7aa0_lock Lu Hongfei
2023-05-31 11:55 ` Neil Armstrong
2023-06-01 14:37 ` kernel test robot
2023-06-01 16:03 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox