msm: vidc: Squash upstream changes

msm: vidc: Add support for setting initial qp

Adds support to set initial qp, thereby allowing the client to set
initial qp for I,P, and B frames.

Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

msm: vidc: Amend calculation of buffer sizes in VENUS_BUFFER_SIZE

Add 8KB worth of padding for extradata. This is required to accommodate
some of the larger extradata types that didn't fit into the residual
space between the actual buffer size and its aligned size.

CRs-Fixed: 647378
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

msm: vidc: Expose extradata size to userspace

Previously, the extradata size was included within VENUS_BUFFER_SIZE
and callers (primarily in userspace) wouldn't know how much extra
padding was added to the buffer size. Exposing it allows userspace to
query directly instead of doing guesswork.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

msm: vidc: Add AFD and CC metadata support to extradata

Add support and control for setting Active format
description and closed caption meta data in the
extradata. FW parses metadata and adds it to the
extradata. Client can use control to parse extradata
for the metadata information.

Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>

msm: vidc: Add support for different errors

When hardware is overloaded or when max number of clients are
reached in driver or firmware, hardware error is sent to video
client. This change is to replace hardware error with actual
errors.

CRs-fixed: 575852
Signed-off-by: Deepak Verma <dverma@codeaurora.org>

msm: vidc: Change in input buffer size calculation

Right now, input buffer size is calculated based on
maximum supported height and width returned from FW.
These values are not true representation as they are
calculated for rotation usecase. Driver needs to use
max MB supported from FW. This change fixes the same.

CRs-Fixed: 599818
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>

msm: vidc: add new control for limiting i/p buffer size

Take the minimum of the size calculated by driver using
max width and height supported and the size set by client
for input buffers. Change interface to get input and
output buffer sizes.

Change-Id: I4875267bef9a7d5f3771724f66f5f792ad0b165f
Merge "msm: vidc: Squash upstream changes" into lollipop