All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM
@ 2016-09-27 15:50 ` Tobias Jakobi
  2016-09-27 15:50   ` [PATCH 1/6] Revert "drm/exynos: g2d: fix system and runtime pm integration" Tobias Jakobi
                     ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Tobias Jakobi @ 2016-09-27 15:50 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: Tobias Jakobi, dri-devel, m.szyprowski

Hello everyone,

as discussed with Marek I have broken down my initial patch into smaller piecer.

Anyway, this series fixes a regression introduced by commit
b05984e21a7e000bf5074ace00d7a574944b2c16.

With best wishes,
Tobias

Tobias Jakobi (6):
  Revert "drm/exynos: g2d: fix system and runtime pm integration"
  drm/exynos: g2d: move PM management to runqueue worker
  drm/exynos: g2d: remove runqueue nodes in g2d_{close,remove}()
  drm/exynos: g2d: wait for engine to finish
  drm/exynos: g2d: use autosuspend mode for PM runtime
  drm/exynos: g2d: simplify g2d_free_runqueue_node()

 drivers/gpu/drm/exynos/exynos_drm_g2d.c | 237 +++++++++++++++++++++++++-------
 1 file changed, 188 insertions(+), 49 deletions(-)

-- 
2.7.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 1/6] Revert "drm/exynos: g2d: fix system and runtime pm integration"
  2016-09-27 15:50 ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Tobias Jakobi
@ 2016-09-27 15:50   ` Tobias Jakobi
  2016-09-27 15:50   ` [PATCH 2/6] drm/exynos: g2d: move PM management to runqueue worker Tobias Jakobi
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Tobias Jakobi @ 2016-09-27 15:50 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: dri-devel, m.szyprowski, inki.dae, Tobias Jakobi

This reverts commit b05984e21a7e000bf5074ace00d7a574944b2c16.

The change, i.e. merging the sleep and runpm operations, produces
a deadlock situation:
(1) exynos_g2d_exec_ioctl() prepares a runqueue node and
    calls g2d_exec_runqueue()
(2) g2d_exec_runqueue() calls g2d_dma_start() which gets
    runtime PM sync
(3) runtime PM core calls g2d_runtime_resume()
(4) g2d_runtime_resume() calls g2d_exec_runqueue(), which
    loops back to (2)

Due to mutexes that are in place, a deadlock situation is created.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 6eca8bb..4bf00f5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -1475,8 +1475,8 @@ static int g2d_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int g2d_runtime_suspend(struct device *dev)
+#ifdef CONFIG_PM_SLEEP
+static int g2d_suspend(struct device *dev)
 {
 	struct g2d_data *g2d = dev_get_drvdata(dev);
 
@@ -1490,6 +1490,25 @@ static int g2d_runtime_suspend(struct device *dev)
 
 	flush_work(&g2d->runqueue_work);
 
+	return 0;
+}
+
+static int g2d_resume(struct device *dev)
+{
+	struct g2d_data *g2d = dev_get_drvdata(dev);
+
+	g2d->suspended = false;
+	g2d_exec_runqueue(g2d);
+
+	return 0;
+}
+#endif
+
+#ifdef CONFIG_PM
+static int g2d_runtime_suspend(struct device *dev)
+{
+	struct g2d_data *g2d = dev_get_drvdata(dev);
+
 	clk_disable_unprepare(g2d->gate_clk);
 
 	return 0;
@@ -1504,16 +1523,12 @@ static int g2d_runtime_resume(struct device *dev)
 	if (ret < 0)
 		dev_warn(dev, "failed to enable clock.\n");
 
-	g2d->suspended = false;
-	g2d_exec_runqueue(g2d);
-
 	return ret;
 }
 #endif
 
 static const struct dev_pm_ops g2d_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(g2d_suspend, g2d_resume)
 	SET_RUNTIME_PM_OPS(g2d_runtime_suspend, g2d_runtime_resume, NULL)
 };
 
-- 
2.7.3

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

