JeffyCN / meta-rockchip

Yocto BSP layer for the Rockchip SOC boards
Other
119 stars 92 forks source link

Gitchy graphics with xserver #8

Closed mhuangwm closed 3 years ago

mhuangwm commented 3 years ago

Hi @JeffyCN, I have a custom board that uses rk3399pro (rockpi-n10) and I'm glueing a yocto build that uses parts of meta-rockchip (this repo) and meta-radxa. Without these graphics recipes, xserver displays fine, but rendering 2d graphics is extremely slow so I thought of baking in the graphic recipes from this layer.

Now, I'm having a weird issue with the xserver I was hoping you can help me with: image

X11 logs seems to be complaining about rockchip_dri.so driver missing:

root@rockpi-n10-rk3399pro:~# cat /var/log/Xorg.0.log
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
[     9.751] Build Operating System: Linux 
[     9.751] Current Operating System: Linux rockpi-n10-rk3399pro 4.4.167 #1 SMP Mon Apr 26 13:14:17 UTC 2021 aarch64
[     9.751] Kernel command line: console=tty1 console=ttyS2,1500000n8 rw root=PARTUUID=b921b045-1df0-41c3-af44-4c6f280d3fae rootfstype=ext4 init=/sbin/init rootwait cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
[     9.752] Build Date: 15 March 2021  02:06:25PM
[     9.752]  
[     9.753] Current version of pixman: 0.38.4
[     9.753]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[     9.753] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     9.754] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Sep 20 10:44:02 2020
[     9.755] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     9.756] (==) No Layout section.  Using the first Screen section.
[     9.756] (**) |-->Screen "Default Screen" (0)
[     9.756] (**) |   |-->Monitor "Default Monitor"
[     9.757] (**) |   |-->Device "Rockchip Graphics"
[     9.757] (==) Automatically adding devices
[     9.757] (==) Automatically enabling devices
[     9.757] (==) Automatically adding GPU devices
[     9.757] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     9.757] (WW) The directory "/usr/share/fonts/X11/misc/" does not exist.
[     9.757]    Entry deleted from font path.
[     9.757] (WW) The directory "/usr/share/fonts/X11/TTF/" does not exist.
[     9.757]    Entry deleted from font path.
[     9.757] (WW) The directory "/usr/share/fonts/X11/OTF/" does not exist.
[     9.757]    Entry deleted from font path.
[     9.757] (WW) The directory "/usr/share/fonts/X11/Type1/" does not exist.
[     9.757]    Entry deleted from font path.
[     9.757] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[     9.757]    Entry deleted from font path.
[     9.757] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[     9.757]    Entry deleted from font path.
[     9.757] (==) FontPath set to:
[     9.757] (==) ModulePath set to "/usr/lib/xorg/modules"
[     9.757] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[     9.757] (II) Loader magic: 0x55690eecd0
[     9.757] (II) Module ABI versions:
[     9.757]    X.Org ANSI C Emulation: 0.4
[     9.757]    X.Org Video Driver: 24.1
[     9.757]    X.Org XInput driver : 24.1
[     9.757]    X.Org Server Extension : 10.0
[     9.760] (--) using VT number 2
[     9.760] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[     9.762] (II) xfree86: Adding drm device (/dev/dri/card0)
[     9.770] (II) no primary bus or device found
[     9.770]    falling back to /sys/devices/platform/display-subsystem/drm/card0
[     9.770] (II) LoadModule: "glx"
[     9.771] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[     9.778] (II) Module glx: vendor="X.Org Foundation"
[     9.778]    compiled for 1.20.8, module version = 1.0.0
[     9.778]    ABI class: X.Org Server Extension, version 10.0
[     9.778] (II) LoadModule: "modesetting"
[     9.779] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[     9.780] (II) Module modesetting: vendor="X.Org Foundation"
[     9.780]    compiled for 1.20.8, module version = 1.20.8
[     9.780]    Module class: X.Org Video Driver
[     9.780]    ABI class: X.Org Video Driver, version 24.1
[     9.780] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[     9.852] (II) modeset(0): using drv /dev/dri/card0
[     9.852] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[     9.852] (II) modeset(0): Creating default Display subsection in Screen section
        "Default Screen" for depth/fbbpp 24/32
