imx6q sabresd kernel 6.1 weston-wayland HDMI output messed up (desire to clone/mirror LVDS to HDMI)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q sabresd kernel 6.1 weston-wayland HDMI output messed up (desire to clone/mirror LVDS to HDMI)

2,497 Views
daharingwitekio
Contributor III

Hello, I'm using a imx6q-sabresd board and wanted to clone/mirror the LVDS output to the HDMI.

I'm using the stock NXP BSP with no changes (using the NXP manifest: https://github.com/nxp-imx/imx-manifest) with imx-6.1.36-2.1.0.xml.

I'm building the imx-image-multimedia image for imx6qsabresd and wayland using the following commands:

1. MACHINE=imx6qsabresd DISTRO=fsl-imx-wayland source ./imx-setup-release.sh -b build-imx6qsabresd-wayland
2. bitbake imx-image-multimedia

When I flash the image to an SD card and boot the sabre, I have the expected behavior. The LVDS display lights up, displays logo, weston starts, displays the desktop on the LVDS display, etc.

So first I killall weston and unset WAYLAND_DISPLAY (or disable the systemd services)...

Then I try the following configurations:

Case 1: Just HDMI
1. weston --tty=1 --device=/dev/fb2 --debug
(note that this mode will be using g2d by default)
* The display stays blank/black/in sleep mode and weston fails with the following (truncated) output:

[13:09:52.685] Output '/dev/fb2' using color profile: built-in default sRGB SDR profile
[13:09:52.685] g2d_renderer_output_create device=/dev/fb2
[13:09:52.685] clone_display_num = 0
[13:09:52.720] The number of the Framebuffer: 3
[13:09:52.720] Opend device=/dev/fb2
[13:09:52.903] fbdev output 1920×1080 px
              guessing 61 Hz and 96 dpi
[13:09:52.903] associating input device event3 with output /dev/fb2 (none by udev)
[13:09:52.903] associating input device event1 with output /dev/fb2 (none by udev)
[13:09:52.905] associating input device event0 with output /dev/fb2 (none by udev)
[13:09:52.908] Output '/dev/fb2' enabled with head(s) /dev/fb2
[13:09:52.908] Compositor capabilities:
              arbitrary surface rotation: yes
              screen capture uses y-flip: yes
              cursor planes: no
              arbitrary resolutions: no
              view mask clipping: yes
              explicit sync: yes
              color operations: no
              presentation clock: CLOCK_MONOTONIC_RAW, id 4
              presentation clock resolution: 0.000000001 s
[13:09:52.911] Loading module '/usr/lib/weston/desktop-shell.so'
[13:09:52.922] launching '/usr/libexec/weston-keyboard'
[13:09:52.934] Warning: support for deprecated wl_shell interface is enabled. Please migrate legacy clien
ts to xdg-shell.
[13:09:52.935] launching '/usr/libexec/weston-desktop-shell'
[13:09:52.944] FBIOPAN_DISPLAY Failed
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-move'
could not load cursor 'dnd-none'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
[13:09:53.991] FBIOPAN_DISPLAY Failed
[13:09:54.021] FBIOPAN_DISPLAY Failed
[13:09:54.052] FBIOPAN_DISPLAY Failed
[13:09:54.083] FBIOPAN_DISPLAY Failed
[13:09:54.114] FBIOPAN_DISPLAY Failed
[13:09:54.145] FBIOPAN_DISPLAY Failed
[13:09:54.176] FBIOPAN_DISPLAY Failed
[13:09:54.207] FBIOPAN_DISPLAY Failed
[13:09:54.238] FBIOPAN_DISPLAY Failed
[13:09:54.268] FBIOPAN_DISPLAY Failed

Case 2: Just HDMI but manually wake display
1. echo 0 > /sys/class/graphics/fb2/blank
   The display wakes up
2. cp /dev/urandom /dev/fb2
   The display goes from black to the fuzzy white-noise I expect
3. weston --tty=1 --device=/dev/fb2 --debug
* The display shows a bastardized version of the weston desktop (SEE IMAGE 1) and weston does not have errors (neither does dmesg). The full output is below:

root@imx6qsabresd:~# weston --debug --device=/dev/fb2 --tty=1
Date: 2023-03-03 UTC
[13:14:50.948] weston 10.0.4
              https://wayland.freedesktop.org
              Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
              Build: 10.0.0-106-g6210a8f1+
