小弟需要将摄像头的数据显示到lcd屏幕,摄像头数据输出YUV420SP格式,原来采用YUV420SP转RGB,然后直接刷到framebuffer的方式进行显示,但是奈何实在是太卡了,后面尝试过使用neon来实现转码部分,发现性能还是很差。后面看到可以使用DE来实现显示,目前参照licheepi的文档已经配上了设备树和相关驱动了,且有/dev/dri/card0这个设备。但是modetest还有问题,只有第三个plane能够显示,具体配置和详细打印如下:
内核版本:
licheepi-zero v5.2
设备树如下:
panel: panel {
compatible = "hannstar,hsd080ifw1", "simple-panel";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
/* TODO: lcd panel uses axp gpio0 as enable pin */
enable-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>;//使能引脚 PB4脚为高使能 这里为pwm信号
// backlight = <&backlight>;
#address-cells = <1>;
#size-cells = <0>;
panel_input: endpoint@0 {
reg = <0>;
remote-endpoint = <&tcon0_out_lcd>;
};
};
};
&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm0_pins>, <&pwm1_pins>;
status = "okay";
};
/*czh add for display*/
&tcon0_out {
tcon0_out_lcd: endpoint@0 {
reg = <0>;
remote-endpoint = <&panel_input>;
};
};
&tcon0{
pinctrl-names = "default";
pinctrl-0 = <&lcd_rgb666_pins_a>;
status = "okay";
};
&de{
status = "okay";
};
启动信息如下:
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.2.0-licheepi-zero (test@test-virtual-machine) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)) #48 SMP Thu Nov 18 15:54:26 CST 2021
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Zero with Dock
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Reserved 16 MiB at 0x41c00000
[ 0.000000] percpu: Embedded 16 pages/cpu s34560 r8192 d22784 u65536
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 15660
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 init=/linuxrc earlyprintk rw vt.global_cursor_default=0
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 36180K/63136K available (6144K kernel code, 343K rwdata, 1816K rodata, 1024K init, 253K bss, 10572K reserved, 16384K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x2f8/0x480 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000019] Switching to timer-based delay loop, resolution 41ns
[ 0.000225] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000486] Console: colour dummy device 80x30
[ 0.000543] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000558] pid_max: default: 32768 minimum: 301
[ 0.000730] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.000746] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.001532] CPU: Testing write buffer coherency: ok
[ 0.002036] /cpus/cpu@0 missing clock-frequency property
[ 0.002066] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002834] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.003052] rcu: Hierarchical SRCU implementation.
[ 0.005469] smp: Bringing up secondary CPUs ...
[ 0.005498] smp: Brought up 1 node, 1 CPU
[ 0.005507] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.005514] CPU: All CPU(s) started in SVC mode.
[ 0.006576] devtmpfs: initialized
[ 0.010628] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.010976] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.011007] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.011800] pinctrl core: initialized pinctrl subsystem
[ 0.012895] NET: Registered protocol family 16
[ 0.014057] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.015397] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.015417] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.040259] SCSI subsystem initialized
[ 0.040503] usbcore: registered new interface driver usbfs
[ 0.040564] usbcore: registered new interface driver hub
[ 0.040644] usbcore: registered new device driver usb
[ 0.040889] mc: Linux media interface: v0.10
[ 0.040936] videodev: Linux video capture interface: v2.00
[ 0.041171] Advanced Linux Sound Architecture Driver Initialized.
[ 0.042707] clocksource: Switched to clocksource arch_sys_counter
[ 0.055141] NET: Registered protocol family 2
[ 0.055955] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.055995] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.056019] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.056042] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.056191] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.056242] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.056559] NET: Registered protocol family 1
[ 0.058533] Initialise system trusted keyrings
[ 0.058911] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.095703] Key type asymmetric registered
[ 0.095729] Asymmetric key parser 'x509' registered
[ 0.095837] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 0.095851] io scheduler mq-deadline registered
[ 0.095858] io scheduler kyber registered
[ 0.096953] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 0.100914] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.101410] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[ 0.102220] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[ 0.240140] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.243532] printk: console [ttyS0] disabled
[ 0.263826] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 1500000) is a U6_16550A
[ 0.791292] printk: console [ttyS0] enabled
[ 0.797489] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[ 0.831541] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.841088] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[ 0.852606] CAN device driver interface
[ 0.897163] mcp251x spi0.0: Cannot initialize MCP2515. Wrong wiring?
[ 0.903573] mcp251x spi0.0: Probe failed, err=19
[ 0.908293] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.914923] ehci-platform: EHCI generic platform driver
[ 0.920459] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 0.926136] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 0.934272] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[ 0.962678] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 0.969982] hub 1-0:1.0: USB hub found
[ 0.973950] hub 1-0:1.0: 1 port detected
[ 0.978586] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.984912] ohci-platform: OHCI generic platform driver
[ 0.990471] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 0.997195] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 1.005300] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[ 1.077918] hub 2-0:1.0: USB hub found
[ 1.081764] hub 2-0:1.0: 1 port detected
[ 1.089115] usbcore: registered new interface driver usb-storage
[ 1.097203] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[ 1.106569] sun6i-rtc 1c20400.rtc: registered as rtc0
[ 1.111634] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.116393] i2c /dev entries driver
[ 1.121386] tp2850 0-0045: tp2850_probe ver 2.0
[ 1.145211] random: fast init done
[ 1.151405] tp2850 init successful ...
[ 1.156171] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.164942] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[ 1.201539] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.209773] usbcore: registered new interface driver usbhid
[ 1.215434] usbhid: USB HID core driver
[ 1.223439] sun4i-codec 1c22c00.codec: ASoC: codec-analog@01c23000 not registered
[ 1.230947] sun4i-codec 1c22c00.codec: Failed to register our card
[ 1.238467] Initializing XFRM netlink socket
[ 1.242902] NET: Registered protocol family 17
[ 1.247434] can: controller area network core (rev 20170425 abi 9)
[ 1.253740] NET: Registered protocol family 29
[ 1.258186] can: raw protocol (rev 20170425)
[ 1.262450] can: broadcast manager protocol (rev 20170425 t)
[ 1.268139] can: netlink gateway (rev 20170425) max_hops=1
[ 1.274373] Registering SWP/SWPB emulation handler
[ 1.280230] Loading compiled-in X.509 certificates
[ 1.290417] simple-framebuffer 43da8000.framebuffer: framebuffer at 0x43da8000, 0x258000 bytes, mapped to 0x(ptrval)
[ 1.301090] simple-framebuffer 43da8000.framebuffer: format=x8r8g8b8, mode=1024x600x32, linelength=4096
[ 1.321025] Console: switching to colour frame buffer device 128x37
[ 1.335801] simple-framebuffer 43da8000.framebuffer: fb0: simplefb registered!
[ 1.344362] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[ 1.356700] sun4i-drm display-engine: bound 1100000.mixer (ops 0xc0748080)
[ 1.364276] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc0745378)
[ 1.371940] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.378615] [drm] No driver support for vblank timestamp query.
[ 1.384563] fb0: switching to sun4i-drm-fb from simple
[ 1.390465] Console: switching to colour dummy device 80x30
[ 1.397180] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[ 1.434919] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.437901] mmc0: new high speed SDHC card at address aaaa
[ 1.439705] mmcblk0: mmc0:aaaa SD32G 29.7 GiB
[ 1.441762] mmcblk0: p1 p2
[ 1.485125] Console: switching to colour frame buffer device 128x37
[ 1.545363] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device
[ 1.553469] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.564959] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.570726] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[ 1.579847] hub 3-0:1.0: USB hub found
[ 1.583825] hub 3-0:1.0: 1 port detected
[ 1.589891] debugfs: Directory '1c22c00.codec' with parent 'V3s Audio Codec' already present!
[ 1.598581] sun4i-codec 1c22c00.codec: ASoC: Failed to create component debugfs directory: -17
[ 1.608960] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[ 1.617565] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:00:07 UTC (7)
[ 1.625875] vcc5v0: disabling
[ 1.628852] ALSA device list:
[ 1.631817] #0: V3s Audio Codec
[ 1.637260] EXT4-fs (mmcblk0p2): mounting ext3 file system using the ext4 subsystem
[ 1.680899] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.689240] VFS: Mounted root (ext3 filesystem) on device 179:2.
[ 1.703424] devtmpfs: mounted
[ 1.707716] Freeing unused kernel memory: 1024K
[ 1.712396] Run /linuxrc as init process
[ 1.886152] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting syslogd: OK
Starting klogd: OK
Running sysctl: [ 2.063060] usb 1-1: new high-speed USB device number 2 using ehci-platform
OK
Initializing random number generator: OK
Saving random seed: [ 2.152392] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting network: OK
Welcome to Buildroot
使用modetest查看drm信息:
# modetest -M sun4i-drm
Encoders:
id crtc type possible crtcs possible clones
40 39 none 0x00000001 0x00000000
Connectors:
id encoder status name size (mm) modes encoders
41 40 connected unknown-1 154x86 1 40
modes:
name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
1024x600 60 1024 1130 1238 1344 600 611 624 635 51200 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:
19 CRTC_ID:
flags: object
value: 39
CRTCs:
id fb pos size
39 42 (0,0) (1024x600)
1024x600 60 1024 1130 1238 1344 600 611 624 635 51200 flags: ; type: preferred, driver
props:
21 ACTIVE:
flags: range
values: 0 1
value: 1
22 MODE_ID:
flags: blob
blobs:
value:
00c8000000046a04d604400500005802
630270027b0200003c00000000000000
48000000313032347836303000000000
00000000000000000000000000000000
00000000
18 OUT_FENCE_PTR:
flags: range
values: 0 18446744073709551615
value: 0
23 VRR_ENABLED:
flags: range
values: 0 1
value: 0
Planes:
id crtc fb CRTC x,y x,y gamma size possible crtcs
30 0 0 0,0 0,0 0 0x00000001
formats: AB15 AB12 AR15 AR12 BG16 BG24 BA15 BA12 BX24 RG16 RG24 RA12 RA15 RX24 XB24 XR24 NV16 NV12 NV21 NV61 UYVY VYUY YUYV YVYU YU11 YU12 YU16 YU24 YV11 YV12 YV16 YV24
props:
7 type:
flags: immutable enum
enums: Overlay=0 Primary=1 Cursor=2
value: 0
16 FB_ID:
flags: object
value: 0
17 IN_FENCE_FD:
flags: signed range
values: -1 2147483647
value: -1
19 CRTC_ID:
flags: object
value: 0
12 CRTC_X:
flags: signed range
values: -2147483648 2147483647
value: 0
13 CRTC_Y:
flags: signed range
values: -2147483648 2147483647
value: 0
14 CRTC_W:
flags: range
values: 0 2147483647
value: 0
15 CRTC_H:
flags: range
values: 0 2147483647
value: 0
8 SRC_X:
flags: range
values: 0 4294967295
value: 0
9 SRC_Y:
flags: range
values: 0 4294967295
value: 0
10 SRC_W:
flags: range
values: 0 4294967295
value: 0
11 SRC_H:
flags: range
values: 0 4294967295
value: 0
29 IN_FORMATS:
flags: immutable blob
blobs:
value:
01000000000000002000000018000000
00000000980000004142313541423132
41523135415231324247313642473234
42413135424131324258323452473136
52473234524131325241313552583234
58423234585232344e5631364e563132
4e5632314e5636315559565956595559
59555956595659555955313159553132
59553136595532345956313159563132
5956313659563234
in_formats blob decoded:
AB15:
AB12:
AR15:
AR12:
BG16:
BG24:
BA15:
BA12:
BX24:
RG16:
RG24:
RA12:
RA15:
RX24:
XB24:
XR24:
NV16:
NV12:
NV21:
NV61:
UYVY:
VYUY:
YUYV:
YVYU:
YU11:
YU12:
YU16:
YU24:
YV11:
YV12:
YV16:
YV24:
32 zpos:
flags: range
values: 0 2
value: 0
33 0 0 0,0 0,0 0 0x00000001
formats: AB15 AB12 AR15 AR12 BG16 BG24 BA15 BA12 BX24 RG16 RG24 RA12 RA15 RX24 XB24 XR24 NV16 NV12 NV21 NV61 UYVY VYUY YUYV YVYU YU11 YU12 YU16 YU24 YV11 YV12 YV16 YV24
props:
7 type:
flags: immutable enum
enums: Overlay=0 Primary=1 Cursor=2
value: 0
16 FB_ID:
flags: object
value: 0
17 IN_FENCE_FD:
flags: signed range
values: -1 2147483647
value: -1
19 CRTC_ID:
flags: object
value: 0
12 CRTC_X:
flags: signed range
values: -2147483648 2147483647
value: 0
13 CRTC_Y:
flags: signed range
values: -2147483648 2147483647
value: 0
14 CRTC_W:
flags: range
values: 0 2147483647
value: 0
15 CRTC_H:
flags: range
values: 0 2147483647
value: 0
8 SRC_X:
flags: range
values: 0 4294967295
value: 0
9 SRC_Y:
flags: range
values: 0 4294967295
value: 0
10 SRC_W:
flags: range
values: 0 4294967295
value: 0
11 SRC_H:
flags: range
values: 0 4294967295
value: 0
29 IN_FORMATS:
flags: immutable blob
blobs:
value:
01000000000000002000000018000000
00000000980000004142313541423132
41523135415231324247313642473234
42413135424131324258323452473136
52473234524131325241313552583234
58423234585232344e5631364e563132
4e5632314e5636315559565956595559
59555956595659555955313159553132
59553136595532345956313159563132
5956313659563234
in_formats blob decoded:
AB15:
AB12:
AR15:
AR12:
BG16:
BG24:
BA15:
BA12:
BX24:
RG16:
RG24:
RA12:
RA15:
RX24:
XB24:
XR24:
NV16:
NV12:
NV21:
NV61:
UYVY:
VYUY:
YUYV:
YVYU:
YU11:
YU12:
YU16:
YU24:
YV11:
YV12:
YV16:
YV24:
35 zpos:
flags: range
values: 0 2
value: 0
36 39 42 0,0 0,0 0 0x00000001
formats: AB15 AB12 AB24 AR15 AR12 AR24 BG16 BG24 BA15 BA12 BA24 BX24 RG16 RG24 RA12 RA15 RA24 RX24 XB24 XR24
props:
7 type:
flags: immutable enum
enums: Overlay=0 Primary=1 Cursor=2
value: 1
16 FB_ID:
flags: object
value: 42
17 IN_FENCE_FD:
flags: signed range
values: -1 2147483647
value: -1
19 CRTC_ID:
flags: object
value: 39
12 CRTC_X:
flags: signed range
values: -2147483648 2147483647
value: 0
13 CRTC_Y:
flags: signed range
values: -2147483648 2147483647
value: 0
14 CRTC_W:
flags: range
values: 0 2147483647
value: 1024
15 CRTC_H:
flags: range
values: 0 2147483647
value: 600
8 SRC_X:
flags: range
values: 0 4294967295
value: 0
9 SRC_Y:
flags: range
values: 0 4294967295
value: 0
10 SRC_W:
flags: range
values: 0 4294967295
value: 67108864
11 SRC_H:
flags: range
values: 0 4294967295
value: 39321600
29 IN_FORMATS:
flags: immutable blob
blobs:
value:
01000000000000001400000018000000
00000000680000004142313541423132
41423234415231354152313241523234
42473136424732344241313542413132
42413234425832345247313652473234
52413132524131355241323452583234
5842323458523234
in_formats blob decoded:
AB15:
AB12:
AB24:
AR15:
AR12:
AR24:
BG16:
BG24:
BA15:
BA12:
BA24:
BX24:
RG16:
RG24:
RA12:
RA15:
RA24:
RX24:
XB24:
XR24:
38 zpos:
flags: range
values: 0 2
value: 0
Frame buffers:
id size pitch
#
依次运行如下测试用例:
modetest -M sun4i-drm -P 30@39:1024x600
modetest -M sun4i-drm -P 33@39:1024x600
modetest -M sun4i-drm -P 36@39:1024x600
只modetest -M sun4i-drm -P 36@39:1024x600是正确的,运行其他两个,屏幕都没有任何输出。
小弟已经在这停留好几天了,烦请各位大佬指点迷津。谢谢了。
离线
据说驱动有bug,没有很好适配V3s,以前不知道在哪个Q群看大佬说过。
我看另外一个帖子说有patch可以解决这个问题,但是找了好久也没找到。
离线
有没有大佬能围观一下呢?只能自己顶贴了
离线
亲测,licheepi-zero以下分支的drm是不对的:
zero-4.13.y
zero-4.13-exp.y
zero-4.14.y
zero-5.2.y
离线