Igalia / cog

WPE launcher and webapp container
MIT License
238 stars 61 forks source link

cog on imx8mini - failed to schedule a page flip: Permission denied #400

Open SebDE opened 2 years ago

SebDE commented 2 years ago

I try to get cog on an imx8-mini platform up and running on a wayland / weston only system to act as a fullscreen html/js gui

I used the meta-webkit yocto layer: meta-webkit = "hardknott:56b0544f7d9610866ca67ee574b7bf01b7fded34" with the following build configuration:

Build Configuration:
BB_VERSION           = "1.50.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-fslc-linux"
MACHINE              = "imx8mm-var-dart"
DISTRO               = "fslc-wayland"
DISTRO_VERSION       = "3.3"
TUNE_FEATURES        = "aarch64 armv8a crc cortexa53 crypto"
TARGET_FPU           = ""

and here is my local.conf

MACHINE ??= 'imx8mm-var-dart'
DISTRO ?= 'fslc-wayland'
DISTRO_FEATURES_append = " opengl wayland"
DISTRO_FEATURES_append = " egl"
PACKAGE_CLASSES ?= 'package_rpm'
IMAGE_INSTALL_append = " gstreamer1.0-plugins-imx gstreamer1.0-plugins-imx-meta"
IMAGE_INSTALL_append = " wpewebkit cog wpebackend-fdo"
PREFERRED_PROVIDER_virtual/wpebackend = "wpebackend-fdo"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks ssh-server-openssh"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
CONF_VERSION = "1"

DL_DIR ?= "/opt/yocto_downloads/"
ACCEPT_FSL_EULA = "1"
LICENSE_FLAGS_WHITELIST_append = " commercial"

But if I try to start cog I just got those messages and no website appears on the attached lcd

root@imx8mm-var-dart:~# cog http://neverssl.com

(cog:574): GLib-GIO-WARNING **: 20:14:20.180: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal.  It should do one of these.

(cog:574): Cog-DRM-WARNING **: 20:14:20.415: failed to schedule a page flip: Permission denied
Cog-Core-Message: 20:14:20.415: <http://neverssl.com/> Load started.
Cog-Core-Message: 20:14:20.422: <http://neverssl.com/> Loading...
Cog-Core-Message: 20:14:20.435: <http://neverssl.com/> Loaded successfully.
Cog-Core-Message: 20:14:20.437: <http://neverssl.com/> Load started.
Cog-Core-Message: 20:14:20.646: <http://quietsilverwholelight.neverssl.com/online> Loading...
Cog-Core-Message: 20:14:20.732: <http://quietsilverwholelight.neverssl.com/online> Loaded successfully.

Is the following warning the problem? (cog:574): Cog-DRM-WARNING **: 20:14:20.415: failed to schedule a page flip: Permission denied

Here is the version info

root@imx8mm-var-dart:~# cog --version
0.12.0 (WPE WebKit 2.34.4)

Hope someone can point me in the right direction - many thanks !

aperezdc commented 2 years ago

@SebDE A couple of things to check:

Thanks in advance!

SebDE commented 2 years ago

@aperezdc Many thanks for your reply and the tipps:

root@imx8mm-var-dart:~# find /dev -group video /dev/galcore /dev/fb0 /dev/dri/card1 /dev/dri/card0 /dev/video0


Here is the output of: 

root@imx8mm-var-dart:~# G_MESSAGES_DEBUG=Cog-DRM cog http://neverssl.com Cog-INFO: 08:23:42.021: com.igalia.Cog.Platform: Cog-INFO: 08:23:42.026: drm - 200/CogDrmPlatform (cog:863): Cog-DEBUG: 08:23:42.047: platform_setup: Platform name: (null) (cog:863): Cog-DRM-DEBUG: 08:23:42.055: init_config: overriding device_scale value, using 1.00 from shell (cog:863): Cog-DRM-DEBUG: 08:23:42.056: init_drm: enumerated device 0xaaaaecefeab0, available_nodes 5 (cog:863): Cog-DRM-DEBUG: 08:23:42.056: init_drm: DRM_NODE_PRIMARY: /dev/dri/card1 (cog:863): Cog-DRM-DEBUG: 08:23:42.056: init_drm: DRM_NODE_RENDER: /dev/dri/renderD128 (cog:863): Cog-DRM-DEBUG: 08:23:42.056: init_drm: enumerated device 0xaaaaecefefd0, available_nodes 1 (cog:863): Cog-DRM-DEBUG: 08:23:42.056: init_drm: DRM_NODE_PRIMARY: /dev/dri/card0 (cog:863): Cog-DRM-DEBUG: 08:23:42.056: init_drm: using device 0xaaaaecefefd0, DRM_NODE_PRIMARY /dev/dri/card0 (cog:863): Cog-DRM-DEBUG: 08:23:42.056: init_drm: 1 connectors available (cog:863): Cog-DRM-DEBUG: 08:23:42.057: init_drm: connector id 35, type 16, connected, 1 usable modes (cog:863): Cog-DRM-DEBUG: 08:23:42.057: init_drm: [0]: '800x480', 800x480@68, flags 10, type 72 (preferred) (cog:863): Cog-DRM-DEBUG: 08:23:42.057: init_drm: using connector id 35, type 16 (cog:863): Cog-DRM-DEBUG: 08:23:42.057: init_drm: using mode [0] '800x480' libinput error: event4 - ADS7846 Touchscreen: kernel bug: device has min == max on ABS_PRESSURE (cog:863): Cog-DEBUG: 08:23:42.160: platform_setup: Selected CogDrmPlatform @ 0xaaaaecea06a0