* [PATCH 2/6] drm/exynos: g2d: move PM management to runqueue worker
  2016-09-27 15:50 ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Tobias Jakobi
  2016-09-27 15:50   ` [PATCH 1/6] Revert "drm/exynos: g2d: fix system and runtime pm integration" Tobias Jakobi
@ 2016-09-27 15:50   ` Tobias Jakobi
  2016-09-27 15:50   ` [PATCH 3/6] drm/exynos: g2d: remove runqueue nodes in g2d_{close, remove}() Tobias Jakobi
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Tobias Jakobi @ 2016-09-27 15:50 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: Tobias Jakobi, dri-devel, m.szyprowski

Do all pm_runtime_{get,put}() calls in the runqueue worker.
Also keep track of the engine's idle/busy state.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c | 78 +++++++++++++++++++++++----------
 1 file changed, 56 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 4bf00f5..eda385a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -138,6 +138,18 @@ enum g2d_reg_type {
 	MAX_REG_TYPE_NR
 };
 
+enum g2d_flag_bits {
+	/*
+	 * If set, suspends the runqueue worker after the currently
+	 * processed node is finished.
+	 */
+	G2D_BIT_SUSPEND_RUNQUEUE,
+	/*
+	 * If set, indicates that the engine is currently busy.
+	 */
+	G2D_BIT_ENGINE_BUSY,
+};
+
 /* cmdlist data structure */
 struct g2d_cmdlist {
 	u32		head;
@@ -226,7 +238,7 @@ struct g2d_data {
 	struct workqueue_struct		*g2d_workq;
 	struct work_struct		runqueue_work;
 	struct exynos_drm_subdrv	subdrv;
-	bool				suspended;
+	unsigned long			flags;
 
 	/* cmdlist */
 	struct g2d_cmdlist_node		*cmdlist_node;
@@ -803,12 +815,8 @@ static void g2d_dma_start(struct g2d_data *g2d,
 	struct g2d_cmdlist_node *node =
 				list_first_entry(&runqueue_node->run_cmdlist,
 						struct g2d_cmdlist_node, list);
-	int ret;
-
-	ret = pm_runtime_get_sync(g2d->dev);
-	if (ret < 0)
-		return;
 
+	set_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
 	writel_relaxed(node->dma_addr, g2d->regs + G2D_DMA_SFR_BASE_ADDR);
 	writel_relaxed(G2D_DMA_START, g2d->regs + G2D_DMA_COMMAND);
 }
@@ -858,18 +866,37 @@ static void g2d_runqueue_worker(struct work_struct *work)
 {
 	struct g2d_data *g2d = container_of(work, struct g2d_data,
 					    runqueue_work);
+	struct g2d_runqueue_node *runqueue_node;
+
+	/*
+	 * The engine is busy and the completion of the current node is going
+	 * to poke the runqueue worker, so nothing to do here.
+	 */
+	if (test_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags))
+		return;
 
 	mutex_lock(&g2d->runqueue_mutex);
-	pm_runtime_put_sync(g2d->dev);
 
-	complete(&g2d->runqueue_node->complete);
-	if (g2d->runqueue_node->async)
-		g2d_free_runqueue_node(g2d, g2d->runqueue_node);
+	runqueue_node = g2d->runqueue_node;
+	g2d->runqueue_node = NULL;
+
+	if (runqueue_node) {
+		pm_runtime_put(g2d->dev);
+
+		complete(&runqueue_node->complete);
+		if (runqueue_node->async)
+			g2d_free_runqueue_node(g2d, runqueue_node);
+	}
+
+	if (!test_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags)) {
+		g2d->runqueue_node = g2d_get_runqueue_node(g2d);
+
+		if (g2d->runqueue_node) {
+			pm_runtime_get_sync(g2d->dev);
+			g2d_dma_start(g2d, g2d->runqueue_node);
+		}
+	}
 
-	if (g2d->suspended)
-		g2d->runqueue_node = NULL;
-	else
-		g2d_exec_runqueue(g2d);
 	mutex_unlock(&g2d->runqueue_mutex);
 }
 
@@ -918,8 +945,10 @@ static irqreturn_t g2d_irq_handler(int irq, void *dev_id)
 		}
 	}
 
-	if (pending & G2D_INTP_ACMD_FIN)
+	if (pending & G2D_INTP_ACMD_FIN) {
+		clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
 		queue_work(g2d->g2d_workq, &g2d->runqueue_work);
+	}
 
 	return IRQ_HANDLED;
 }
@@ -1259,10 +1288,11 @@ int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data,
 	runqueue_node->pid = current->pid;
 	runqueue_node->filp = file;
 	list_add_tail(&runqueue_node->list, &g2d->runqueue);
-	if (!g2d->runqueue_node)
-		g2d_exec_runqueue(g2d);
 	mutex_unlock(&g2d->runqueue_mutex);
 
+	/* Let the runqueue know that there is work to do. */
+	queue_work(g2d->g2d_workq, &g2d->runqueue_work);
+
 	if (runqueue_node->async)
 		goto out;
 
@@ -1400,6 +1430,8 @@ static int g2d_probe(struct platform_device *pdev)
 	}
 
 	pm_runtime_enable(dev);
+	clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
+	clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
@@ -1458,6 +1490,9 @@ static int g2d_remove(struct platform_device *pdev)
 {
 	struct g2d_data *g2d = platform_get_drvdata(pdev);
 
+	/* Suspend runqueue operation. */
+	set_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
+
 	cancel_work_sync(&g2d->runqueue_work);
 	exynos_drm_subdrv_unregister(&g2d->subdrv);
 
@@ -1480,9 +1515,8 @@ static int g2d_suspend(struct device *dev)
 {
 	struct g2d_data *g2d = dev_get_drvdata(dev);
 
-	mutex_lock(&g2d->runqueue_mutex);
-	g2d->suspended = true;
-	mutex_unlock(&g2d->runqueue_mutex);
+	/* Suspend runqueue operation. */
+	set_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
 
 	while (g2d->runqueue_node)
 		/* FIXME: good range? */
@@ -1497,8 +1531,8 @@ static int g2d_resume(struct device *dev)
 {
 	struct g2d_data *g2d = dev_get_drvdata(dev);
 
-	g2d->suspended = false;
-	g2d_exec_runqueue(g2d);
+	clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
+	queue_work(g2d->g2d_workq, &g2d->runqueue_work);
 
 	return 0;
 }
-- 
2.7.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 3/6] drm/exynos: g2d: remove runqueue nodes in g2d_{close, remove}()
  2016-09-27 15:50 ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Tobias Jakobi
  2016-09-27 15:50   ` [PATCH 1/6] Revert "drm/exynos: g2d: fix system and runtime pm integration" Tobias Jakobi
  2016-09-27 15:50   ` [PATCH 2/6] drm/exynos: g2d: move PM management to runqueue worker Tobias Jakobi
@ 2016-09-27 15:50   ` Tobias Jakobi
  2016-09-27 15:50   ` [PATCH 4/6] drm/exynos: g2d: wait for engine to finish Tobias Jakobi
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Tobias Jakobi @ 2016-09-27 15:50 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: Tobias Jakobi, dri-devel, m.szyprowski

The driver might be closed (and/or removed) while there are still
nodes queued for processing.
Make sure to remove these nodes, which means all of them in
the case of g2d_remove() and only those belonging to the
corresponding process in g2d_close().

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c | 48 ++++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index eda385a..3599489 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -855,11 +855,27 @@ static void g2d_free_runqueue_node(struct g2d_data *g2d,
 	kmem_cache_free(g2d->runqueue_slab, runqueue_node);
 }
 
-static void g2d_exec_runqueue(struct g2d_data *g2d)
+/**
+ * g2d_remove_runqueue_nodes - remove items from the list of runqueue nodes
+ * @g2d: G2D state object
+ * @file: if not zero, only remove items with this DRM file
+ *
+ * Has to be called under runqueue lock.
+ */
+static void g2d_remove_runqueue_nodes(struct g2d_data *g2d, struct drm_file* file)
 {
-	g2d->runqueue_node = g2d_get_runqueue_node(g2d);
-	if (g2d->runqueue_node)
-		g2d_dma_start(g2d, g2d->runqueue_node);
+	struct g2d_runqueue_node *node, *n;
+
+	if (list_empty(&g2d->runqueue))
+		return;
+
+	list_for_each_entry_safe(node, n, &g2d->runqueue, list) {
+		if (file && node->filp != file)
+			continue;
+
+		list_del_init(&node->list);
+		g2d_free_runqueue_node(g2d, node);
+	}
 }
 
 static void g2d_runqueue_worker(struct work_struct *work)
@@ -1369,15 +1385,19 @@ static void g2d_close(struct drm_device *drm_dev, struct device *dev,
 	if (!g2d)
 		return;
 
+	/* Remove the runqueue nodes that belong to us. */
+	mutex_lock(&g2d->runqueue_mutex);
+	g2d_remove_runqueue_nodes(g2d, file);
+	mutex_unlock(&g2d->runqueue_mutex);
+
+	/*
+	 * Even after the engine is idle, there might still be stale cmdlists
+	 * (i.e. cmdlisst which we submitted but never executed) around, with
+	 * their corresponding GEM/userptr buffers.
+	 * Properly unmap these buffers here.
+	 */
 	mutex_lock(&g2d->cmdlist_mutex);
 	list_for_each_entry_safe(node, n, &g2d_priv->inuse_cmdlist, list) {
-		/*
-		 * unmap all gem objects not completed.
-		 *
-		 * P.S. if current process was terminated forcely then
-		 * there may be some commands in inuse_cmdlist so unmap
-		 * them.
-		 */
 		g2d_unmap_cmdlist_gem(g2d, node, file);
 		list_move_tail(&node->list, &g2d->free_cmdlist);
 	}
@@ -1496,10 +1516,8 @@ static int g2d_remove(struct platform_device *pdev)
 	cancel_work_sync(&g2d->runqueue_work);
 	exynos_drm_subdrv_unregister(&g2d->subdrv);
 
-	while (g2d->runqueue_node) {
-		g2d_free_runqueue_node(g2d, g2d->runqueue_node);
-		g2d->runqueue_node = g2d_get_runqueue_node(g2d);
-	}
+	/* There should be no locking needed here. */
+	g2d_remove_runqueue_nodes(g2d, NULL);
 
 	pm_runtime_disable(&pdev->dev);
 
-- 
2.7.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 4/6] drm/exynos: g2d: wait for engine to finish
  2016-09-27 15:50 ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Tobias Jakobi
                     ` (2 preceding siblings ...)
  2016-09-27 15:50   ` [PATCH 3/6] drm/exynos: g2d: remove runqueue nodes in g2d_{close, remove}() Tobias Jakobi
@ 2016-09-27 15:50   ` Tobias Jakobi
  2016-09-27 23:41   ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Inki Dae
  2016-09-28 14:20   ` Marek Szyprowski
  5 siblings, 0 replies; 9+ messages in thread
From: Tobias Jakobi @ 2016-09-27 15:50 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: Tobias Jakobi, dri-devel, m.szyprowski

While the engine works on a runqueue node it does memory access to
the buffers associated with that node.
Make sure that the engine is idle when g2d_close() and/or
g2d_remove() are called, i.e. buffer associated with the process (for
g2d_close()), or all buffers (for g2d_remove()) can be safely be
unmapped.

We have to take into account that the engine might be in an undefined
state, i.e. it hangs and doesn't become idle. In this case, we issue
a hardware reset to return the hardware and the driver context into a
proper state.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c | 84 ++++++++++++++++++++++++++++++---
 1 file changed, 77 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 3599489..5de5ea4 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -258,6 +258,12 @@ struct g2d_data {
 	unsigned long			max_pool;
 };
 
+static inline void g2d_hw_reset(struct g2d_data *g2d)
+{
+	writel(G2D_R | G2D_SFRCLEAR, g2d->regs + G2D_SOFT_RESET);
+	clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
+}
+
 static int g2d_init_cmdlist(struct g2d_data *g2d)
 {
 	struct device *dev = g2d->dev;
@@ -969,6 +975,63 @@ static irqreturn_t g2d_irq_handler(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+/**
+ * g2d_wait_finish - wait for the G2D engine to finish the current runqueue node
+ * @g2d: G2D state object
+ * @file: if not zero, only wait if the current runqueue node belongs
+ *        to the DRM file
+ *
+ * Should the engine not become idle after a 100ms timeout, a hardware
+ * reset is issued.
+ */
+static void g2d_wait_finish(struct g2d_data *g2d, struct drm_file *file)
+{
+	struct device *dev = g2d->dev;
+
+	struct g2d_runqueue_node *runqueue_node = NULL;
+	unsigned int tries = 10;
+
+	mutex_lock(&g2d->runqueue_mutex);
+
+	/* If no node is currently processed, we have nothing to do. */
+	if (!g2d->runqueue_node)
+		goto out;
+
+	runqueue_node = g2d->runqueue_node;
+
+	/* Check if the currently processed item belongs to us. */
+	if (file && runqueue_node->filp != file)
+		goto out;
+
+	mutex_unlock(&g2d->runqueue_mutex);
+
+	/* Wait for the G2D engine to finish. */
+	while (tries-- && (g2d->runqueue_node == runqueue_node))
+		mdelay(10);
+
+	mutex_lock(&g2d->runqueue_mutex);
+
+	if (g2d->runqueue_node != runqueue_node)
+		goto out;
+
+	dev_err(dev, "wait timed out, resetting engine...\n");
+	g2d_hw_reset(g2d);
+
+	/*
+	 * After the hardware reset of the engine we are going to loose
+	 * the IRQ which triggers the PM runtime put().
+	 * So do this manually here.
+	 */
+	pm_runtime_put(dev);
+
+	complete(&runqueue_node->complete);
+	if (runqueue_node->async)
+		g2d_free_runqueue_node(g2d, runqueue_node);
+
+out:
+	mutex_unlock(&g2d->runqueue_mutex);
+}
+
 static int g2d_check_reg_offset(struct device *dev,
 				struct g2d_cmdlist_node *node,
 				int nr, bool for_addr)
@@ -1391,6 +1454,13 @@ static void g2d_close(struct drm_device *drm_dev, struct device *dev,
 	mutex_unlock(&g2d->runqueue_mutex);
 
 	/*
+	 * Wait for the runqueue worker to finish its current node.
+	 * After this the engine should no longer be accessing any
+	 * memory belonging to us.
+	 */
+	g2d_wait_finish(g2d, file);
+
+	/*
 	 * Even after the engine is idle, there might still be stale cmdlists
 	 * (i.e. cmdlisst which we submitted but never executed) around, with
 	 * their corresponding GEM/userptr buffers.
@@ -1510,8 +1580,9 @@ static int g2d_remove(struct platform_device *pdev)
 {
 	struct g2d_data *g2d = platform_get_drvdata(pdev);
 
-	/* Suspend runqueue operation. */
+	/* Suspend operation and wait for engine idle. */
 	set_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
+	g2d_wait_finish(g2d, NULL);
 
 	cancel_work_sync(&g2d->runqueue_work);
 	exynos_drm_subdrv_unregister(&g2d->subdrv);
@@ -1533,13 +1604,12 @@ static int g2d_suspend(struct device *dev)
 {
 	struct g2d_data *g2d = dev_get_drvdata(dev);
 
-	/* Suspend runqueue operation. */
+	/*
+	 * Suspend the runqueue worker operation and wait until the G2D
+	 * engine is idle.
+	 */
 	set_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
-
-	while (g2d->runqueue_node)
-		/* FIXME: good range? */
-		usleep_range(500, 1000);
-
+	g2d_wait_finish(g2d, NULL);
 	flush_work(&g2d->runqueue_work);
 
 	return 0;
-- 
2.7.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM
  2016-09-27 15:50 ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Tobias Jakobi
                     ` (3 preceding siblings ...)
  2016-09-27 15:50   ` [PATCH 4/6] drm/exynos: g2d: wait for engine to finish Tobias Jakobi
@ 2016-09-27 23:41   ` Inki Dae
  2016-09-28  0:06     ` Tobias Jakobi
  2016-09-28 14:20   ` Marek Szyprowski
  5 siblings, 1 reply; 9+ messages in thread
