This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Increasing DRM memory

Part Number: AM5728


Tool/software: Linux

I have developed two different decode, two deinterace and WriteBack in DSS.

 I use ti-processor-sdk-linux-am57xx-evm-03.01.00.06 without gstreamer.

now, i find drm memory error as below it.

omapdrm omapdrm.0: could not remap: -12 (3)

Error getting dmabuf scatterlist.

[00:00:17.008] dce_buf_lock(55) dce_memNum(1) err(0) 
[00:00:17.008] videOut(2) before VIDDEC3_process
[00:00:17.016] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.019] videOut(2) before VIDDEC3_process
[00:00:17.027] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.042] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:17.042] videOut(2) before VIDDEC3_process
[00:00:17.049] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.049] videOut(2) before VIDDEC3_process
[00:00:17.056] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.087] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:17.087] videOut(2) before VIDDEC3_process
[00:00:17.096] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.096] videOut(2) before VIDDEC3_process
[00:00:17.105] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.116] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:17.116] videOut(2) before VIDDEC3_process
[00:00:17.124] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.124] videOut(2) before VIDDEC3_process
[00:00:17.133] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.144] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:17.144] videOut(2) before VIDDEC3_process
[00:00:17.150] videOut(2) duration(6) after VIDDEC3_process
[00:00:17.151] videOut(2) before VIDDEC3_process
[00:00:17.157] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.157] dce_buf_unlock(55) dce_memNum(1) err(0) 
[00:00:17.169] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:17.169] videOut(2) before VIDDEC3_process
[00:00:17.178] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.178] videOut(2) before VIDDEC3_process
[00:00:17.185] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.297] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:17.310] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:17.310] videOut(2) before VIDDEC3_process
[00:00:17.320] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.320] videOut(2) before VIDDEC3_process
[00:00:17.329] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.330] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:17.426] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:17.426] videOut(2) before VIDDEC3_process
[00:00:17.432] videOut(2) duration(6) after VIDDEC3_process
[00:00:17.433] videOut(2) before VIDDEC3_process
[00:00:17.439] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.439] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:17.450] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:17.450] videOut(2) before VIDDEC3_process
[00:00:17.460] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.461] videOut(2) before VIDDEC3_process
[00:00:17.468] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.468] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:17.475] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:17.475] videOut(2) before VIDDEC3_process
[00:00:17.485] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.485] videOut(2) before VIDDEC3_process
[00:00:17.494] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.494] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:17.506] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:17.506] videOut(2) before VIDDEC3_process
[00:00:17.512] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.513] videOut(2) before VIDDEC3_process
[00:00:17.519] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.519] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:17.526] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:17.526] videOut(2) before VIDDEC3_process
[00:00:17.536] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.536] videOut(2) before VIDDEC3_process
[00:00:17.544] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.544] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:17.556] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:17.556] videOut(2) before VIDDEC3_process
[00:00:17.565] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.565] videOut(2) before VIDDEC3_process
[00:00:17.573] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.573] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:17.580] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:17.580] videOut(2) before VIDDEC3_process
[00:00:17.587] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.587] videOut(2) before VIDDEC3_process
[00:00:17.594] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.594] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:17.606] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:17.606] videOut(2) before VIDDEC3_process
[00:00:17.622] videOut(2) duration(17) after VIDDEC3_process
[00:00:17.622] videOut(2) before VIDDEC3_process
[00:00:17.631] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.631] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:17.640] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:17.640] videOut(2) before VIDDEC3_process
[00:00:17.649] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.651] videOut(2) before VIDDEC3_process
[00:00:17.659] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.659] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:17.666] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:17.666] videOut(2) before VIDDEC3_process
[00:00:17.673] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.674] videOut(2) before VIDDEC3_process
[00:00:17.680] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.680] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:17.696] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:17.696] videOut(2) before VIDDEC3_process
[00:00:17.704] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.705] videOut(2) before VIDDEC3_process
[00:00:17.713] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.713] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:17.720] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:17.720] videOut(2) before VIDDEC3_process
[00:00:17.730] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.730] videOut(2) before VIDDEC3_process
[00:00:17.738] videOut(2) duration(8) after VIDDEC3_process
[00:00:17.738] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:17.746] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:17.746] videOut(2) before VIDDEC3_process
[00:00:17.752] videOut(2) duration(6) after VIDDEC3_process
[00:00:17.752] videOut(2) before VIDDEC3_process
[00:00:17.759] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.759] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:17.772] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:17.772] videOut(2) before VIDDEC3_process
[00:00:17.781] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.781] videOut(2) before VIDDEC3_process
[00:00:17.791] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.791] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:17.806] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:17.806] videOut(2) before VIDDEC3_process
[00:00:17.814] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.814] videOut(2) before VIDDEC3_process
[00:00:17.824] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.824] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:17.845] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:17.845] videOut(2) before VIDDEC3_process
[00:00:17.852] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.852] videOut(2) before VIDDEC3_process
[00:00:17.859] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.859] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:17.872] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:17.872] videOut(2) before VIDDEC3_process
[00:00:17.881] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.881] videOut(2) before VIDDEC3_process
[00:00:17.891] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.891] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:17.906] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:17.906] videOut(2) before VIDDEC3_process
[00:00:17.914] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.914] videOut(2) before VIDDEC3_process
[00:00:17.924] videOut(2) duration(10) after VIDDEC3_process
[00:00:17.924] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:17.939] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:17.939] videOut(2) before VIDDEC3_process
[00:00:17.946] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.946] videOut(2) before VIDDEC3_process
[00:00:17.953] videOut(2) duration(7) after VIDDEC3_process
[00:00:17.953] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:17.972] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:17.972] videOut(2) before VIDDEC3_process
[00:00:17.981] videOut(2) duration(9) after VIDDEC3_process
[00:00:17.981] videOut(2) before VIDDEC3_process
[00:00:17.992] videOut(2) duration(11) after VIDDEC3_process
[00:00:17.992] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:18.006] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:18.006] videOut(2) before VIDDEC3_process
[00:00:18.014] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.014] videOut(2) before VIDDEC3_process
[00:00:18.025] videOut(2) duration(11) after VIDDEC3_process
[00:00:18.025] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:18.039] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:18.039] videOut(2) before VIDDEC3_process
[00:00:18.046] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.047] videOut(2) before VIDDEC3_process
[00:00:18.053] videOut(2) duration(6) after VIDDEC3_process
[00:00:18.053] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:18.072] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:18.072] videOut(2) before VIDDEC3_process
[00:00:18.081] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.082] videOut(2) before VIDDEC3_process
[00:00:18.092] videOut(2) duration(11) after VIDDEC3_process
[00:00:18.092] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:18.106] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:18.106] videOut(2) before VIDDEC3_process
[00:00:18.114] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.116] videOut(2) before VIDDEC3_process
[00:00:18.124] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.124] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:18.139] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:18.139] videOut(2) before VIDDEC3_process
[00:00:18.146] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.146] videOut(2) before VIDDEC3_process
[00:00:18.153] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.153] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:18.172] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:18.172] videOut(2) before VIDDEC3_process
[00:00:18.181] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.181] videOut(2) before VIDDEC3_process
[00:00:18.191] videOut(2) duration(10) after VIDDEC3_process
[00:00:18.191] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:18.206] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:18.206] videOut(2) before VIDDEC3_process
[00:00:18.214] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.214] videOut(2) before VIDDEC3_process
[00:00:18.223] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.223] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:18.240] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:18.240] videOut(2) before VIDDEC3_process
[00:00:18.247] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.247] videOut(2) before VIDDEC3_process
[00:00:18.254] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.254] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:18.272] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:18.272] videOut(2) before VIDDEC3_process
[00:00:18.281] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.281] videOut(2) before VIDDEC3_process
[00:00:18.291] videOut(2) duration(10) after VIDDEC3_process
[00:00:18.291] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:18.306] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:18.306] videOut(2) before VIDDEC3_process
[00:00:18.314] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.314] videOut(2) before VIDDEC3_process
[00:00:18.324] videOut(2) duration(10) after VIDDEC3_process
[00:00:18.324] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:18.343] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:18.343] videOut(2) before VIDDEC3_process
[00:00:18.349] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.349] videOut(2) before VIDDEC3_process
[00:00:18.356] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.356] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:18.372] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:18.372] videOut(2) before VIDDEC3_process
[00:00:18.381] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.381] videOut(2) before VIDDEC3_process
[00:00:18.391] videOut(2) duration(10) after VIDDEC3_process
[00:00:18.391] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:18.406] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:18.406] videOut(2) before VIDDEC3_process
[00:00:18.414] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.415] videOut(2) before VIDDEC3_process
[00:00:18.424] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.424] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:18.440] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:18.440] videOut(2) before VIDDEC3_process
[00:00:18.447] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.448] videOut(2) before VIDDEC3_process
[00:00:18.454] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.454] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:18.472] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:18.472] videOut(2) before VIDDEC3_process
[00:00:18.481] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.482] videOut(2) before VIDDEC3_process
[00:00:18.491] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.491] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:18.506] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:18.506] videOut(2) before VIDDEC3_process
[00:00:18.514] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.515] videOut(2) before VIDDEC3_process
[00:00:18.524] videOut(2) duration(10) after VIDDEC3_process
[00:00:18.524] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:18.539] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:18.539] videOut(2) before VIDDEC3_process
[00:00:18.546] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.547] videOut(2) before VIDDEC3_process
[00:00:18.553] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.553] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:18.572] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:18.572] videOut(2) before VIDDEC3_process
[00:00:18.580] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.581] videOut(2) before VIDDEC3_process
[00:00:18.590] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.590] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:18.606] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:18.606] videOut(2) before VIDDEC3_process
[00:00:18.622] videOut(2) duration(17) after VIDDEC3_process
[00:00:18.624] videOut(2) before VIDDEC3_process
[00:00:18.632] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.632] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:18.640] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:18.640] videOut(2) before VIDDEC3_process
[00:00:18.647] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.647] videOut(2) before VIDDEC3_process
[00:00:18.654] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.654] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:18.672] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:18.672] videOut(2) before VIDDEC3_process
[00:00:18.680] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.680] videOut(2) before VIDDEC3_process
[00:00:18.690] videOut(2) duration(10) after VIDDEC3_process
[00:00:18.690] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:18.706] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:18.706] videOut(2) before VIDDEC3_process
[00:00:18.714] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.714] videOut(2) before VIDDEC3_process
[00:00:18.724] videOut(2) duration(10) after VIDDEC3_process
[00:00:18.724] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:18.739] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:18.739] videOut(2) before VIDDEC3_process
[00:00:18.746] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.747] videOut(2) before VIDDEC3_process
[00:00:18.753] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.753] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:18.772] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:18.772] videOut(2) before VIDDEC3_process
[00:00:18.780] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.780] videOut(2) before VIDDEC3_process
[00:00:18.789] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.789] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:18.806] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:18.806] videOut(2) before VIDDEC3_process
[00:00:18.813] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.813] videOut(2) before VIDDEC3_process
[00:00:18.821] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.821] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:18.839] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:18.839] videOut(2) before VIDDEC3_process
[00:00:18.846] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.847] videOut(2) before VIDDEC3_process
[00:00:18.853] videOut(2) duration(6) after VIDDEC3_process
[00:00:18.853] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:18.872] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:18.872] videOut(2) before VIDDEC3_process
[00:00:18.880] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.881] videOut(2) before VIDDEC3_process
[00:00:18.889] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.889] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:18.906] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:18.906] videOut(2) before VIDDEC3_process
[00:00:18.913] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.913] videOut(2) before VIDDEC3_process
[00:00:18.922] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.922] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:18.939] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:18.939] videOut(2) before VIDDEC3_process
[00:00:18.946] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.947] videOut(2) before VIDDEC3_process
[00:00:18.953] videOut(2) duration(7) after VIDDEC3_process
[00:00:18.953] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:18.972] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:18.972] videOut(2) before VIDDEC3_process
[00:00:18.980] videOut(2) duration(8) after VIDDEC3_process
[00:00:18.980] videOut(2) before VIDDEC3_process
[00:00:18.989] videOut(2) duration(9) after VIDDEC3_process
[00:00:18.989] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:19.006] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:19.006] videOut(2) before VIDDEC3_process
[00:00:19.013] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.014] videOut(2) before VIDDEC3_process
[00:00:19.021] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.021] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:19.039] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:19.039] videOut(2) before VIDDEC3_process
[00:00:19.046] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.047] videOut(2) before VIDDEC3_process
[00:00:19.053] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.053] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:19.072] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:19.072] videOut(2) before VIDDEC3_process
[00:00:19.079] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.079] videOut(2) before VIDDEC3_process
[00:00:19.087] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.087] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:19.106] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:19.106] videOut(2) before VIDDEC3_process
[00:00:19.114] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.118] videOut(2) before VIDDEC3_process
[00:00:19.126] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.126] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:19.139] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:19.139] videOut(2) before VIDDEC3_process
[00:00:19.146] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.147] videOut(2) before VIDDEC3_process
[00:00:19.153] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.153] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:19.172] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:19.172] videOut(2) before VIDDEC3_process
[00:00:19.180] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.180] videOut(2) before VIDDEC3_process
[00:00:19.188] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.188] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:19.206] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:19.206] videOut(2) before VIDDEC3_process
[00:00:19.213] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.213] videOut(2) before VIDDEC3_process
[00:00:19.221] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.221] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:19.239] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:19.239] videOut(2) before VIDDEC3_process
[00:00:19.246] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.247] videOut(2) before VIDDEC3_process
[00:00:19.254] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.254] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:19.272] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:19.272] videOut(2) before VIDDEC3_process
[00:00:19.280] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.280] videOut(2) before VIDDEC3_process
[00:00:19.289] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.289] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:19.306] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:19.306] videOut(2) before VIDDEC3_process
[00:00:19.313] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.313] videOut(2) before VIDDEC3_process
[00:00:19.322] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.322] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:19.343] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:19.343] videOut(2) before VIDDEC3_process
[00:00:19.349] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.350] videOut(2) before VIDDEC3_process
[00:00:19.357] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.357] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:19.372] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:19.372] videOut(2) before VIDDEC3_process
[00:00:19.380] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.380] videOut(2) before VIDDEC3_process
[00:00:19.389] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.389] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:19.406] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:19.406] videOut(2) before VIDDEC3_process
[00:00:19.413] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.413] videOut(2) before VIDDEC3_process
[00:00:19.422] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.422] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:19.440] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:19.440] videOut(2) before VIDDEC3_process
[00:00:19.446] videOut(2) duration(6) after VIDDEC3_process
[00:00:19.447] videOut(2) before VIDDEC3_process
[00:00:19.453] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.453] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:19.473] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:19.473] videOut(2) before VIDDEC3_process
[00:00:19.480] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.480] videOut(2) before VIDDEC3_process
[00:00:19.489] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.489] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:19.506] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:19.506] videOut(2) before VIDDEC3_process
[00:00:19.514] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.514] videOut(2) before VIDDEC3_process
[00:00:19.523] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.523] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:19.539] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:19.539] videOut(2) before VIDDEC3_process
[00:00:19.546] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.547] videOut(2) before VIDDEC3_process
[00:00:19.553] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.553] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:19.572] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:19.572] videOut(2) before VIDDEC3_process
[00:00:19.580] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.580] videOut(2) before VIDDEC3_process
[00:00:19.590] videOut(2) duration(10) after VIDDEC3_process
[00:00:19.590] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:19.606] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:19.606] videOut(2) before VIDDEC3_process
[00:00:19.622] videOut(2) duration(17) after VIDDEC3_process
[00:00:19.626] videOut(2) before VIDDEC3_process
[00:00:19.633] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.633] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:19.643] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:19.643] videOut(2) before VIDDEC3_process
[00:00:19.649] videOut(2) duration(6) after VIDDEC3_process
[00:00:19.650] videOut(2) before VIDDEC3_process
[00:00:19.657] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.657] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:19.672] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:19.672] videOut(2) before VIDDEC3_process
[00:00:19.680] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.680] videOut(2) before VIDDEC3_process
[00:00:19.689] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.689] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:19.706] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:19.706] videOut(2) before VIDDEC3_process
[00:00:19.713] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.713] videOut(2) before VIDDEC3_process
[00:00:19.722] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.722] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:19.741] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:19.741] videOut(2) before VIDDEC3_process
[00:00:19.747] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.748] videOut(2) before VIDDEC3_process
[00:00:19.754] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.754] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:19.772] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:19.772] videOut(2) before VIDDEC3_process
[00:00:19.780] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.781] videOut(2) before VIDDEC3_process
[00:00:19.790] videOut(2) duration(10) after VIDDEC3_process
[00:00:19.790] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:19.806] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:19.806] videOut(2) before VIDDEC3_process
[00:00:19.814] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.814] videOut(2) before VIDDEC3_process
[00:00:19.823] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.823] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:19.840] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:19.841] videOut(2) before VIDDEC3_process
[00:00:19.847] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.848] videOut(2) before VIDDEC3_process
[00:00:19.854] videOut(2) duration(6) after VIDDEC3_process
[00:00:19.854] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:19.872] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:19.872] videOut(2) before VIDDEC3_process
[00:00:19.880] videOut(2) duration(8) after VIDDEC3_process
[00:00:19.880] videOut(2) before VIDDEC3_process
[00:00:19.890] videOut(2) duration(10) after VIDDEC3_process
[00:00:19.890] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:19.906] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:19.906] videOut(2) before VIDDEC3_process
[00:00:19.914] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.914] videOut(2) before VIDDEC3_process
[00:00:19.923] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.923] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:19.941] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:19.941] videOut(2) before VIDDEC3_process
[00:00:19.947] videOut(2) duration(6) after VIDDEC3_process
[00:00:19.948] videOut(2) before VIDDEC3_process
[00:00:19.954] videOut(2) duration(7) after VIDDEC3_process
[00:00:19.954] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:19.972] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:19.972] videOut(2) before VIDDEC3_process
[00:00:19.981] videOut(2) duration(9) after VIDDEC3_process
[00:00:19.981] videOut(2) before VIDDEC3_process
[00:00:19.991] videOut(2) duration(10) after VIDDEC3_process
[00:00:19.991] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:20.011] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:20.011] videOut(2) before VIDDEC3_process
[00:00:20.019] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.019] videOut(2) before VIDDEC3_process
[00:00:20.028] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.028] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:20.039] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:20.040] videOut(2) before VIDDEC3_process
[00:00:20.047] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.048] videOut(2) before VIDDEC3_process
[00:00:20.054] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.054] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:20.074] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:20.074] videOut(2) before VIDDEC3_process
[00:00:20.082] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.082] videOut(2) before VIDDEC3_process
[00:00:20.092] videOut(2) duration(10) after VIDDEC3_process
[00:00:20.092] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:20.106] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:20.106] videOut(2) before VIDDEC3_process
[00:00:20.113] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.115] videOut(2) before VIDDEC3_process
[00:00:20.123] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.123] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:20.141] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:20.141] videOut(2) before VIDDEC3_process
[00:00:20.147] videOut(2) duration(6) after VIDDEC3_process
[00:00:20.148] videOut(2) before VIDDEC3_process
[00:00:20.154] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.154] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:20.176] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:20.176] videOut(2) before VIDDEC3_process
[00:00:20.186] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.186] videOut(2) before VIDDEC3_process
[00:00:20.196] videOut(2) duration(10) after VIDDEC3_process
[00:00:20.196] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:20.216] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:20.216] videOut(2) before VIDDEC3_process
[00:00:20.225] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.225] videOut(2) before VIDDEC3_process
[00:00:20.233] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.233] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:20.243] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:20.243] videOut(2) before VIDDEC3_process
[00:00:20.249] videOut(2) duration(6) after VIDDEC3_process
[00:00:20.250] videOut(2) before VIDDEC3_process
[00:00:20.258] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.258] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:20.272] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:20.272] videOut(2) before VIDDEC3_process
[00:00:20.281] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.281] videOut(2) before VIDDEC3_process
[00:00:20.291] videOut(2) duration(10) after VIDDEC3_process
[00:00:20.291] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:20.310] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:20.310] videOut(2) before VIDDEC3_process
[00:00:20.319] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.319] videOut(2) before VIDDEC3_process
[00:00:20.328] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.328] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:20.344] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:20.344] videOut(2) before VIDDEC3_process
[00:00:20.350] videOut(2) duration(6) after VIDDEC3_process
[00:00:20.351] videOut(2) before VIDDEC3_process
[00:00:20.358] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.358] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:20.372] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:20.372] videOut(2) before VIDDEC3_process
[00:00:20.381] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.428] videOut(2) before VIDDEC3_process
[00:00:20.438] videOut(2) duration(11) after VIDDEC3_process
[00:00:20.438] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:20.446] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:20.446] videOut(2) before VIDDEC3_process
[00:00:20.455] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.455] videOut(2) before VIDDEC3_process
[00:00:20.463] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.463] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:20.472] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:20.473] videOut(2) before VIDDEC3_process
[00:00:20.479] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.480] videOut(2) before VIDDEC3_process
[00:00:20.486] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.486] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:20.493] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:20.493] videOut(2) before VIDDEC3_process
[00:00:20.503] videOut(2) duration(10) after VIDDEC3_process
[00:00:20.503] videOut(2) before VIDDEC3_process
[00:00:20.511] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.511] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:20.528] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:20.528] videOut(2) before VIDDEC3_process
[00:00:20.536] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.536] videOut(2) before VIDDEC3_process
[00:00:20.546] videOut(2) duration(10) after VIDDEC3_process
[00:00:20.546] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:20.567] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:20.567] videOut(2) before VIDDEC3_process
[00:00:20.575] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.576] videOut(2) before VIDDEC3_process
[00:00:20.582] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.582] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:20.612] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:20.613] videOut(2) before VIDDEC3_process
[00:00:20.623] videOut(2) duration(11) after VIDDEC3_process
[00:00:20.623] videOut(2) before VIDDEC3_process
[00:00:20.632] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.632] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:20.653] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:20.653] videOut(2) before VIDDEC3_process
[00:00:20.661] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.663] videOut(2) before VIDDEC3_process
[00:00:20.670] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.670] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:20.686] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:20.686] videOut(2) before VIDDEC3_process
[00:00:20.694] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.695] videOut(2) before VIDDEC3_process
[00:00:20.701] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.701] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:20.710] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:20.710] videOut(2) before VIDDEC3_process
[00:00:20.719] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.719] videOut(2) before VIDDEC3_process
[00:00:20.727] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.727] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:20.862] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:20.862] videOut(2) before VIDDEC3_process
[00:00:20.870] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.871] videOut(2) before VIDDEC3_process
[00:00:20.878] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.878] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:20.885] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:20.885] videOut(2) before VIDDEC3_process
[00:00:20.892] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.893] videOut(2) before VIDDEC3_process
[00:00:20.899] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.899] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:20.906] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:20.906] videOut(2) before VIDDEC3_process
[00:00:20.916] videOut(2) duration(10) after VIDDEC3_process
[00:00:20.916] videOut(2) before VIDDEC3_process
[00:00:20.924] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.924] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:20.933] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:20.933] videOut(2) before VIDDEC3_process
[00:00:20.942] videOut(2) duration(9) after VIDDEC3_process
[00:00:20.942] videOut(2) before VIDDEC3_process
[00:00:20.950] videOut(2) duration(8) after VIDDEC3_process
[00:00:20.951] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:20.959] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:20.959] videOut(2) before VIDDEC3_process
[00:00:20.965] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.966] videOut(2) before VIDDEC3_process
[00:00:20.973] videOut(2) duration(7) after VIDDEC3_process
[00:00:20.973] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:21.002] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:21.002] videOut(2) before VIDDEC3_process
[00:00:21.012] videOut(2) duration(10) after VIDDEC3_process
[00:00:21.013] videOut(2) before VIDDEC3_process
[00:00:21.021] videOut(2) duration(9) after VIDDEC3_process
[00:00:21.021] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:21.041] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:21.041] videOut(2) before VIDDEC3_process
[00:00:21.051] videOut(2) duration(10) after VIDDEC3_process
[00:00:21.051] videOut(2) before VIDDEC3_process
[00:00:21.060] videOut(2) duration(9) after VIDDEC3_process
[00:00:21.060] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:21.088] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:21.088] videOut(2) before VIDDEC3_process
[00:00:21.094] videOut(2) duration(6) after VIDDEC3_process
[00:00:21.095] videOut(2) before VIDDEC3_process
[00:00:21.101] videOut(2) duration(6) after VIDDEC3_process
[00:00:21.101] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:21.110] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:21.110] videOut(2) before VIDDEC3_process
[00:00:21.121] videOut(2) duration(11) after VIDDEC3_process
[00:00:21.121] videOut(2) before VIDDEC3_process
[00:00:21.129] videOut(2) duration(8) after VIDDEC3_process
[00:00:21.129] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:21.142] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:21.142] videOut(2) before VIDDEC3_process
[00:00:21.151] videOut(2) duration(9) after VIDDEC3_process
[00:00:21.151] videOut(2) before VIDDEC3_process
[00:00:21.160] videOut(2) duration(9) after VIDDEC3_process
[00:00:21.160] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:21.189] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:21.189] videOut(2) before VIDDEC3_process
[00:00:21.195] videOut(2) duration(7) after VIDDEC3_process
[00:00:21.196] videOut(2) before VIDDEC3_process
[00:00:21.202] videOut(2) duration(7) after VIDDEC3_process
[00:00:21.202] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:21.221] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:21.221] videOut(2) before VIDDEC3_process
[00:00:21.236] videOut(2) duration(15) after VIDDEC3_process
[00:00:21.473] videOut(2) before VIDDEC3_process
[00:00:21.485] videOut(2) duration(12) after VIDDEC3_process
[00:00:21.502] dce_buf_lock(103) dce_memNum(1) err(0) 
[00:00:21.502] videOut(0) before VIDDEC3_process
[00:00:21.503] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:21.520] videOut(0) duration(18) after VIDDEC3_process
[00:00:21.544] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:21.544] videOut(2) before VIDDEC3_process
[00:00:21.545] videOut(0) before VIDDEC3_process
[00:00:21.552] videOut(2) duration(8) after VIDDEC3_process
[00:00:21.554] videOut(2) before VIDDEC3_process
[00:00:21.560] videOut(0) duration(15) after VIDDEC3_process
[00:00:21.568] videOut(2) duration(14) after VIDDEC3_process
[00:00:21.596] dce_buf_lock(108) dce_memNum(1) err(0) 
[00:00:21.596] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:21.598] videOut(0) before VIDDEC3_process
[00:00:21.701] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:21.701] videOut(2) before VIDDEC3_process
[00:00:21.707] videOut(0) duration(110) after VIDDEC3_process
[00:00:21.707] videOut(0) before VIDDEC3_process
[00:00:21.714] videOut(2) duration(13) after VIDDEC3_process
[00:00:21.715] videOut(2) before VIDDEC3_process
[00:00:21.721] videOut(0) duration(14) after VIDDEC3_process
[00:00:21.728] videOut(2) duration(14) after VIDDEC3_process
[00:00:21.739] dce_buf_lock(109) dce_memNum(1) err(0) 
[00:00:21.739] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:21.742] videOut(0) before VIDDEC3_process
[00:00:21.746] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:21.746] videOut(2) before VIDDEC3_process
[00:00:21.754] videOut(0) duration(13) after VIDDEC3_process
[00:00:21.754] videOut(0) before VIDDEC3_process
[00:00:21.762] videOut(2) duration(17) after VIDDEC3_process
[00:00:21.762] videOut(2) before VIDDEC3_process
[00:00:21.770] videOut(0) duration(16) after VIDDEC3_process
[00:00:21.778] videOut(2) duration(16) after VIDDEC3_process
[00:00:21.789] dce_buf_lock(110) dce_memNum(1) err(0) 
[00:00:21.789] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:21.792] videOut(0) before VIDDEC3_process
[00:00:21.796] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:21.796] videOut(2) before VIDDEC3_process
[00:00:21.804] videOut(0) duration(13) after VIDDEC3_process
[00:00:21.804] videOut(0) before VIDDEC3_process
[00:00:21.812] videOut(2) duration(17) after VIDDEC3_process
[00:00:21.812] videOut(2) before VIDDEC3_process
[00:00:21.820] videOut(0) duration(16) after VIDDEC3_process
[00:00:21.828] videOut(2) duration(16) after VIDDEC3_process
[00:00:21.839] dce_buf_lock(111) dce_memNum(1) err(0) 
[00:00:21.839] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:21.840] videOut(0) before VIDDEC3_process
[00:00:21.846] dce_buf_lock(58) dce_memNum(1) err(0) 
[00:00:21.846] videOut(2) before VIDDEC3_process
[00:00:21.852] videOut(0) duration(12) after VIDDEC3_process
[00:00:21.852] videOut(0) before VIDDEC3_process
[00:00:21.859] videOut(2) duration(13) after VIDDEC3_process
[00:00:21.860] videOut(2) before VIDDEC3_process
[00:00:21.866] videOut(0) duration(14) after VIDDEC3_process
[00:00:21.873] videOut(2) duration(14) after VIDDEC3_process
[00:00:21.884] dce_buf_lock(112) dce_memNum(1) err(0) 
[00:00:21.884] dce_buf_unlock(59) dce_memNum(1) err(0) 
[00:00:21.884] videOut(0) before VIDDEC3_process
[00:00:21.894] videOut(0) duration(10) after VIDDEC3_process
[00:00:21.894] videOut(0) before VIDDEC3_process
[00:00:21.901] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:21.901] videOut(2) before VIDDEC3_process
[00:00:21.909] videOut(0) duration(15) after VIDDEC3_process
[00:00:21.922] videOut(2) duration(22) after VIDDEC3_process
[00:00:21.922] videOut(2) before VIDDEC3_process
[00:00:21.932] videOut(2) duration(10) after VIDDEC3_process
[00:00:21.942] dce_buf_unlock(57) dce_memNum(1) err(0) 
[00:00:21.949] dce_buf_lock(62) dce_memNum(1) err(0) 
[00:00:21.949] videOut(2) before VIDDEC3_process
[00:00:21.958] videOut(2) duration(9) after VIDDEC3_process
[00:00:21.958] videOut(2) before VIDDEC3_process
[00:00:21.972] videOut(2) duration(14) after VIDDEC3_process
[00:00:21.972] dce_buf_unlock(56) dce_memNum(1) err(0) 
[00:00:21.980] dce_buf_lock(59) dce_memNum(1) err(0) 
[00:00:21.980] videOut(2) before VIDDEC3_process
[00:00:21.988] videOut(2) duration(9) after VIDDEC3_process
[00:00:21.989] videOut(2) before VIDDEC3_process
[00:00:22.000] videOut(2) duration(11) after VIDDEC3_process
[00:00:22.000] dce_buf_unlock(61) dce_memNum(1) err(0) 
[00:00:22.014] dce_buf_lock(57) dce_memNum(1) err(0) 
[00:00:22.014] videOut(2) before VIDDEC3_process
[00:00:22.025] videOut(2) duration(12) after VIDDEC3_process
[00:00:22.026] videOut(2) before VIDDEC3_process
[00:00:22.036] videOut(2) duration(10) after VIDDEC3_process
[00:00:22.037] dce_buf_unlock(60) dce_memNum(1) err(0) 
[00:00:22.050] dce_buf_lock(56) dce_memNum(1) err(0) 
[00:00:22.050] videOut(2) before VIDDEC3_process
[00:00:22.072] videOut(2) duration(22) after VIDDEC3_process
[00:00:22.072] videOut(2) before VIDDEC3_process
[00:00:22.082] videOut(2) duration(10) after VIDDEC3_process
[00:00:22.083] dce_buf_unlock(62) dce_memNum(1) err(0) 
[00:00:22.083] dce_buf_unlock(109) dce_memNum(1) err(0) 
[00:00:22.093] dce_buf_lock(61) dce_memNum(1) err(0) 
[00:00:22.096] videOut(2) before VIDDEC3_process
[00:00:22.105] dce_buf_lock(113) dce_memNum(1) err(0) 
[00:00:22.105] videOut(0) before VIDDEC3_process
[00:00:22.112] videOut(2) duration(16) after VIDDEC3_process
[00:00:22.113] videOut(2) before VIDDEC3_process
[00:00:22.122] videOut(0) duration(17) after VIDDEC3_process
[00:00:22.122] videOut(0) before VIDDEC3_process
[00:00:22.129] videOut(2) duration(16) after VIDDEC3_process
[00:00:22.139] videOut(0) duration(17) after VIDDEC3_process
[00:00:22.139] dce_buf_unlock(58) dce_memNum(1) err(0) 
[00:00:22.139] dce_buf_unlock(110) dce_memNum(1) err(0) 
[00:00:22.151] dce_buf_lock(114) dce_memNum(1) err(0) 
[00:00:22.151] videOut(0) before VIDDEC3_process
[00:00:22.161] dce_buf_lock(60) dce_memNum(1) err(0) 
[00:00:22.162] videOut(2) before VIDDEC3_process
[00:00:22.167] videOut(0) duration(16) after VIDDEC3_process
[00:00:22.168] videOut(0) before VIDDEC3_process
[00:00:22.176] videOut(2) duration(14) after VIDDEC3_process
[00:00:22.176] videOut(2) before VIDDEC3_process
[00:00:22.182] videOut(0) duration(15) after VIDDEC3_process
[00:00:22.191] videOut(2) duration(15) after VIDDEC3_process
[00:00:22.277] dce_buf_lock(115) dce_memNum(1) err(-5) 
[00:00:28.196] dce_buf_unlock(57) dce_memNum(1) err(0) 

