Skip to content

Commit 3e9c146

Browse files
anderssonlumag
authored andcommitted
drm/msm/dpu: Issue MDSS reset during initialization
It's typical for the bootloader to bring up the display for showing a boot splash or efi framebuffer. But in some cases the kernel driver ends up only partially configuring (in particular) the DPU, which might result in e.g. that two different data paths attempts to push data to the interface - with resulting graphical artifacts. Naturally the end goal would be to inherit the bootloader's configuration and provide the user with a glitch free handover from the boot configuration to a running DPU. But as implementing seamless transition from the bootloader configuration to the running OS will be a considerable effort, start by simply resetting the entire MDSS to its power-on state, to avoid the partial configuration. Signed-off-by: Bjorn Andersson <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/482796/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 3e4659f commit 3e9c146

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

drivers/gpu/drm/msm/msm_mdss.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
*/
55

66
#include <linux/clk.h>
7+
#include <linux/delay.h>
78
#include <linux/irq.h>
89
#include <linux/irqchip.h>
910
#include <linux/irqdesc.h>
1011
#include <linux/irqchip/chained_irq.h>
1112
#include <linux/pm_runtime.h>
13+
#include <linux/reset.h>
1214

1315
#include "msm_drv.h"
1416
#include "msm_kms.h"
@@ -193,6 +195,32 @@ static void msm_mdss_destroy(struct msm_mdss *msm_mdss)
193195
irq_set_chained_handler_and_data(irq, NULL, NULL);
194196
}
195197

198+
static int msm_mdss_reset(struct device *dev)
199+
{
200+
struct reset_control *reset;
201+
202+
reset = reset_control_get_optional_exclusive(dev, NULL);
203+
if (!reset) {
204+
/* Optional reset not specified */
205+
return 0;
206+
} else if (IS_ERR(reset)) {
207+
return dev_err_probe(dev, PTR_ERR(reset),
208+
"failed to acquire mdss reset\n");
209+
}
210+
211+
reset_control_assert(reset);
212+
/*
213+
* Tests indicate that reset has to be held for some period of time,
214+
* make it one frame in a typical system
215+
*/
216+
msleep(20);
217+
reset_control_deassert(reset);
218+
219+
reset_control_put(reset);
220+
221+
return 0;
222+
}
223+
196224
/*
197225
* MDP5 MDSS uses at most three specified clocks.
198226
*/
@@ -229,6 +257,10 @@ static struct msm_mdss *msm_mdss_init(struct platform_device *pdev, bool is_mdp5
229257
int ret;
230258
int irq;
231259

260+
ret = msm_mdss_reset(&pdev->dev);
261+
if (ret)
262+
return ERR_PTR(ret);
263+
232264
msm_mdss = devm_kzalloc(&pdev->dev, sizeof(*msm_mdss), GFP_KERNEL);
233265
if (!msm_mdss)
234266
return ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)