Message ID | 20220301153122.20660-4-cbranchereau@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Ingenic DRM bridge_atomic_enable proposal | expand |
Hi Christophe, Le mar., mars 1 2022 at 16:31:22 +0100, Christophe Branchereau <cbranchereau@gmail.com> a écrit : > Following the introduction of bridge_atomic_enable in the ingenic > drm driver, the crtc is enabled between .prepare and .enable, if > it exists. > > Add it so the backlight is only enabled after the crtc is, to avoid > graphical issues. > > Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com> > --- > drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 23 ++++++++++++-- > drivers/gpu/drm/panel/panel-innolux-ej030na.c | 31 > ++++++++++++++++--- > 2 files changed, 48 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > index f043b484055b..b5736344e3ec 100644 > --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > @@ -183,8 +183,6 @@ static int y030xx067a_prepare(struct drm_panel > *panel) > goto err_disable_regulator; > } > > - msleep(120); > - > return 0; > > err_disable_regulator: > @@ -202,6 +200,25 @@ static int y030xx067a_unprepare(struct drm_panel > *panel) > return 0; > } > > +static int y030xx067a_enable(struct drm_panel *panel) > +{ > + if (panel->backlight) { > + /* Wait for the picture to be ready before enabling backlight */ > + msleep(120); > + } > + > + return 0; > +} > + > +static int y030xx067a_disable(struct drm_panel *panel) > +{ > + struct y030xx067a *priv = to_y030xx067a(panel); > + > + regmap_clear_bits(priv->map, 0x06, REG06_XPSAVE); Shouldn't that be balanced by a regmap_set_bits() in the .enable() function? Cheers, -Paul > + > + return 0; > +} > + > static int y030xx067a_get_modes(struct drm_panel *panel, > struct drm_connector *connector) > { > @@ -239,6 +256,8 @@ static int y030xx067a_get_modes(struct drm_panel > *panel, > static const struct drm_panel_funcs y030xx067a_funcs = { > .prepare = y030xx067a_prepare, > .unprepare = y030xx067a_unprepare, > + .enable = y030xx067a_enable, > + .disable = y030xx067a_disable, > .get_modes = y030xx067a_get_modes, > }; > > diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > index c558de3f99be..6de7370185cd 100644 > --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > @@ -80,8 +80,6 @@ static const struct reg_sequence > ej030na_init_sequence[] = { > { 0x47, 0x08 }, > { 0x48, 0x0f }, > { 0x49, 0x0f }, > - > - { 0x2b, 0x01 }, > }; > > static int ej030na_prepare(struct drm_panel *panel) > @@ -109,8 +107,6 @@ static int ej030na_prepare(struct drm_panel > *panel) > goto err_disable_regulator; > } > > - msleep(120); > - > return 0; > > err_disable_regulator: > @@ -128,6 +124,31 @@ static int ej030na_unprepare(struct drm_panel > *panel) > return 0; > } > > +static int ej030na_enable(struct drm_panel *panel) > +{ > + struct ej030na *priv = to_ej030na(panel); > + > + /* standby off */ > + regmap_write(priv->map, 0x2b, 0x01); > + > + if (panel->backlight) { > + /* Wait for the picture to be ready before enabling backlight */ > + msleep(120); > + } > + > + return 0; > +} > + > +static int ej030na_disable(struct drm_panel *panel) > +{ > + struct ej030na *priv = to_ej030na(panel); > + > + /* standby on */ > + regmap_write(priv->map, 0x2b, 0x00); > + > + return 0; > +} > + > static int ej030na_get_modes(struct drm_panel *panel, > struct drm_connector *connector) > { > @@ -165,6 +186,8 @@ static int ej030na_get_modes(struct drm_panel > *panel, > static const struct drm_panel_funcs ej030na_funcs = { > .prepare = ej030na_prepare, > .unprepare = ej030na_unprepare, > + .enable = ej030na_enable, > + .disable = ej030na_disable, > .get_modes = ej030na_get_modes, > }; > > -- > 2.34.1 >
Hi Paul, it should in theory, but doesn't work in practice, the display doesn't like having that bit set outside of the init sequence. Feel free to experiment if you think you can make it work though, you should have that panel on 1 or 2 devices I think. KR CB On Wed, Mar 2, 2022 at 12:22 PM Paul Cercueil <paul@crapouillou.net> wrote: > > Hi Christophe, > > Le mar., mars 1 2022 at 16:31:22 +0100, Christophe Branchereau > <cbranchereau@gmail.com> a écrit : > > Following the introduction of bridge_atomic_enable in the ingenic > > drm driver, the crtc is enabled between .prepare and .enable, if > > it exists. > > > > Add it so the backlight is only enabled after the crtc is, to avoid > > graphical issues. > > > > Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com> > > --- > > drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 23 ++++++++++++-- > > drivers/gpu/drm/panel/panel-innolux-ej030na.c | 31 > > ++++++++++++++++--- > > 2 files changed, 48 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > > b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > > index f043b484055b..b5736344e3ec 100644 > > --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > > +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > > @@ -183,8 +183,6 @@ static int y030xx067a_prepare(struct drm_panel > > *panel) > > goto err_disable_regulator; > > } > > > > - msleep(120); > > - > > return 0; > > > > err_disable_regulator: > > @@ -202,6 +200,25 @@ static int y030xx067a_unprepare(struct drm_panel > > *panel) > > return 0; > > } > > > > +static int y030xx067a_enable(struct drm_panel *panel) > > +{ > > + if (panel->backlight) { > > + /* Wait for the picture to be ready before enabling backlight */ > > + msleep(120); > > + } > > + > > + return 0; > > +} > > + > > +static int y030xx067a_disable(struct drm_panel *panel) > > +{ > > + struct y030xx067a *priv = to_y030xx067a(panel); > > + > > + regmap_clear_bits(priv->map, 0x06, REG06_XPSAVE); > > Shouldn't that be balanced by a regmap_set_bits() in the .enable() > function? > > Cheers, > -Paul > > > + > > + return 0; > > +} > > + > > static int y030xx067a_get_modes(struct drm_panel *panel, > > struct drm_connector *connector) > > { > > @@ -239,6 +256,8 @@ static int y030xx067a_get_modes(struct drm_panel > > *panel, > > static const struct drm_panel_funcs y030xx067a_funcs = { > > .prepare = y030xx067a_prepare, > > .unprepare = y030xx067a_unprepare, > > + .enable = y030xx067a_enable, > > + .disable = y030xx067a_disable, > > .get_modes = y030xx067a_get_modes, > > }; > > > > diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > > b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > > index c558de3f99be..6de7370185cd 100644 > > --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > > +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > > @@ -80,8 +80,6 @@ static const struct reg_sequence > > ej030na_init_sequence[] = { > > { 0x47, 0x08 }, > > { 0x48, 0x0f }, > > { 0x49, 0x0f }, > > - > > - { 0x2b, 0x01 }, > > }; > > > > static int ej030na_prepare(struct drm_panel *panel) > > @@ -109,8 +107,6 @@ static int ej030na_prepare(struct drm_panel > > *panel) > > goto err_disable_regulator; > > } > > > > - msleep(120); > > - > > return 0; > > > > err_disable_regulator: > > @@ -128,6 +124,31 @@ static int ej030na_unprepare(struct drm_panel > > *panel) > > return 0; > > } > > > > +static int ej030na_enable(struct drm_panel *panel) > > +{ > > + struct ej030na *priv = to_ej030na(panel); > > + > > + /* standby off */ > > + regmap_write(priv->map, 0x2b, 0x01); > > + > > + if (panel->backlight) { > > + /* Wait for the picture to be ready before enabling backlight */ > > + msleep(120); > > + } > > + > > + return 0; > > +} > > + > > +static int ej030na_disable(struct drm_panel *panel) > > +{ > > + struct ej030na *priv = to_ej030na(panel); > > + > > + /* standby on */ > > + regmap_write(priv->map, 0x2b, 0x00); > > + > > + return 0; > > +} > > + > > static int ej030na_get_modes(struct drm_panel *panel, > > struct drm_connector *connector) > > { > > @@ -165,6 +186,8 @@ static int ej030na_get_modes(struct drm_panel > > *panel, > > static const struct drm_panel_funcs ej030na_funcs = { > > .prepare = ej030na_prepare, > > .unprepare = ej030na_unprepare, > > + .enable = ej030na_enable, > > + .disable = ej030na_disable, > > .get_modes = ej030na_get_modes, > > }; > > > > -- > > 2.34.1 > > > >
Hi Christophe, Le lun., mars 7 2022 at 19:12:49 +0100, Christophe Branchereau <cbranchereau@gmail.com> a écrit : > Hi Paul, it should in theory, but doesn't work in practice, the > display doesn't like having that bit set outside of the init sequence. > > Feel free to experiment if you think you can make it work though, you > should have that panel on 1 or 2 devices I think. It does actually work in practice; what probably fails for you is the regmap_set_bits(), which causes a spi-read-then-write. Since AFAIK it is not possible to read registers from this panel (only write), then this does not work. An easy fix would be to just use REGCACHE_FLAT as the cache type in the regmap_config. Then regmap_set_bits() can be used. Cheers, -Paul > > KR > CB > > On Wed, Mar 2, 2022 at 12:22 PM Paul Cercueil <paul@crapouillou.net> > wrote: >> >> Hi Christophe, >> >> Le mar., mars 1 2022 at 16:31:22 +0100, Christophe Branchereau >> <cbranchereau@gmail.com> a écrit : >> > Following the introduction of bridge_atomic_enable in the ingenic >> > drm driver, the crtc is enabled between .prepare and .enable, if >> > it exists. >> > >> > Add it so the backlight is only enabled after the crtc is, to >> avoid >> > graphical issues. >> > >> > Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com> >> > --- >> > drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 23 ++++++++++++-- >> > drivers/gpu/drm/panel/panel-innolux-ej030na.c | 31 >> > ++++++++++++++++--- >> > 2 files changed, 48 insertions(+), 6 deletions(-) >> > >> > diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c >> > b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c >> > index f043b484055b..b5736344e3ec 100644 >> > --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c >> > +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c >> > @@ -183,8 +183,6 @@ static int y030xx067a_prepare(struct drm_panel >> > *panel) >> > goto err_disable_regulator; >> > } >> > >> > - msleep(120); >> > - >> > return 0; >> > >> > err_disable_regulator: >> > @@ -202,6 +200,25 @@ static int y030xx067a_unprepare(struct >> drm_panel >> > *panel) >> > return 0; >> > } >> > >> > +static int y030xx067a_enable(struct drm_panel *panel) >> > +{ >> > + if (panel->backlight) { >> > + /* Wait for the picture to be ready before enabling >> backlight */ >> > + msleep(120); >> > + } >> > + >> > + return 0; >> > +} >> > + >> > +static int y030xx067a_disable(struct drm_panel *panel) >> > +{ >> > + struct y030xx067a *priv = to_y030xx067a(panel); >> > + >> > + regmap_clear_bits(priv->map, 0x06, REG06_XPSAVE); >> >> Shouldn't that be balanced by a regmap_set_bits() in the .enable() >> function? >> >> Cheers, >> -Paul >> >> > + >> > + return 0; >> > +} >> > + >> > static int y030xx067a_get_modes(struct drm_panel *panel, >> > struct drm_connector *connector) >> > { >> > @@ -239,6 +256,8 @@ static int y030xx067a_get_modes(struct >> drm_panel >> > *panel, >> > static const struct drm_panel_funcs y030xx067a_funcs = { >> > .prepare = y030xx067a_prepare, >> > .unprepare = y030xx067a_unprepare, >> > + .enable = y030xx067a_enable, >> > + .disable = y030xx067a_disable, >> > .get_modes = y030xx067a_get_modes, >> > }; >> > >> > diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c >> > b/drivers/gpu/drm/panel/panel-innolux-ej030na.c >> > index c558de3f99be..6de7370185cd 100644 >> > --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c >> > +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c >> > @@ -80,8 +80,6 @@ static const struct reg_sequence >> > ej030na_init_sequence[] = { >> > { 0x47, 0x08 }, >> > { 0x48, 0x0f }, >> > { 0x49, 0x0f }, >> > - >> > - { 0x2b, 0x01 }, >> > }; >> > >> > static int ej030na_prepare(struct drm_panel *panel) >> > @@ -109,8 +107,6 @@ static int ej030na_prepare(struct drm_panel >> > *panel) >> > goto err_disable_regulator; >> > } >> > >> > - msleep(120); >> > - >> > return 0; >> > >> > err_disable_regulator: >> > @@ -128,6 +124,31 @@ static int ej030na_unprepare(struct drm_panel >> > *panel) >> > return 0; >> > } >> > >> > +static int ej030na_enable(struct drm_panel *panel) >> > +{ >> > + struct ej030na *priv = to_ej030na(panel); >> > + >> > + /* standby off */ >> > + regmap_write(priv->map, 0x2b, 0x01); >> > + >> > + if (panel->backlight) { >> > + /* Wait for the picture to be ready before enabling >> backlight */ >> > + msleep(120); >> > + } >> > + >> > + return 0; >> > +} >> > + >> > +static int ej030na_disable(struct drm_panel *panel) >> > +{ >> > + struct ej030na *priv = to_ej030na(panel); >> > + >> > + /* standby on */ >> > + regmap_write(priv->map, 0x2b, 0x00); >> > + >> > + return 0; >> > +} >> > + >> > static int ej030na_get_modes(struct drm_panel *panel, >> > struct drm_connector *connector) >> > { >> > @@ -165,6 +186,8 @@ static int ej030na_get_modes(struct drm_panel >> > *panel, >> > static const struct drm_panel_funcs ej030na_funcs = { >> > .prepare = ej030na_prepare, >> > .unprepare = ej030na_unprepare, >> > + .enable = ej030na_enable, >> > + .disable = ej030na_disable, >> > .get_modes = ej030na_get_modes, >> > }; >> > >> > -- >> > 2.34.1 >> > >> >>
Hi Paul, yes that works fine, thanks for checking it out On Mon, Mar 14, 2022 at 9:54 PM Paul Cercueil <paul@crapouillou.net> wrote: > > Hi Christophe, > > Le lun., mars 7 2022 at 19:12:49 +0100, Christophe Branchereau > <cbranchereau@gmail.com> a écrit : > > Hi Paul, it should in theory, but doesn't work in practice, the > > display doesn't like having that bit set outside of the init sequence. > > > > Feel free to experiment if you think you can make it work though, you > > should have that panel on 1 or 2 devices I think. > > It does actually work in practice; what probably fails for you is the > regmap_set_bits(), which causes a spi-read-then-write. Since AFAIK it > is not possible to read registers from this panel (only write), then > this does not work. > > An easy fix would be to just use REGCACHE_FLAT as the cache type in the > regmap_config. Then regmap_set_bits() can be used. > > Cheers, > -Paul > > > > > KR > > CB > > > > On Wed, Mar 2, 2022 at 12:22 PM Paul Cercueil <paul@crapouillou.net> > > wrote: > >> > >> Hi Christophe, > >> > >> Le mar., mars 1 2022 at 16:31:22 +0100, Christophe Branchereau > >> <cbranchereau@gmail.com> a écrit : > >> > Following the introduction of bridge_atomic_enable in the ingenic > >> > drm driver, the crtc is enabled between .prepare and .enable, if > >> > it exists. > >> > > >> > Add it so the backlight is only enabled after the crtc is, to > >> avoid > >> > graphical issues. > >> > > >> > Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com> > >> > --- > >> > drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 23 ++++++++++++-- > >> > drivers/gpu/drm/panel/panel-innolux-ej030na.c | 31 > >> > ++++++++++++++++--- > >> > 2 files changed, 48 insertions(+), 6 deletions(-) > >> > > >> > diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > >> > b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > >> > index f043b484055b..b5736344e3ec 100644 > >> > --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > >> > +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > >> > @@ -183,8 +183,6 @@ static int y030xx067a_prepare(struct drm_panel > >> > *panel) > >> > goto err_disable_regulator; > >> > } > >> > > >> > - msleep(120); > >> > - > >> > return 0; > >> > > >> > err_disable_regulator: > >> > @@ -202,6 +200,25 @@ static int y030xx067a_unprepare(struct > >> drm_panel > >> > *panel) > >> > return 0; > >> > } > >> > > >> > +static int y030xx067a_enable(struct drm_panel *panel) > >> > +{ > >> > + if (panel->backlight) { > >> > + /* Wait for the picture to be ready before enabling > >> backlight */ > >> > + msleep(120); > >> > + } > >> > + > >> > + return 0; > >> > +} > >> > + > >> > +static int y030xx067a_disable(struct drm_panel *panel) > >> > +{ > >> > + struct y030xx067a *priv = to_y030xx067a(panel); > >> > + > >> > + regmap_clear_bits(priv->map, 0x06, REG06_XPSAVE); > >> > >> Shouldn't that be balanced by a regmap_set_bits() in the .enable() > >> function? > >> > >> Cheers, > >> -Paul > >> > >> > + > >> > + return 0; > >> > +} > >> > + > >> > static int y030xx067a_get_modes(struct drm_panel *panel, > >> > struct drm_connector *connector) > >> > { > >> > @@ -239,6 +256,8 @@ static int y030xx067a_get_modes(struct > >> drm_panel > >> > *panel, > >> > static const struct drm_panel_funcs y030xx067a_funcs = { > >> > .prepare = y030xx067a_prepare, > >> > .unprepare = y030xx067a_unprepare, > >> > + .enable = y030xx067a_enable, > >> > + .disable = y030xx067a_disable, > >> > .get_modes = y030xx067a_get_modes, > >> > }; > >> > > >> > diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > >> > b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > >> > index c558de3f99be..6de7370185cd 100644 > >> > --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > >> > +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > >> > @@ -80,8 +80,6 @@ static const struct reg_sequence > >> > ej030na_init_sequence[] = { > >> > { 0x47, 0x08 }, > >> > { 0x48, 0x0f }, > >> > { 0x49, 0x0f }, > >> > - > >> > - { 0x2b, 0x01 }, > >> > }; > >> > > >> > static int ej030na_prepare(struct drm_panel *panel) > >> > @@ -109,8 +107,6 @@ static int ej030na_prepare(struct drm_panel > >> > *panel) > >> > goto err_disable_regulator; > >> > } > >> > > >> > - msleep(120); > >> > - > >> > return 0; > >> > > >> > err_disable_regulator: > >> > @@ -128,6 +124,31 @@ static int ej030na_unprepare(struct drm_panel > >> > *panel) > >> > return 0; > >> > } > >> > > >> > +static int ej030na_enable(struct drm_panel *panel) > >> > +{ > >> > + struct ej030na *priv = to_ej030na(panel); > >> > + > >> > + /* standby off */ > >> > + regmap_write(priv->map, 0x2b, 0x01); > >> > + > >> > + if (panel->backlight) { > >> > + /* Wait for the picture to be ready before enabling > >> backlight */ > >> > + msleep(120); > >> > + } > >> > + > >> > + return 0; > >> > +} > >> > + > >> > +static int ej030na_disable(struct drm_panel *panel) > >> > +{ > >> > + struct ej030na *priv = to_ej030na(panel); > >> > + > >> > + /* standby on */ > >> > + regmap_write(priv->map, 0x2b, 0x00); > >> > + > >> > + return 0; > >> > +} > >> > + > >> > static int ej030na_get_modes(struct drm_panel *panel, > >> > struct drm_connector *connector) > >> > { > >> > @@ -165,6 +186,8 @@ static int ej030na_get_modes(struct drm_panel > >> > *panel, > >> > static const struct drm_panel_funcs ej030na_funcs = { > >> > .prepare = ej030na_prepare, > >> > .unprepare = ej030na_unprepare, > >> > + .enable = ej030na_enable, > >> > + .disable = ej030na_disable, > >> > .get_modes = ej030na_get_modes, > >> > }; > >> > > >> > -- > >> > 2.34.1 > >> > > >> > >> > >
diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c index f043b484055b..b5736344e3ec 100644 --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c @@ -183,8 +183,6 @@ static int y030xx067a_prepare(struct drm_panel *panel) goto err_disable_regulator; } - msleep(120); - return 0; err_disable_regulator: @@ -202,6 +200,25 @@ static int y030xx067a_unprepare(struct drm_panel *panel) return 0; } +static int y030xx067a_enable(struct drm_panel *panel) +{ + if (panel->backlight) { + /* Wait for the picture to be ready before enabling backlight */ + msleep(120); + } + + return 0; +} + +static int y030xx067a_disable(struct drm_panel *panel) +{ + struct y030xx067a *priv = to_y030xx067a(panel); + + regmap_clear_bits(priv->map, 0x06, REG06_XPSAVE); + + return 0; +} + static int y030xx067a_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -239,6 +256,8 @@ static int y030xx067a_get_modes(struct drm_panel *panel, static const struct drm_panel_funcs y030xx067a_funcs = { .prepare = y030xx067a_prepare, .unprepare = y030xx067a_unprepare, + .enable = y030xx067a_enable, + .disable = y030xx067a_disable, .get_modes = y030xx067a_get_modes, }; diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c b/drivers/gpu/drm/panel/panel-innolux-ej030na.c index c558de3f99be..6de7370185cd 100644 --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c @@ -80,8 +80,6 @@ static const struct reg_sequence ej030na_init_sequence[] = { { 0x47, 0x08 }, { 0x48, 0x0f }, { 0x49, 0x0f }, - - { 0x2b, 0x01 }, }; static int ej030na_prepare(struct drm_panel *panel) @@ -109,8 +107,6 @@ static int ej030na_prepare(struct drm_panel *panel) goto err_disable_regulator; } - msleep(120); - return 0; err_disable_regulator: @@ -128,6 +124,31 @@ static int ej030na_unprepare(struct drm_panel *panel) return 0; } +static int ej030na_enable(struct drm_panel *panel) +{ + struct ej030na *priv = to_ej030na(panel); + + /* standby off */ + regmap_write(priv->map, 0x2b, 0x01); + + if (panel->backlight) { + /* Wait for the picture to be ready before enabling backlight */ + msleep(120); + } + + return 0; +} + +static int ej030na_disable(struct drm_panel *panel) +{ + struct ej030na *priv = to_ej030na(panel); + + /* standby on */ + regmap_write(priv->map, 0x2b, 0x00); + + return 0; +} + static int ej030na_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -165,6 +186,8 @@ static int ej030na_get_modes(struct drm_panel *panel, static const struct drm_panel_funcs ej030na_funcs = { .prepare = ej030na_prepare, .unprepare = ej030na_unprepare, + .enable = ej030na_enable, + .disable = ej030na_disable, .get_modes = ej030na_get_modes, };
Following the introduction of bridge_atomic_enable in the ingenic drm driver, the crtc is enabled between .prepare and .enable, if it exists. Add it so the backlight is only enabled after the crtc is, to avoid graphical issues. Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com> --- drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 23 ++++++++++++-- drivers/gpu/drm/panel/panel-innolux-ej030na.c | 31 ++++++++++++++++--- 2 files changed, 48 insertions(+), 6 deletions(-)