imx6q (sabresd based design) g2d_open: fail with status -24

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

imx6q (sabresd based design) g2d_open: fail with status -24

1,893 Views
daharingwitekio
Contributor III

I have a imx6q-sabresd based board with wayland weston (also another image that uses xwayland). I'm able to start and use weston, but only when using pixman (CPU graphics). When I try to start weston with the default settings (ie with --use-g2d=1) which uses the GL rendering, I get the following error:

 

[21:29:08.220] Command line: weston ---debug --tty=1 --device=/dev/fb0 --use-g2d=1 --log=/tmp/weston.log
[21:29:08.220] OS: Linux, 6.1.36-custom-machine+gfd5321d928cc, #1 SMP PREEMPT Mon Nov 27 17:22:40 PST 2023, armv7l
[21:29:08.221] Flight recorder: enabled
[21:29:08.221] Using config file '/etc/xdg/weston/weston.ini'
[21:29:08.221] Output repaint window is 7 ms maximum.
[21:29:08.221] Loading module '/usr/lib/libweston-10/fbdev-backend.so'
[21:29:08.227] initializing fbdev backend
[21:29:08.227] warning: the fbdev backend is deprecated, please migrate to the DRM backend
[21:29:08.228] Trying weston_launch launcher...
[21:29:08.228] could not get launcher fd from env
[21:29:08.228] Trying direct launcher...
[21:29:08.236] Loading module '/usr/lib/libweston-10/g2d-renderer.so'
[21:29:08.249] g2d_open fail.
[21:29:08.249] g2d_renderer_create failed.

 

 

Upon further investigation, I tried to run the provided imx-g2d-samples starting with just /opt/g2d_samples/g2d_basic_test but I'm always met with the following error:

 

[     1] HAL user version: 6.4.11.658245
[     2] HAL kernel version: 6.4.11.684571
g2d_open: fail with status -24
g2d_open fail.

 

 

Since the G2D library is NXP proprietary (source code not provided), we were unable to dig into the error which seems to be coming from the library.

---
Additionally, if I disable g2d, I get an ELG error instead. See below:

 

[21:36:29.690] Command line: weston ---debug --tty=1 --device=/dev/fb0 --use-g2d=0 --log=/tmp/weston.log
[21:36:29.690] OS: Linux, 6.1.36-custom-machine+gfd5321d928cc, #1 SMP PREEMPT Mon Nov 27 17:22:40 PST 2023, armv7l
[21:36:29.690] Flight recorder: enabled
[21:36:29.690] Using config file '/etc/xdg/weston/weston.ini'
[21:36:29.690] Output repaint window is 7 ms maximum.
[21:36:29.691] Loading module '/usr/lib/libweston-10/fbdev-backend.so'
[21:36:29.697] initializing fbdev backend
[21:36:29.697] warning: the fbdev backend is deprecated, please migrate to the DRM backend
[21:36:29.697] Trying weston_launch launcher...
[21:36:29.697] could not get launcher fd from env
[21:36:29.697] Trying direct launcher...
[21:36:29.697] Loading module '/usr/lib/libweston-10/gl-renderer.so'
[21:36:29.710] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_platform_base EGL_KHR_platform_wayland
               EGL_EXT_platform_wayland EGL_EXT_device_query
[21:36:29.710] warning: either no EGL_EXT_platform_base support or specific platform support; falling back to eglGetDisplay.
[21:36:29.710] failed to initialize display
[21:36:29.710] EGL error state: EGL_NOT_INITIALIZED (0x3001)
[21:36:29.710] gl_renderer_create failed.
[21:36:29.785] BUG: layer_list is not empty after shutdown. Calls to weston_layer_fini() are missing somwhere.

 

 I also see

 

[     1] HAL user version: 6.4.11.658245
[     2] HAL kernel version: 6.4.11.684571
free(): double free detected in tcache 2

 

In the terminal after running the weston command, but not in the weston log file.

 

Keep in mind that if I use `--use-pixman`, then weston is able to start and run fine.

---

I have added the `kernel-module-imx-gpu-viv` package to my image, and enabled
`
CONFIG_MXC_GPU_VIV=y`
in my defconfig.

I've tried adding many different packages based on reference images (such as
mesa,
imx-gpu-g2d, 
imx-gpu-viv, 
packagegroup-fsl-tools-gpu,
packagegroup-fsl-gstreamer1.0,
etc)
but I have been unable to get graphics acceleration to work.

 

Can anyone provide any insight into this issue or what I might be missing?

Labels (3)
0 Kudos
Reply
12 Replies

1,875 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @daharingwitekio 

Please check the GPU setting in dts and kernel driver. You can refer the EVK dts and kernel.

This error more likely relates to driver

0 Kudos
Reply

1,872 Views
daharingwitekio
Contributor III

As far as I'm aware, I have the necessary DTS entries. I used the imx6q-sabresd.dts as a reference.