From: Inki Dae @ 2016-09-27 23:41 UTC (permalink / raw)
  To: Tobias Jakobi, linux-samsung-soc; +Cc: dri-devel, m.szyprowski

We would need to review this patch series for -next in a hurry.
I have to request git-pull soon.

2016년 09월 28일 00:50에 Tobias Jakobi 이(가) 쓴 글:
> Hello everyone,
> 
> as discussed with Marek I have broken down my initial patch into smaller piecer.
> 
> Anyway, this series fixes a regression introduced by commit
> b05984e21a7e000bf5074ace00d7a574944b2c16.
> 
> With best wishes,
> Tobias
> 
> Tobias Jakobi (6):
>   Revert "drm/exynos: g2d: fix system and runtime pm integration"
>   drm/exynos: g2d: move PM management to runqueue worker
>   drm/exynos: g2d: remove runqueue nodes in g2d_{close,remove}()
>   drm/exynos: g2d: wait for engine to finish
>   drm/exynos: g2d: use autosuspend mode for PM runtime
>   drm/exynos: g2d: simplify g2d_free_runqueue_node()
> 
>  drivers/gpu/drm/exynos/exynos_drm_g2d.c | 237 +++++++++++++++++++++++++-------
>  1 file changed, 188 insertions(+), 49 deletions(-)
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM
  2016-09-27 23:41   ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Inki Dae
