All of lore.kernel.org
 help / color / mirror / Atom feed
From: Devarsh Thakkar <devarsht@ti.com>
To: <linux-kernel@vger.kernel.org>, <jyri.sarha@iki.fi>,
	<tomba@kernel.org>, <airlied@linux.ie>, <daniel@ffwll.ch>,
	<dri-devel@lists.freedesktop.org>
Cc: <nm@ti.com>, <a-bhatia1@ti.com>, <r-ravikumar@ti.com>,
	<nikhil.nd@ti.com>, <linux-arm-kernel@lists.infradead.org>,
	<devarsht@ti.com>, <vigneshr@ti.com>,
	<tomi.valkeinen@ideasonboard.com>,
	<laurent.pinchart@ideasonboard.com>
Subject: [PATCH] drm/tidss: Soft Reset DISPC on startup
Date: Mon, 14 Mar 2022 17:07:39 +0530	[thread overview]
Message-ID: <20220314113739.18000-1-devarsht@ti.com> (raw)

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>
---
 drivers/gpu/drm/tidss/tidss_dispc.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

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;
-- 
2.17.1


WARNING: multiple messages have this Message-ID
From: Devarsh Thakkar <devarsht@ti.com>
To: <linux-kernel@vger.kernel.org>, <jyri.sarha@iki.fi>,
	<tomba@kernel.org>, <airlied@linux.ie>, <daniel@ffwll.ch>,
	<dri-devel@lists.freedesktop.org>
Cc: <nm@ti.com>, <a-bhatia1@ti.com>, <r-ravikumar@ti.com>,
	<nikhil.nd@ti.com>,  <linux-arm-kernel@lists.infradead.org>,
	<devarsht@ti.com>, <vigneshr@ti.com>,
	<tomi.valkeinen@ideasonboard.com>,
	<laurent.pinchart@ideasonboard.com>
Subject: [PATCH] drm/tidss: Soft Reset DISPC on startup
Date: Mon, 14 Mar 2022 17:07:39 +0530	[thread overview]
Message-ID: <20220314113739.18000-1-devarsht@ti.com> (raw)

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>
---
 drivers/gpu/drm/tidss/tidss_dispc.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

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;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID
From: Devarsh Thakkar <devarsht@ti.com>
To: <linux-kernel@vger.kernel.org>, <jyri.sarha@iki.fi>,
	<tomba@kernel.org>, <airlied@linux.ie>, <daniel@ffwll.ch>,
	<dri-devel@lists.freedesktop.org>
Cc: nm@ti.com, r-ravikumar@ti.com, devarsht@ti.com,
	tomi.valkeinen@ideasonboard.com, a-bhatia1@ti.com,
	laurent.pinchart@ideasonboard.com, nikhil.nd@ti.com,
	linux-arm-kernel@lists.infradead.org, vigneshr@ti.com
Subject: [PATCH] drm/tidss: Soft Reset DISPC on startup
Date: Mon, 14 Mar 2022 17:07:39 +0530	[thread overview]
Message-ID: <20220314113739.18000-1-devarsht@ti.com> (raw)

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>
---
 drivers/gpu/drm/tidss/tidss_dispc.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

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;
-- 
2.17.1


             reply	other threads:[~2022-03-14 11:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 11:37 Devarsh Thakkar [this message]
2022-03-14 11:37 ` [PATCH] drm/tidss: Soft Reset DISPC on startup Devarsh Thakkar
2022-03-14 11:37 ` Devarsh Thakkar
2022-04-12  9:10 ` Devarsh Thakkar
2022-04-12  9:10   ` Devarsh Thakkar
2022-04-12  9:10   ` Devarsh Thakkar
2022-04-12 14:24 ` Tomi Valkeinen
2022-04-12 14:24   ` Tomi Valkeinen
2022-04-12 14:24   ` Tomi Valkeinen
2022-04-12 21:20   ` Nishanth Menon
2022-04-12 21:20     ` Nishanth Menon
2022-04-12 21:20     ` Nishanth Menon
2022-04-13  5:32     ` Tony Lindgren
2022-04-13  5:32       ` Tony Lindgren
2022-04-13  5:32       ` Tony Lindgren
2022-04-19 12:19 ` Tomi Valkeinen
2022-04-19 12:19   ` Tomi Valkeinen
2022-04-19 12:19   ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220314113739.18000-1-devarsht@ti.com \
    --to=devarsht@ti.com \
    --cc=a-bhatia1@ti.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jyri.sarha@iki.fi \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikhil.nd@ti.com \
    --cc=nm@ti.com \
    --cc=r-ravikumar@ti.com \
    --cc=tomba@kernel.org \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.