[     9.852] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[     9.852] (**) modeset(0): Option "AccelMethod" "exa"
[     9.852] (**) modeset(0): Option "FlipFB" "always"
[     9.853] (**) modeset(0): Option "NoEDID" "true"
[     9.853] (==) modeset(0): RGB weight 888
[     9.853] (==) modeset(0): Default visual is TrueColor
[     9.853] (**) modeset(0): glamor disabled
[     9.853] (II) modeset(0): ShadowFB: preferred NO, enabled NO
[     9.853] (II) modeset(0): FlipFB: Always
[     9.853] (II) modeset(0): Output DSI-1 using monitor section Default Monitor
[     9.853] (**) modeset(0): Option "Rotate" "normal"
[     9.853] (II) modeset(0): EDID for output DSI-1
[     9.854] (II) modeset(0): Printing probed modes for output DSI-1
[     9.854] (II) modeset(0): Modeline "720x1280"x60.6   67.00  720 832 836 848  1280 1292 1296 1304 -hsync -vsync (79.0 kHz P)
[     9.854] (II) modeset(0): Modeline "720x1280"x60.6   67.00  720 732 736 848  1280 1288 1292 1304 (79.0 kHz)
[     9.854] (II) modeset(0): Output DSI-1 connected
[     9.854] (II) modeset(0): Using exact sizes for initial modes
[     9.854] (II) modeset(0): Output DSI-1 using initial mode 720x1280 +0+0
[     9.854] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[     9.854] (==) modeset(0): DPI set to (96, 96)
[     9.854] (II) Loading sub module "fb"
[     9.854] (II) LoadModule: "fb"
[     9.854] (II) Loading /usr/lib/xorg/modules/libfb.so
[     9.855] (II) Module fb: vendor="X.Org Foundation"
[     9.855]    compiled for 1.20.8, module version = 1.0.0
[     9.855]    ABI class: X.Org ANSI C Emulation, version 0.4
[     9.861] (II) Loading sub module "exa"
[     9.861] (II) LoadModule: "exa"
[     9.861] (II) Loading /usr/lib/xorg/modules/libexa.so
[     9.861] (II) Module exa: vendor="X.Org Foundation"
[     9.861]    compiled for 1.20.8, module version = 2.6.0
[     9.861]    ABI class: X.Org Video Driver, version 24.1
[     9.861] (II) modeset(0): Using RGA EXA
[     9.862] (II) EXA(0): Driver allocated offscreen pixmaps
[     9.862] (II) EXA(0): Driver registered support for the following operations:
[     9.862] (II)         Solid
[     9.862] (II)         Copy
[     9.862] (II)         Composite (RENDER acceleration)
[     9.862] (II)         UploadToScreen
[     9.862] (II)         DownloadFromScreen
[     9.944] (II) modeset(0): exa initialized
[     9.944] (==) modeset(0): Backing store enabled
[     9.944] (==) modeset(0): Silken mouse enabled
[     9.944] (II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
[     9.944] (==) modeset(0): DPMS enabled
[     9.944] (WW) modeset(0): Option "Rotate" is not used
[     9.946] (II) modeset(0): [DRI2] Setup complete
[     9.946] (II) modeset(0): [DRI2]   DRI driver: rockchip
[     9.946] (II) modeset(0): [DRI2]   VDPAU driver: rockchip
[     9.946] (II) Initializing extension Generic Event Extension
[     9.946] (II) Initializing extension SHAPE
[     9.946] (II) Initializing extension MIT-SHM
[     9.946] (II) Initializing extension XInputExtension
[     9.946] (II) Initializing extension XTEST
[     9.946] (II) Initializing extension BIG-REQUESTS
[     9.946] (II) Initializing extension SYNC
[     9.946] (II) Initializing extension XKEYBOARD
[     9.946] (II) Initializing extension XC-MISC
[     9.946] (II) Initializing extension XFIXES
[     9.946] (II) Initializing extension RENDER
[     9.946] (II) Initializing extension RANDR
[     9.946] (II) Initializing extension COMPOSITE
[     9.946] (II) Initializing extension DAMAGE
[     9.946] (II) Initializing extension MIT-SCREEN-SAVER
[     9.946] (II) Initializing extension DOUBLE-BUFFER
[     9.946] (II) Initializing extension DPMS
[     9.946] (II) Initializing extension Present
[     9.946] (II) Initializing extension DRI3
[     9.946] (II) Initializing extension X-Resource
[     9.946] (II) Initializing extension XVideo
[     9.946] (II) Initializing extension XVideo-MotionCompensation
[     9.946] (II) Initializing extension GLX
[     9.946] (EE) AIGLX error: dlopen of /usr/lib/dri/rockchip_dri.so failed (/usr/lib/dri/rockchip_dri.so: cannot open shared object file: No such file or directory)
[     9.946] (EE) AIGLX error: unable to load driver rockchip
[     9.958] (II) IGLX: Loaded and initialized swrast
[     9.958] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[     9.958] (II) Initializing extension XFree86-VidModeExtension
[     9.958] (II) Initializing extension XFree86-DGA
[     9.958] (II) Initializing extension XFree86-DRI
[     9.958] (II) Initializing extension DRI2
[     9.967] (II) modeset(0): Damage tracking initialized
[     9.967] (II) modeset(0): Setting screen physical size to 190 x 338
[    10.023] (II) config/udev: Adding input device goodix-ts (/dev/input/event1)
[    10.023] (**) goodix-ts: Applying InputClass "evdev touchscreen catchall"
[    10.023] (**) goodix-ts: Applying InputClass "libinput touchscreen catchall"
[    10.023] (II) LoadModule: "libinput"
[    10.024] (II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
[    10.025] (II) Module libinput: vendor="X.Org Foundation"
[    10.025]    compiled for 1.20.8, module version = 0.29.0
[    10.025]    Module class: X.Org XInput Driver
[    10.025]    ABI class: X.Org XInput driver, version 24.1
[    10.025] (II) Using input driver 'libinput' for 'goodix-ts'
[    10.025] (**) goodix-ts: always reports core events
[    10.025] (**) Option "Device" "/dev/input/event1"
[    10.025] (**) Option "_source" "server/udev"
[    10.029] (II) event1  - goodix-ts: is tagged by udev as: Touchscreen
[    10.030] (II) event1  - goodix-ts: device is a touch device
[    10.030] (II) event1  - goodix-ts: device removed
[    10.100] (**) Option "config_info" "udev:/sys/devices/platform/ff110000.i2c/i2c-1/1-0014/input/input1/event1"
[    10.100] (II) XINPUT: Adding extended input device "goodix-ts" (type: TOUCHSCREEN, id 6)
[    10.101] (**) Option "AccelerationScheme" "none"
[    10.101] (**) goodix-ts: (accel) selected scheme none/0
[    10.101] (**) goodix-ts: (accel) acceleration factor: 2.000
[    10.101] (**) goodix-ts: (accel) acceleration threshold: 4
[    10.109] (II) event1  - goodix-ts: is tagged by udev as: Touchscreen
[    10.112] (II) event1  - goodix-ts: device is a touch device
[    10.118] (II) config/udev: Adding input device rk8xx_pwrkey (/dev/input/event0)
[    10.118] (**) rk8xx_pwrkey: Applying InputClass "evdev keyboard catchall"
[    10.118] (**) rk8xx_pwrkey: Applying InputClass "libinput keyboard catchall"
[    10.118] (II) Using input driver 'libinput' for 'rk8xx_pwrkey'
[    10.118] (**) rk8xx_pwrkey: always reports core events
[    10.118] (**) Option "Device" "/dev/input/event0"
[    10.118] (**) Option "_source" "server/udev"
[    10.126] (II) event0  - rk8xx_pwrkey: is tagged by udev as: Keyboard
[    10.126] (II) event0  - rk8xx_pwrkey: device is a keyboard
[    10.127] (II) event0  - rk8xx_pwrkey: device removed
[    10.148] (**) Option "config_info" "udev:/sys/devices/platform/ff3c0000.i2c/i2c-0/0-0020/input/input0/event0"
[    10.148] (II) XINPUT: Adding extended input device "rk8xx_pwrkey" (type: KEYBOARD, id 7)
[    10.153] (II) event0  - rk8xx_pwrkey: is tagged by udev as: Keyboard
[    10.153] (II) event0  - rk8xx_pwrkey: device is a keyboard
[    10.155] (II) config/udev: Adding input device gpio-keys (/dev/input/event2)
[    10.155] (**) gpio-keys: Applying InputClass "evdev keyboard catchall"
[    10.155] (**) gpio-keys: Applying InputClass "libinput keyboard catchall"
[    10.155] (II) Using input driver 'libinput' for 'gpio-keys'
[    10.155] (**) gpio-keys: always reports core events
[    10.155] (**) Option "Device" "/dev/input/event2"
[    10.155] (**) Option "_source" "server/udev"
[    10.157] (II) event2  - gpio-keys: is tagged by udev as: Keyboard
[    10.157] (II) event2  - gpio-keys: device is a keyboard
[    10.157] (II) event2  - gpio-keys: device removed
[    10.224] (**) Option "config_info" "udev:/sys/devices/platform/gpio-keys/input/input2/event2"
[    10.224] (II) XINPUT: Adding extended input device "gpio-keys" (type: KEYBOARD, id 8)
[    10.230] (II) event2  - gpio-keys: is tagged by udev as: Keyboard
[    10.230] (II) event2  - gpio-keys: device is a keyboard
[    10.267] (WW) modeset(0): flip queue failed: Invalid argument
[    10.267] (WW) modeset(0): Page flip failed: Invalid argument
[    10.588] (II) modeset(0): Disabling kernel dirty updates, not required.
JeffyCN commented 3 years ago

Hi,

By "a weird issue with the xserver", did you mean the "missing rockchip_dri.so" warning? If so, that is expected, and it will fallback to swrast.

We only provide GBM/EGL/GLESv2/GLESv1/OPENCL with mali, so other implements(e.g. glx) will fallback to mesa(software opengl)

And according to the log, you are using RGA(hw accel module) based exa accel and flipfb(double-buffer rendering, slow but avoid tearing): [ 9.852] () modeset(0): Option "AccelMethod" "exa" [ 9.852] () modeset(0): Option "FlipFB" "always" [ 9.861] (II) modeset(0): Using RGA EXA

There's no other error logs, so guessing it should work.

mhuangwm commented 3 years ago

Hi Jeffy, By weird issue, I mean rendering of the graphics onto the screen (like the image I posted). Top half seems to have multiple renderings of the terminal box and the bottom half has the calibration screen. (I was expecting just a single terminal box).

What settings/drivers would you recommend to use on the rk3399pro boards to use for smooth experiences? Like watching youtube

mhuangwm commented 3 years ago

For reference, this is what I expected (I built this against poky's xserver's recipe and without librga) image

JeffyCN commented 3 years ago

well, that seems like something wrong in the kernel side(rga driver). maybe try to modify /etc/X11/xorg/20-mod.conf, change exa to glamor

JeffyCN commented 3 years ago

by the way, if possible, please upload your rootfs and kernel image, maybe i can try to debug it. and which version of this repo did you use?

mhuangwm commented 3 years ago

thanks for reaching out a helping hand, I appreciate it. I added the openbox WM and the problem seem to go away (weird). i think previously it was using matchbox.. so maybe something that with matchbox that it doesn't like.

I also tried using glamor, but rendering of GUI is extremely slow (on xfce deskop).. is this expected?

mhuangwm commented 3 years ago

Jeffy, I'll go ahead and close this issue. It also turns out that mali drivers weren't loading properly (kernel expecting r14, but r18 was installed)

JeffyCN commented 3 years ago

Jeffy, I'll go ahead and close this issue. It also turns out that mali drivers weren't loading properly (kernel expecting r14, but r18 was installed)

So the kernel is old(with out-dated mali driver), and there're lots of fixes about RGA in recent kernel. The matchbox+lxterminal works well on my side, could related to kernel version.