Vidc: Treat Non-IDR frame type error as bit stream error

Hardware error is being generated from driver when video
core returns NON IDR frame type error during thumbnail
decoding. This change handles this error by treating
it as BIT_STREAM_ERR.

Change-Id: I16a19eea679d42a22b336d6ebbd0bd1f57c0a8a4
CRs-fixed: 414858
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
video: msm: Increase video encoding output buffer size

When bistream buffer size is half of YUV buffer size, video core
may be put into a bad state where output buffers are not returned
back to user space. Increasing the output buffer size solves the issue.

Change-Id: Ide94e5ef039a0a38e91464acf60534468888de18
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
msm: vidc: Remove kernel mapping on input/output buffers

This change will remove the kernel mapping of input and
output buffers for both video encoder and decoder to
avoid the errors resulting from ion_map_kernel() for
high resolution video concurrency use cases due to the
limited vmalloc space. It also removed the metadata
processing in kerner video driver as kernel virtual
address is removed. The metadata processing can be
done in user space video component.

Change-Id: I3f2c9b7c13b3e09097ce07ca7b59154b97401052
CRs-fixed: 471135
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
vidc: Fix EOS handling if video h/w has a frame in transaction

In case of video hardware is encoding a frame and EOS buffer with
with zero data length arrived, set the EOS flag to the transaction
available in the transaction table which will be passed to the
client in frame done callback from the video hardware.

Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
msm: vidc: Add LTR feature for H264 encoder

This change adds Long Term Reference picture
selection feature for H264 video encoder.

Change-Id: Ida957df244d8715c955afe8d809708123a94e999
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: Add support for NV21 color format encoding

This change adds NV21 color format encoding support.

CRs-fixed: 448511
Change-Id: If26f1241a006e2d325668b8e189f6ff76df8e125
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: Fix klocwork error

This change fixes the klocwork errors

Change-Id: I73a6ed0e568e98a51c8e095b824a783f91ce6657
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: Reduce priority of unwanted logs

Change reduces the priority of unwanted logs
which are coming in kernel logs by default
in video driver. Now these logs will come
only when enabled.

Change-Id: I18a534c7aaf8a2819be1b8812fad9e0710c49bd3
CRs-fixed: 454273
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: Fix various NULL pointer accesses, memory leaks.

This commit fixes various NULL pointer and memory leak bugs.

Change-Id: I3b3ac40b5e440b9665858913921a06de14741b6f
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
msm: vidc: port heap mask change to ion for secure session

Changes to pass ION_SECURE in the correct argument field
while calling ion_alloc. Without this change secure session
fails.

Change-Id: Ifa4878b1c312beafc735cb649570913159799d7c
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
vidc: Add secure node support for encoder.

Encoder driver will expose a new node for clients
intending to start a secure encoding session.

Change-Id: I2a104155fd19534a3b3b35e6606d39047f34c42f
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
vidc: Correct start and stop sequence.

Video core stop should be called only if start is successful.

Change-Id: Ie2a8d970355387ee3fcdc34b62184972e89dd6cc
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: vidc: Fix iommu pagefault in concurrent scenario

IOMMU pagefault is seen while running decoder and
encoder concurrently for specific codec combination.
Map double the buffer size to ion_map_iommu() API for
encoder reconstruction buffers to avoid the pagefault.

Change-Id: Ib5546a42a75c4c628767310f1a291e7ed443056c
CRs-fixed: 450621
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: fix buffer pool index

While searching for the available buffer entry in the buffer pool the search
should begin from index 1 as zeroth entry is reserved.

Change-Id: I051b0232bb782f073ba9ad0b757a799703814df3
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
vidc: handle secure and non-secure session concurrency

Non-secure session should be rejected if a secure session is
running.

Change-Id: I13364a7bc4417a682728be333681278e7de8a1f7
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
msm: vidc: Add free buffer api to flush state

This change adds free buffer api to video
client's flushing state to allow buffer
freeing in flush state.

CRs-fixed: 430214
Change-Id: I970efbbd8cc503eab4b944e12630f1b1faa9069c
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: Don't free shared memory on channel close

The driver already frees the memory in vcd_ddl.c at ddl_close().  No
need to prematurely free the memory here.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: Reset stop_called state when START is called

The driver needs to reset the stop_called field once START called.
Otherwise in START, STOP, START, STOP sequences the secondary STOP will
be treated as a duplicate STOP and ignored.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
vidc: close instance if securing session fails.

Video driver will close the instance if secure call fails.

Change-Id: I39147272a9183f011529078fe8a18ac8cb2726fd
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Merge branch 'cm-10.2' into martincz