diff options
| author | Lucas Stach <l.stach@pengutronix.de> | 2017-03-24 13:01:53 -0400 |
|---|---|---|
| committer | Philipp Zabel <p.zabel@pengutronix.de> | 2017-10-11 06:04:23 -0400 |
| commit | 263c3b8044f9c9356a34fdb2640b52d27e378f9c (patch) | |
| tree | a42fcead7aad413e5b24dee7c1f34beabf8ad792 | |
| parent | cda77556447c782b3c9c068f81ef58136cb487c3 (diff) | |
gpu: ipu-v3: prg: wait for double buffers to be filled on channel startup
Wait for both double buffer to be filled when first starting a channel.
This makes channel startup a lot more reliable, probably because it allows
the internal state machine to settle before the requests from the IPU are
coming in.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[p.zabel@pengutronix.de: rebased before switch to runtime PM]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| -rw-r--r-- | drivers/gpu/ipu-v3/ipu-prg.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c index ecc9ea44dc50..0013ca9f72c8 100644 --- a/drivers/gpu/ipu-v3/ipu-prg.c +++ b/drivers/gpu/ipu-v3/ipu-prg.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <drm/drm_fourcc.h> | 14 | #include <drm/drm_fourcc.h> |
| 15 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
| 16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
| 17 | #include <linux/iopoll.h> | ||
| 17 | #include <linux/mfd/syscon.h> | 18 | #include <linux/mfd/syscon.h> |
| 18 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> | 19 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> |
| 19 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| @@ -329,6 +330,12 @@ int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, | |||
| 329 | val = IPU_PRG_REG_UPDATE_REG_UPDATE; | 330 | val = IPU_PRG_REG_UPDATE_REG_UPDATE; |
| 330 | writel(val, prg->regs + IPU_PRG_REG_UPDATE); | 331 | writel(val, prg->regs + IPU_PRG_REG_UPDATE); |
| 331 | 332 | ||
| 333 | /* wait for both double buffers to be filled */ | ||
| 334 | readl_poll_timeout(prg->regs + IPU_PRG_STATUS, val, | ||
| 335 | (val & IPU_PRG_STATUS_BUFFER0_READY(prg_chan)) && | ||
| 336 | (val & IPU_PRG_STATUS_BUFFER1_READY(prg_chan)), | ||
| 337 | 5, 1000); | ||
| 338 | |||
| 332 | clk_disable_unprepare(prg->clk_ipg); | 339 | clk_disable_unprepare(prg->clk_ipg); |
| 333 | 340 | ||
| 334 | chan->enabled = true; | 341 | chan->enabled = true; |