I do have the following entries (this is everything that should be related to graphics/display that I have):

#include "imx6q.dtsi"
#include <dt-bindings/clock/imx6qdl-clock.h>
...
...
/ {
	mxcfb1: fb@0 {
		compatible = "fsl,mxc_sdc_fb";
		disp_dev = "ldb";
		interface_pix_fmt = "RGB666";
		default_bpp = <16>;
		int_clk = <0>;
		late_init = <0>;
		status = "okay";
	};
        ...
        ...
};

&dcic1 {
	dcic_id = <0>;
	dcic_mux = "dcic-hdmi";
	status = "disabled";
};

&dcic2 {
	dcic_id = <1>;
	dcic_mux = "dcic-lvds1";
	status = "okay";
};

&ldb {
	status = "okay";

	lvds-channel@0 {
		status = "okay";
		fsl,data-mapping = "spwg";
		fsl,data-width = <18>;
		crtc = "ipu2-di0";
		primary;

		display-timings {
			/* default display timings */
			native-mode = <&timing1>;

			/* display timings */
			timing1: ourdisplay {
                        .....
                        .....
			};
		};
	};

	lvds-channel@1 {
		crtc = "ipu2-di1";
		status = "disabled";
	};
};

&gpc {
	fsl,ldo-bypass = <1>;
};

&reg_arm {
	vin-supply = <&sw1a_reg>;
};

&reg_pu {
	vin-supply = <&sw1c_reg>;
};

&reg_soc {
	vin-supply = <&sw1c_reg>;
};

&reg_vdd1p1 {
	vin-supply = <&vgen5_reg>;
};

&reg_vdd2p5 {
	vin-supply = <&vgen5_reg>;
};

&clks {
	assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
			  <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
	assigned-clock-parents = <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
				 <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
};
...
...

 

 

Is there anything that seems to be missing? As far as I can tell, I have everything important.

0 Kudos
Reply

1,289 Views
fatalerror
Contributor II

I had exactly the same problem after I mixed-and-matched yocto layers. For me the problem was a mismatch between the g2d / imx-gpu-viv libs and the "galcore" kernel driver. After I made sure that g2d_basic_test spits out the same version for 'user' and 'kernel' everything worked.

It is a pity that the error messages of these closed source libs are basically worthless for non-nxp employees. Nobody knows what error -24 is supposed to mean - how about a more deccriptive message...

0 Kudos
Reply

1,869 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @daharingwitekio 

Can you share the kernel version?

0 Kudos
Reply

1,865 Views
daharingwitekio
Contributor III
Ah yes, sorry I forgot to mention it. I'm using Yocto Mickledore with linux-imx kernel 6.1 (currently based on commit 04b05c5527e9af8d81254638c307df07dc9a5dd3) with the meta-imx layer.
0 Kudos
Reply

1,855 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @daharingwitekio 

I checked the current settings you shared, there is no obvious error.

Can you share the kernel log when you test g2d?

And check the information under  /sys/kernel/debug/gc.

0 Kudos
Reply

1,836 Views
daharingwitekio
Contributor III

Enabling more debug using `dmesg -n 8`, and then running `/opt/g2d_samples/g2d_basic_test`, I get no new dmesg logs.

Same base error though:

 

root@product:/# /opt/g2d_samples/g2d_basic_test 
---------------- g2d_open/close stress test ----------
[     1] HAL user version: 6.4.11.658245
[     2] HAL kernel version: 6.4.11.684571
g2d_open: fail with status -24
g2d_open/close stress test fail.

 

 

Under /sys/kernel/debug/gc, I got this info:

 

root@product:/sys/kernel/debug/gc# ls
clients           database64x       info              poweroff_timeout  vidmem64x
clk               dump_trigger      load              version
database          idle              meminfo           vidmem

root@product:/sys/kernel/debug/gc# cat info 
gpu      : 0
model    : 2000
revision : 5108
product  :    0
eco      :    0

gpu      : 16
model    :  320
revision : 5007
product  :    0
eco      :    0

gpu      : 20
model    :  355
revision : 1215
product  :    0
eco      :    0

root@product:/sys/kernel/debug/gc# cat meminfo 
VIDEO MEMORY:
  POOL SYSTEM:
    Free :        134199280 B
    Used :            18448 B
    MinFree :     134199280 B
    MaxUsed :         18448 B
    Total :       134217728 B
  POOL VIRTUAL:
    Used :             0 B
    MaxUsed :          0 B

root@product:/sys/kernel/debug/gc# cat version 
6.4.11.p2.684571 built at daharingwitekio-ubuntu
Platform path: drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c

root@product:/sys/kernel/debug/gc# cat vidmem  

root@product:/sys/kernel/debug/gc# cat clients 
PID     NAME
------------------------

root@product:/sys/kernel/debug/gc# cat database
GPU Idle: 0 ns

root@product:/sys/kernel/debug/gc# cat load 
core      : 0
load      : 0%

 

 

