All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Purski <m.purski@samsung.com>
To: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Archit Taneja <architt@codeaurora.org>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Inki Dae <inki.dae@samsung.com>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Maciej Purski <m.purski@samsung.com>
Subject: [PATCH v2 02/10] drm/exynos: move pm_runtime_get_sync() to exynos_dsi_init()
Date: Wed, 30 May 2018 14:15:53 +0200	[thread overview]
Message-ID: <1527682561-1386-3-git-send-email-m.purski@samsung.com> (raw)
In-Reply-To: <1527682561-1386-1-git-send-email-m.purski@samsung.com>

In order to allow bridge drivers to use DSI transfers in their
pre_enable callbacks, pm_runtime_get_sync() should be performed before
exynos_dsi_enable(). DSIM_STATE_ENABLED flag now should not guard
from calling dsi_host_transfer() before enabling.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 9599e6b..85eb2262 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1312,6 +1312,7 @@ static int exynos_dsi_init(struct exynos_dsi *dsi)
 {
 	const struct exynos_dsi_driver_data *driver_data = dsi->driver_data;
 
+	pm_runtime_get_sync(dsi->dev);
 	exynos_dsi_reset(dsi);
 	exynos_dsi_enable_irq(dsi);
 
@@ -1388,7 +1389,6 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
 	ret = drm_panel_prepare(dsi->panel);
 	if (ret < 0) {
 		dsi->state &= ~DSIM_STATE_ENABLED;
-		pm_runtime_put_sync(dsi->dev);
 		return;
 	}
 
@@ -1400,7 +1400,6 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
 		dsi->state &= ~DSIM_STATE_ENABLED;
 		exynos_dsi_set_display_enable(dsi, false);
 		drm_panel_unprepare(dsi->panel);
-		pm_runtime_put_sync(dsi->dev);
 		return;
 	}
 
@@ -1422,7 +1421,10 @@ static void exynos_dsi_disable(struct drm_encoder *encoder)
 
 	dsi->state &= ~DSIM_STATE_ENABLED;
 
-	pm_runtime_put_sync(dsi->dev);
+	if (dsi->state & DSIM_STATE_INITIALIZED) {
+		pm_runtime_put_sync(dsi->dev);
+		dsi->state &= ~DSIM_STATE_INITIALIZED;
+	}
 }
 
 static enum drm_connector_status
@@ -1566,9 +1568,6 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host,
 	struct exynos_dsi_transfer xfer;
 	int ret;
 
-	if (!(dsi->state & DSIM_STATE_ENABLED))
-		return -EINVAL;
-
 	if (!(dsi->state & DSIM_STATE_INITIALIZED)) {
 		ret = exynos_dsi_init(dsi);
 		if (ret)
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: m.purski@samsung.com (Maciej Purski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 02/10] drm/exynos: move pm_runtime_get_sync() to exynos_dsi_init()
Date: Wed, 30 May 2018 14:15:53 +0200	[thread overview]
Message-ID: <1527682561-1386-3-git-send-email-m.purski@samsung.com> (raw)
In-Reply-To: <1527682561-1386-1-git-send-email-m.purski@samsung.com>

In order to allow bridge drivers to use DSI transfers in their
pre_enable callbacks, pm_runtime_get_sync() should be performed before
exynos_dsi_enable(). DSIM_STATE_ENABLED flag now should not guard
from calling dsi_host_transfer() before enabling.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 9599e6b..85eb2262 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1312,6 +1312,7 @@ static int exynos_dsi_init(struct exynos_dsi *dsi)
 {
 	const struct exynos_dsi_driver_data *driver_data = dsi->driver_data;
 
+	pm_runtime_get_sync(dsi->dev);
 	exynos_dsi_reset(dsi);
 	exynos_dsi_enable_irq(dsi);
 
@@ -1388,7 +1389,6 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
 	ret = drm_panel_prepare(dsi->panel);
 	if (ret < 0) {
 		dsi->state &= ~DSIM_STATE_ENABLED;
-		pm_runtime_put_sync(dsi->dev);
 		return;
 	}
 
@@ -1400,7 +1400,6 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
 		dsi->state &= ~DSIM_STATE_ENABLED;
 		exynos_dsi_set_display_enable(dsi, false);
 		drm_panel_unprepare(dsi->panel);
-		pm_runtime_put_sync(dsi->dev);
 		return;
 	}
 
@@ -1422,7 +1421,10 @@ static void exynos_dsi_disable(struct drm_encoder *encoder)
 
 	dsi->state &= ~DSIM_STATE_ENABLED;
 
-	pm_runtime_put_sync(dsi->dev);
+	if (dsi->state & DSIM_STATE_INITIALIZED) {
+		pm_runtime_put_sync(dsi->dev);
+		dsi->state &= ~DSIM_STATE_INITIALIZED;
+	}
 }
 
 static enum drm_connector_status
@@ -1566,9 +1568,6 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host,
 	struct exynos_dsi_transfer xfer;
 	int ret;
 
