msm8960-common: camera: enable needsEarlyVideoSize

Send video-size parameter to HAL before recording begins to ensure that
video size lines up with preview size so memory allocations line up
correctly.

Change-Id: Idf1f52a8aadaf7232bfbadb6ee6464e0ee0c7d70
Camera: Set and get proper video size key as described in the application file.

CRs-Fixed: 343259

(cherry picked from commit 98bb823f9d2171a8d9d8331bbc3aa9972598a7a5)

Change-Id: I59b8e5d28c04baf9f0b6eef512988f5f5662c505
HAL: return pretained preview buffer to surface when preview window changed or camera disconnected.

When preview is paused due to taking snapshot, preview buffer is retained.
However, if UI changes preview window or disconnect, previous preview buffer is
not valid any more, so we need to put it back. Next time when preview is
started, it will act as a clean start of preview and get preview buffer
from display.

CR-fixed: 342926

Change-Id: I45b4580fedf523264285d0179260f13127e95bc5
Camera:Preview buffer length correction in YV12 mode also.

CRs-fixed: 343289
(cherry picked from commit 0d4758953a0c925c60f5f117bef6f719daaa9de3)

Change-Id: Ifb0a39294132db806a622eafef63931eebacf3ca
Camera: Compare correct buffer size with the 4k aligned buffer size.

Preview width and height received in peview callback were incorrect,
causing mmap failures. Instead of fetching width and height in
every preview callback, stored the preview buffer size value
while preview buffer allocation.

Change-Id: I8a5387777760d0cdec514f0adec31de105956785
CRs-Fixed: 341634
HAL: fix memory leak for preview buffers

During camera hardware release, preview buffers hold during taking picture
need to return back to surface if they are not done yet.

CRs-fixed: 344896

Change-Id: I1817fb42446049276d33bf7a3fbfac80a1a9c105

Conflicts:

	QCameraHWI_Preview.cpp
Camera: Fix for ZSL/Burst mode JPEG memory leak

This change fixes the memory leaks
during ZSL/Burst mode in the omx
layer.

Change-Id: Ia6c557c7db9572cc3e6c4dabddb65c5a0bf6d189
CRs-fixed: 349015
(cherry picked from commit 17c0940805dcc3ba5840eada8a3a026c0d501136)
HAL: fix memory leak for preview buffers and add error handling

During camera hardware release, preview buffers hold during taking picture
need to return back to surface if they are not done yet.

Change-Id: I3533d43eb0aa4a9f6c0c8eb222702772eae27d1a
(cherry picked from commit 083cbdda6e88218cd7b8c4583c02ef1bae3e0bc6)
(cherry picked from commit 236c33ac4bf8ae350c4838a5168cdc2e9603d01a)
camera: Clean, write-back, cache for preview and video buffers.

Write-back preview and video buffers to main memory before they
are delivered to display and video encoder respectively.

Change-Id: I748a23a2b1ade1163d6ec09623090ad4d043a441
msm: camera: invalidate cached buffers before sending to hardware

Since the buffers are now allocated in cached mode they
need to be cache-invalidated before hardware writes new
data into them. This prevents the CPU from reading stale data
from the cache. Also, if hardware reads a CPU modified buffer, the
data needs to be cache-cleaned or written back before hardware
reads from it. An example here is gemini reading a post-processed
buffer for JPEG encoding.

Change-Id: I8b4598f7984b8292bcc7ed1cc8d7ac03dd7365a8
Merge remote-tracking branch 'upstream/cm-10.1' into cm-10.1