Jump to content

ILI9488 display patch for SKU: MSP3520, MSP3521, MSP4020, MSP4021


Recommended Posts

I am releasing this patch in the hope of you may find it useful. I have also included a sample dts file.  It seems to work in 48mhz quite well with very few SPI errors. (Note that the pieces of the driver has been around for some time but I have never seen it put together without further work. Hopefully this patch would make it readily usable. I have tested it on 5.5.18 and quite happy with it.)

 

 

_4241261.JPG

0001-fbtft-fb_ili9488.patch 1_ili9488.dts

 

Sample file is for nanopi neo.

 

Driver also works with 4 inch LCD, MSP4020, MSP4021

Link to comment
Share on other sites

The colors seem a bit off, I tried fixing it with the following changes. Its a better approximation/mapping and also makes screen brighter but the colors still a bit off. Any ideas?

 

for (i = 0; i < to_copy; i++) {
+            u16 pixel = vmem16;
+            u16 b = pixel & 0x1f;
+            u16 g = (pixel & (0x3f << 5)) >> 5;
+            u16 r = (pixel & (0x1f << 11)) >> 11;
+
+            u8 r8 = ((r & 0x1F)*4*63)/31 + 3;
+            u8 g8 = (g & 0x3F)*4 + 3;
+            u8 b8 = ((b & 0x1F)*4*63)/31 + 3;
+
+            txbuf[i * 3 + 0] = r8;
+            txbuf[i * 3 + 1] = g8;
+            txbuf[i * 3 + 2] = b8;
+        }
 

Link to comment
Share on other sites

Thank a lot for your ILI9488 driver. Indeed the colors seem not as they should be.  But this part of code do not work for me at all:

 

On 7/5/2020 at 4:21 AM, yam1 said:

for (i = 0; i < to_copy; i++) {
+            u16 pixel = vmem16;
+            u16 b = pixel & 0x1f;
+            u16 g = (pixel & (0x3f << 5)) >> 5;
+            u16 r = (pixel & (0x1f << 11)) >> 11;
+
+            u8 r8 = ((r & 0x1F)*4*63)/31 + 3;
+            u8 g8 = (g & 0x3F)*4 + 3;
+            u8 b8 = ((b & 0x1F)*4*63)/31 + 3;
+
+            txbuf[i * 3 + 0] = r8;
+            txbuf[i * 3 + 1] = g8;
+            txbuf[i * 3 + 2] = b8;
+        }
 

I'm getting these lines regardless of whether what is located in framebuffer:

Edited by enclis
Link to comment
Share on other sites

On another note, kernel 5.7 or later is somehow automatically switched to use DRM driver for ili9486 displays - this driver is not working. To work around this I made a copy of the fb ili9486 driver with a different name:

 

 

0001-fbtft-fb_ili9486o.patch

 

 

update: DRM driver is working (slowly) on 5.9, so may be you don't need this patch any more... fbdev drivers seem to take precedence over DRM drivers, so if you leave this in it would still use the fbdev driver -- for drmfb the initialization string seemed not being honored may be the reason why it's so slow

Link to comment
Share on other sites

hi
could you please explain how to apply this patch?

 

all im getting is:

$patch < 0001-fbtft-fb_ili9488.patch
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
|index dad1ddcd7..fd27a2dea 100644
|--- a/drivers/staging/fbtft/Kconfig
|+++ b/drivers/staging/fbtft/Kconfig
--------------------------

thanks!!
 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines