video: msm: wfd: Encode frames asynchronously

The sequence of unlocking, encoding, and locking again was dangerous
since it is unpredictable when the lock can be reacquired in the input
thread. In most cases, this was fine as the encoder took long enough to
return buffers back to VSG that we were able to re-acquire the lock.
However, in cases that encoder is faster than expected, VSG receives an
EBD call back before the input thread can reacquire the lock and put the
encoded buffer into the busy queue. This causes the output thread to
complain about unexpected buffers and drop the frame, which eventually
causes 100% frame drop.

CRs-Fixed: 339432
Change-Id: I29731cfb4a51ffc8f362426d570482ad7f6394b6
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2 files changed