A couple of out-of-tree DRM graphics drivers for tiny displays.
notro / tinydrm Goto Github PK
View Code? Open in Web Editor NEWDiscontinued. Out of tree tinydrm modules
Home Page: https://github.com/notro/tinydrm/wiki
Discontinued. Out of tree tinydrm modules
Home Page: https://github.com/notro/tinydrm/wiki
A couple of out-of-tree DRM graphics drivers for tiny displays.
I am using Adafruit 1.8" TFT LCD with a BeagleBone Black. I created a device tree overlay, BB-LCD-ADAFRUIT-18-SPI1-00A0.dts, which will load the tinydrm st7735r driver by David Lechner (@dlech).
I ran into a problem when trying to enable PWM backlight control. I was able to turn on the backlight on by setting bl_power
to 0
(FB_BLANK_UNBLACK
) per comment by @notro:
echo 0 > /sys/devices/platform/backlight_pwm/backlight/backlight_pwm/bl_power
NOTE: FB_BLANK_UNBLACK
is specified in sysfs-class-backlight
the tinydrm driver should make sure the backlight turns on when the display pipeline is enabled.
I am creating this issue to discussion a patch to st7735r that would set bl_power
correctly for PWM backlight.
Both ili9341 and ili9486 drivers do not rotate the screens, rotation works great under fbtft. What needs to be changed in the code to support this? Is there an example implementation?
Many thanks for tinydrm.
I found the tinydrm lately,I moved fbtft to tinydrm excitedly! but it is not working properly,that look this:
I don't konw what happed,and I did some testing:
root@orangepi4:/boot/overlay-user# modetest -M "ili9341" -c
Connectors:
id encoder status name size (mm) modes encoders
31 35 connected (null)-1 49x37 1 35
modes:
index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
#0 320x240 0.01 320 320 320 320 240 240 240 240 1 flags: ; type: preferred, driver
props:
1 EDID:
flags: immutable blob
blobs:
value:
2 DPMS:
flags: enum
enums: On=0 Standby=1 Suspend=2 Off=3
value: 0
5 link-status:
flags: enum
enums: Good=0 Bad=1
value: 0
6 non-desktop:
flags: immutable range
values: 0 1
value: 0
4 TILE:
flags: immutable blob
blobs:
value:
20 CRTC_ID:
flags: object
value: 34
root@orangepi4:/boot/overlay-user# modetest -M "ili9341" -s 31:320x240@RG16 -v
setting mode 320x240-0.01Hz@RG16 on connectors 31, crtc 34
failed to set gamma: Function not implemented
freq: 1958.35Hz
freq: 1970.31Hz
freq: 1531.32Hz
freq: 1545.03Hz
freq: 2814.94Hz
freq: 4297.66Hz
freq: 4304.13Hz
root@orangepi4:/boot/overlay-user# dmesg |grep spi
[ 4.737590] [drm] Initialized ili9341 1.0.0 20180514 for spi1.0 on minor 0
[ 4.743904] ads7846 spi1.1: supply vcc not found, using dummy regulator
[ 4.744910] ili9341 spi1.0: [drm] *ERROR* Failed to update display -22
[ 4.746782] ads7846 spi1.1: touchscreen, irq 121
[ 4.763146] input: ADS7846 Touchscreen as /devices/platform/ff1d0000.spi/spi_master/spi1/spi1.1/input/input7
[ 5.116143] ili9341 spi1.0: [drm] fb0: ili9341drmfb frame buffer device
root@orangepi4:/boot/overlay-user# dmesg |grep drm
[ 4.149572] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped.
[ 4.737590] [drm] Initialized ili9341 1.0.0 20180514 for spi1.0 on minor 0
[ 4.744910] ili9341 spi1.0: [drm] *ERROR* Failed to update display -22
[ 4.775493] panfrost ff9a0000.gpu: [drm:panfrost_devfreq_init [panfrost]] Failed to register cooling device
[ 4.794188] [drm] Initialized panfrost 1.1.0 20180908 for ff9a0000.gpu on minor 1
[ 4.861633] rockchip-drm display-subsystem: bound ff8f0000.vop (ops vop_component_ops [rockchipdrm])
[ 4.861711] [drm] unsupported AFBC format[3231564e]
[ 4.866473] rockchip-drm display-subsystem: bound ff900000.vop (ops vop_component_ops [rockchipdrm])
[ 4.866656] rockchip-drm display-subsystem: bound fec00000.dp (ops cdn_dp_component_ops [rockchipdrm])
[ 4.868390] cdn-dp fec00000.dp: [drm:cdn_dp_pd_event_work [rockchipdrm]] Not connected. Disabling cdn
[ 4.874237] rockchip-drm display-subsystem: bound ff940000.hdmi (ops dw_hdmi_rockchip_ops [rockchipdrm])
[ 4.882608] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[ 4.882949] [drm] Initialized rockchip 1.0.0 20140818 for display-subsystem on minor 2
[ 4.900521] cdn-dp fec00000.dp: [drm:cdn_dp_pd_event_work [rockchipdrm]] Not connected. Disabling cdn
[ 5.116143] ili9341 spi1.0: [drm] fb0: ili9341drmfb frame buffer device
[ 5.898522] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
I noticed " ili9341 spi1.0: [drm] ERROR Failed to update display -22" in dmesg,is problem?
Hi Noralf,
I was interested in adding support for ssd1306 I2C display in the mainline. I see that there is already fbtft driver for the same but it seems to be for the SPI only and moreover, after reading mailing list conversations and you wiki notes, I think it is preferable to have tinydrm driver.
Could you please tell me what is the standard procedure to do that? I was mainly confused as I wasn't sure if any such effort has been done previously and/or are there any discussions happened specifically for ssd1306 and related displays? Does submitting tinydrm driver in the mailing list directly works? And how staging drivers are moved? I mean I know that fbdev maintainer don't want to accept more drivers, so once we have full functional tinydrm driver accepted in the mainline, do we end up deleting the driver from fbtft subsystem?
Thanks!
Hello,
I am developing a tinydrm kernel module for driving a simple monochromatic 128x48 LCD. We opted to go for tinydrm instead of fbdev or fbtft since drm/kms is the future, right?
So far so good. I can already display some graphics, etc.
However I need to control contrast of this LCD and I don't seem to be able to find any good examples or helpers on how to expose contrast settings to userspace?
Do we somehow expose some custom ioctl for that? Seems like a dirty hack...
What is the preferred way to do this?
For example fbtft provides methods for this via set_gamma
function pointer in fbtftops
:
static struct fbtft_display display = {
.regwidth = 8,
.width = WIDTH,
.height = HEIGHT,
.gamma_num = 1,
.gamma_len = 1,
.gamma = "00",
.fbtftops = {
.write_vmem = write_vmem,
.init_display = init_display,
.set_addr_win = set_addr_win,
.blank = blank,
.set_gamma = set_gamma,
},
};
Can you help @notro ?
I am using pi4 with aarch64 OS, attached a 1.3inch lcd HAT using st7789vw controller.
It works fine on kernel 4.19 by fbtft and flexfb.
After migrate to kernel 5.4, it stop work.
I have to comment out all fbtft & flexfb configurations, pull and compile tinydrm, deploy kernel module and load it on boot, modify st7789vw dts to adopt my lcd,
compile and load it in config.txt.
After those instructions, I still can't make it work.
rpi4:~$ lsmod |grep st77 st7789vw 16384 1 drm_mipi_dbi 28672 1 st7789vw backlight 20480 2 st7789vw,gpio_backlight rpi4:~$ dmesg |grep st7 [ 2.592372] st7789vw: loading out-of-tree module taints kernel. [ 3.842403] st7789vw spi0.0: fb1: ST7789VWdrmfb frame buffer device rpi4:~$ DISPLAY=:0 xrandr --listproviders Providers: number : 2 Provider 0: id: 0x41 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 1 outputs: 1 associated providers: 0 name:modesetting Provider 1: id: 0x74 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting
the lcd shows nothing while execute
rpi4:~$ cat /dev/random > /dev/fb1 cat: write error: No space left on device
directfb can't work with it
(*) Direct/Memcpy: Using Generic 64bit memcpy() (*) Direct/Thread: Started 'Fusion Dispatch' (1345) [MESSAGING - OTHER/0] <8388608>... (*) DirectFB/FBDev: Found 'ST7789VWdrmfb' (ID 0) with frame buffer at 0x00000000, 112k (MMIO 0x00000000, 0k) (*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org) (*) DirectFB/Core/WM: Default 0.3 (directfb.org) (*) Direct/Thread: Started 'Genefx' (1346) [DEFAULT - OTHER/0] <8388608>... (*) FBDev/Mode: Setting 240x240 RGB16 (*) FBDev/Mode: Switched to 240x240 (virtual 240x240) at 16 bit (RGB16), pitch 480 (!) DirectFB/FBDev: Could not set gamma ramp --> Device or resource busy
mesa egl can't work with it , and mesa failure to load an driver ST7789VM
rpi4:~$ DISPLAY=:0 eglinfo EGL client extensions string: EGL_EXT_client_extensions EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless GBM platform: MESA-LOADER: failed to open ST7789VW: /usr/lib/dri/ST7789VW_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri) failed to load driver: ST7789VW Mesa: The provided filesystem timestamp for the cache is bogus! Disabling On-disk cache. EGL API version: 1.4 EGL vendor string: Mesa Project EGL version string: 1.4 EGL client APIs: OpenGL OpenGL_ES
@notro
hi, where is tinydrm_display_pipe_prepare_fb in v4.18 ? Should we use "drm_gem_fb_simple_display_pipe_prepare_fb" instead ?
First of all, thanks for your hard work on these drivers. π
I'm working with EastRising's ILI9341-based ER-TFTM024-3 wired through the 4-wire SPI Interface II to a Raspberry Pi Zero.
The problem, bluntly, is that loading fb_ili9341
produces a usable framebuffer in /dev/fb1
, but the tinydrm-based ili9341
seems unable to communicate with the display. The screen remains blank.
After enabling full debugging in the drm
module, I found out that everything read from the display is 0. Essentially, everything in /sys/kernel/debug/dri/0/command
(and the output of the mipi-dcs
debugging tool) is just a bunch of zeros.
I don't have much more clues, unfortunately. modetest -M ili9341
returns the usual set of relevant information, but no test image ever gets to the display. Although there is some communication since lowering the SPI bus frequency clearly slows down the test.
Here is my device tree, if it might help : display.txt.
Any insight or clue is most welcome. π
Hi Notro,
I've been using FBTFT for some time, but there are some benefits in tinydrm so I have been trying to change over. Writing my driver in FBTFT was really straightforward (based off examples) and it worked perfectly:
https://github.com/kjngineering/ST7796S/blob/master/fb_st7796s.c
st7796s@0 {
reg = <0>;
compatible = "sitronix,st7796s";
pinctrl-names = "default";
spi-max-frequency = <55000000>;
rotate = <180>;
bgr;
fps = <30>;
buswidth = <8>;
reset-gpios = <&pio 4 1 GPIO_ACTIVE_HIGH>; //PE1
dc-gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>; //PB5
debug = <0>;
};
However writing the driver for tindrm has not been as simple. Although I made it harder on myself flicking between several kernel versions that had significant drm header changes. I had a go writing the driver, but I cannot get any meaningful results.
https://github.com/kjngineering/ST7796S/blob/master/st7796s.c
display@0 {
reg = <0>;
compatible = "sitronix,st7796s";
spi-max-frequency = <20000000>;
rotation = <0>;
reset-gpios = <&pio 4 1 GPIO_ACTIVE_HIGH>; //PE1
dc-gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>; //PB5
debug = <0>;
status = "okay";
};
At the moment I am stuck with repetitive spi transfer issues at initialization:
[ 54.601107] st7796s spi0.0: SPI transfer failed: -110 [ 54.606250] spi_master spi0: failed to transfer one message from queue [ 54.722664] spi_master spi0: spi0.0: timeout transferring 1 bytes@10000000Hz
It looks like the screen gets halfway through initialization before running into these (screen flashes, i get some static). I cannot figure out why, comparing the two drivers it should work the same but I think I am missing something in the SPI transfer mode 8-bit v 16-bit? But I cannot fix it. Switching back to the FBTFT config works fine.
I have tried reducing SPI speed and several other ideas without success.
Platform is Allwinner H3, Linux is 5.4.45 LTS via Buildroot.
Dear sir,
I am happily using Weston on ili9341.
Weston runs on fbdev-backend but I would like to try drm-backend in order to have hardware acceleration.
I encountered tinydrm and realized that it could suit my purpose.
Anyway,so far I have this line in my config.txt on Raspberry Pi:
dtoverlay=rpi-display with couple of other parameters like speed etc.
I would like to kindly ask you,how do I enable tinydrm layer?
Do I have to change config.txt,or should I tun the module automatically?
I still see fbtft as well as fb_ili9341 modules loaded instead of tinydrm module.
I have kernel 4.19.42 and I see some overlays and files related to tinydrm,but I have not found any information how to activate it.
Thank you for your help
Currently I am trying to get and ili9488 screen working with 3 wire spi, specifically this one from buydisplay.com (http://www.buydisplay.com/default/lcd-3-5-inch-320x480-tft-display-module-optl-touch-screen-w-breakout-board). To do this I am using a Raspberry Pi Zero W and running Jessie Lite. In order to get this working I have decided to go off of the piscreen module and device tree that are available here. I have made some modifications to the device tree (piscreen2r-overlay.dts) and now it looks like this. From what I have been able to learn, which is mainly from websites like (kernel.org, and raspberry pi documentation. I also put the line "dtoverlay=" and "dtoverlay=piscreen2r" the file "/boot/config.txt" to make it use that overlay. Also "dtparam=spi=on" this line I have uncommented in that file as well.
For the device tree below I am setting pin 25 to be the reset pin, and pin 22 to be the back light pin. From what I understand looking at the pi zero's default device tree, it isn't necessary to set anything for the chip select(CS) and for the spi pins since these should be the default. Being GPIO10 for MOSI and GPIO11 for SCLK, and for the CS i used GPIO8.
`
/piscreen2r-overlay.dts/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
spidev@0{
status = "disabled";
};
spidev@1{
status = "disabled";
};
};
};
fragment@1 {
target = <&gpio>;
__overlay__ {
piscreen2_pins: piscreen2_pins {
brcm,pins = <25 22>;
brcm,function = <1 1>; /* out out */
};
};
};
fragment@2 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
piscreen2: piscreen2@0{
compatible = "ozzmaker,piscreen2";
pinctrl-names = "default";
pinctrl-0 = <&piscreen2_pins>;
reg = <0>;
spi-max-frequency = <64000000>;
spi-3wire;
rotation = <0>;
reset-gpios = <&gpio 25 0>;
backlight = <&backlight>;
};
};
};
fragment@3 {
target-path = "/soc";
__overlay__ {
backlight: backlight {
compatible = "gpio-backlight";
gpios = <&gpio 22 0>;
};
};
};
__overrides__ {
speed = <&piscreen2>,"spi-max-frequency:0";
rotation = <&piscreen2>,"rotation:0";
};
};`
From here to get things up and running I followed the documentation in raspberry pi developement I ran "uname -a" to get my kernel version which is 4.10.4+. So in that previous link I went through the development instructions following them step by step. The only modification being creating the device tree binary (.dtb) using the device tree (.dts) code that i put above. I did not receive any errors while following this so I went on to testing.
For testing I followed what is on the development page under the mode test section. All of the build commands worked correctly. however when I tried to get the connector id using ./tests/modetest/modetest -M "piscreen" -c it gave me the following error
failed to open device 'piscreen': No such file or directory
So I am wondering for what reason would the device not have become available in that directory? And what can I do to make it available? Thank you for the help! Also I know some of the specifics may not be necessary to getting the solution I need but I hope by detailing it might be helpful to other.
Hi! I"m jumping this question over here from the fbtft issues.
I'm working on the ili9488 driver in SPI mode but it only works in 3bit or 18bit in this mode (parallel works in 16bit and 18bit). My attempts to stuff the 16bit up to 24bit in fbtft didn't work, it kept kernel dumping cause I assume it wont' support greater.
If I turn attention to doing this in tinydrm would I be able to run this at 18bit mode with little extra work? Basically does tinydrm support 18bit natively?
Thanks for all the work on the great wikis it's helped a lot in learning this!
hiya notro - if you're interested, i was just starting to compile this and got compilation errors on the most recent raspbian.
ladyada@c23af73
i can submit a pr if you like :)
tinydrm is an attempt at making a drm version of fbtft.
I will post progress reports in this thread as the tinydrm work moves forward.
If you want to be notified, click the Subscribe button to the right.
One change from fbtft is that we now write drivers for displays, not controllers. The main reason for this is that we're not allowed to have the binary init sequence in the Device Tree and it's impossible to cover all the possible controller configurations with individual properties.
The controller specific code is put in a module of it's own and contains the necessary code to update the display memory.
This is an example of how a display driver might look like: ada-mipifb.c
This is how a controller module might look like (many controllers are mipi compliant): mipi-dbi.c
But this could change depending on the feedback from the drm maintainers.
I haven't posted anything on the drm mailinglist yet, just a very short discussion.
Hello Notro,
I'm trying to move from a working fbtft_device to a tinydrm without success.
Its look like that it is a spi issues and I can't find a solution.
I'm using kernel 4.19.79 (but I have the same issue with 5.4) in a at91-sama5d27_som1_ek board.
I followed everything from your development wiki page.
I have an 400x240 ili9327 TFT (only initialization string differs) but I'm using yours mi0283qt driver as start example (tried with ili9341 with same result).
I have checked it with a logic analyzer and the hardware are working correct like the kernel log.
Here are some background information:
at91-sama5d27_som1_ek.dts
flx4: flexcom@fc018000 {
atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
status = "okay";
...
spi3: spi@400 {
compatible = "atmel,at91rm9200-spi";
reg = <0x400 0x200>;
interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
AT91_XDMAC_DT_PERID(19))>,
<&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
AT91_XDMAC_DT_PERID(20))>;
dma-names = "tx", "rx";
clocks = <&flx4_clk>;
clock-names = "spi_clk";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs
&pinctrl_mikrobus2_spi_cs>;
atmel,fifo-size = <32>;
status = "okay"; /* Conflict with uart6 and i2c3. */
#address-cells = <1>;
#size-cells = <0>;
display@1{
compatible = "multi-inno,mi0283qt";
reg = <1>;
spi-max-frequency = <32000000>;
rotation = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mikrobus_display>;
dc-gpios = <&pioA PIN_PD25 GPIO_ACTIVE_HIGH>;
reset-gpios = <&pioA PIN_PB2 GPIO_ACTIVE_HIGH>;
//backlight = <&backlight>;
status = "okay";
};
};
kernel log
atmel_spi f8000000.spi: DMA TX channel not available, SPI unable to use DMA
atmel_spi f8000000.spi: Atmel SPI Controller using PIO only
atmel_spi f8000000.spi: Using FIFO (16 data)
atmel_spi f8000000.spi: Atmel SPI Controller version 0x311 at 0xf8000000 (irq 31)
atmel_spi fc018400.spi: Using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
atmel_spi fc018400.spi: Using FIFO (16 data)
atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 179)
...
mi0283qt spi1.1: spi1.1 supply power not found, using dummy regulator
mi0283qt spi1.1: Linked as a consumer to regulator.0
[drm:0xbf00e904] SPI speed: 32MHz
[drm:0xbf00e5ac] preferred_depth=16, rotation = 0
[drm:0xc03f6248]
[drm:0xc03f6248]
[drm:0xc03f62c8] new minor registered 0
[drm:0xc03f7810] adding "Virtual-1" to sysfs
[drm:0xc03f7668] generating hotplug event
[drm] Initialized mi0283qt 1.0.0 20160614 for spi1.1 on minor 0
[drm:0xc040c2a0] OBJ ID: 28 (2)
[drm:0xc03ee668]
[drm:0xc03dfac4] [CONNECTOR:28:Virtual-1]
[drm:0xc03dfcd0] [CONNECTOR:28:Virtual-1] probed modes :
[drm:0xc03faf28] Modeline 32:"320x240" 0 1 320 320 320 320 240 240 240 240 0x48 0x0
[drm:0xc03ee7e8] connector 28 enabled? yes
[drm:0xc03eed04] looking for cmdline mode on connector 28
[drm:0xc03eef78] looking for preferred mode on connector 28 0
[drm:0xc03eed2c] found mode 320x240
[drm:0xc03ef098] picking CRTCs for 320x240 config
[drm:0xc03ee9ec] desired mode 320x240 set on crtc 30 (0,0)
[drm:0xc040c2a0] OBJ ID: 28 (2)
[drm:0xc03ee264] surface width(320), height(240) and bpp(16)
[drm:0xc0408e40] [FB:34]
[drm:0xc040c240] OBJ ID: 34 (2)
mi0283qt spi1.1: fb0: DRM emulated frame buffer device
[drm:0xc03f6b98]
[drm:0xc03f381c] pid = 224, minor = 0
[drm:0xc03f391c]
[drm:0xc03f513c] pid=224, dev=0xe200, auth=1, DRM_IOCTL_VERSION
[drm:0xc03f513c] pid=224, dev=0xe200, auth=1, DRM_IOCTL_VERSION
[drm:0xc03f3a4c] open_count = 1
[drm:0xc03f336c] pid = 224, device = 0xe200, open_count = 1
[drm:0xc03f3968]
[drm:0xc03f3990] driver lastclose completed
[drm:0xc040c2a0] OBJ ID: 34 (1)
[drm:0xc040c2a0] OBJ ID: 28 (3)
[drm:0xc040c2a0] OBJ ID: 28 (4)
[drm:0xbf013064]
[drm:0xbf00f2d0] cmd=0a, par=08
[drm:0xbf00f4a0] cmd=01
[drm:0xbf00f4a0] cmd=28
[drm:0xbf00f488] cmd=cf, par=00 83 30
[drm:0xbf00f488] cmd=ed, par=64 03 12 81
[drm:0xbf00f488] cmd=e8, par=85 01 79
[drm:0xbf00f488] cmd=cb, par=39 2c 00 34 02
[drm:0xbf00f488] cmd=f7, par=20
[drm:0xbf00f488] cmd=ea, par=00 00
[drm:0xbf00f488] cmd=c0, par=26
[drm:0xbf00f488] cmd=c1, par=11
[drm:0xbf00f488] cmd=c5, par=35 3e
[drm:0xbf00f488] cmd=c7, par=be
[drm:0xbf00f488] cmd=3a, par=05
[drm:0xbf00f488] cmd=b1, par=00 1b
[drm:0xbf00f488] cmd=f2, par=08
[drm:0xbf00f488] cmd=26, par=01
[drm:0xbf00f488] cmd=e0, par=1f 1a 18 0a 0f 06 45 87 32 0a 07 02 07 05 00
[drm:0xbf00f488] cmd=e1, par=00 25 27 05 10 09 3a 78 4d 05 18 0d 38 3a 1f
[drm:0xbf00f488] cmd=b7, par=07
[drm:0xbf00f488] cmd=b6, par=0a 82 27 00
[drm:0xbf00f4a0] cmd=11
[drm:0xbf00f4a0] cmd=29
[drm:0xbf00f488] cmd=36, par=e8
[drm:0xbf00e67c] Flushing [FB:34] x1=0, x2=320, y1=0, y2=240
[drm:0xbf00f488] cmd=2a, par=00 00 01 3f
[drm:0xbf00f488] cmd=2b, par=00 00 00 ef
[drm:0xbf00f3c4] cmd=2c, len=153600
spi_master spi1: failed to transfer one message from queue
spi_master spi1: failed to transfer one message from queue
spi_master spi1: failed to transfer one message from queue
[drm:0xc040c240] OBJ ID: 28 (5)
mi0283qt spi1.1: [drm:0xc04167a0] fbdev: ret=0
[drm:0xc03f6b98]
[drm:0xc03f6b98]
Please show me the way.
Thanks a lot in advance.
If it happens to SPI master that does DMA for all of the transfers tinydrm may fail.
Easy to debug by enabling CONFIG_DMA_API_DEBUG=y
.
Example (it's only a tip of an iceberg):
[ 23.750467] DMA-API: dw_dmac_pci 0000:00:15.0: device driver maps memory from stack [probable addr=000000001e49185d]
[ 23.750529] WARNING: CPU: 1 PID: 1296 at kernel/dma/debug.c:1161 check_for_stack+0xb7/0x190
[ 23.750533] Modules linked in: mmc_block(+) spi_pxa2xx_platform(+) pwm_lpss_pci pwm_lpss spi_pxa2xx_pci sdhci_pci cqhci intel_mrfld_pwrbtn extcon_intel_mrfld sdhci intel_mrfld_adc led_class mmc_core ili9341 mipi_dbi tinydrm backlight ti_ads7950 industrialio_triggered_buffer kfifo_buf intel_soc_pmic_mrfld hci_uart btbcm
[ 23.750599] CPU: 1 PID: 1296 Comm: modprobe Not tainted 5.0.0-rc7+ #236
[ 23.750605] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 542 2015.01.21:18.19.48
[ 23.750620] RIP: 0010:check_for_stack+0xb7/0x190
[ 23.750630] Code: 8b 6d 50 4d 85 ed 75 04 4c 8b 6d 10 48 89 ef e8 2f 8b 44 00 48 89 c6 4a 8d 0c 23 4c 89 ea 48 c7 c7 88 d0 82 b4 e8 40 7c f9 ff <0f> 0b 8b 05 79 00 4b 01 85 c0 74 07 5b 5d 41 5c 41 5d c3 8b 05 54
[ 23.750637] RSP: 0000:ffff97bbc0292fa0 EFLAGS: 00010286
[ 23.750646] RAX: 0000000000000000 RBX: ffff97bbc0290000 RCX: 0000000000000006
[ 23.750652] RDX: 0000000000000007 RSI: 0000000000000002 RDI: ffff94b33e115450
[ 23.750658] RBP: ffff94b33c8578b0 R08: 0000000000000002 R09: 00000000000201c0
[ 23.750664] R10: 00000006ecb0ccc6 R11: 0000000000034f38 R12: 000000000000316c
[ 23.750670] R13: ffff94b33c84b250 R14: ffff94b33dedd5a0 R15: 0000000000000001
[ 23.750679] FS: 0000000000000000(0000) GS:ffff94b33e100000(0063) knlGS:00000000f7faf690
[ 23.750686] CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
[ 23.750691] CR2: 00000000f7f54faf CR3: 000000000722c000 CR4: 00000000001006e0
[ 23.750696] Call Trace:
[ 23.750713] debug_dma_map_sg+0x100/0x340
[ 23.750727] ? dma_direct_map_sg+0x3b/0xb0
[ 23.750739] spi_map_buf+0x25a/0x300
[ 23.750751] __spi_pump_messages+0x2a4/0x680
[ 23.750762] __spi_sync+0x1dd/0x1f0
[ 23.750773] spi_sync+0x26/0x40
[ 23.750790] mipi_dbi_typec3_command_read+0x14d/0x240 [mipi_dbi]
[ 23.750802] ? spi_finalize_current_transfer+0x10/0x10
[ 23.750821] mipi_dbi_typec3_command+0x1bc/0x1d0 [mipi_dbi]
...
Hi, what is the substitution for tinydrm_lastclose ?
Hi!
I just wanted to point out that include/video/mipi_display.h
defines standard commandset for various MIPI compatible displays (DSI, DCS, DBI and DPI).
I recently sent some patches for in-tree fbtft driver that cleans up existing drivers including ili9340.
Thanks for working on that.
I am replying to raspberrypi/linux#1270 (comment) here.
I maintain Linux drivers for a number of LEGO MINDSTORMS compatible products that use the displays listed above. I've been using the fbtft drivers for these, but since is sounds like those won't be around forever, I'd like to get them implemented here.
I'm willing to do the coding and testing for these chips, just point me in the right direction.
I am trying to run crystalfonts lcd cfaf240320a0024sc (https://www.crystalfontz.com/product/cfaf240320a0024sc-240x320-full-color-touchscreen-tft-2-4) with stm32mpu over SPI. The LCD controller is ST7789
I am using stmp32mp157 that comes with octavo OSD32MP1-BRK.
Openstllinux kernel version is 5.4
I have build and installed the driver. The driver is loaded correctly. dmesg displays the following:
[ 109.037910] st7789vw: loading out-of-tree module taints kernel.
[ 109.045346] [drm] Initialized ST7789VW 1.0.0 20171128 for spi2.0 on minor 0
[ 109.495708] Console: switching to colour frame buffer device 30x30
[ 109.652859] st7789vw spi2.0: fb0: ST7789VWdrmfb frame buffer device
But I see no output on the lcd screen, whatever I do.
I have used modetest to test the driver as we:
root@stm32mp1:~# LIBGL_DEBUG=verbose modetest -M "ST7789VW" -s 31:240x240@RG16
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 3, (OK)
drmGetBusid returned ''
setting mode 240x240-0Hz@RG16 on connectors 31, crtc 34
failed to set gamma: Function not implemented
It doesn't display any pattern.
On testing the speed of display:
root@stm32mp1:~# LIBGL_DEBUG=verbose modetest -M "ST7789VW" -s 31:240x240@RG16 -v
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 3, (OK)
drmGetBusid returned ''
setting mode 240x240-0Hz@RG16 on connectors 31, crtc 34
failed to set gamma: Function not implemented
freq: 10.32Hz
freq: 10.31Hz
freq: 10.32Hz
freq: 10.33Hz
root@stm32mp1:~# for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done
SPI-1: connected
root@stm32mp1:~# cat /sys/kernel/debug/dri/0/state
plane[32]: plane-0
crtc=(null)
fb=0
crtc-pos=240x240+0+0
src-pos=240.000000x240.000000+0.000000+0.000000
rotation=1
normalized-zpos=0
color-encoding=ITU-R BT.601 YCbCr
color-range=YCbCr limited range
crtc[34]: crtc-0
enable=0
active=0
self_refresh_active=0
planes_changed=1
mode_changed=1
active_changed=1
connectors_changed=1
color_mgmt_changed=0
plane_mask=0
connector_mask=0
encoder_mask=0
mode: "": 0 0 0 0 0 0 0 0 0 0 0x0 0x0
connector[31]: SPI-1
crtc=(null)
self_refresh_aware=0
root@stm32mp1:~# modetest -M "ST7789VW"
Encoders:
id crtc type possible crtcs possible clones
35 34 none 0x00000001 0x00000000
Connectors:
id encoder status name size (mm) modes encoders
31 35 connected (null)-1 20x20 1 35
modes:
name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
240x240 0 240 240 240 240 240 240 240 240 1 flags: ; type: preferred, driver
props:
1 EDID:
flags: immutable blob
blobs:
value:
2 DPMS:
flags: enum
enums: On=0 Standby=1 Suspend=2 Off=3
value: 0
5 link-status:
flags: enum
enums: Good=0 Bad=1
value: 0
6 non-desktop:
flags: immutable range
values: 0 1
value: 0
4 TILE:
flags: immutable blob
blobs:
value:
20 CRTC_ID:
flags: object
value: 34
CRTCs:
id fb pos size
34 38 (0,0) (240x240)
240x240 0 240 240 240 240 240 240 240 240 1 flags: ; type: preferred, driver
props:
22 ACTIVE:
flags: range
values: 0 1
value: 1
23 MODE_ID:
flags: blob
blobs:
value:
01000000f000f000f000f0000000f000
f000f000f00000000000000000000000
48000000323430783234300000000000
00000000000000000000000000000000
00000000
19 OUT_FENCE_PTR:
flags: range
values: 0 18446744073709551615
value: 0
24 VRR_ENABLED:
flags: range
values: 0 1
value: 0
Planes:
id crtc fb CRTC x,y x,y gamma size possible crtcs
32 34 38 0,0 0,0 0 0x00000001
formats: RG16 XR24
props:
8 type:
flags: immutable enum
enums: Overlay=0 Primary=1 Cursor=2
value: 1
17 FB_ID:
flags: object
value: 38
18 IN_FENCE_FD:
flags: signed range
values: -1 2147483647
value: -1
20 CRTC_ID:
flags: object
value: 34
13 CRTC_X:
flags: signed range
values: -2147483648 2147483647
value: 0
14 CRTC_Y:
flags: signed range
values: -2147483648 2147483647
value: 0
15 CRTC_W:
flags: range
values: 0 2147483647
value: 240
16 CRTC_H:
flags: range
values: 0 2147483647
value: 240
9 SRC_X:
flags: range
values: 0 4294967295
value: 0
10 SRC_Y:
flags: range
values: 0 4294967295
I can not make any progress, any help is welcome
The board I have uses a winstar display (https://www.winstar.com.tw/products/graphic-lcd-display-module/lcd-graphics.html)
The display uses something that looks like a 8080 parallel interface and I assume it supports the MIPI command set.
tinydrm does not support parallel interface today - but it looks like a doable task to add this to mipi-dbi.c, adding a new mipi_dbi_spi(...) function, like what exists for SPI already.
But to do so a new platfrom device or something similar is required.
Would adding a "struct dpi_device" do the trick?
A struct dpi_device should include enough functionality to be useful for more than one device, so the combination will make it simpler to add further parallel displays in the future.
We have today auxdisplay/hd44780,c - but this controller supports only characters and not graphics - so I assume they are out of scope.
Any hints what is the best possible way forward to implement support for the 8080 interface?
I hope that the 6800 interface can be included in the same go, but until now I have no HW to test it with so will concentrate on what I can test.
I know the parallel support from a performance point of view will be bad, but the alternative is to use a char device and some proprietary SW - and prefers a more modern approach.
Any hints how to move forward appreciated, so I avoid basing this on the wrong high-level design.
hi, and thank you for all this content. on my side I try to make work an ili9488 screen in DPI via the driver EE0350BT on Raspian Buster (4.19).
info: on I start on these:
#17
690032b
But I canβt find any files concerning this EE0350BT driver. See technical sheet if necessary: https://drive.google.com/file/d/1z0sa2pZ5k_1co56-s-dZ_UERXpwmQ-ln/view?usp=sharing
Hello
can you upload your IMG becuase i can not get it to work.
Thomas
I have a dual display setup (using ili9341 screens) working properly using fbtft drivers, but when I move them to use drm drivers, the second display only gets refreshed if I mouse over it, otherwise its not getting refreshed. If I use 1 fbtft driver and 1 drm driver, they both get refreshed properly. This happens only when both of them are using drm drivers. Does not matter if I use two same drm drivers or two different drm drivers. I have been pulling my hair out to try to figure this out. I was wondering if you knew of anything in the driver, drm, or X that would cause this to happen and any recommendation on what I should try? Thanks.
Hi notro
I need to run the waveshare compatible 3.5inch 480x320 SPI display with tinyDRM. The display is built on ili9486.
Can I have some instructions/guidelines on how to move forward ?
As a result I want my display to work with Mali GPU.
mripard/sunxi-mali#15 (comment)
Thanks
Consider adding a README.md so new people can see what the project is and how it differs from fbtft.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.