@ 2016-09-28  0:06     ` Tobias Jakobi
  0 siblings, 0 replies; 9+ messages in thread
From: Tobias Jakobi @ 2016-09-28  0:06 UTC (permalink / raw)
  To: Inki Dae, Tobias Jakobi, linux-samsung-soc; +Cc: dri-devel, m.szyprowski

Hello,


Inki Dae wrote:
> We would need to review this patch series for -next in a hurry.
> I have to request git-pull soon.
I just want to point out that I have yet to test the split series.
Currently it's only compile-tested.

But I have done a stress test with both sync and async execution mode
with the first version of the patch (the big one, before the split), and
there everything seemed to work.

So this should apply for this series as well... hopefully :)


With best wishes,
Tobias


> 2016년 09월 28일 00:50에 Tobias Jakobi 이(가) 쓴 글:
>> Hello everyone,
>>
>> as discussed with Marek I have broken down my initial patch into smaller piecer.
>>
>> Anyway, this series fixes a regression introduced by commit
>> b05984e21a7e000bf5074ace00d7a574944b2c16.
>>
>> With best wishes,
>> Tobias
>>
>> Tobias Jakobi (6):
>>   Revert "drm/exynos: g2d: fix system and runtime pm integration"
>>   drm/exynos: g2d: move PM management to runqueue worker
>>   drm/exynos: g2d: remove runqueue nodes in g2d_{close,remove}()
>>   drm/exynos: g2d: wait for engine to finish
>>   drm/exynos: g2d: use autosuspend mode for PM runtime
>>   drm/exynos: g2d: simplify g2d_free_runqueue_node()
>>
>>  drivers/gpu/drm/exynos/exynos_drm_g2d.c | 237 +++++++++++++++++++++++++-------
>>  1 file changed, 188 insertions(+), 49 deletions(-)
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM
  2016-09-27 15:50 ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Tobias Jakobi
                     ` (4 preceding siblings ...)
  2016-09-27 23:41   ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Inki Dae
