Patch "drm/ssd130x: Init display before the SSD130X_DISPLAY_ON command" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/ssd130x: Init display before the SSD130X_DISPLAY_ON command

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-ssd130x-init-display-before-the-ssd130x_display_.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5646905ccd3a1f96d245bdb75615b31619bf825b
Author: Javier Martinez Canillas <javierm@xxxxxxxxxx>
Date:   Wed Jan 25 19:42:30 2023 +0100

    drm/ssd130x: Init display before the SSD130X_DISPLAY_ON command
    
    [ Upstream commit 343c700480982214dc4f834f536a49a4098e556a ]
    
    Commit 622113b9f11f ("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: 622113b9f11f ("drm/ssd130x: Replace simple display helpers with the atomic helpers")
    Signed-off-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>
    Reviewed-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230125184230.3343206-1-javierm@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index bc41a5ae810a..4bb3a247732d 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -665,18 +665,8 @@ static const struct drm_crtc_helper_funcs ssd130x_crtc_helper_funcs = {
 	.atomic_check = ssd130x_crtc_helper_atomic_check,
 };
 
-static void ssd130x_crtc_reset(struct drm_crtc *crtc)
-{
-	struct drm_device *drm = crtc->dev;
-	struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
-
-	ssd130x_init(ssd130x);
-
-	drm_atomic_helper_crtc_reset(crtc);
-}
-
 static const struct drm_crtc_funcs ssd130x_crtc_funcs = {
-	.reset = ssd130x_crtc_reset,
+	.reset = drm_atomic_helper_crtc_reset,
 	.destroy = drm_crtc_cleanup,
 	.set_config = drm_atomic_helper_set_config,
 	.page_flip = drm_atomic_helper_page_flip,
@@ -695,6 +685,12 @@ static void ssd130x_encoder_helper_atomic_enable(struct drm_encoder *encoder,
 	if (ret)
 		return;
 
+	ret = ssd130x_init(ssd130x);
+	if (ret) {
+		ssd130x_power_off(ssd130x);
+		return;
+	}
+
 	ssd130x_write_cmd(ssd130x, 1, SSD130X_DISPLAY_ON);
 
 	backlight_enable(ssd130x->bl_dev);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux