2013年9月26日 星期四

Vivante 3d gc2000 work flow

///////////////////////////create device node /dev/galcore/////////////////////////////
$home/myandroid/kernel_imx/drivers/mxc/gpu-viv/Kbuild
MODULE_NAME ?= galcore
/* define node name*/
$home/myandroid/kernel_imx/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
define DEVICE_NAME "galcore"

$home/myandroid/kernel_imx/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c
drv_init call
ret = register_chrdev(major, DEVICE_NAME, &driver_fops);

///////////////////////////////opengles2 functions///////////////////////////////////////////
myandroid/device/fsl-proprietary/gpu-viv/lib/egl/libGLESv2_VIVANTE.so
glActiveTexture
glBindBuffer
...
...
...
//those functions glxxxxxx call sub_D40C
int __fastcall sub_D40C(int a1, int a2, int a3) //address 0x0000D40C {
int result; // r0@1
int v4;
int v5;
v4 = a2;
  v5 = a3;
  gcoOS_GetTLS(&v4);  //------------> goto libGAL.so
  result = v4;
  if ( v4 )
    result = *(_DWORD *)(v4 + 36);
  return result;
}

and

$home/myandroid/device/fsl-proprietary/gpu-viv/lib/libGAL.so
//export function
signed int __fastcall gcoOS_GetTLS(void **a1) {
...
...
gcoOS_GetTLS v4 = open("/dev/galcore", 2);
...
...
}

and

device node /dev/galcore pass command into module galcore

and goto

$home/myandroid/kernel_imx/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
gckKERNEL_Dispatch(IN gckKERNEL Kernel, IN gctBOOL FromUser, IN OUT gcsHAL_INTERFACE * Interface)

here is my doc:
https://community.nxp.com/docs/DOC-334051

沒有留言:

張貼留言