[13:14:50.948] Command line: weston --debug --device=/dev/fb2 --tty=1
[13:14:50.948] OS: Linux, 6.1.36+g04b05c5527e9, #1 SMP PREEMPT Mon Sep  4 14:11:15 PDT 2023, armv7l
[13:14:50.948] Flight recorder: enabled
[13:14:50.949] Using config file '/etc/xdg/weston/weston.ini'
WARNING: debug protocol has been enabled. This is a potential denial-of-service attack vector and informa
tion leak.
[13:14:50.949] Output repaint window is 7 ms maximum.
[13:14:50.949] Loading module '/usr/lib/libweston-10/fbdev-backend.so'
[13:14:50.959] initializing fbdev backend
[13:14:50.959] warning: the fbdev backend is deprecated, please migrate to the DRM backend
[13:14:50.959] Trying logind launcher...
[13:14:50.960] logind: failed to get session seat
[13:14:50.960] logind: cannot setup systemd-logind helper error: (No data available), using legacy fallba
ck
[13:14:50.960] Trying weston_launch launcher...
[13:14:50.960] could not get launcher fd from env
[13:14:50.960] Trying direct launcher...
[13:14:50.960] /dev/tty1 is already in graphics mode, is another display server running?
[13:14:50.961] Loading module '/usr/lib/libweston-10/g2d-renderer.so'
[13:14:50.979] Opening fbdev frame buffer.
[13:14:50.979] Calculating pixman format from:
               - type: 0 (aux: 0)
               - visual: 2
               - bpp: 24 (grayscale: 0)
               - red: offset: 16, length: 8, MSB: 0
               - green: offset: 8, length: 8, MSB: 0
               - blue: offset: 0, length: 8, MSB: 0
               - transp: offset: 0, length: 0, MSB: 0
[13:14:51.089] Created head '/dev/fb2' for device /dev/fb2 (DISP3 BG)
[13:14:51.090] param->device = /dev/fb2, disp_count = 1, backend->clone_mode = 0
[13:14:51.129] event3  - gpio-keys: is tagged by udev as: Keyboard
[13:14:51.129] event3  - gpio-keys: device is a keyboard
[13:14:51.137] event2  - WM8962 Beep Generator: not tagged as supported input device
[13:14:51.239] event2  - not using input device '/dev/input/event2'
[13:14:51.255] event1  - max11801_ts: is tagged by udev as: Touchscreen
[13:14:51.257] event1  - max11801_ts: device is a touch device
[13:14:51.267] event0  - EETI eGalax Touch Screen: is tagged by udev as: Touchscreen
[13:14:51.272] event0  - EETI eGalax Touch Screen: device is a touch device
[13:14:51.307] libinput: configuring device "gpio-keys".
[13:14:51.307] Touchscreen - max11801_ts - /sys/devices/platform/soc/2100000.bus/21a4000.i2c/i2c-1/1-0048
/input/input2/event1
[13:14:51.307] libinput: configuring device "max11801_ts".
[13:14:51.307] input device event1 has no enabled output associated (none named), skipping calibration fo
r now.
[13:14:51.307] Touchscreen - EETI eGalax Touch Screen - /sys/devices/platform/soc/2100000.bus/21a8000.i2c
/i2c-2/2-0004/input/input1/event0
[13:14:51.307] libinput: configuring device "EETI eGalax Touch Screen".
[13:14:51.307] input device event0 has no enabled output associated (none named), skipping calibration fo
r now.
[13:14:51.307] Color manager: no-op
[13:14:51.307] Creating fbdev output.
[13:14:51.307] Output '/dev/fb2' using color profile: built-in default sRGB SDR profile
[13:14:51.307] g2d_renderer_output_create device=/dev/fb2
[13:14:51.307] clone_display_num = 0
[13:14:51.307] The number of the Framebuffer: 3
[13:14:51.308] Opend device=/dev/fb2
[13:14:51.451] fbdev output 1920×1080 px
              guessing 61 Hz and 96 dpi
[13:14:51.451] associating input device event3 with output /dev/fb2 (none by udev)
[13:14:51.451] associating input device event1 with output /dev/fb2 (none by udev)
[13:14:51.454] associating input device event0 with output /dev/fb2 (none by udev)
[13:14:51.456] Output '/dev/fb2' enabled with head(s) /dev/fb2
[13:14:51.456] Compositor capabilities:
              arbitrary surface rotation: yes
              screen capture uses y-flip: yes
              cursor planes: no
              arbitrary resolutions: no
              view mask clipping: yes
              explicit sync: yes
              color operations: no
              presentation clock: CLOCK_MONOTONIC_RAW, id 4
              presentation clock resolution: 0.000000001 s
[13:14:51.457] Loading module '/usr/lib/weston/desktop-shell.so'
[13:14:51.460] launching '/usr/libexec/weston-keyboard'
[13:14:51.473] Warning: support for deprecated wl_shell interface is enabled. Please migrate legacy clien
ts to xdg-shell.
[13:14:51.474] launching '/usr/libexec/weston-desktop-shell'

