Problem with GPU Driver after recompiling kernel

2,060 views
Skip to first unread message

John Chen

unread,
Sep 1, 2013, 8:58:18 AM9/1/13
to wand...@googlegroups.com
Hello,

I'm having problem with the Vivante GPU Driver after I recompiled the kernel
and replaced the stock one from the Ubuntu 12.04 image from the Wandboard.org
Download page.

First, I compiled the kernel according to the instructions at:
The kernel is Robert Nelson's Wandboard Tree ( 3.0.35 ), and I double checked
that galcore.ko, vivante.ko, drm.ko are all built into the kernel, that is, the MXC
Vivante GPU Support is selected during menuconfig.

However, after I boot into the new kernel, the Xorg crashes with segfault in 
vivante_drv.so. After debugging with gdb, I found out that it is the call to
gcoHAL_Construct() in libGAL.so that failed, thus returning a NULL GPU Context
Object, which was later referenced, causing the Xorg to crash. The vivante_drv.so
module did throw out some error when it failed to construct the HAL, but it didn't
stop, and resulted in the segfault on Xorg. The error message is:
----
(EE) VIVANTE(0): internal error: GPU Ctx Init Failed
(EE) VIVANTE(0): internal error: initExaLayer failed in VivScreenInit()
----

As I don't have the source to libGAL.so, so I strace-ed it, and found out it is likely
due to an IOCTL that caused the gcoHAL_Construct() function to fail:
open("/dev/galcore", O_RDWR)            = 8
[...]
write(0, "(II)         UploadToScreen\n", 28) = 28
ioctl(8, 0x7530, 0xbeb3c330)            = -1 ENOTTY (Inappropriate ioctl for device)
write(2, "(EE) VIVANTE(0): internal error:"..., 53(EE) VIVANTE(0): internal error: GPU Ctx Init Failed
) = 53

So it seemed that it's the 0x7530 IOCTL (IOCTL_GCHAL_INTERFACE) to
/dev/galcore that failed with ENOTTY that caused the Xorg to crash.

Thus, I'm wondering if anyone knows what can cause the galcore module to
refuse the IOCTL_GCHAL_INTERFACE.

In addition to Robert Nelson's 3.0.35 wandboard tree, I've also tried the
official 3.0.35 wandboard tree at git://repo.or.cz/wandboard.git ( branch wandboard )
However, the same occurs as well.

Thanks.

Chen John L.


Otavio Salvador

unread,
Sep 1, 2013, 9:16:24 AM9/1/13
to Wandboard Discussion Group
It may be multiple things:

* not loaded galcode module
* mismatch between kernel GPU API and the binaries in rootfs
* wrong permission on /dev/galcore
* ...

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750

Justin Defields

unread,
Nov 14, 2013, 1:14:58 PM11/14/13
to wand...@googlegroups.com
Did you ever figure out what the issue was?  I'm having the same symptoms.

Regards,

Justin DeFields

Marlon Smith

unread,
Dec 3, 2013, 4:18:08 PM12/3/13
to wand...@googlegroups.com
Same problem here as well. Is this issue still unresolved? I need to be able to build my own kernel to add driver support.

Marcus Folkesson

unread,
Mar 2, 2014, 4:00:33 AM3/2/14
to wand...@googlegroups.com
Hello,

I'm almost sure that there is a version-mismatch between your lib/application and the kernel driver.
The gpu-driver is often changing the structure you pass to the driver, and if the size between your lib's version and the kernel is mismatching, it will give you an -ENOTTY back.

Try to determine which kernel version your lib is built for.

Best regards
Marcus Folkesson

Jonathan Olson

unread,
Jan 7, 2015, 9:44:15 PM1/7/15
to wand...@googlegroups.com

The /dev/galcore driver in Linux 3.14 expects a driver argument like the following for the IOCTL_GCHAL_INTERFACE ioctl.

 

typedef struct _DRIVER_ARGS

{

    gctUINT64               InputBuffer;

    gctUINT64               InputBufferSize;

    gctUINT64               OutputBuffer;

    gctUINT64               OutputBufferSize;

}

DRIVER_ARGS;

 

Each InputBuffer and OutBuffer must be a gcsHAL_INTERFACE type which currently has a size of 248 bytes.   To verify what the current iMX6Q libGAL.so is passing to the kernel I set a breakpoint on the first call to ioctl() when querying the interface parameters.  On inspecting the $r2 ioctl argument, the current iMX6Q GPU drivers are passing a DRIVER_ARGS which contains 32-bit values, not the gcfUINT64 values expected by the 3.14 kernel.  In addition, the size of the gcsHAL_INTERFACE parameters was apparently 128 bytes at the time the iMX6Q GPU driver was compiled.

 

(gdb) info registers

r0             0xffffffe7 4294967271

r1             0x7530 30000

r2             0x7efef7fc 2130638844

r3             0x14008 81928

r4             0x76fb9ee8 1996201704

r5             0x7530 30000

r6             0x2710 10000

r7             0x80 128

r8             0x7efef838 2130638904

r9             0x1 1

r10            0xaaa22a22 2862754338

r11            0xffffffff 4294967295

r12            0x76fb692c 1996187948

sp             0x7efef7f0 0x7efef7f0

lr             0x76fa7fec 1996128236

pc             0x76eb0bec 0x76eb0bec <ioctl+12>

cpsr           0x200e0030 537788464

(gdb) x/8x $r2

0x7efef7fc: 0x7efef838 0x00000080 0x7efef838 0x00000080

0x7efef80c: 0x00024078 0x00022930 0x00000000 0x0002407c

 

Please, Freescale could you rebuild these drivers to support the current 3.14 kernel!

 

Regards,

 

Jonathan Olson

Reply all
Reply to author
Forward
0 new messages