One thing I noticed that might be of interest in the kernel boot logs is this:

 

[    1.778654] imx-gpc 20dc000.gpc: Failed to create device link (0x180) with 20c8000.anatop:regulator-v
ddpu
[    1.812171] imx-ipuv3 2400000.ipu: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)

 

 

0 Kudos
Reply

1,791 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Are you using custom machine and just import meta-imx from github?

Did you import meta-freescale layer?

Or you are using the Yocto project we release?

 

 

0 Kudos
Reply

1,774 Views
daharingwitekio
Contributor III

Here's the layers I'm using:

  ${BSPDIR}/sources/poky/meta \
  ${BSPDIR}/sources/poky/meta-poky \
  ${BSPDIR}/sources/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-openembedded/meta-filesystems \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  ${BSPDIR}/sources/meta-openembedded/meta-python \
  ${BSPDIR}/sources/meta-freescale \
  ${BSPDIR}/sources/meta-freescale-distro \
  ${BSPDIR}/sources/meta-arm/meta-arm \
  ${BSPDIR}/sources/meta-arm/meta-arm-toolchain \
  ${BSPDIR}/sources/meta-imx/meta-bsp \
  ${BSPDIR}/sources/meta-my-custom-layer \

And this is the NXP manifest I used as my base: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-mickledore/imx-6.1.22-2.0.0.xml

My machine conf is based on `meta-imx/meta-bsp/conf/machine/imx6qsabresd.conf`. I changed to my own dts/defconfig, added firmware, etc. My kernel config is based on the same one they were using.

My distro is based on `meta-freescale-distro/conf/distro/fsl-wayland.conf`. Only real difference here is I'm using busybox/sysvinit as my virtual_runtime/init_manager

0 Kudos
Reply

1,733 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @daharingwitekio 

You are using L6.1.36 kernel and firmware not L6.1.22.

I think you should can this previous error log about  regulator-vddpu, the gpu power domain not work.

pd_pu: power-domain@1 {
						reg = <1>;
						#power-domain-cells = <0>;
						power-supply = <&reg_pu>;
						clocks = <&clks IMX6QDL_CLK_GPU3D_CORE>,
						         <&clks IMX6QDL_CLK_GPU3D_SHADER>,
						         <&clks IMX6QDL_CLK_GPU2D_CORE>,
						         <&clks IMX6QDL_CLK_GPU2D_AXI>,
						         <&clks IMX6QDL_CLK_OPENVG_AXI>,
						         <&clks IMX6QDL_CLK_VPU_AXI>;
					};

gpu_3d: gpu@130000 {
			compatible = "vivante,gc";
			reg = <0x00130000 0x4000>;
			interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clks IMX6QDL_CLK_GPU3D_AXI>,
				 <&clks IMX6QDL_CLK_GPU3D_CORE>,
				 <&clks IMX6QDL_CLK_GPU3D_SHADER>;
			clock-names = "bus", "core", "shader";
			power-domains = <&pd_pu>;
			#cooling-cells = <2>;
			status = "disabled";
		};

 

0 Kudos
Reply

1,657 Views
daharingwitekio
Contributor III

Could you clarify what you meant by this? I did try enabling gpu_3d and gpu_2d but running the basic G2D test still failed with the same error.

0 Kudos
Reply

1,649 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @daharingwitekio 

From the error , seems that regulator-vddpu used by GPU has link issue.

 

 imx-gpc 20dc000.gpc: Failed to create device link (0x180) with 20c8000.anatop:regulator-vddpu

 

Can you also test L5.15.71 BSP? 

 

Update:

This is warning message in L6.1.36, here is my test on imx6qpdlsolox which is similiar withe imx6q.Please re-check your porting steps.

imx6qpdlsolox login: root
root@imx6qpdlsolox:~# cd /opt/g2d_samples/
root@imx6qpdlsolox:/opt/g2d_samples# ./g2d_basic_test
---------------- g2d_open/close stress test ----------
Width 1920, Height 1088
---------------- g2d_alloc stress test ---------------
---------------- test dst YUV feature ----------------
RGBA to YUY2 time 12514us, 79fps, 166Mpixel/s ........
YUY2 to NV12 time 7005us, 142fps, 298Mpixel/s ........
---------------- g2d blit performance ----------------
RGBA->RGBA time 3704us, 269fps, 563Mpixel/s ........
g2d blending time 9338us, 107fps, 223Mpixel/s ........
---------------- g2d clear performance ----------------
g2d clear time 1837us, 544fps, 1137Mpixel/s ........
^C
root@imx6qpdlsolox:/opt/g2d_samples# dmesg | grep imx-gpc
[    2.366450] imx-gpc 20dc000.gpc: Failed to create device link (0x180) with 20c8000.anatop:regulator-vddpu
root@imx6qpdlsolox:/opt/g2d_samples#

 

0 Kudos
Reply