-	if (!(dsi->state & DSIM_STATE_ENABLED))
-		return -EINVAL;
-
 	if (!(dsi->state & DSIM_STATE_INITIALIZED)) {
 		ret = exynos_dsi_init(dsi);
 		if (ret)
-- 
2.7.4

  parent reply	other threads:[~2018-05-30 12:16 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180530121622eucas1p1015b65cd12a544b1ea72fe6bfd1a3ccc@eucas1p1.samsung.com>
2018-05-30 12:15 ` [PATCH v2 00/10] Add TOSHIBA TC358764 DSI/LVDS bridge driver Maciej Purski
2018-05-30 12:15   ` Maciej Purski
     [not found]   ` <CGME20180530121623eucas1p27e08223bc5b04dbb0b0253c18a9f83d5@eucas1p2.samsung.com>
2018-05-30 12:15     ` [PATCH v2 01/10] drm/exynos: rename "bridge_node" to "mic_bridge_node" Maciej Purski
2018-05-30 12:15       ` Maciej Purski
2018-06-25  2:37       ` Inki Dae
2018-06-25  2:37         ` Inki Dae
2018-06-25  2:37         ` Inki Dae
     [not found]   ` <CGME20180530121623eucas1p1309b2c054ccd7a52a611b46346709af9@eucas1p1.samsung.com>
2018-05-30 12:15     ` Maciej Purski [this message]
2018-05-30 12:15       ` [PATCH v2 02/10] drm/exynos: move pm_runtime_get_sync() to exynos_dsi_init() Maciej Purski
     [not found]   ` <CGME20180530121624eucas1p2678b6a5424cb8df286b6142cd3754b65@eucas1p2.samsung.com>
2018-05-30 12:15     ` [PATCH v2 03/10] drm/exynos: move connector creation to attach callback Maciej Purski
2018-05-30 12:15       ` Maciej Purski
     [not found]   ` <CGME20180530121625eucas1p239693227eda97d090f3bfe530ded0c52@eucas1p2.samsung.com>
2018-05-30 12:15     ` [PATCH v2 04/10] drm/exynos: add non-panel path to exynos_dsi_enable() Maciej Purski
2018-05-30 12:15       ` Maciej Purski
2018-05-30 12:15       ` Maciej Purski
     [not found]   ` <CGME20180530121626eucas1p288656bbbace0c333decadff418e13c34@eucas1p2.samsung.com>
2018-05-30 12:15     ` [PATCH v2 05/10] panel/hv070wsa-100: add DT bindings Maciej Purski
2018-05-30 12:15       ` Maciej Purski
2018-05-31  4:00       ` Rob Herring
2018-05-31  4:00         ` Rob Herring
2018-05-31  4:00         ` Rob Herring
     [not found]   ` <CGME20180530121626eucas1p17699adbe488cfb34da3f648bffe97fa2@eucas1p1.samsung.com>
2018-05-30 12:15     ` [PATCH v2 06/10] drm/panel: add support for BOE HV070WSA-100 panel to simple-panel Maciej Purski
2018-05-30 12:15       ` Maciej Purski
     [not found]   ` <CGME20180530121627eucas1p1c8daf24d7c95e9e8b04a523d4662dfd9@eucas1p1.samsung.com>
2018-05-30 12:15     ` [PATCH v2 07/10] dt-bindings: tc358754: add DT bindings Maciej Purski
2018-05-30 12:15       ` Maciej Purski
2018-05-30 12:36       ` Laurent Pinchart
2018-05-30 12:36         ` Laurent Pinchart
2018-06-18 11:07         ` Maciej Purski
2018-06-18 11:07           ` Maciej Purski
2018-05-31  4:02       ` Rob Herring
2018-05-31  4:02         ` Rob Herring
2018-05-31  4:02         ` Rob Herring
2018-06-18 11:23         ` Maciej Purski
2018-06-18 11:23           ` Maciej Purski
     [not found]   ` <CGME20180530121628eucas1p291c2774152145231a0a5c4ed56354d7f@eucas1p2.samsung.com>
2018-05-30 12:15     ` [PATCH v2 08/10] drm/bridge: tc358764: Add DSI to LVDS bridge driver Maciej Purski
2018-05-30 12:15       ` Maciej Purski
2018-05-31  6:51       ` Archit Taneja
2018-05-31  6:51         ` Archit Taneja
2018-05-31  6:51         ` Archit Taneja
2018-06-18 11:20         ` Maciej Purski
2018-06-18 11:20           ` Maciej Purski
     [not found]   ` <CGME20180530121629eucas1p2cc1a8c3f5a8e704f4d6f3cf75834cf00@eucas1p2.samsung.com>
2018-05-30 12:16     ` [PATCH v2 09/10] ARM: dts: exynos5250: add DSI node Maciej Purski
2018-05-30 12:16       ` Maciej Purski
2018-05-30 12:16       ` Maciej Purski
2018-05-30 14:32       ` Krzysztof Kozlowski
2018-05-30 14:32         ` Krzysztof Kozlowski
     [not found]   ` <CGME20180530121630eucas1p1584c59b67815a65d0747afab214979ef@eucas1p1.samsung.com>
2018-05-30 12:16     ` [PATCH v2 10/10] ARM: dts: exynos5250-arndale: add DSI and panel nodes Maciej Purski
2018-05-30 12:16       ` Maciej Purski

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=1527682561-1386-3-git-send-email-m.purski@samsung.com \
    --to=m.purski@samsung.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=thierry.reding@gmail.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.