@ 2016-09-28 14:20   ` Marek Szyprowski
  2016-09-28 20:57     ` Tobias Jakobi
  5 siblings, 1 reply; 9+ messages in thread
From: Marek Szyprowski @ 2016-09-28 14:20 UTC (permalink / raw)
  To: Tobias Jakobi, linux-samsung-soc; +Cc: dri-devel

Dear Tobias,


On 2016-09-27 17:50, Tobias Jakobi wrote:
> Hello everyone,
>
> as discussed with Marek I have broken down my initial patch into smaller piecer.
>
> Anyway, this series fixes a regression introduced by commit
> b05984e21a7e000bf5074ace00d7a574944b2c16.
>
> With best wishes,
> Tobias

Patches looks really nice! However I didn't have time to test them on 
the real
hardware.

You can add my:
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

> Tobias Jakobi (6):
>    Revert "drm/exynos: g2d: fix system and runtime pm integration"
>    drm/exynos: g2d: move PM management to runqueue worker
>    drm/exynos: g2d: remove runqueue nodes in g2d_{close,remove}()
>    drm/exynos: g2d: wait for engine to finish
>    drm/exynos: g2d: use autosuspend mode for PM runtime
>    drm/exynos: g2d: simplify g2d_free_runqueue_node()
>
>   drivers/gpu/drm/exynos/exynos_drm_g2d.c | 237 +++++++++++++++++++++++++-------
>   1 file changed, 188 insertions(+), 49 deletions(-)
>

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM
  2016-09-28 14:20   ` Marek Szyprowski
@ 2016-09-28 20:57     ` Tobias Jakobi
  0 siblings, 0 replies; 9+ messages in thread
