Skip to content

Commit 343c700

Browse files
drm/ssd130x: Init display before the SSD130X_DISPLAY_ON command
Commit 622113b ("drm/ssd130x: Replace simple display helpers with the atomic helpers") changed the driver to just use the atomic helpers instead of the simple KMS abstraction layer. But the commit also made a subtle change on the display power sequence and initialization order, by moving the ssd130x_power_on() call to the encoder .atomic_enable handler and the ssd130x_init() call to CRTC .reset handler. Before this change, both ssd130x_power_on() and ssd130x_init() were called in the simple display pipeline .enable handler, so the display was already initialized by the time the SSD130X_DISPLAY_ON command was sent. For some reasons, it only made the ssd130x SPI driver to fail but the I2C was still working. That is the reason why the bug was not noticed before. To revert to the old driver behavior, move the ssd130x_init() call to the encoder .atomic_enable as well. Besides fixing the panel not being turned on when using SPI, it also gets rid of the custom CRTC .reset callback. Fixes: 622113b ("drm/ssd130x: Replace simple display helpers with the atomic helpers") Signed-off-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 51128c3 commit 343c700

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

drivers/gpu/drm/solomon/ssd130x.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -656,18 +656,8 @@ static const struct drm_crtc_helper_funcs ssd130x_crtc_helper_funcs = {
656656
.atomic_check = drm_crtc_helper_atomic_check,
657657
};
658658

659-
static void ssd130x_crtc_reset(struct drm_crtc *crtc)
660-
{
661-
struct drm_device *drm = crtc->dev;
662-
struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
663-
664-
ssd130x_init(ssd130x);
665-
666-
drm_atomic_helper_crtc_reset(crtc);
667-
}
668-
669659
static const struct drm_crtc_funcs ssd130x_crtc_funcs = {
670-
.reset = ssd130x_crtc_reset,
660+
.reset = drm_atomic_helper_crtc_reset,
671661
.destroy = drm_crtc_cleanup,
672662
.set_config = drm_atomic_helper_set_config,
673663
.page_flip = drm_atomic_helper_page_flip,
@@ -686,6 +676,12 @@ static void ssd130x_encoder_helper_atomic_enable(struct drm_encoder *encoder,
686676
if (ret)
687677
return;
688678

679+
ret = ssd130x_init(ssd130x);
680+
if (ret) {
681+
ssd130x_power_off(ssd130x);
682+
return;
683+
}
684+
689685
ssd130x_write_cmd(ssd130x, 1, SSD130X_DISPLAY_ON);
690686

691687
backlight_enable(ssd130x->bl_dev);

0 commit comments

Comments
 (0)