Broken framebuffer/EGLFS output with resolution 1366x768

Hello.
We are trying to use a Chalkboard Touchscreen with a resolution of 1366x768 and a Boot2Qt Yocto image on a Colibri i.MX6 DualLite board.

Our Qt application that we start with the EGLFS (framebuffer) platform plug-in crashes immediately with
EGL Error : Could not create the egl surface: error = 0x3003

We also tested the framebuffer output with the fb-test/fb-rect tool provided by the Boot2Qt Yocto image. The rectangle which are displayed on the display look broken. There are a lot of horizontal lines in the output.

If we set the screen resolution to 1024x768 everything works fine.

After some research I have read that the i.MX6 Vivante have some trouble with resolutions that can’t be divided by 8. Could this be the issue in this case?

Btw. the pre-installed Angstrom image with X11 server seems to work without any problems on the 1366x768 resolution.

Thanks in advance for your help

The kernel version on Boot2Qt image is : Linux b2qt-colibri-imx6 3.14.52-v2.6b2.1+g9f2723e #1 SMP Thu Jan 5 14:58:43 UTC 2017 armv7l GNU/Linu

Hi

Could you try to install the 2.6 Image which uses the 3.14.52 Kernel? The preinstalled image used the 3.10. Kernel which has quite different drivers.

Also could you provide the output of ‘xrandr’ and the following file from the module with your display attached?
/sys/devices/soc0/soc/20e0000.hdmi_video/edid

Max

Hello. I have installed the image with Angstrom v2016.12 - Kernel 4.1.39-2.7.2+gba2f75f, Colibri-iMX6_Qt5-X11-Image 2.7.2 20170516

Actually I want to run my Qt application with eglfs and not with xcb plugin. Thats why i used Boot2Qt.

But here are the output of xrandr:

xrandr 
Screen 0: minimum 240 x 240, current 1366 x 768, maximum 8192 x 8192
DISP3 BG - DI1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   D:1366x768p-60  60.00*+
   D:1920x1080p-60  60.00  
   D:1280x720p-50  50.00  
   S:1280x720p-60  60.00  
   V:1024x768p-60  60.01  
   V:800x600p-60  60.32  
   D:720x576p-50  50.00  
   V:640x480p-60  60.00 

and

cat /sys/devices/soc0/soc/20e0000.hdmi_video/edid
0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x17 0x10 0x10 0x00 0x01 0x00 0x00 0x00 
0x32 0x18 0x01 0x03 0x80 0x16 0x0C 0x78 0x3A 0x7C 0x11 0x9E 0x59 0x47 0x9B 0x27 
0x10 0x50 0x54 0x21 0x08 0x00 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 
0x01 0x01 0x01 0x01 0x01 0x01 0x78 0x20 0x56 0x72 0x51 0x00 0x1E 0x30 0x6E 0x28 
0x55 0x00 0x10 0x09 0x00 0x00 0x00 0x1E 0x02 0x3A 0x80 0x18 0x71 0x38 0x2D 0x40 
0x58 0x2C 0x45 0x00 0x10 0x09 0x00 0x00 0x00 0x1E 0x00 0x00 0x00 0xFC 0x00 0x43 
0x48 0x41 0x4C 0x4B 0x2D 0x31 0x30 0x30 0x31 0x0A 0x20 0x20 0x00 0x00 0x00 0xFD 
0x00 0x3B 0x3D 0x0F 0x2E 0x08 0x00 0x0A 0x20 0x20 0x20 0x20 0x20 0x20 0x01 0x8A 
0x02 0x03 0x16 0x41 0x41 0x84 0x23 0x09 0x07 0x07 0x83 0x01 0x00 0x00 0x67 0x03 
0x0C 0x00 0x00 0x00 0x88 0x1E 0x02 0x3A 0x80 0x18 0x71 0x38 0x2D 0x40 0x58 0x2C 
0x45 0x00 0x10 0x09 0x00 0x00 0x00 0x1E 0x01 0x1D 0x80 0x18 0x71 0x1C 0x16 0x20 
0x58 0x2C 0x25 0x00 0x10 0x09 0x00 0x00 0x00 0x9E 0x01 0x1D 0x00 0xBC 0x52 0xD0 
0x1E 0x20 0xB8 0x28 0x55 0x40 0x10 0x09 0x00 0x00 0x00 0x1E 0x01 0x1D 0x80 0xD0 
0x72 0x1C 0x16 0x20 0x10 0x2C 0x25 0x80 0x10 0x09 0x00 0x00 0x00 0x9E 0x8C 0x0A 
0xD0 0x90 0x20 0x40 0x31 0x20 0x0C 0x40 0x55 0x00 0x04 0x03 0x00 0x00 0x00 0x18 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x2B 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Hi

