ReadMe_Linux.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. Linux Build for Vivante's Graphics Testsuite
  2. Contents
  3. 1. Quick start
  4. 2. Prerequisite
  5. 3. Build
  6. 4. Run the applications
  7. 1. Quick start
  8. ==============
  9. 1) Uncompress the source code, and set the root directory of test source code.
  10. # Please make sure driver and test source package are unzipped in different
  11. # directory.
  12. # <PROJECTS_DIR> must be a full path.
  13. export PROJECTS_TEST_DIR=<PROJECTS_DIR>/TEST
  14. mkdir -p $PROJECTS_TEST_DIR
  15. tar zxvf VIVANTE_GAL_Unified_Src_tst_<version>.tgz -C $PROJECTS_TEST_DIR.
  16. # Just set the root directory of test source code.
  17. # Do not care $AQARCH any more for test building.
  18. export AQROOT=$PROJECTS_TEST_DIR
  19. # Notice: the path of the AQROOT at here is different with the path where
  20. # driver source code was installed.
  21. 2) Set Vivante driver SDK environment variables.
  22. # Tests building depends on Vivante driver SDK.
  23. # Set 3 environment variables according to the path where your driver SDK
  24. # was installed to make sure the tool chain can find Vivante driver SDK.
  25. export VIVANTE_SDK_DIR=<DRIVER_SDK_DIR>
  26. export VIVANTE_SDK_INC=<DRIVER_SDK_DIR>/include
  27. export VIVANTE_SDK_LIB=<DRIVER_SDK_DIR>/drivers
  28. 3) Set other environment variables.
  29. # Set cross compile toolchain.
  30. export CROSS_COMPILE=<CROSS_COMPILER_PREFIX>
  31. # Set the Linux kernel directory.
  32. export KERNEL_DIR=<PATH_TO_LINUX_KERNEL_SOURCE>
  33. # Set X11 installation path.
  34. # If you are not using X11 as the GUI system, this variable is not necessary.
  35. export X11_ARM_DIR=<PATH_TO_X11_STUFF>
  36. # Set DirectFB installation path.
  37. # Exported this variable to support DirectFB accelerator building;
  38. # Set it to empty to skip DirectFB accelerator building
  39. export DFB_DIR=<PATH_TO_DIRECTFB_INSTALLATION_DIRECTORY>
  40. # Set the toolchain path.
  41. export TOOLCHAIN=<PATH_TO_TOOLCHAIN_TOPDIR>
  42. # Set the static library path which contains libc.a, etc.
  43. # If you are not building the package with static link, this variable is not necessary.
  44. export LIB_DIR=<PATH_TO_STATIC_LIBRARIES>
  45. # The binaries will be installed at $SDK_DIR.
  46. # By default, SDK_DIR=$AQROOT/build/sdk, you can modify it as following:
  47. TEST_SDK_DIR=<PATH_TO_INSTALL_BINARIES>
  48. export SDK_DIR=$TEST_SDK_DIR
  49. # Add the toolchain to the PATH.
  50. export PATH=$TOOLCHAIN/bin:$PATH
  51. # We use arm-2010q1 toolchain to compile this package.
  52. 3) Build.
  53. cd $AQROOT
  54. make -f makefile.linux
  55. make -f makefile.linux install
  56. The binaries are installed at <SDK_DIR>.
  57. More build options please see 'Build commands'.
  58. 4) Run the applications.
  59. Move to the target board.
  60. a) Copy <SDK_DIR> to the target board.
  61. b) Create device node.
  62. mknod /dev/galcore c 199 0
  63. c) Insert the kernel driver.
  64. insmod <VIVANTE_SDK_LIB>/galcore.ko registerMemBase=<REG_MEM_BASE> irqLine=<IRQ> contiguousSize=<CONTIGUOUS_MEM_SIZE>
  65. d) Set environment variable.
  66. export LD_LIBRARY_PATH=<VIVANTE_SDK_LIB>
  67. e) Run the application.
  68. eg. Run tutorial1.
  69. cd <SDK_DIR>/samples/tutorial
  70. ./tutorial1
  71. 2. Prerequisite
  72. ===============
  73. 1) Get the Vivante driver SDK
  74. Before building the Vivante test suites, you need to get or build Vivante driver SDK.
  75. 3. Build
  76. =========
  77. 1) Build commands.
  78. a) Build
  79. make -f makefile.linux <OPTIONS>
  80. b) Install
  81. make -f makefile.linux <OPTIONS> install
  82. c) Clean
  83. make -f makefile.linux <OPTIONS> clean
  84. Please see section 3) for the details on OPTIONS.
  85. 2) The targets
  86. There are a lot of modules in the package.
  87. Use the following the commands to build, install and clean a specific module.
  88. a) Build
  89. make -f makefile.linux <OPTIONS> <MODULE>
  90. b) Install
  91. make -f makefile.linux <OPTIONS> <MODULE> V_TARGET=install
  92. c) Clean
  93. make -f makefile.linux <OPTIONS> <MODULE> V_TARGET=clean
  94. MODULE list:
  95. hal_drv: Build HAL driver, including galcore.ko, libGAL.so.
  96. gfx_test: Build DirectFB samples.
  97. vdktest: Build VDK samples, including OpenGL ES 1.1/2.0 tutorials.
  98. tiger: Build OpenVG 1.1 sample: tiger.
  99. Please see the section 3) for the details on OPTIONS.
  100. 3) The options
  101. There are a lot of OPTIONS to control how to build the driver.
  102. To enable/disable an option, set <OPTION>=<value> in the command line.
  103. option value description
  104. -------------------------------------------------
  105. DEBUG 0 Disable debugging;default value;
  106. 1 Enable debugging;
  107. CPU_TYPE [CPU type] Set -mcpu=[CPU type] in the build command line. 0
  108. 0 Use the default value - arm920.
  109. NO_DMA_COHERENT 0 Enable coherent DMA;default value;
  110. 1 Disable coherent DMA;
  111. ABI 0 Change application binary interface;default is 0 which means no setting;
  112. aapcs-linux For example, build driver for Aspenite board;
  113. USE_VDK 0 Don't use the VDK programming interface;default value;
  114. 1 Use the VDK programming interface;
  115. Don't support static linking;
  116. Supports FBDEV and X11 system;
  117. EGL_API_FB 0 Use X11 system as the GUI system for the EGL;default value;
  118. 1 Use the FBDEV as the GUI system for the EGL;
  119. Supports static linking with STATLIC_LINK=1 build option;
  120. gcdSTATIC_LINK 0 Disable static linking;default value;
  121. Don't affects on DirectFB accelerator.
  122. 1 Enable static linking;
  123. Don't affects on DirectFB accelerator.
  124. CUSTOM_PIXMAP 0 Don't use special pixmap surface format;default value;
  125. 1 Use special pixmap surface format;
  126. Only affects on EGL driver;
  127. 4. Run the applications
  128. =======================
  129. Move to the target board.
  130. 1) Copy <SDK_DIR> to the target board.
  131. 2) Create the device node.
  132. mknod /dev/galcore c 199 0
  133. 3) Insert the kernel driver.
  134. There are two kinds of ways to manage the video memory: pre-reserved and
  135. dynamically allocated.
  136. We must pass the correct parameters to the driver according to these two conditions.
  137. a) Reserve a piece of memory from the system.
  138. insmod <SDK_DIR>/drivers/galcore.ko registerMemBase=<REG_MEM_BASE> irqLine=<IRQ> contiguousBase=<CONTIGUOUS_MEM_BASE> contiguousSize=<CONTIGUOUS_MEM_SIZE>
  139. b) Allocate a piece of memory dynamically when the driver boots up.
  140. insmod <SDK_DIR>/drivers/galcore.ko registerMemBase=<REG_MEM_BASE> irqLine=<IRQ> contiguousSize=<CONTIGUOUS_MEM_SIZE>
  141. 4) Set environment variable.
  142. export LD_LIBRARY_PATH=<SDK_DIR>/drivers
  143. Add additional paths to LD_LIBRARY_PATH if you are use other extra libraries.
  144. 5) Run the application.
  145. eg. Run tutorial1.
  146. cd <SDK_DIR>/samples/tutorial
  147. ./tutorial1