yam1 Posted April 24, 2020 Posted April 24, 2020 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.) 0001-fbtft-fb_ili9488.patch 1_ili9488.dts Sample file is for nanopi neo. Driver also works with 4 inch LCD, MSP4020, MSP4021
le51 Posted April 29, 2020 Posted April 29, 2020 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 ?
yam1 Posted July 5, 2020 Author Posted July 5, 2020 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; + }
enclis Posted July 23, 2020 Posted July 23, 2020 (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 July 23, 2020 by enclis
yam1 Posted July 24, 2020 Author Posted July 24, 2020 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: 0001-fbtft-fb_st7789.patch The patch contains the brightness fix as mentioned earlier - the colors seem okay on this type of displays.
yam1 Posted July 24, 2020 Author Posted July 24, 2020 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
Coby Levy Posted September 16, 2020 Posted September 16, 2020 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!!
martinayotte Posted September 17, 2020 Posted September 17, 2020 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
Recommended Posts