Jump to content

Recommended Posts

Posted

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

Posted

Hi, that is a great news !

  • the provided dts file is for what kind of board ?
  • Do you plan to get the touch to work too ?
Posted

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;
+        }
 

Posted (edited)

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
Posted

I made a copy of the driver with a different resolution, now it works with 240x240, 1.3", or 1.54", st7789 based tiny displays:

 

st7789-1.jpg.5e622ad72dfaa56316f5a3caadbca24d.jpg

0001-fbtft-fb_st7789.patch

 

The patch contains the brightness fix as mentioned earlier - the colors seem okay on this type of displays.

Posted

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

Posted

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!!
 

Posted
17 hours ago, Coby Levy said:

could you please explain how to apply this patch?

Like the message says, you need to use "-p" :

patch -p 1 < 0001-fbtft-fb_ili9488.patch

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines