Process the freeBufID array even when an error occurs

At least the Ducati MPEG2 decoder may set buffers to be
unlocked when it returns an error, so change libdce to
always forward these buffers to the kernel.

Trying with VC1 or H264 videos seems to work fine so far.
ducati: get rid of un-needed #include

we don't depend on resmgr... cleaning up..

Signed-off-by: Nicolas Dechesne <n-dechesne@ti.com>
Expose more APIs in the ih264enc.h header
PM: moving ivahd_boot() back to ivahd_init()

On the kernel side, the IVAHD is enabled in HW_AUTO when the omapdce module is
loaded, so the ivahd_boot() needs to be called only once during connect()
Revert "PM: implementing PM on DCE side"

This reverts commit ff8487cb15d5042137dd6715e34c749c72ce3e72.
Get rid of UP core0 stuff

We do not support UP any more, only SMP (ipu).

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Increase systemHeap size

This is necessary to decode more streams in parallel.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Add .version

We add a .version section in the base image at link time, thanks to the new
version module.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Import PSI KPI profiler code

Imported PSI KPI profiler code from ducati MM commit
2641be42718183b6cec9a79806ce63232b1920a9, untouched.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Update PSI KPI profiler

Updated version received from Philippe Lafon, using the internal timer instead
of the 32k to reduce profiling overhead. See
https://gerrit.ext.ti.com/gerrit/omap/#change,8766:

  [Tool] Faster instrumentation less intrusive

  The instrumentation is accelerated (~2x) using the CTM timer + code optimization for the ducati load measure
  If number of tasks > 64 the instrumentation now groups add all others into a "OTHERS" so that there is no limitation
  OMX now allows multi instances indexing (was needed for several instances of the same component)
  the 32K now uses the official API Tools_Time_get32k() (dependency: Iae1836f1af11f39cbe5b3fb9a0f9e439b4cfa1f9)
  the 32K no sleep fix is removed from here since done in PM (dependency : I599363f465bde1bc8fd60c44722678f25e99cda7)
  Needed for both OMAP5 and OMAP4

  Change-Id: I5e245bf5e6dc6da4630c4c4536c9aad72c71d370
  Signed-off-by: Philippe Lafon <p-lafon@ti.com>

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Integrate PSI KPI profiler (v2)

This is a quick integration of the PSI KPI profiler into the DCE image.

We track create/delete to support more than one DCE stream running with correct
profiling.

Remainings things:

- Do not hardcode KPI_PROFILER but let the build "recipe" decide.
- Make the create/delete refcnt work with other codec "clients" than DCE, too.
- Fix profile.h include path; today this breaks DCE "modularity".
- Dynamic enable/disable (print phy addr of kpi_control and let the user poke?)
  At least do not touch from dce.c
- Do not hardcode BUILD_FOR_OMAP5 and BUILD_FOR_SMP.
- Determine OMAP4/5 at runtime and get the correct 32k timer address, allowing
  a single OMAP4/5 f/w binary; or, alternatively, use the original routine from
  tools.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
Report KPI IVA & cores loads in load_task (v2)

We hack PSI KPI profiler a bit, to be able to read the IVA & cores total times
"live" and do our computations. We protect the cores statistical data
collection with a GateAll for consistency. Note that each core has his timer
now.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
load_task: alternate BIOS way

Load_getCPULoad() is broken in SMP; use alternate method received from Alan
Karl.

Signed-off-by: Vincent Stehlé <v-stehle@ti.com>