mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] video: mipi_dbi: don't send image before initialization
@ 2024-12-10  8:04 Sven Püschel
  2024-12-12  9:06 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Püschel @ 2024-12-10  8:04 UTC (permalink / raw)
  To: barebox; +Cc: Sven Püschel, Ahmad Fatoum

Don't send an image to the display before it is initialized, as it can
cause a broken image being stored in the display memory and being shown
while initializing. Instead just damage the image in the flush call but
avoid writing the actual image.

This problem was experienced with a ILI9341 LCD driver and calling the
splash command before enabling the framebuffer. The splash command flushed
out the data, but given no initialization, they were misinterpreted.
After enabling the display, it displayed the broken image for a short time
before being updated. This caused a flickering effect for the viewer.
Switching the command ordering also fixes the problem, but sends an black
image before the actual splash image.

Co-developed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
---
 drivers/video/mipi_dbi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/mipi_dbi.c b/drivers/video/mipi_dbi.c
index 9611a402d1..c202ecc1c7 100644
--- a/drivers/video/mipi_dbi.c
+++ b/drivers/video/mipi_dbi.c
@@ -366,6 +366,9 @@ void mipi_dbi_fb_flush(struct fb_info *info)
 		dbidev->damage.y2 = info->yres;
 	}
 
+	if (!info->enabled)
+		return;
+
 	mipi_dbi_fb_dirty(dbidev, info, &dbidev->damage);
 }
 EXPORT_SYMBOL(mipi_dbi_fb_flush);
-- 
2.39.5




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] video: mipi_dbi: don't send image before initialization
  2024-12-10  8:04 [PATCH] video: mipi_dbi: don't send image before initialization Sven Püschel
@ 2024-12-12  9:06 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-12-12  9:06 UTC (permalink / raw)
  To: barebox, Sven Püschel; +Cc: Ahmad Fatoum


On Tue, 10 Dec 2024 09:04:03 +0100, Sven Püschel wrote:
> Don't send an image to the display before it is initialized, as it can
> cause a broken image being stored in the display memory and being shown
> while initializing. Instead just damage the image in the flush call but
> avoid writing the actual image.
> 
> This problem was experienced with a ILI9341 LCD driver and calling the
> splash command before enabling the framebuffer. The splash command flushed
> out the data, but given no initialization, they were misinterpreted.
> After enabling the display, it displayed the broken image for a short time
> before being updated. This caused a flickering effect for the viewer.
> Switching the command ordering also fixes the problem, but sends an black
> image before the actual splash image.
> 
> [...]

Applied, thanks!

[1/1] video: mipi_dbi: don't send image before initialization
      https://git.pengutronix.de/cgit/barebox/commit/?id=a7ae043343c8 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-12  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-10  8:04 [PATCH] video: mipi_dbi: don't send image before initialization Sven Püschel
2024-12-12  9:06 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox