PowerVR Drivers sometime crashes

Hi,

I’m currently using PVR 3.0.00.06 driver from TI for beagleboard for my benchmarking. The application runs well but sometime at the GLES initialization the application crash without knowing the reason. Any helps are welcome.

Here is the stack trace:

[ 93.202636] Unable to handle kernel paging request at virtual address ca19036c

[ 93.210021] pgd = c7c38000

[ 93.212768] [ca19036c] *pgd=00000000

[ 93.216400] Internal error: Oops: 5 [#1]

[ 93.220336] Modules linked in: omaplfb pvrsrvkm

[ 93.224914] CPU: 0 Not tainted (2.6.29-omap1 #1)

[ 93.230041] PC is at LinuxMemAreaToCpuPAddr+0xc8/0x100 [pvrsrvkm]

[ 93.236267] LR is at OSMemHandleToCpuPAddr+0x10/0x14 [pvrsrvkm]

[ 93.242218] pc : [] lr : [] psr: 80000013

[ 93.242218] sp : c5e81e08 ip : c5e81e20 fp : c5e81e1c

[ 93.253753] r10: 00000008 r9 : c5e80000 r8 : c7f7f9c0

[ 93.259033] r7 : c7c0b008 r6 : c7f5ff20 r5 : bacdbc68 r4 : c7f5ff20

[ 93.265594] r3 : 000bacdb r2 : c9ea5000 r1 : c6800000 r0 : c7f5f9b0

[ 93.272155] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user

[ 93.279327] Control: 10c5387d Table: 87c38019 DAC: 00000015

[ 93.285125] Process benchmark_app (pid: 1760, stack limit = 0xc5e802e8)

[ 93.291778] Stack: (0xc5e81e08 to 0xc5e82000)

[ 93.296142] 1e00: c7f5ff20 00000000 c5e81e2c c5e81e20 bf00b9ac bf0090a0

[ 93.304534] 1e20: c5e81e44 c5e81e30 bf00918c bf00b9a8 c7f5ff20 c5e81eb0 c5e81e64 c5e81e48

[ 93.312896] 1e40: bf009ba4 bf0090a0 c7c0b000 c5e81eb0 c7c0b000 0000000b c5e81e84 c5e81e68

[ 93.321289] 1e60: bf01248c bf009af8 c7c0b00c 00000000 c7c0a000 c7c0a000 c5e81eac c5e81e88

[ 93.329650] 1e80: bf00fa80 bf012464 bef1838c bef1838c c01c670b 000006e0 c79c9840 bef1838c

[ 93.338043] 1ea0: c5e81eec c5e81eb0 bf00be58 bf00f9b0 0000000b 0000001c bef183cc 0000000c

[ 93.346405] 1ec0: bef183bc 00000010 00000003 c7f7f9c0 c7e32668 c79c9840 c01c670b bef1838c

[ 93.354797] 1ee0: c5e81f0c c5e81ef0 c00c6e30 bf00bda0 c5e81fac 00000003 c79c9840 c01c670b

[ 93.363189] 1f00: c5e81f7c c5e81f10 c00c7310 c00c6dd0 40d09000 c79c9840 00000003 c7cae380

[ 93.371551] 1f20: 000000a0 00001000 c5e81f74 c5e81f38 c00ade84 c00ad7d8 000000fb c5e80000

[ 93.379943] 1f40: 40d09000 c79c9840 00000000 00000003 c5e80000 00000003 bef1838c c01c670b

[ 93.388305] 1f60: c79c9840 c003c004 c5e80000 00000008 c5e81fa4 c5e81f80 c00c73b4 c00c6e78

[ 93.396697] 1f80: 00000003 00000000 00000010 00016680 00000000 00000036 00000000 c5e81fa8

[ 93.405059] 1fa0: c003be80 c00c7380 00000010 00016680 00000003 c01c670b bef1838c 0000001c

[ 93.413452] 1fc0: 00000010 00016680 00000000 00000036 00000000 00017670 00000008 00000008

[ 93.421813] 1fe0: 00017b48 bef18388 403916c8 402f599c 40000010 00000003 00000000 00000000

[ 93.430206] Backtrace:

[ 93.432678] [] (LinuxMemAreaToCpuPAddr+0x0/0x100 [pvrsrvkm]) from [] (OSMemHandleToCpuPAddr+0x10/0x14 [pvrsrvkm])

[ 93.444915] r5:00000000 r4:c7f5ff20

[ 93.448516] [] (OSMemHandleToCpuPAddr+0x0/0x14 [pvrsrvkm]) from [] (LinuxMemAreaToCpuPAddr+0xf8/0x100 [pvrsrvkm])

[ 93.460754] [] (LinuxMemAreaToCpuPAddr+0x0/0x100 [pvrsrvkm]) from [] (PVRMMapKVIndexAddressToMMapData+0xb8/0x130 [pvrsrvkm])

[ 93.473968] r5:c5e81eb0 r4:c7f5ff20

[ 93.477569] [] (PVRMMapKVIndexAddressToMMapData+0x0/0x130 [pvrsrvkm]) from [] (PVRMMapKVIndexAddressToMMapDataBW+0x34/0x44 [pvrsrvkm])

[ 93.491668] r7:0000000b r6:c7c0b000 r5:c5e81eb0 r4:c7c0b000

[ 93.497375] [] (PVRMMapKVIndexAddressToMMapDataBW+0x0/0x44 [pvrsrvkm]) from [] (BridgedDispatchKM+0xdc/0x13c [pvrsrvkm])

[ 93.510253] r4:c7c0a000

[ 93.512817] [] (BridgedDispatchKM+0x0/0x13c [pvrsrvkm]) from [] (PVRSRV_BridgeDispatchKM+0xc4/0xec [pvrsrvkm])

[ 93.524810] r8:bef1838c r7:c79c9840 r6:000006e0 r5:c01c670b r4:bef1838c

[ 93.531585] [] (PVRSRV_BridgeDispatchKM+0x0/0xec [pvrsrvkm]) from [] (vfs_ioctl+0x6c/0x7c)

[ 93.541748] r6:bef1838c r5:c01c670b r4:c79c9840

[ 93.546417] [] (vfs_ioctl+0x0/0x7c) from [] (do_vfs_ioctl+0x4a4/0x508)

[ 93.554779] r6:c01c670b r5:c79c9840 r4:00000003

[ 93.559417] [] (do_vfs_ioctl+0x0/0x508) from [] (sys_ioctl+0x40/0x64)

[ 93.567687] [] (sys_ioctl+0x0/0x64) from [] (ret_fast_syscall+0x0/0x2c)

[ 93.576110] r7:00000036 r6:00000000 r5:00016680 r4:00000010

[ 93.581848] Code: e89da830 e5902004 e1a03621 e1a01a01 (e7923103)

[ 93.588104] —[ end trace 0d3b5dcdb7c4a210 ]—

Regards,

-Hieu

Hi Hieu,

Have you checked return values and for GL errors at each stage of initialisation?
Are you using VBOs?You might be accessing a VBO that has been freed or indexing vertices outside it, when I’ve ever had a crash in the PVR driver it has always been due to something like that.
If it is crashing in the initialisation it would be handy to know at which stage.

Cheers,
Mark.

Mark,

Have you checked return values and for GL errors at each stage of

initialisation?
Yes, I am

Are you using VBOs?

No, I'm not using VBO

You might be accessing a VBO that has been freed or indexing vertices

outside it, when I've ever had a crash in the PVR driver it has always
been due to something like that.

If it is crashing in the initialisation it would be handy to know at

which stage.
The crash happened when I call to eglInitialize function, the eglDisplay
has valid ID.
The crash occurred when I run my application with extensive drawing code
which construct many triangles. It seems that there is some errors at
the deinitialize of EGL in the last session.

Here is my construction
  EGLint pi32ConfigAttribs[3];
  m_eglDisplay = eglGetDisplay((NativeDisplayType)0);

  EGLint iMajorVersion, iMinorVersion;
  if (!eglInitialize(m_eglDisplay, &iMajorVersion,
&iMinorVersion)) // <<< Crash here
  {
    printf("Error: eglInitialize() failed.\n");
    goto cleanup;
  }

  pi32ConfigAttribs[0] = EGL_SURFACE_TYPE;
  pi32ConfigAttribs[1] = EGL_WINDOW_BIT;
  pi32ConfigAttribs[2] = EGL_NONE;

  int iConfigs;
  if (!eglChooseConfig(m_eglDisplay, pi32ConfigAttribs,
&m_eglConfig, 1, &iConfigs) || (iConfigs != 1))
  {
    printf("Error: eglChooseConfig() failed.\n");
    goto cleanup;
  }

  m_eglSurface = eglCreateWindowSurface(m_eglDisplay, m_eglConfig,
(NativeWindowType)0, NULL);
  if (!TestEGLError("eglCreateWindowSurface"))
  {
    goto cleanup;
  }

  m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, NULL,
NULL);
  if (!TestEGLError("eglCreateContext"))
  {
    goto cleanup;
  }

  eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface,
m_eglContext);
  if (!TestEGLError("eglMakeCurrent"))
  {
    goto cleanup;
  }

  // Enable 2D mode
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  myglOrtho(f2vt(0.0), f2vt(SCREEN_WIDTH), f2vt(SCREEN_HEIGHT),
f2vt(0.0), f2vt(-1.0), f2vt(1.0));
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
    
  // Disable the depth buffer
  glDisable(GL_DEPTH_TEST);

  return true;

cleanup:
  eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
  eglTerminate(m_eglDisplay);
  return false;

And the destruction
  glFinish();
  eglSwapBuffers(m_eglDisplay, m_eglSurface);
  eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
   eglDestroyContext(m_eglDisplay, m_eglContext);
  eglDestroySurface(m_eglDisplay, m_eglSurface);
     eglTerminate(m_eglDisplay);

Regards,
-Hieu