(cog:863): GLib-GIO-WARNING **: 08:23:42.174: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal. It should do one of these. Cog-Core-Message: 08:23:42.407: http://neverssl.com/ Load started. Cog-Core-Message: 08:23:42.414: http://neverssl.com/ Loading... Cog-Core-Message: 08:23:42.427: http://neverssl.com/ Loaded successfully. Cog-Core-Message: 08:23:42.428: http://neverssl.com/ Load started. Cog-Core-Message: 08:23:42.609: http://funclearsublimesong.neverssl.com/online Loading... Cog-Core-Message: 08:23:42.696: http://funclearsublimesong.neverssl.com/online Loaded successfully.



Many thanks !

Ps: But if I remeber right @philn wrote somewhere else that he has already an imx8 module with a running configuration? Maybe he can share the configuration or have a quick look? 
philn commented 2 years ago

Sorry I can't help much about this, I haven't worked on imx8 for a couple years and it was on a downstream, heavily patched BSP anyway.

aperezdc commented 2 years ago

@SebDE: Thanks for commenting and trying out things 😺 — a couple of observations:

aperezdc commented 2 years ago

@SebDE One more comment: after I fix #401 another option will be to try building Cog from the repository and running with cog -P drm -O renderer=gles which should be somewhat more compatible with certain drivers and has some additional checks that allow that mode be more careful choosing buffer formats that the driver can handle.

jclsn commented 2 years ago

Same issue here. How to change the pixel format? @aperezdc

cog http://localhost:8081                                                                                                                                                                                                                                                                               
[  205.508219] imx-drm 32c00000.bus:display-subsystem: sn65dsi83_connector_mode_valid: mode: 800*480@25000 is valid
[  205.518614] imx-drm 32c00000.bus:display-subsystem: sn65dsi83_connector_mode_valid: mode: 800*480@25000 is valid

(cog:1498): GLib-GIO-WARNING **: 07:31:02.304: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal.  It should do one of these.
Cog-Core-Message: 07:31:02.624: <http://localhost:8081/> Load started.
[  205.956077] sn65dsi83 1-002d: DSI clock [ 75000000 ] Hz
[  205.961383] sn65dsi83 1-002d: GeoMetry [ 800 x 480 ] Hz
Cog-Core-Message: 07:31:02.864: <http://localhost:8081/> Loading...
Cog-Core-Message: 07:31:04.254: <http://localhost:8081/> Loaded successfully.

My display seems to be at 25kHz even, which can't be right.

aperezdc commented 2 years ago

@jclsn Could you set G_MESSAGES_DEBUG=Cog-DRM in the environment and re-run? I am curious to see if there are other modes enumerated in your case.

I am not familiar with the sn65dsi83 driver, but doesn't this indicate that 75Hz gets picked in the end?

[  205.956077] sn65dsi83 1-002d: DSI clock [ 75000000 ] Hz
jclsn commented 2 years ago

@aperezdc Will try on Monday.

I btw hear often that you are focusing more on Chromium than on this project. Is that true? Asking because I need to evaluate cog

jclsn commented 2 years ago

@aperezdc I set the environment variable you asked for. Here is the output

Cog-INFO: 08:01:13.836: com.igalia.Cog.Platform:
Cog-INFO: 08:01:13.845:   drm - 200/CogDrmPlatform
(cog:813): Cog-DEBUG: 08:01:13.980: platform_setup: Platform name: (null)
(cog:813): Cog-DRM-DEBUG: 08:01:13.990: init_config: overriding device_scale value, using 1.00 from shell
(cog:813): Cog-DRM-DEBUG: 08:01:13.992: init_drm: enumerated device 0xaaaae670d6b0, available_nodes 5
(cog:813): Cog-DRM-DEBUG: 08:01:13.992: init_drm:   DRM_NODE_PRIMARY: /dev/dri/card1
(cog:813): Cog-DRM-DEBUG: 08:01:13.993: init_drm:   DRM_NODE_RENDER: /dev/dri/renderD128
(cog:813): Cog-DRM-DEBUG: 08:01:13.993: init_drm: enumerated device 0xaaaae670dbd0, available_nodes 1
(cog:813): Cog-DRM-DEBUG: 08:01:13.993: init_drm:   DRM_NODE_PRIMARY: /dev/dri/card0
(cog:813): Cog-DRM-DEBUG: 08:01:13.993: init_drm: using device 0xaaaae670dbd0, DRM_NODE_PRIMARY /dev/dri/card0
(cog:813): Cog-DRM-DEBUG: 08:01:13.993: init_drm: 1 connectors available
(cog:813): Cog-DRM-DEBUG: 08:01:14.004: init_drm:  connector id 35, type 16, connected, 1 usable modes
(cog:813): Cog-DRM-DEBUG: 08:01:14.004: init_drm:    [0]: '800x480', 800x480@59, flags 10, type 72 (preferred) 
(cog:813): Cog-DRM-DEBUG: 08:01:14.014: init_drm: using connector id 35, type 16
(cog:813): Cog-DRM-DEBUG: 08:01:14.015: init_drm: using mode [0] '800x480'
(cog:813): Cog-DEBUG: 08:01:14.040: platform_setup: Selected CogDrmPlatform @ 0xaaaae66af6a0