I see several things which may contribute to what you see.
However I’m unsure as to which of it is.

  • non CEA resolution

For HDMI the driver is written for CEA resolutions but it works somewhat
for other resolutions as well. Also the effect of the not dividable by 8 resolution
you mention might contribute.

If this is the root cause there is not much we can do.

  • framebuffer color depth at a not supported setting.

I’ve seen strange effects when using 24bit per pixel and then using the
GPU to render something. Maybe depending on resolution also 16 or 32 bit
framebuffers behave funny.

You could try to force a framebuffer color depth with the bpp parameter
from the commandline. I.e. set the U-Boot variable vidargs to one of the
following:

video=mxcfb0:dev=hdmi,1366x768M@60,if=RGB24,bpp=16 video=mxcfb1:off fbmem=8M
video=mxcfb0:dev=hdmi,1366x768M@60,if=RGB24,bpp=32 video=mxcfb1:off fbmem=8M
  • The Chalkboard Touchscreen’s EDID announces audio capabilities and other stuff

With the attached patch I injected the Chalkboard Touchscreen’s EDID data
into the kernel. At least my monitor couldn’t cope with the 1366x768 signals.
After removing the edid extension data I got a reasonable picture. So
maybe one of the settings (audio?) from the extension data messes with the signal timing.

You could try if a kernel with that patch applied helps also with the real display.
I used the patch on top of the toradex_4.1-2.0.x-imx branch, but I guess it applies or at least is easily backported to older versions.

  • Vivante GPU driver and Graphical Backend.

The Vivante GPU drivers (EGL, OpenGL …) use a different binary depending
on the used graphical backend (X11, EGLFS …).
The Yocto build decides which binary to add to an image in the imx-gpu-viv
recipe. It uses for that the DISTRO_FEATURES list. And after changing
DISTRO_FEATURES one needs to rebuild everything to be sure of getting the
right stuff.
https://github.com/Freescale/meta-freescale/blob/master/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc

So if your issues with EGL happen on all resolution that might be something
to look into.

Max

Hi.

  • framebuffer color depth at a not supported setting.

Setting bpp to 16 or 32 had no effect. The QML app still crashes.

  • The Chalkboard Touchscreen’s EDID announces audio capabilities and other stuff

I would try the patch you have mentioned on my kernel. Where can I find the patch?

Hi

Sorry, I forgot to actually attach it.

Here you go.

Max

Thanks for the patch, but it did not solve my problem. I see the adjusted values in /sys/devices/soc0/soc/20e0000.hdmi_video/edid but my Qt app still crashes.

These modes are available for my screen (/sys/class/graphics/fb0/modes)

V:1024x768p-60,
V:800x600p-60,
V:640x480p-60,
D:1920x1080p-60,
D:1366x768p-60,
V:640x480p-60

I also tested my Qt app with 1024x768 (4:3) and 1920x1080 (16:9). The Qt app starts on both resolutions.

I think in my case I have the divided by 8 problem here.

Do you have any idea how to set/configure a custom HDMI resolution like 1360x768 in the kernel?

Probably easiest is to change the SW EDID to the timing you want to use.

I expect the following to use a 1360x768 resolution:

0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x17, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
0x32, 0x18, 0x01, 0x03, 0x80, 0x16, 0x0C, 0x78, 0x3A, 0x7C, 0x11, 0x9E, 0x59, 0x47, 0x9B, 0x27,
0x10, 0x50, 0x54, 0x21, 0x08, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x78, 0x20, 0x50, 0x72, 0x51, 0x00, 0x1E, 0x30, 0x6E, 0x28,
0x55, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x02, 0x3A, 0x80, 0x18, 0x71, 0x38, 0x2D, 0x40,
0x58, 0x2C, 0x45, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x43,
0x48, 0x41, 0x4C, 0x4B, 0x2D, 0x31, 0x30, 0x30, 0x31, 0x0A, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFD,
0x00, 0x3B, 0x3D, 0x0F, 0x2E, 0x08, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x91

I could solve the issue by applying the patch from https://community.nxp.com/message/860347 on my Kernel.

Now the EGL error is gone and the Qt application starts on the 1366x768 resolution.