import h kernel
msm_fb: display: Add support to YCBYCR MDP format

Add support of MDP_YCBYCR_H2V1 interleaved YUV format to MDP
for a-family targets.

Change-Id: I5afb84a95693d1ced114152364782a10c4d56bc2
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay.c
msm: rotator: Add support to YCBYCR rotator format

Add support for MDP_YCBYCR_H2V1 interleaved YUV format in rotator
block.

Change-Id: I4bb192aaab1e72f6e5687ae222a5f9ea2c254bd4
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:
	drivers/char/msm_rotator.c
init
Merge ../m/ into s
msm: mdss: Change vsync dispatch mechanism

Notify the userspace when to read vsync instead of userspace
blocking on the vsync show event. Use a work queue to call
sysfs_notify to accomplish this.

Change-Id: I2d6ea6a6c4683cbd4c3ed9ca355546282e375194
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c
Disable Samsung MTP driver
msm: vidc: Add VP8 version set-up via Profile and Level

VP8 specification does not define level or profile concept but
specify a version. The OpenMax IL version 1.1.2 specify a single
profile and multiple levels for VP8 codec, the levels are indeed the
version numbers. The way of setting the codec version using level
field comes from the definitions at OpenMax IL. Since is a single
profile, level value is use to set-up the version but FW expects the
version value to be pass in the profile field, for that reason
incoming level is copy to FW profile.

Change-Id: I1ddc47b7a25efd1d31bed18e54c2b576427d1564
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>

Conflicts:
	include/linux/videodev2.h

Change-Id: Iab6ff5878bae312355326a9012eac0e59431aece
msm: vidc: Propagate FBD buffer offset

The offset is used to know the position of the valid data. In the past
this was not use for any codec but is essential for VPX/VP8 encoder.

Change-Id: Id0c5cef74f3ec80a0c41646a3e95d50889932f18
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
msm: vidc: Remove redundant check

Removing a check that was previously done by
get_vb_from_device_addr() call. Also modify the
buffer data check print's to provide more concise
information.

Change-Id: Idf320a5ae89bf104e1ea66192fe0ea621f39185f
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Initialize data_offset to avoid trash values

When data_offset is used by client this may get
trash values causing unexpected results.

Change-Id: Iaa7ca85f6dd81c4246580047f915cbb6327e7361
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: ensure safe deletions of session instances

Session instance should acquire lock before
cleaning up the session.

Change-Id: I0e496579794291a8115286c9550c5028c7391d55
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Fix the filled length for flushed buffers

For the buffers which are flushed internally in the driver,
the filled length should be zero. This change fixes
the same.

Change-Id: I21553c7812e2c15af14097f5562dbc8e68107506
CRs-Fixed: 513940
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
msm: vidc: add check for supported video session

Check if video session load can be handled by f/w
after session_init_done state and before moving to
load_resources state. This will ensure fallback of
unsupported video session to software codec library.

Change-Id: Ib8856a519a23c8bcab951c0e014dc5f454859efe
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Add support for dumping packets

Whenever we read and write from queues add support for logging the
packet being written or read.  As this produces heavy kmsg traffic, also
add a dynamic fallback option to use ftrace.  Output to ftrace can be
triggered by 'echo 1 > debugfs/msm_vidc/debug_output'

Change-Id: Ie221c60ab465605ede332ac7eaadfb4b26c19e01
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: Increase maximum buffer count limit

Some clients want to allocate more buffers on decoder
input port than required (mainly for performance reasons).
Video decoder should honor the client request as long as
V4L2 framework permits.

CRs-fixed: 509088
Change-Id: Ic0da1b11ca49ebcd4498f8c8d93ba5b0e2dae8ba
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
msm: vidc: Add support for ring buffer and frame assembly

Add capabilities to optimize input buffers memory usage by using a
single ring buffer and at the same time provide to firmware a
contiguous buffer to handle frame assembly internally avoiding memory
copies.

Change-Id: I37badbb86b6990c9bf47a86042290c0a1052b68c
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Return min buffer count in VIDIOC_REQBUFS.

- If stream triggers multiple port reconfigure events, number of
  buffers required for output plane incremented due to actual
  buffer count returned from video driver.
- Minbuffer count should be return when buffer requirement called.

Change-Id: I943f2cfdd595b8278058b5bdcbbcf24c9f320440
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Revert "msm: vidc: Decrease the size of decoder compressed buffer"

For some codecs like VP8 the compression is not high. So the
compressed stream length could be more than 1/4th of the size
of the uncompressed stream. This change sets the size of the
compressed stream to to half of the uncompressed stream.

This reverts commit 2d72071c8759589048094adbbdc302591532ac74.

CRs-Fixed: 525713
Change-Id: I103d862c41e9dd8c4971870c5bb82a93bd0c073b
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
msm: vidc: Add support for V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB

V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB is the V4L2 standard version
of the vendor extension V4L2_CID_MPEG_VIDC_VIDEO_CIR_MBS. Driver needs
to support both versions as some of the clients use the standard
control.

Change-Id: Ib05f75f9c8eaa64dd08a548b71d1d2387aace9aa
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>