staging: fbtft: Moving fb_ili9341 (and others) to DRM
Subsystems (3)
Hi,
I'm looking at the fbtft TODO (convert drivers to DRM) and want to check whether fb_ili9341 can be dropped. Findings against v7.4-rc1:
1. fb_ili9341's init sequence is the MI0283QT-9A one. Comparing register writes with drivers/gpu/drm/tiny/mi0283qt.c, the values are identical, including the default gamma tables. Differences I found:
- mi0283qt writes EN3GAM (0xF2) = 0x08; the fbtft write is commented out.
- mi0283qt always sets MADCTL BGR; fbtft makes it configurable (bgr=).
- fbtft rotate=270 also sets ML; mi0283qt does not.
- Rotation maps as DRM rotation = fbtft rotate - 90 (mod 360).
- fbtft also offers runtime gamma adjustment.
2. fb_ili9341 registers the compatible "ilitek,ili9341", which is also the fallback in the dt-schema binding, so it can match nodes that the DRM drivers claim via their specific compatibles.
3. In-tree users: no defconfig enables FB_TFT. canaan_kd233 (62363a8e2f56, Feb 2021) has a status = "disabled" panel node compatible with "canaan,kd233-tft", "ilitek,ili9341". It predates the first DRM driver accepting ilitek,ili9341 (5a04227326b0, Jul 2021), and none of the DRM drivers match canaan,kd233-tft. fbtft requests "dc" and "reset" GPIOs, which fits that node. I haven't tried binding it. I suppose that, if the board is used, then it is built against the fbtft driver.
4. fb_ili9341 has had only style/mechanical changes in recent years.
Questions:
a) Is removing fb_ili9341 acceptable, pointing users of other ILI9341 modules to panel-mipi-dbi? The KD233 node would then have no driver.
b) Or should KD233 panel support go into a DRM driver first? I don't have its init sequence or physical size, or the board...
c) Is removal of all of fbtft already planned?
d) Several other fbtft drivers have drm counterparts. Should I inspect those to see if removal is needed?
I have not tested on hardware.
Thanks,
Daniel M
Quoted 8 lines · Daniel Matyas
Questions:
a) Is removingfb_ili9341acceptable, pointing users of other ILI9341 modules to panel-mipi-dbi? The KD233 node would then have no driver.
b) Or should KD233 panel support go into a DRM driver first? I don't have its init sequence or physical size, or the board...
c) Is removal of all of fbtft already planned?
d) Several other fbtft drivers have drm counterparts. Should I inspect those to see if removal is needed?
IIRC the main reason fbtft needs to stay is because it supports parallel interface which is missing in the DRM drivers.
Nam
Quoted 10 lines · Nam Cao
Quoted 8 lines · Daniel Matyas
Questions:
a) Is removingfb_ili9341acceptable, pointing users of other ILI9341 modules to panel-mipi-dbi? The KD233 node would then have no driver.
b) Or should KD233 panel support go into a DRM driver first? I don't have its init sequence or physical size, or the board...
c) Is removal of all of fbtft already planned?
d) Several other fbtft drivers have drm counterparts. Should I inspect those to see if removal is needed?
Quoted 4 lines
IIRC the main reason fbtft needs to stay is because it supports parallel interface which is missing in the DRM drivers.
Nam
Thank you for clarifying. However, the fb_ili9341 driver uses only the SPI interface. Is it alright then to move (or remove) those drivers that only use SPI interface and have DRM counterparts?
Furthermore, would there be a need to enable parallel interface support in the DRM subsystem?
Daniel M
Quoted 12 lines · Daniel Matyas
Quoted 10 lines · Nam Cao
Quoted 8 lines · Daniel Matyas
Questions:
a) Is removingfb_ili9341acceptable, pointing users of other ILI9341 modules to panel-mipi-dbi? The KD233 node would then have no driver.
b) Or should KD233 panel support go into a DRM driver first? I don't have its init sequence or physical size, or the board...
c) Is removal of all of fbtft already planned?
d) Several other fbtft drivers have drm counterparts. Should I inspect those to see if removal is needed?
Quoted 7 lines
Quoted 4 lines
IIRC the main reason fbtft needs to stay is because it supports parallel interface which is missing in the DRM drivers.
Nam
Thank you for clarifying. However, the
fb_ili9341driver uses only the SPI interface.
Only two drivers use that macro, indeed:drivers/staging/fbtft/fb_ili9341.c, line 136drivers/staging/fbtft/fb_sh1106.c, line 173
Quoted 2 lines
Is it alright then to move (or remove) those drivers that only use SPI interface and have DRM counterparts?
You can suggest removing it, but it might break some users (yes, I understand that FBTFT is a staging driver), but doing such only for two out of dozens drivers seems to me a bit inconsistent approach.
Quoted 2 lines
Furthermore, would there be a need to enable parallel interface support in the DRM subsystem?
If you can do it, I will agree on retiring the FBTFT drivers that will gain such a support. I can test 8347d (IIRC I have that panel at hand).
Signature · 2 lines
With Best Regards, Andy Shevchenko