How do i increase drm memory ?

  • Hi.
    document you indicate don't help me.
    when /sys/kernel/debug/dri/0/tiler_map is almost 128MB, Error happens as "omapdrm omapdrm.0: could not remap: -12 (3)"
    two decoding(1080i60) and two VPE(deinterlace) and WriteBack require many DRM memory(omap_bo_new, drmIoctl (m_DrmDeviceFD, DRM_IOCTL_MODE_CREATE_DUMB, &creq);

    How do i increase dri/0 memory ?
  • Hi Lee,
    How many buffers are allocated to decoder component for both input and output?
    It looks like you are pinning all decoder buffers after allocating itself with dce_buf_lock(). Is this correct?

    Refer git.ti.com/.../viddec3test.c
    Here output buffer FD is locked with dce_buf_lock when it is being submitted for process and unpinned with dce_buf_unlock after decoder releases from freeBufID list.

    In this case, only buffers held by decoder will remain in 128MB tiler region.

    Ramprasad
  • Hi Ramprasad.
    I post "video_log.txt".
    as you see "video_log.txt", when i use dce_buf_lock/dce_buf_unlock, i write log.

    at last line of "video_log.txt", drmfd(115) is firstly used, but drm driver is putted as "omapdrm omapdrm.0: could not remap: -12 (3)"
    and then, it is not dce_buf_lock/dce_buf_unlock.

    I think that our developed platform need drm memory as below it. sometimes tiler memory overrun 128MB in a moment.
    i can see tiler_map info when i meet drm error.

    GC320 : 1280x720x4*2
    one 1080i60 Video decoding with reference frame(9) : 3637248 * 10
    video deinterlacing : 1920*1080*3/2 * 6
    the other 1080i60 Video decoding with reference frame(9) : 3637248 * 10
    video deinterlacing : 1920*1080*3/2 * 6
    3D GPU : gbm_surface_create( 1920, 1080... ) * 5
    four alsa play

    <Coding>
    lpPendingItem->m_err = dce_buf_lock(lpCodecCtx->dce_memNum, lpCodecCtx->dce_memhandle);
    sprintf(d_buf, "dce_buf_lock(%d) dce_memNum(%d) err(%d) \n", lpCodecCtx->dce_memhandle[0], lpCodecCtx->dce_memNum, lpPendingItem->m_err);

    if ( lpPendingItem->m_err )
    {
    system("cat /sys/kernel/debug/dri/0/tiler_map");
    printf("DBG : sleep 3. at %s\n", __FUNCTION__);
    sleep(3);

    }


    CONTAINER 0 DUMP BEGIN
    000:fffffffffffff(64*1)fffffffffffffeeeeeeeeeeeee(64*1)eeeeeeeeeeeeeddddd(32*1)dddddccccc(32*1)cccccbbbbb(32*1)bbbbbaaaaa(32*1)aaaaa
    001:
    002:
    003:
    004:
    005:
    006:
    007:
    008:
    009:
    010:
    011:
    012:
    013:
    014:
    015:
    016:
    017:
    018:
    019:
    020:
    021:
    022:
    023:
    024:
    025:
    026:
    027:
    028:
    029:
    030:
    031:
    032:
    033:
    034:
    035:
    036:
    037:
    038:
    039:
    040:
    041:
    042:
    043:
    044:
    045:
    046:
    047:
    048:
    049:
    050:
    051:
    052:
    053:
    054:
    055:
    056:
    057:
    058:
    059:
    060:
    061:
    062:
    063:
    064:
    065:
    066:
    067:
    068:
    069:
    070:
    071:
    072:
    073:
    074:
    075:
    076:
    077:
    078:
    079:
    080:
    081:
    082:
    083:
    084:
    085:
    086:
    087:
    088:
    089:
    090:
    091:
    092:
    093:
    094:
    095:
    096:
    097:
    098:
    099:
    100:
    101:
    102:
    103:
    104:
    105:
    106:
    107:
    108:
    109:
    110:
    111:
    112:
    113:
    114:
    115:
    116:
    117:
    118:
    119:
    120:
    121:
    122:
    123:
    124:
    125:
    126:
    127:
    CONTAINER 0 DUMP END
    CONTAINER 1 DUMP BEGIN
    000:
    001:
    002: <=================================================================================================================
    003:=============================================================3552K==============================================================
    004:================================================================================================================================
    005:=========================================================================><=====================================================
    006:================================================================================================================================
    007:=============================================================3552K==============================================================
    008:================================================================================================================================
    009:=====><=========================================================================================================================
    010:=============================================================3040K==============================================================
    011:================================================================================================================================
    012:=><=============================================================================================================================
    013:=============================================================3040K==============================================================
    014:=============================================================================================================================><=
    015:=============================================================3040K==============================================================
    016:================================================================================================================================
    017:=========================================================================================================================><=====
    018:================================================================================================================================
    019:=============================================================3552K==============================================================
    020:================================================================================================================================
    021:=====================================================>
    022:
    023:
    024: <=============
    025:=============================================================3040K==============================================================
    026:================================================================================================================================
    027:=============================================================================================================><=================
    028:================================================================================================================================
    029:=============================================================3552K==============================================================
    030:================================================================================================================================
    031:=========================================><=====================================================================================
    032:=============================================================3552K==============================================================
    033:================================================================================================================================
    034:=====================================================================================================><=========================
    035:================================================================================================================================
    036:=============================================================3552K==============================================================
    037:================================================================================================================================
    038:=================================><=============================================================================================
    039:=============================================================3552K==============================================================
    040:================================================================================================================================
    041:=============================================================================================>
    042: <=================================================================================================
    043:=============================================================3552K==============================================================
    044:================================================================================================================================
    045:=========================================================================================><=====================================
    046:=============================================================3040K==============================================================
    047:================================================================================================================================
    048:=====================================================================================><=========================================
    049:================================================================================================================================
    050:=============================================================3552K==============================================================
    051:================================================================================================================================
    052:=================>X=============================================================================================================
    053:=============================================================3552K==============================================================
    054:================================================================================================================================
    055:==============================================================================>
    056: <=================================================================================================================
    057:=============================================================3040K==============================================================
    058:================================================================================================================================
    059:==========X=====================================================================================================================
    060:=============================================================3040K==============================================================
    061:================================================================================================================================
    062:======X=========================================================================================================================
    063:=============================================================3040K==============================================================
    064:================================================================================================================================
    065:==X=============================================================================================================================
    066:=============================================================3040K==============================================================
    067:==============================================================================================================================X=
    068:=============================================================3040K==============================================================
    069:================================================================================================================================
    070:==========================================================================================================================X=====
    071:=============================================================3040K==============================================================
    072:================================================================================================================================
    073:======================================================================================================================X=========
    074:=============================================================3040K==============================================================
    075:================================================================================================================================
    076:==================================================================================================================>
    077:
    078: <====================================================================================
    079:=============================================================2040K==============================================================
    080:==========================================XXXXX=================================================================================
    081:=============================================================3552K==============================================================
    082:================================================================================================================================
    083:==========================================================================================================X=====================
    084:================================================================================================================================
    085:=============================================================3552K==============================================================
    086:================================================================================================================================
    087:======================================X=========================================================================================
    088:=============================================================3552K==============================================================
    089:================================================================================================================================
    090:==================================================================================================X=============================
    091:================================================================================================================================
    092:=============================================================3552K==============================================================
    093:================================================================================================================================
    094:==============================X=================================================================================================
    095:=============================================================2040K==============================================================
    096:=============================XXXXX<=============================================================================================
    097:================================================================================================================================
    098:=============================================================4052K==============================================================
    099:================================================================================================================================
    100:============================X===================================================================================================
    101:================================================================================================================================
    102:=============================================================4052K==============================================================
    103:================================================================================================================================
    104:======================><========================================================================================================
    105:================================================================================================================================
    106:=============================================================4052K==============================================================
    107:================================================================================================================================
    108:=================X====================================================1500K=====================================================
    109:============================================================================><==================================================
    110:=============================================================1500K==============================================================
    111:========X=========================================================1500K=========================================================
    112:===================================================================><===========================================================
    113:================================================================================================================================
    114:=============================================================3600K==============================================================
    115:================================================================================================================================
    116:=====><=========================================================================================================================
    117:=============================================================3600K==============================================================
    118:================================================================================================================================
    119:=======================================================================><=======================================================
    120:================================================================================================================================
    121:================================================================================================================================
    122:================================================================================================================================
    123:=============================================================8640K==============================================================
    124:================================================================================================================================
    125:================================================================================================================================
    126:================================================================================================================================
    127:===============================================================================================================================>
    CONTAINER 1 DUMP END
  • As mentioned in the e2e post here, new kernel won't be using TILER memory for many of these drivers. 

    You can either wait for the patches in Yocto or, you can try allocating the buffers for VPE and GC320 from CMEM pool and export the buffers to these drivers. You can learn how to allocate the memory from CMEM pool and exporting to V4l2 based driver following the code under macro "USE_CMEM_BUF" in loopback.c in dual-camera-demo example application. The demo code can be found here - 

    /****************************************************************************
    *
    *    Copyright 2012 - 2015 Vivante Corporation, Santa Clara, California.
    *    All Rights Reserved.
    *
    *    Permission is hereby granted, free of charge, to any person obtaining
    *    a copy of this software and associated documentation files (the
    *    'Software'), to deal in the Software without restriction, including
    *    without limitation the rights to use, copy, modify, merge, publish,
    *    distribute, sub license, and/or sell copies of the Software, and to
    *    permit persons to whom the Software is furnished to do so, subject
    *    to the following conditions:
    *
    *    The above copyright notice and this permission notice (including the
    *    next paragraph) shall be included in all copies or substantial
    *    portions of the Software.
    *
    *    THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
    *    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
    *    IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
    *    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    *    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    *    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    *
    *****************************************************************************/
    
    
    #include <galUtil.h>
    #include "gutsystem.h"
    
    /* drm headers */
    #include <omap/omap_drm.h>
    #include <libdrm/omap_drmif.h>
    #include <xf86drm.h>
    
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <sys/mman.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <errno.h>
    
    //#define VIVANTE_DEBUG
    
    /* Version info. */
    static const char c_szFrameworkInfo[] = "\tGAL Test Framework Version 3.1 \n";
    
    /* Test case. */
    static char        g_caseName[MAX_BUFFER_SIZE + 1]    = "";
    static char        g_simpleCaseName[MAX_BUFFER_SIZE + 1]  = "";
    
    gctHANDLE   g_caseDll           = gcvNULL;
    static GalTest     *g_testObject       = gcvNULL;
    
    /* Base objects */
    static GalRuntime g_Runtime;
    static gctUINT s_frameNo;
    static gctBOOL g_UseRange = gcvFALSE;
    
    #if defined(LINUX) || defined(ANDROID)
    /* Video memory mapping. */
    static gctPHYS_ADDR g_InternalPhysical, g_ExternalPhysical, g_ContiguousPhysical;
    static gctSIZE_T    g_InternalSize,     g_ExternalSize,     g_ContiguousSize;
    static gctPOINTER   g_Internal,         g_External,         g_Contiguous;
    #endif
    
    static gctSTRING        g_Argv2Test[MAX_ARG_COUNT] = {"",};
    
    int g_alloc_fd = -1;
    
    static void PrintUsage()
    {
        sysOutput("Usage: galRunTest2 gltTestCase.dll [-option value] [...]\n"
                "options:\n"
    #ifdef VIVANTE_DEBUG
                "\tw\tThe width of the target surface.\n"
                "\th\tThe height of the target surface.\n"
                "\tf\tThe format of the target surface.\n"
                "\tp\tThe pool of the target surface.\n"
    #endif
                "\ts\tenable/disable. Enable/disable target saving.\n"
                "\tc\tThe config file.\n");
    }
    
    static const struct PoolInfo
    {
        gctCONST_STRING name;
        gcePOOL         type;
    } c_PoolInfos[] =
    {
        {"DEFAULT", gcvPOOL_DEFAULT},
        {"VIRTUAL", gcvPOOL_VIRTUAL},
        {"SYSTEM",  gcvPOOL_SYSTEM},
    };
    
    static gcePOOL ConvToTargetPool(const char *name)
    {
        int i;
    
        for (i = 0; i < sizeof(c_PoolInfos) / sizeof(c_PoolInfos[0]); i++)
        {
            if (strcmp(name, c_PoolInfos[i].name) == 0) {
                return c_PoolInfos[i].type;
            }
        }
    
        sysOutput("*WARN* Unsupport target surface pool: \"%s\", "
                "use default value: \"gcvPOOL_DEFAULT\"\n", name);
        return gcvPOOL_DEFAULT;
    }
    
    static const char * ConvToTargetPoolStr(gcePOOL pool)
    {
        int i;
    
        for (i = 0; i < sizeof(c_PoolInfos) / sizeof(c_PoolInfos[0]); i++)
        {
            if (c_PoolInfos[i].type == pool) {
                return c_PoolInfos[i].name;
            }
        }
    
        return "Unknown Pool Type";
    }
    
    
    gctBOOL ConfigSetup(const char* cfgName)
    {
        FILE* config;
        char strTemp[MAX_BUFFER_SIZE];
    
        config = fopen(cfgName, "r");
        if (config == gcvNULL)
        {
            sysOutput("There's no config file: %s\n", cfgName);
            return gcvFALSE;
        }
    
        fscanf (config, "Screen Width = %d\n", &g_Runtime.width);
        fscanf (config, "Screen Height = %d\n", &g_Runtime.height);
        fscanf (config, "Surface Format = %s\n", strTemp);
        g_Runtime.format = GalQueryFormat(strTemp);
        if (g_Runtime.format == gcvSURF_UNKNOWN)
        {
            sysOutput("Unknown format: %s\n", strTemp);
            return gcvFALSE;
        }
    
        fscanf (config, "Surface Pool = %s\n", strTemp);
        g_Runtime.pool = ConvToTargetPool(strTemp);
    
        fclose (config);
        return gcvTRUE;
    }
    
    /*
     *  Name:       ParseArgs( int argc, char *argv[] )
     *  Returns:    0 when successed.
     *  Parameters: arguments, the command line arguments to parse.
     *  Description:This function parses the command line arguments and set the corresponding variables, e.g., the bitmap directory, the log file directory and so on.
    */
    static int ParseArgs(int argc, char *argv[])
    {
        int     i;
        int     result          = 0;
        char    *str;
        char strCfgName[MAX_BUFFER_SIZE]= {'\0',};
    #ifdef VIVANTE_DEBUG
        gctUINT cmdWidth = 0, cmdHeight = 0;
        gceSURF_FORMAT cmdFormat = gcvSURF_UNKNOWN;
        gcePOOL cmdPool = -1;
    #endif /* VIVANTE_DEBUG */
    
        /* Set g_caseName. */
        memset(g_caseName, 0, sizeof(g_caseName));
        strncpy(g_caseName, argv[1], strlen(argv[1]));
    
        /* Start from argv[2]. */
        i = 2;
        while (i < argc)
        {
            str = argv[i];
            if ((str[0] == '-' || str[0] == '/') && str[2] == '\0')
            {
                switch (str[1])
                {
    #ifdef VIVANTE_DEBUG
                    case 'w':
                        {
                            assert(argv[i + 1] != NULL);
                            cmdWidth = atoi(argv[i + 1]);
                            i += 2;
                        }
                        continue;
    
                    case 'h':
                        {
                            assert(argv[i + 1] != NULL);
                            cmdHeight = atoi(argv[i + 1]);
                            i += 2;
                        }
                        continue;
    
                    case 'f':
                        {
                            assert(argv[i + 1] != NULL);
                            cmdFormat = ConvToTargetFormat(argv[i + 1]);
                            i += 2;
                        }
                        continue;
    
                    case 'p':
                        {
                            assert(argv[i + 1] != NULL);
                            cmdPool = ConvToTargetPool(argv[i + 1]);
                            i += 2;
                        }
                        continue;
    #endif /* VIVNATE_DEBUG */
                    case 'n':
                        {
                            assert(argv[i + 1] != NULL);
                            g_Runtime.startFrame = atoi(argv[i + 1]);
                            g_Runtime.endFrame = atoi(argv[i + 2]);
                            i += 3;
                            if (g_Runtime.startFrame > g_Runtime.endFrame)
                            {
                                sysOutput("start frame no.%d is bigger than end frame no.%d\n",
                                            g_Runtime.startFrame, g_Runtime.endFrame);
                                result = -1;
                            }
                            else
                            {
                                g_UseRange = gcvTRUE;
                            }
                        }
                        continue;
    
                    case 'c':
                        {
                            if (argv[i + 1] == NULL)
                            {
                                sysOutput("please specify the config file following -c\n");
                                result = -1;
                            }
                            strncpy(strCfgName, argv[i + 1], strlen(argv[i + 1]));
                            i += 2;
                         }
                        continue;
    
                    case 's':
                        {
                            if (argv[i + 1] == NULL)
                            {
                                sysOutput("please specify enable/disable following -s\n");
                                result = -1;
                            }
    
                            if (!strncmp("enable", argv[i + 1], 6))
                            {
                                g_Runtime.saveTarget = gcvTRUE;
                            }
                            else if (!strncmp("disable", argv[i + 1], 7))
                            {
                                g_Runtime.saveTarget = gcvFALSE;
                                g_Runtime.noSaveTargetNew = gcvTRUE;
                            }
                            else
                            {
                                sysOutput("please specify enable/disable following -s\n");
                                result = -1;
                            }
    
                            i += 2;
                         }
                        continue;
    
                    case 't':
                        {
                            if (argv[i + 1] == NULL)
                            {
                                sysOutput("please specify enable/disable following -t\n");
                                result = -1;
                            }
    
                            if (!strncmp("enable", argv[i + 1], 6))
                            {
                                g_Runtime.createTarget = gcvTRUE;
                            }
                            else if (!strncmp("disable", argv[i + 1], 7))
                            {
                                g_Runtime.createTarget = gcvFALSE;
                            }
                            else
                            {
                                sysOutput("please specify enable/disable following -s\n");
                                result = -1;
                            }
    
                            i += 2;
                         }
                        continue;
    
    
                    default:
                        break;
                }
            }
    
            {
                g_Argv2Test[g_Runtime.argc] = argv[i];
                i++;
    
                ++g_Runtime.argc;
                if (g_Runtime.argc > MAX_ARG_COUNT)
                {
                    sysOutput("Arguments for test too much\n");
                    result = -1;
                }
            }
        }
    
        /* Use cfg file to cover the default values. */
    #ifdef VIVANTE_DEBUG
        if (strCfgName[0] != '\0')
        {
            ConfigSetup(strCfgName);
        }
    
        // use command value to cover the default values
        if (cmdWidth != 0)
        {
            g_Runtime.width = cmdWidth;
        }
    
        if (cmdHeight != 0)
        {
            g_Runtime.height = cmdHeight;
        }
    
        if (cmdFormat != gcvSURF_UNKNOWN)
        {
            g_Runtime.format = cmdFormat;
        }
    
        if (cmdPool != -1)
        {
            g_Runtime.pool = cmdPool;
        }
    #else
        if (strCfgName[0] == '\0')
        {
            sysOutput("Please specify config file with -c\n");
            return -1;
        }
    
        if (!ConfigSetup(strCfgName))
            return -1;
    #endif
    
        return result;
    }
    
    int ChipCheck(GalRuntime *rt)
    {
        gceSTATUS status;
        gctUINT32 i;
        gctINT ret = 0;
    
        status = gcoHAL_QueryChipIdentity(rt->hal, &rt->ChipModel, &rt->ChipRevision, &rt->ChipFeatures, gcvNULL);
        if (status < 0)
        {
            GalOutput(GalOutputType_Log, "*ERROR* Failed to query chip info (status = 0x%x)\n", status);
            ret = -1;
            goto EXIT;
        }
    
        status = gcoOS_ReadRegister(rt->os, 0x98, &rt->PatchRevision);
        if (status < 0)
        {
            GalOutput(GalOutputType_Log, "*ERROR* Failed to read patch version (status = 0x%x)\n", status);
            ret = -2;
            goto EXIT;
        }
    
        GalOutput(GalOutputType_Log, "=================== Chip Information ==================\n");
        GalOutput(GalOutputType_Log, "Chip : GC%x\n", rt->ChipModel);
        GalOutput(GalOutputType_Log, "Chip revision: 0x%08x\n", rt->ChipRevision);
        GalOutput(GalOutputType_Log, "Patch revision: 0x%08x\n", rt->PatchRevision);
        GalOutput(GalOutputType_Log, "Chip Features: 0x%08x\n", rt->ChipFeatures);
    
        status = gcoHAL_QueryChipMinorFeatures(rt->hal, &rt->ChipMinorFeaturesNumber, gcvNULL);
        if (status < 0)
        {
            GalOutput(GalOutputType_Log, "*ERROR* Failed to query minor feature count (status = 0x%x)\n", status);
            ret = -2;
            goto EXIT;
        }
    
        if (MAX_MINORFEATURE_NUMBER < rt->ChipMinorFeaturesNumber)
        {
            GalOutput(GalOutputType_Log, "*ERROR* no enough space for minor features\n");
            ret = -3;
            goto EXIT;
        }
    
        status = gcoHAL_QueryChipMinorFeatures(rt->hal, &rt->ChipMinorFeaturesNumber, rt->ChipMinorFeatures);
        if (status < 0)
        {
            GalOutput(GalOutputType_Log, "*ERROR* Failed to query minor features (status = 0x%x)\n", status);
            ret = -4;
            goto EXIT;
        }
    
        for (i = 0; i < rt->ChipMinorFeaturesNumber; i++)
        {
            GalOutput(GalOutputType_Log, "Chip MinorFeatures%d: 0x%08x\n", i, rt->ChipMinorFeatures[i]);
        }
    
        GalOutput(GalOutputType_Log, "=======================================================\n");
    
    EXIT:
    
        return ret;
    }
    
    static void close_target_surface()
    {
        close(g_alloc_fd);
    }
    
    static void* create_target_surface()
    {
        /* omapdrm vars */
        struct omap_device *dev;
        struct omap_bo *bo;
        int dmabuf_fd;
        int i;
    
        uint32_t size, flags = 0;
        void *vaddr = gcvNULL;
    
        /* Vivante DDK vars */
        gcsSURF_FORMAT_INFO_PTR info[2];    /* format parameters */
        int bpr;
        size_t stride;
    
        //g_alloc_fd = drmOpen("omapdrm", NULL);
        g_alloc_fd = open("/dev/dri/card0", O_RDWR | O_CLOEXEC);
        if (g_alloc_fd <= 0) {
            sysOutput("*ERROR* Failed to open omapdrm device\n");
            return gcvNULL;
        }
        //sysOutput("\tINFO: opened omapdrm device\n");
    
        dev = omap_device_new(g_alloc_fd);
        if (dev == gcvNULL) {
            sysOutput("*ERROR* Failed to get omap device\n");
            return gcvNULL;
        }
        //sysOutput("\tINFO: got omap_device\n");
    
        /* calculate the size of the buffer needed. Use gcoSURF_QueryFormat API to
         * format parameters descriptor - this contains information on format as
         * needed by the Vivante driver
         */
        gcmVERIFY_OK(gcoSURF_QueryFormat(g_Runtime.format, info));
        //sysOutput("\tINFO: bits per pixel: %d\n", info[0]->bitsPerPixel);
    
        /* Vivante HAL needs 16 pixel alignment in width and 4 pixel alignment in
         * height.
         */
        bpr = ((g_Runtime.width + 15) & ~15) * (info[0]->bitsPerPixel / 8);
        sysOutput("\tINFO: bytes per row: %d\n", bpr);
        size = bpr * ((g_Runtime.height + 3) & ~3);
        stride = bpr;
        //sysOutput("\tINFO: height: %d\n \
          //      \tINFO: width: %d\n \
            //    \tINFO: size: %d\n \
              //  \tINFO: stride: %d\n",
                //g_Runtime.height, g_Runtime.width, size, stride);
        
        /* TODO: need to get the flags right here */
        /* MEM_CACHED, MEM_WRITE, */
        //flags &= ~OMAP_BO_CACHE_MASK;   /* MEM_CACHED */
        flags = OMAP_BO_WC;            /* write combine */
        //flags &= ~OMAP_BO_TILED_MASK;   /* non-Tiler */
    
        bo = omap_bo_new(dev, size, flags);
        if (!bo) {
            sysOutput("*ERROR* Failed to create omap bo\n");
            return gcvNULL;
        }
        //sysOutput("\tINFO: created omap bo object with size: %d\n", omap_bo_size(bo));
    
        /* get dmabuf fd that can be shared */
        dmabuf_fd = omap_bo_dmabuf(bo);
        if (dmabuf_fd <= 0) {
            sysOutput("*ERROR* Failed to get dmabuf fd from bo");
            omap_bo_del(bo);
            return gcvNULL;
        }
        //sysOutput("\tINFO: got the dmabuf handle: 0x%x\n", dmabuf_fd);
    
        /* now that we have a share fd, we don't need bo in this process any more.
         * Free it (which just drops the refcount)
         */
        //omap_bo_del(bo);
        //sysOutput("\tINFO: deleted omap bo object\n");
    
        /* map the dmabuf to this process, we can `mmap` the `dmabuf_fd` directly
         * here. TODO
         * we use omap_bo API anyway
         */
        vaddr = omap_bo_map(bo);
        //vaddr = mmap(0, size, PROT_READ | PROT_WRITE,
        //        MAP_SHARED, dmabuf_fd, 0);
        if (!vaddr) {
            sysOutput("*ERROR* could not mmap dmabuf - %s\n", strerror(errno));
            return -errno;
        }
        /*
         * `omap_bo` might not have backing pages at this point, make sure you got
         * them by writing into it.
         */
        memset(vaddr, 0, size);
        sysOutput("INFO: initialized the bo\n");
        
        //sysOutput("\tINFO: mapped the omap bo to this process\n");
    
        /* we mapped the bo, dont the omap_device anymore */
        //omap_device_del(dev);
        //sysOutput("\tINFO: deleted omap_device\n");
    
        return vaddr;
    
    }
    
    /*
     *  Name:       Initialize()
     *  Parameters: case_name, the name of the dll of the test case.
    */
    
    static gctBOOL Initialize()
    {
        PGalCreateTestObject createTestObject;
        gceSTATUS status;
    
        /* Load test dll */
        g_caseDll = sysLoadModule(g_caseName);
        if (g_caseDll == gcvNULL)
        {
            sysOutput("*ERROR* Failed to load: \"%s\"\n", g_caseName);
            return gcvFALSE;
        }
    
        createTestObject = (PGalCreateTestObject)sysGetProcAddress(g_caseDll, "GalCreateTestObject");
        if (createTestObject == gcvNULL)
        {
            sysOutput("*ERROR* Failed to find: \"GalCreateTestObject\" in %s\n", g_caseName);
            return gcvFALSE;
        }
    
        /* Setup log file objects. */
        if (!sysSetupLog(g_simpleCaseName))
        {
            sysOutput("*ERROR* Failed to set up log\n");
            return gcvFALSE;
        }
    
        /* Construct the gcoOS object. */
        status = gcoOS_Construct(gcvNULL, &g_Runtime.os);
        if (status < 0)
        {
            sysOutput("*ERROR* Failed to construct OS object (status = %d)\n", status);
            return gcvFALSE;
        }
    
        /* Construct the gcoHAL object. */
        status = gcoHAL_Construct(gcvNULL, g_Runtime.os, &g_Runtime.hal);
        if (status < 0)
        {
            sysOutput("*ERROR* Failed to construct GAL object (status = %d)\n", status);
            return gcvFALSE;
        }
    
        if (!gcoHAL_IsFeatureAvailable(g_Runtime.hal, gcvFEATURE_2DPE20))
        {
            switch (g_Runtime.format)
            {
            /* PE1.0 support. */
            case gcvSURF_X4R4G4B4:
            case gcvSURF_A4R4G4B4:
            case gcvSURF_X1R5G5B5:
            case gcvSURF_A1R5G5B5:
            case gcvSURF_X8R8G8B8:
            case gcvSURF_A8R8G8B8:
            case gcvSURF_R5G6B5:
                break;
    
            default:
                sysOutput("*ERROR* the target format %d is not supported by the hardware.\n",
                    g_Runtime.format);
                return gcvFALSE;
            }
        }
    
    #if defined(LINUX) || defined(ANDROID)
        /* Query the amount of video memory. */
        status = gcoHAL_QueryVideoMemory(g_Runtime.hal,
                                         &g_InternalPhysical, &g_InternalSize,
                                         &g_ExternalPhysical, &g_ExternalSize,
                                         &g_ContiguousPhysical, &g_ContiguousSize);
        if (gcmIS_ERROR(status))
        {
            sysOutput("gcoHAL_QueryVideoMemory failed %d.", status);
            return gcvFALSE;
        }
    
        /* Map the local internal memory. */
        if (g_InternalSize > 0)
        {
            status = gcoHAL_MapMemory(g_Runtime.hal,
                                      g_InternalPhysical, g_InternalSize,
                                      &g_Internal);
            if (gcmIS_ERROR(status))
            {
                sysOutput("gcoHAL_MapMemory failed %d.", status);
                return gcvFALSE;
            }
        }
    
        /* Map the local external memory. */
        if (g_ExternalSize > 0)
        {
            status = gcoHAL_MapMemory(g_Runtime.hal,
                                      g_ExternalPhysical, g_ExternalSize,
                                      &g_External);
            if (gcmIS_ERROR(status))
            {
                sysOutput("gcoHAL_MapMemory failed %d.", status);
                return gcvFALSE;
            }
        }
    
        /* Map the contiguous memory. */
        if (g_ContiguousSize > 0)
        {
            status = gcoHAL_MapMemory(g_Runtime.hal,
                                      g_ContiguousPhysical, g_ContiguousSize,
                                      &g_Contiguous);
            if (gcmIS_ERROR(status))
            {
                sysOutput("gcoHAL_MapMemory failed %d.", status);
                return gcvFALSE;
            }
        }
    #endif
    
        status = gcoHAL_Get2DEngine(g_Runtime.hal, &g_Runtime.engine2d);
        if (status < 0)
        {
            sysOutput("*ERROR* Failed to get 2D engine object (status = %d)\n", status);
            return gcvFALSE;
        }
    
        if (g_Runtime.createTarget)
        {
            void *vaddr = gcvNULL;
            size_t stride, size, bpr;
    
            gcsSURF_FORMAT_INFO_PTR info[2];
            gctUINT address[3];
            gctPOINTER memory[3];
            gctSHBUF shBuf = gcvNULL;
            gceHARDWARE_TYPE type;
            unsigned long phys = ~0U;
    
            vaddr = create_target_surface();
            if (!vaddr) {
                sysOutput("*ERROR*: Failed to create drm target surface ");
                return gcvFALSE;
            }
    
            gcoHAL_GetHardwareType(gcvNULL, &type);
    
            /* now that we created gem buffer and mapped it to this process, we need to
             * map this to GC320 MMU. First we get the hardware type, to figure which
             * version of MMU is the HAL using. Then set this buffer as an underlying
             * buffer to the gcoSURF object.
             */
            //set_default_hardware_type();
    
            /* create a wrapper gcoSURF surface object, because we are mapping the user
             * allocated buffer pool should be gcvPOOL_USER */
            status = gcoSURF_Construct(
                    gcvNULL,
                    g_Runtime.width,
                    g_Runtime.height,
                    1,
                    gcvSURF_BITMAP,
                    g_Runtime.format,
                    gcvPOOL_USER,
                    &g_Runtime.target);
            if (status < 0) {
                sysOutput("*ERROR* Failed to create gcoSURF object");
                return gcvFALSE;
            }
            /* calculate the size of the buffer needed. Use gcoSURF_QueryFormat API to
             * format parameters descriptor - this contains information on format as
             * needed by the Vivante driver
             */
            status = gcoSURF_QueryFormat(g_Runtime.format, info);
            if (status < 0) {
                sysOutput("*ERROR* Failed to create query format info");
                return gcvFALSE;
            }
    
            /* Vivante HAL needs 16 pixel alignment in width and 4 pixel alignment in
             * height.
             */
            bpr = ((g_Runtime.width + 15) & ~15) * (info[0]->bitsPerPixel / 8);
            //size = bpr * ((g_Runtime.height + 3) && ~3);
            stride = bpr;
            
            /* set the underlying buffer */
            status = gcoSURF_SetBuffer(
                        g_Runtime.target,
                        gcvSURF_BITMAP,
                        g_Runtime.format,
                        stride,
                        vaddr,
                        phys);
            if (status < 0) {
                sysOutput("*ERROR* Failed to set buffer for gcoSURF object");
                return gcvFALSE;
            }
            
            /* set window size */
            status = gcoSURF_SetWindow(
                        g_Runtime.target, 0, 0, g_Runtime.width, g_Runtime.height);
            if (status < 0) {
                sysOutput("*ERROR* Failed to set window for gcoSURF object");
                return gcvFALSE;
            }
    
            /* lock surface */
            status = gcoSURF_Lock(g_Runtime.target, address, memory);
            if (status < 0) {
                sysOutput("*ERROR* Failed to lock gcoSURF object");
                return gcvFALSE;
            }
    
    #if gcdYINTERLACED_RENDERING
            /* Set Y inverted content flag */
            gcmONERROR(
                    gcoSURF_SetFlags(g_Runtime.target,
                        gcvSURF_FLAG_CONTENT_YINVERTED,
                        gcvTRUE));
    #endif
    
            /* Alloc shared buffer */
            /* TODO: This is for sharing across processes, shouldn't the dmabuf be
             * sufficient, do we need to call this function
             */
            status = gcoSURF_AllocShBuffer(g_Runtime.target, &shBuf);
            if (status < 0) {
                sysOutput("*ERROR* Failed to create shared gcoSURF object");
                return gcvFALSE;
            }
            gcoHAL_SetHardwareType(gcvNULL, type);
    
        }
        else
            g_Runtime.target = gcvNULL;
    
    
        g_Runtime.pe20      = gcoHAL_IsFeatureAvailable(g_Runtime.hal, gcvFEATURE_2DPE20);
    #if gcvVERSION_MAJOR >= 4
        g_Runtime.fullDFB     = gcoHAL_IsFeatureAvailable(g_Runtime.hal, gcvFEATURE_FULL_DIRECTFB);
    #else
        g_Runtime.fullDFB     = gcvFALSE;
    #endif
    
        // log chip info
        if (ChipCheck(&g_Runtime) < 0)
        {
            sysOutput("*ERROR* Check chip info failed!\n");
            return gcvFALSE;
        }
    
        // output framework cfg info
        GalOutput(GalOutputType_Log, c_szFrameworkInfo);
    
        GalOutput(GalOutputType_Log,
            "===================== Test Config =====================\n"
            "\tscreen window width : %d\n"
            "\tscreen window height: %d\n"
            "\tsurface format: %s\n"
            "\tsurface pool: %s\n"
            "=======================================================\n",
            g_Runtime.width,
            g_Runtime.height,
            GalQueryFormatStr(g_Runtime.format),
            ConvToTargetPoolStr(g_Runtime.pool));
    
        g_testObject = createTestObject(&g_Runtime);
    
        /* output test case description */
        if (g_Runtime.wholeDescription != gcvNULL)
        {
            GalOutput(GalOutputType_Log, g_Runtime.wholeDescription);
        }
    
        if (g_testObject == gcvNULL)
        {
            if (!g_Runtime.notSupport)
                sysOutput("*ERROR* Failed to create test object for %s\n", g_caseName);
            return gcvFALSE;
        }
    
        s_frameNo = g_Runtime.startFrame; /* Frame Number. */
    
        return gcvTRUE;
    }
    
    /*
     *  Name:       Finalize()
     *  Returns:    None.
     *  Parameters: None.
     *  Description:Free all resource that the framework has used. These may include the memory resource it used, and the egl system resource and so on.
     *              Here it includes "finalize the test object(case)", "free egl resource", "free library resource", "finalize output file resource" and
     *              "destroy win32 resource".
    */
    static void Finalize()
    {
        if (g_testObject != gcvNULL)
        {
            if (g_testObject->destroy != gcvNULL) g_testObject->destroy(g_testObject);
        }
    
        if (g_Runtime.wholeDescription != gcvNULL)
        {
            free(g_Runtime.wholeDescription);
        }
    
        if (g_caseDll != gcvNULL)
            sysUnloadModule(g_caseDll);
    
        if (g_Runtime.hal != gcvNULL)
        {
            gcoHAL_Commit(g_Runtime.hal, gcvTRUE);
        }
    
        if (g_Runtime.target != gcvNULL)
        {
            gceHARDWARE_TYPE type;
    
            gcoHAL_GetHardwareType(gcvNULL, &type);
            //set_default_hardware_type();
    
            gcmVERIFY_OK(gcoSURF_Unlock(g_Runtime.target, gcvNULL));
            gcmVERIFY_OK(gcoSURF_Destroy(g_Runtime.target));
            gcmVERIFY_OK(gcoHAL_Commit(gcvNULL, gcvTRUE));
    
            gcoHAL_SetHardwareType(gcvNULL, type);
    
            close_target_surface();
        }
    
    #if defined(LINUX) || defined(ANDROID)
        if (g_Internal != gcvNULL)
        {
            /* Unmap the local internal memory. */
            gcmVERIFY_OK(gcoHAL_UnmapMemory(g_Runtime.hal,
                                            g_InternalPhysical, g_InternalSize,
                                            g_Internal));
        }
    
        if (g_External != gcvNULL)
        {
            /* Unmap the local external memory. */
            gcmVERIFY_OK(gcoHAL_UnmapMemory(g_Runtime.hal,
                                            g_ExternalPhysical, g_ExternalSize,
                                            g_External));
        }
    
        if (g_Contiguous != gcvNULL)
        {
            /* Unmap the contiguous memory. */
            gcmVERIFY_OK(gcoHAL_UnmapMemory(g_Runtime.hal,
                                            g_ContiguousPhysical, g_ContiguousSize,
                                            g_Contiguous));
        }
    #endif
    
        if (g_Runtime.hal != gcvNULL)
        {
            gcoHAL_Commit(g_Runtime.hal, gcvTRUE);
            gcoHAL_Destroy(g_Runtime.hal);
        }
    
        if (g_Runtime.os != gcvNULL)
        {
            gcoOS_Destroy(g_Runtime.os);
        }
    
        GalFinalizeOutput();
    }
    
    static gctBOOL MakeSimpleCaseName(char simpleCaseName[MAX_BUFFER_SIZE + 1], char *caseName)
    {
        char *start = caseName;
        size_t len = strlen(caseName);
        assert(len < MAX_BUFFER_SIZE);
    
        memset(simpleCaseName, 0, sizeof(simpleCaseName));
    
        do {
            char *end;
            int i;
    
            start = strstr(start, PREFIX);
            if (start != '\0')
            {
                strcpy(simpleCaseName, start);
                start += sizeof(PREFIX);
            }
            else
            {
                return gcvFALSE;
            }
    
            end = strstr(simpleCaseName, SURFFIX);
            if (end != gcvNULL)
            {
                *end = '\0';
            }
    
            for (i = 0; simpleCaseName[i] != '\0'; i++)
            {
                if (!((simpleCaseName[i] >= 'a' && simpleCaseName[i] <= 'z')
                    || (simpleCaseName[i] >= 'A' && simpleCaseName[i] <= 'Z')
                    || (simpleCaseName[i] >= '0' && simpleCaseName[i] <= '9')
                    || (simpleCaseName[i] == '_')))
                {
                    break;
                }
            }
    
            if (simpleCaseName[i] == '\0')
            {
                return gcvTRUE;
            }
        } while (start);
    
        return gcvFALSE;
    }
    
    /*
     *  Name:       Run()
     *  Returns:    None.
     *  Parameters: None.
    */
    static gctBOOL Run()
    {
        do {
            char bmpFileName[MAX_BUFFER_SIZE * 2];
    
            if (g_testObject == gcvNULL || g_testObject->render == gcvNULL ||
               (g_Runtime.createTarget && g_Runtime.target == gcvNULL))
            {
                break;
            }
    
            /* Notes: Some cases use accumulated vaule by frame number inside test body.
             *        You may be not expected to get the result images by rendering only one/some frames.
             */
            if (s_frameNo+1 > g_testObject->frameCount)
            {
                GalOutput(GalOutputType_Console,
                    "Frame %d is beyend range. Total frames are %d.\n", s_frameNo, g_testObject->frameCount);
                break;
            }
    
            GalOutput(GalOutputType_Result|GalOutputType_Console,
                "Begin to render %s frame %d ...\n", g_simpleCaseName, s_frameNo);
    
            /* clear target surface to black. */
            if (g_Runtime.target != gcvNULL && g_Runtime.cleanTarget)
            {
                if(gcmIS_ERROR(Gal2DCleanSurface(g_Runtime.hal, g_Runtime.target, COLOR_ARGB8(0x00, 0x00, 0x00, 0x00))))
                {
                    break;
                }
            }
    
            /* generate bmp file name */
            sprintf(bmpFileName, "%s%s_%03d.bmp", g_bmpPath, g_simpleCaseName, s_frameNo);
            if (g_Runtime.saveTarget)
            {
                g_Runtime.saveFullName = gcvNULL;
            }
            else
            {
                g_Runtime.saveFullName = bmpFileName;
            }
    
            if (g_testObject->render(g_testObject, s_frameNo) == gcvTRUE)
            {
                /* Rendering succeed. */
                GalOutput(GalOutputType_Result|GalOutputType_Console,
                    "Rendering %s frame %d ... succeed\n", g_simpleCaseName, s_frameNo);
            }
            else
            {
                /* Failed. */
                GalOutput(GalOutputType_Result|GalOutputType_Console,
                    "Rendering %s frame %d ... failed\n", g_simpleCaseName, s_frameNo);
                break;
            }
    
            if (g_Runtime.saveTarget)
            {
                // save rendering result
                if (!GalSaveSurface2DIB(g_Runtime.target, bmpFileName))
                {
                    GalOutput(GalOutputType_Error|GalOutputType_Console,
                        "*ERROR* Failed to save bmp file: %s\n", bmpFileName);
                    break;
                }
            }
    
            /* next frame */
            s_frameNo++;
    
            return (s_frameNo < g_testObject->frameCount && (!g_UseRange || s_frameNo <= g_Runtime.endFrame));
    
        } while (gcvFALSE);
    
        GalOutput(GalOutputType_Error|GalOutputType_Console,
                        "*ERROR* Rendering failed in frame %d!!!\n", s_frameNo);
        /* stop rendering. */
        return gcvFALSE;
    }
    
    
    /*******************************************************************************
    **
    **  main
    **
    **  Test entry point.
    **
    **  INPUT:
    **
    **      Command lines.
    **
    **  OUTPUT:
    **
    **      Nothing.
    **
    **  RETURN:
    **
    **      int
    **          Exit value.
    */
    int main(int argc, char *argv[])
    {
        int i;
    
        /* Assume failure. */
        int result = -1;
    
        if (argc < 4)
        {
            sysOutput("The parameters are too less!!!");
            PrintUsage();
            return result;
        }
    
        // echo cmd line
        for (i = 0; i < argc; i++)
        {
            sysOutput("%s ", argv[i]);
            if (i == argc - 1)
                sysOutput("\n");
        }
    
        /* default arguements */
        memset(&g_Runtime, 0, sizeof(g_Runtime));
    
        /* target surface. */
        g_Runtime.target    = gcvNULL;
        g_Runtime.width   = 640;
        g_Runtime.height  = 480;
        g_Runtime.format  = gcvSURF_A8R8G8B8;
        g_Runtime.pool  = gcvPOOL_DEFAULT;
    
        g_Runtime.argc      = 0;
        g_Runtime.argv      = g_Argv2Test;
        g_Runtime.saveTarget    = gcvTRUE;
        g_Runtime.noSaveTargetNew = gcvFALSE;
        g_Runtime.cleanTarget = gcvTRUE;
        g_Runtime.createTarget = gcvTRUE;
        g_Runtime.notSupport = gcvFALSE;
        g_Runtime.startFrame = 0;
        g_Runtime.endFrame = 0;
    
        /* check command arguements */
        if (ParseArgs(argc, argv) != 0)
        {
            PrintUsage();
            return 1;
        }
    
        if (!MakeSimpleCaseName(g_simpleCaseName, g_caseName))
        {
            sysOutput("Invalid case name:%s. Should include string "PREFIX"*"SURFFIX"\n", g_caseName);
            return 2;
        }
    
        do
        {
            /* Initialize the test. */
            if (!Initialize())
            {
                if (!g_Runtime.notSupport)
                    sysOutput("Initialize test failed\n");
                else
                    sysOutput("Cannot initialize test because hw feature is not supported.\n");
                result = 0;
                break;
            }
    
            while (Run())
            {
            }
    
            result = 0;
        }
        while (gcvFALSE);
    
        /* Cleanup the test environment. */
        Finalize();
    
        return result;
    }
    
    

    Attached example file where GC320 can accept buffers allocated outside. In this example, instead of using omap_bo to allocate the buffer, use CMEM to allocate the buffer as pointed in dual-camera-demo. 

  • Hi Lee,
    Please refer PSDKLA-3753 in Post release update
    processors.wiki.ti.com/.../Processor_SDK_Linux_Automotive_Post_Release_Fixes

    This has fix for allocating Graphics buffers and omap-bo buffers in non-Tiler region.
    Please make sure for ipumm, this can not be used, buffers need to be in TIler.
    By default all GPU allocations will happen in CMA region.

    Thanks
    Ramprasad
  • Hi. Ramprasad
    your patch is PSDK LA. but, we use processor-sdk-linux-am57xx-evm-03.01.00.06 . I wonder that It's patch works well because we dont' use PSDK LA.

    also, we don't know how to use OMAP_BO_MEM_CONTIG and AP_BO_MEM_PIN at libdrm-2.4.67.

    and, we have plan that we upgrade PSDK v3.03(30-Mar-2017) from PSDK v3.01.
    If we upgrade PSDK v3.03 and apply this patch of PSDK LA(Linux Automotive), Is it works well ?
    Otherwise, When do you release PSDK applied this patch of PSDK LA(Linux Automotive) ?

    we will use PSDK v3.03(30-Mar-2017) and apply 6011.galRunTest2_drm.c in your help . we will use VPE with CMEM.
    Is it possible that 3D GPU share surface of GC320 allocated CMEM with GBM_BO_IMPORT_FD ?

    Thanks a lot.
  • Hi Lee,

    Core- Linux SDK for AMx and DRAx is common , patches should be applyable. Please try applying the meta-glsdk patches on your yocto. and build.

    If this doesn't apply ,you can try  applying these kernel patches on your 3.01

    http://review.omapzoom.org/#/c/38337

    http://review.omapzoom.org/#/c/38338

    http://review.omapzoom.org/#/c/38339 and copy SGX UM from https://git.ti.com/graphics/omap5-sgx-ddk-um-linux/commits/ti-img-sgx/1.14.3699939_k4.4 

    With only these two, you should observe all GPU allocations will be in non-TILER. Libdrm changes are trivial and only #defines are in header files , you can manually add these changes from 

    http://arago-project.org/git/projects/?p=meta-glsdk.git;a=blob;f=recipes-graphics/drm/libdrm/0001-libdrm_omap-Add-new-masks-for-memory-allocations.patch;h=46ac300ae15a6bd7bbe8360885a6225715e21c4c;hb=ea8521cde689e81f118467b1fba5acfa543bff66 

    Whenever you are allocating drm buffers with omap_bo_new() , OMAP_BO_MEM_CONTIG in the bo_flags list. This will allocate buffers in CMA region.

    We have not tested allocating drm buffers in CMA for GC320 surfaces. You can try this for VPE and is working well.

    Can you please give more details for

    >>Is it possible that 3D GPU share surface of GC320 allocated CMEM with GBM_BO_IMPORT_FD 

    Ramprasad