If the panel is wrapped in a panel_bridge it gets prepar()ed before the
upstream DSI bridge which can cause hangs (e.g. with imx-nwl since clocks
are not enabled yet). To avoid this move the panel's first DSI access to
enable() so the upstream bridge can prepare the DSI host controller in
it's pre_enable().
The second patch makes the disable() call symmetric to the above and the third
one just eases debugging.
Changes from v1:
* As per review comments by Sam Ravnborg
* Ignore failures to disable the backlight in jh057n_disable()
* Add 'drm/panel: jh057n00900: Use drm_panel_{unprepare,disable} consistently'
* Collected Reviewed-By: Thanks Sam!
To: "Guido Günther" <[email protected]>,Purism Kernel Team <[email protected]>,Thierry Reding <[email protected]>,Sam Ravnborg <[email protected]>,David Airlie <[email protected]>,Daniel Vetter <[email protected]>,[email protected],[email protected]
Guido Günther (4):
drm/panel: jh057n00900: Move panel DSI init to enable()
drm/panel: jh057n00900: Move mipi_dsi_dcs_set_display_off to disable()
drm/panel: jh057n00900: Print error code on all DRM_DEV_ERROR()s
drm/panel: jh057n00900: Use drm_panel_{unprepare,disable} consistently
.../drm/panel/panel-rocktech-jh057n00900.c | 31 ++++++++++---------
1 file changed, 17 insertions(+), 14 deletions(-)
--
2.20.1
This makes it symmetric with the panel init happening in enable().
Signed-off-by: Guido Günther <[email protected]>
---
drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
index c6b4bfd79fde..fed24c51d48b 100644
--- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
+++ b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
@@ -158,19 +158,19 @@ static int jh057n_enable(struct drm_panel *panel)
static int jh057n_disable(struct drm_panel *panel)
{
struct jh057n *ctx = panel_to_jh057n(panel);
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
- return backlight_disable(ctx->backlight);
+ backlight_disable(ctx->backlight);
+ return mipi_dsi_dcs_set_display_off(dsi);
}
static int jh057n_unprepare(struct drm_panel *panel)
{
struct jh057n *ctx = panel_to_jh057n(panel);
- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
if (!ctx->prepared)
return 0;
- mipi_dsi_dcs_set_display_off(dsi);
regulator_disable(ctx->iovcc);
regulator_disable(ctx->vcc);
ctx->prepared = false;
--
2.20.1
Hi Guido.
On Fri, Jul 26, 2019 at 03:14:35PM +0200, Guido G?nther wrote:
>
> If the panel is wrapped in a panel_bridge it gets prepar()ed before the
> upstream DSI bridge which can cause hangs (e.g. with imx-nwl since clocks
> are not enabled yet). To avoid this move the panel's first DSI access to
> enable() so the upstream bridge can prepare the DSI host controller in
> it's pre_enable().
>
> The second patch makes the disable() call symmetric to the above and the third
> one just eases debugging.
>
> Changes from v1:
> * As per review comments by Sam Ravnborg
> * Ignore failures to disable the backlight in jh057n_disable()
> * Add 'drm/panel: jh057n00900: Use drm_panel_{unprepare,disable} consistently'
> * Collected Reviewed-By: Thanks Sam!
>
> To: "Guido G?nther" <[email protected]>,Purism Kernel Team <[email protected]>,Thierry Reding <[email protected]>,Sam Ravnborg <[email protected]>,David Airlie <[email protected]>,Daniel Vetter <[email protected]>,[email protected],[email protected]
>
>
> Guido G?nther (4):
> drm/panel: jh057n00900: Move panel DSI init to enable()
> drm/panel: jh057n00900: Move mipi_dsi_dcs_set_display_off to disable()
> drm/panel: jh057n00900: Print error code on all DRM_DEV_ERROR()s
> drm/panel: jh057n00900: Use drm_panel_{unprepare,disable} consistently
Looks good. Series applied to drm-misc-next and pushed out.
Sam