[PATCH v9 10/18] drm: bridge: samsung-dsim: Init exynos host for first DSI transfer
Jagan Teki
jagan at amarulasolutions.com
Fri Dec 9 15:23:35 UTC 2022
The existing drm panels and bridges in Exynos required host
initialization during the first DSI command transfer even though
the initialization was done before.
This host reinitialization is handled via DSIM_STATE_REINITIALIZED
flag and triggers from host transfer.
Do this exclusively for Exynos.
Initial logic is derived from Marek Szyprowski changes.
Signed-off-by: Marek Szyprowski <m.szyprowski at samsung.com>
Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
Changes from v9:
- derived from v8
- added comments
drivers/gpu/drm/bridge/samsung-dsim.c | 15 ++++++++++++++-
include/drm/bridge/samsung-dsim.h | 5 +++--
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index 2e15d753fdd0..ec3ab679afd9 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -1254,6 +1254,19 @@ static int samsung_dsim_init(struct samsung_dsim *dsi, unsigned int flag)
{
const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
+ /*
+ * FIXME:
+ * The existing drm panels and bridges in Exynos required host
+ * initialization during the first DSI command transfer even though
+ * the initialization was done before.
+ *
+ * This host reinitialization is handled via DSIM_STATE_REINITIALIZED
+ * flag and triggers from host transfer. Do this exclusively for Exynos.
+ */
+ if ((dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) &&
+ dsi->state & DSIM_STATE_REINITIALIZED)
+ return 0;
+
if (dsi->state & flag)
return 0;
@@ -1467,7 +1480,7 @@ static ssize_t samsung_dsim_host_transfer(struct mipi_dsi_host *host,
if (!(dsi->state & DSIM_STATE_ENABLED))
return -EINVAL;
- ret = samsung_dsim_init(dsi, DSIM_STATE_INITIALIZED);
+ ret = samsung_dsim_init(dsi, DSIM_STATE_REINITIALIZED);
if (ret)
return ret;
diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h
index b8132bf8e36f..0c5a905f3de7 100644
--- a/include/drm/bridge/samsung-dsim.h
+++ b/include/drm/bridge/samsung-dsim.h
@@ -17,8 +17,9 @@ struct samsung_dsim;
#define DSIM_STATE_ENABLED BIT(0)
#define DSIM_STATE_INITIALIZED BIT(1)
-#define DSIM_STATE_CMD_LPM BIT(2)
-#define DSIM_STATE_VIDOUT_AVAILABLE BIT(3)
+#define DSIM_STATE_REINITIALIZED BIT(2)
+#define DSIM_STATE_CMD_LPM BIT(3)
+#define DSIM_STATE_VIDOUT_AVAILABLE BIT(4)
enum samsung_dsim_type {
SAMSUNG_DSIM_TYPE_EXYNOS3250,
--
2.25.1
More information about the dri-devel
mailing list