Case 3: Just HDMI using pixman and manually wake display
1. echo 0 > /sys/class/graphics/fb2/blank
   enable the display (if you don't, it will remain off)
2. weston --device=/dev/fb2 --tty=1 --use-pixman --debug
   This works! Weston runs, I see the desktop, I can launch applications and see them

Case 4: LVDS + HDMI (uses g2d by default)
1. echo 0 > /sys/class/graphics/fb2/blank
   enable the HDMI display (if you don't, it will remain off)
2.  weston --debug --device=/dev/fb0,/dev/fb2 --tty=1
  weston runs successfully, and the LVDS display is extended with the HDMI display, but the HDMI display shows the same bastardized content (SEE IMAGE 2); 

Case 5: LVDS + HDMI using pixman
1. weston --debug --device=/dev/fb0,/dev/fb2 --tty=1 --use-pixman
Gives this error:

[13:26:49.321] Failed to open frame buffer device ‘/dev/fb0,/dev/fb2’: No such file or directory
[13:26:49.321] Creating frame buffer head failed.
[13:26:49.399] BUG: layer_list is not empty after shutdown. Calls to weston_layer_fini() are missing somw
here.
free(): double free detected in tcache 2
Aborted

Case 6: LVDS + HDMI with clone-mode (and g2d) and manually wake display
1. echo 0 > /sys/class/graphics/fb2/blank
   enable the HDMI display (if you don't, it will remain off)
2. weston --debug --device=/dev/fb0,/dev/fb2 --tty=1 --clone-mode
   this has the same output as Case 4 above

 

 

I was originally trying to follow this post where it seems to have worked for them (though they built the core-weston image instead which I have not tried): https://community.nxp.com/t5/i-MX-Processors/Using-HDMI-as-mirror-of-primary-lvds-display/m-p/139752... 

Labels (1)
0 Kudos
Reply
8 Replies

2,461 Views
joanxie
NXP TechSupport
NXP TechSupport

refer to your description, you couldn't bring up HDMI(without LVDS), right? did you try the prebuilt image? does it work for you?

https://www.nxp.com/design/design-center/software/embedded-software/i-mx-software/embedded-linux-for...

and did you set anything via uboot? just use the default settings?

0 Kudos
Reply

2,416 Views
daharingwitekio
Contributor III

I confirmed, the behavior when using the prebuilt images you linked for the imx6qsabresd is identical to what I see when I run the images I built manually/the behavior I described in the original post.

Sort of, the HDMI (as described in my post) will work only if I manually wake the display (else it will never turn on by itself) and only if I use pixman.

I did not change any u-boot settings. I know that some older posts suggested changing the video parameters in u-boot, however, the newer kernel has the settings in the DTS so it doesn't seem to need video arguments unless it's overriding the current DTS settings.

 

0 Kudos
Reply

2,405 Views
joanxie
NXP TechSupport
NXP TechSupport

is this issue related to the 6.1 bsp? could you find the same issue with old bsp? because imx6q is too old to find the evk board anywhere, as I known imx6q doesn't have such issue on old bsp, I checked the 6.1 bsp user guide, for imx6q, still suggest add parameters in the uboot, maybe you can try it, if still failed, I will try to test on imx6qp board firstly for you

joanxie_0-1704274297224.png

 

0 Kudos
Reply

2,370 Views
daharingwitekio
Contributor III

I did try the Kirkstone NXP BSP (using kernel 5.15 for the NXP release). I encountered the same issues as I recall. I did try using the video args to override the DTS as well for various settings. I would have two video args: one for the LVDS and one for the HDMI. I based it on the same values from this other post since his and my display resolutions match as well as the same mxcfb numbers but swapped (lvds is mxcfb0 for me and HDMI is mxcfb1 https://community.nxp.com/t5/i-MX-Processors/Using-HDMI-as-mirror-of-primary-lvds-display/m-p/139752...

I also tried the community kirkstone BSP (kernel 6.1) which uses DRM and at some point the cloning did mostly work but the colors were messed up on one display (I think it's because the displays supported different color schemes and the clone mode only clones exact settings).

 

0 Kudos
Reply

1,799 Views
joanxie
NXP TechSupport
NXP TechSupport

for new bsp try to use the command as below, two commands need to be added before running weston as below:

  1. echo 0 > /sys/class/graphics/fb2/blank
  2. echo 16 >/sys/class/graphics/fb2/bits_per_pixel
  3. weston --backend=fbdev-backend.so --device=/dev/fb0,/dev/fb2 --tty=1 &

0 Kudos
Reply

1,726 Views
msalvinik
Contributor III

I have the same problem on a imx6q-sabresd-based board with a 24bpp LVDS display (HDMI disabled), fixed with

echo 16 >/sys/class/graphics/fb0/bits_per_pixel

Have NXP planned a fix for that bug?

Thanks

0 Kudos
Reply

1,714 Views
msalvinik
Contributor III

Additional information:

the same problem impacts also gstreamer: it is not possible to reproduce a video if framebuffer is not set to 16bpp before launching gstreamer

kernel 5.15.71

0 Kudos
Reply

2,323 Views
joanxie
NXP TechSupport
NXP TechSupport

will check this issue and reply to you ASAP

0 Kudos
Reply