libfimg: Optimize packAttribute() for small copies

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
libfimg: Add private optimized copy of memcpy

Apparently at least Debian has an issue with memcpy performing poorly on
ARMv6-based S3C6410 (in comparison to kernel memcpy), so to improve
things this patch imports kernel memcpy into the project. Perf shows
about 30% less time spent in memcpy(), so performance gain is
significant.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
libfimg: host_template: Fix wrong copy stride

In case of sequential copies, when no packing was necessary, wrong copy
size could be calculated in some cases, because attribute width was used
instead of stride.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
libfimg: Batch requests in ring buffer

To minimize the number of context switches and allow more
parallelization, this patch changes the library to batch requests in a
ring buffer.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
libfimg: Batch draw requests

Instead of flushing all requests it is more reasonable to batch multiple
partial draw requests together to minimize context switches and improve
throughput. Currently requests are flushed every 8 draw requests and
after last draw request, but some heuristic based on number of vertices
per request might lead to even better performance.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>