From: Tobias Jakobi @ 2016-09-28 20:57 UTC (permalink / raw)
  To: Marek Szyprowski, linux-samsung-soc; +Cc: dri-devel

Hello Marek,


Marek Szyprowski wrote:
> Dear Tobias,
> 
> 
> On 2016-09-27 17:50, Tobias Jakobi wrote:
>> Hello everyone,
>>
>> as discussed with Marek I have broken down my initial patch into
>> smaller piecer.
>>
>> Anyway, this series fixes a regression introduced by commit
>> b05984e21a7e000bf5074ace00d7a574944b2c16.
>>
>> With best wishes,
>> Tobias
> 
> Patches looks really nice! However I didn't have time to test them on
> the real
> hardware.
thanks for having a look!

I have just tested the split version of the patch on top of 4.8-rc8, and
can confirm that all the tests in upstream libdrm are working.

With best wishes,
Tobias



> You can add my:
> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> 
>> Tobias Jakobi (6):
>>    Revert "drm/exynos: g2d: fix system and runtime pm integration"
>>    drm/exynos: g2d: move PM management to runqueue worker
>>    drm/exynos: g2d: remove runqueue nodes in g2d_{close,remove}()
>>    drm/exynos: g2d: wait for engine to finish
>>    drm/exynos: g2d: use autosuspend mode for PM runtime
>>    drm/exynos: g2d: simplify g2d_free_runqueue_node()
>>
>>   drivers/gpu/drm/exynos/exynos_drm_g2d.c | 237
>> +++++++++++++++++++++++++-------
>>   1 file changed, 188 insertions(+), 49 deletions(-)
>>
> 
> Best regards

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-09-28 20:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20160927155105epcas1p2f38b5f490e87cdfd9893a01b28b30e54@epcas1p2.samsung.com>
2016-09-27 15:50 ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Tobias Jakobi
2016-09-27 15:50   ` [PATCH 1/6] Revert "drm/exynos: g2d: fix system and runtime pm integration" Tobias Jakobi
2016-09-27 15:50   ` [PATCH 2/6] drm/exynos: g2d: move PM management to runqueue worker Tobias Jakobi
2016-09-27 15:50   ` [PATCH 3/6] drm/exynos: g2d: remove runqueue nodes in g2d_{close, remove}() Tobias Jakobi
2016-09-27 15:50   ` [PATCH 4/6] drm/exynos: g2d: wait for engine to finish Tobias Jakobi
2016-09-27 23:41   ` [PATCH 0/6] drm/exynos: g2d: rework sleep and runtime PM Inki Dae
2016-09-28  0:06     ` Tobias Jakobi
2016-09-28 14:20   ` Marek Szyprowski
2016-09-28 20:57     ` Tobias Jakobi

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.