summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tidss
diff options
context:
space:
mode:
authorDevarsh Thakkar <devarsht@ti.com>2022-03-14 17:07:39 +0530
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-04-19 15:09:45 +0300
commitc9b2d923befd8cee0b9d6cbd96128ec0bf44c881 (patch)
tree7f706d32e85a0649a2db49fffb974fe79cd98d30 /drivers/gpu/drm/tidss
parent40f458b7816bd3ddddc068998523b4e039c04818 (diff)
downloadlinux-stable-c9b2d923befd8cee0b9d6cbd96128ec0bf44c881.tar.gz
linux-stable-c9b2d923befd8cee0b9d6cbd96128ec0bf44c881.tar.bz2
linux-stable-c9b2d923befd8cee0b9d6cbd96128ec0bf44c881.zip
drm/tidss: Soft Reset DISPC on startup
Soft reset the display subsystem controller on startup and wait for the reset to complete. This helps the scenario where display was already in use by some other core before the linux was booted. Signed-off-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220314113739.18000-1-devarsht@ti.com
Diffstat (limited to 'drivers/gpu/drm/tidss')
-rw-r--r--drivers/gpu/drm/tidss/tidss_dispc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
index 60b92df615aa..dae47853b728 100644
--- a/drivers/gpu/drm/tidss/tidss_dispc.c
+++ b/drivers/gpu/drm/tidss/tidss_dispc.c
@@ -2650,6 +2650,20 @@ static void dispc_init_errata(struct dispc_device *dispc)
}
}
+static void dispc_softreset(struct dispc_device *dispc)
+{
+ u32 val;
+ int ret = 0;
+
+ /* Soft reset */
+ REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1);
+ /* Wait for reset to complete */
+ ret = readl_poll_timeout(dispc->base_common + DSS_SYSSTATUS,
+ val, val & 1, 100, 5000);
+ if (ret)
+ dev_warn(dispc->dev, "failed to reset dispc\n");
+}
+
int dispc_init(struct tidss_device *tidss)
{
struct device *dev = tidss->dev;
@@ -2709,6 +2723,10 @@ int dispc_init(struct tidss_device *tidss)
return r;
}
+ /* K2G display controller does not support soft reset */
+ if (feat->subrev != DISPC_K2G)
+ dispc_softreset(dispc);
+
for (i = 0; i < dispc->feat->num_vps; i++) {
u32 gamma_size = dispc->feat->vp_feat.color.gamma_size;
u32 *gamma_table;