(cog:813): GLib-GIO-WARNING **: 08:01:14.086: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal.  It should do one of these.
Cog-Core-Message: 08:01:14.662: <http://localhost:8081/> Load started.
Cog-Core-Message: 08:01:14.939: <http://localhost:8081/> Loading...
Cog-Core-Message: 08:01:16.381: <http://localhost:8081/> Loaded successfully.

I am not familiar with the sn65dsi83 driver, but doesn't this indicate that 75Hz gets picked in the end?

Not sure. It says Hz not µHz. I would assume that everything is correct here though, because Chromium works without issues.

SebDE commented 2 years ago

@aperezdc - Thanks for the hints and explanation. I will try to make a build with the etnaviv driver (at the moment I don't know how, but hopefully I will find the needed informations). I also collected some informations about the lcd, but first of all: I'm able to run a session with a wayland terminal without problems. But your totally right, the 68Hz are very weird. I'm using an evaluation kit from Variscite and there is also a wiki with some informations.

... equipped with SN65DSI84 MIPI-DSI to LVDS bridge ... evaluation kit comes with 800x480 LCD panel. DART-MX8M-MINI DTS file was created with this panel in mind

Here is the configuration from the device-tree

dsi_lvds_bridge: sn65dsi84@2c {
        compatible = "ti,sn65dsi83";
        reg = <0x2c>;
        ti,dsi-lanes = <4>;
        ti,lvds-format = <1>;
        ti,lvds-bpp = <24>;
        ti,lvds-channels = <1>;
        ti,width-mm = <154>;
        ti,height-mm = <87>;
        enable-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_lvds>;
        status = "okay";

        display-timings {
            lvds {
                clock-frequency = <33000000>;
                hactive = <800>;
                vactive = <480>;
                hback-porch = <40>;
                hfront-porch = <40>;
                vback-porch = <29>;
                vfront-porch = <13>;
                hsync-len = <48>;
                vsync-len = <3>;
                hsync-active = <0>;
                vsync-active = <0>;
                de-active = <1>;
                pixelclk-active = <0>;
            };
        };

        port {
            lvds_in: endpoint {
                remote-endpoint = <&dsi_out>;
            };
        };
    };

I also searched for some informations in /var/log/messages

Mar 01 17:14:25 imx8mm-var-dart kernel: sn65dsi83 0-002c: DSI clock [ 99000000 ] Hz
Mar 01 17:14:25 imx8mm-var-dart kernel: sn65dsi83 0-002c: Resolution [ 800 x 480 ]
Mar 01 17:14:25 imx8mm-var-dart kernel: sn65dsi83 0-002c: lvds_clk=33000000 lvds_clk_range=0x0
Mar 01 17:14:25 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_range=0x13
Mar 01 17:14:25 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_div=0x2
...
Mar 01 17:15:47 imx8mm-var-dart kernel: sn65dsi83 0-002c: DSI clock [ 99000000 ] Hz
Mar 01 17:15:47 imx8mm-var-dart kernel: sn65dsi83 0-002c: Resolution [ 800 x 480 ]
Mar 01 17:15:47 imx8mm-var-dart kernel: sn65dsi83 0-002c: lvds_clk=33000000 lvds_clk_range=0x0
Mar 01 17:15:47 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_range=0x13
Mar 01 17:15:47 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_div=0x2
Mar 01 17:16:05 imx8mm-var-dart kernel: sn65dsi83 0-002c: DSI clock [ 99000000 ] Hz
Mar 01 17:16:05 imx8mm-var-dart kernel: sn65dsi83 0-002c: Resolution [ 800 x 480 ]
Mar 01 17:16:05 imx8mm-var-dart kernel: sn65dsi83 0-002c: lvds_clk=33000000 lvds_clk_range=0x0
Mar 01 17:16:05 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_range=0x13
Mar 01 17:16:05 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_div=0x2
Mar 01 17:20:44 imx8mm-var-dart kernel: sn65dsi83 0-002c: DSI clock [ 99000000 ] Hz
Mar 01 17:20:44 imx8mm-var-dart kernel: sn65dsi83 0-002c: Resolution [ 800 x 480 ]
Mar 01 17:20:44 imx8mm-var-dart kernel: sn65dsi83 0-002c: lvds_clk=33000000 lvds_clk_range=0x0
Mar 01 17:20:44 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_range=0x13
Mar 01 17:20:44 imx8mm-var-dart kernel: sn65dsi83 0-002c: dsi_clk_div=0x2

@jclsn : What module / panel do you use? Did you make a custom board?