msm: vidc: Register device with clock driver and rename clocks

Rename the clocks per the new naming convention under which
similarly named clocks are distinguish between using their
associated device's name and ID.

Change-Id: I807b6c46ec78bd4eb54d36e0f8a57a5c314ad46c
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/clock-7x30.c
	arch/arm/mach-msm/clock-8960.c
msm: vidc: Preventing dereference pointers and array
out of bounds

Preventing a dereference pointer, and adding logic to prevent
array out of bounds

Change-Id: I8b21e4cb25a3dbb13c907d84c7ea342a12eed468
Signed-off-by: Eduardo Carrasco <cecarras@codeaurora.org>
msm: vidc: 7x30: Fix device argument of clk_get() for mem_clk

A NULL device pointer will cause clk_get() to fail.  Fix it.

Change-Id: Iac42c467e1c9ed6ee30996d550ae24b231792a40
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
vidc: Map userspace allocated buffers into video smmu.

Buffers allocated in userspace are registered with
video driver for video core to use them. Video driver
uses the msm mapped buffer API's to get the device
address for those buffers. This address is then passed
on to video core.

Change-Id: I33dae3c90feb6c320cf0d422adf17b14eee03625
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
vidc: 720p: Set DB line buffers in case of reconfig

In the case of multi resolution H263 clip, there is
no response from the core. With fixes in video f/w,
there is a problem in reconfig. Fixed by setting the
DB line buffers to the core again in the case of
reconfiguration.

Change-Id: Iab3402d76ee904568c684ecdcc36f19b417aaa42
CRs-Fixed: 303874
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
msm: vidc: print message as kernel info instead of error

both decoder and encoder uses same driver structure and
720p/1080p core base addresses, so the below log message
is not an error message. hence making it as kernel info
meesage intead of error message.
Log message: Device config mismatch

CRs-fixed: 316470
Change-Id: Ib0f070eb44217961639d8326409f18f8a3600f19
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
vidc: Add ION support for Decoder and Encoder.

If ION is enabled in the platform, then use the ION api's
to allocate memory, to get the virtual address and physical
address for decoder and  encoder.

Change-Id: I6372d14914de3a8f589fbcf45ffcee211fe563e3
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
msm: vidc: enable thumbnail mode with single output buffer

Generate thumbnails using 720p core with single video decoder
output buffer.

Change-Id: I51453f240ab38abd5326df96ea407981c6806f6b
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
vidc: vdec: Pass alignment flag to mapping api's.

Mapping api by default assumes 4K alignment.
Video core requires output buffer to be aligned
to 8K.This change will pass aligment information to
the mapper API.

Change-Id: Iea630649476946614dfdbdf5150d97cf46a0ba42
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
vidc: Select board specific memory heap id.

Allocates ION memory from the heap id specified
in the board file.

Change-Id: If701972a632fa336c6447e95b79484739593f1da
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/devices-8960.c
vidc: 1080p: Override profile to ASP for XVid/Divx456

Always set profile to ASP for XVid/Divx456 apart from
MPEG-4. Core will ignore the profile information from
the sequence header and continue to decode with profile
set by driver.

Change-Id: Ided0fe74ace8c78e28dfc68ba172cce024015e47
CRs-fixed: 319168
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
msm: vidc: Fix handling EOS with bitstream error.

If the EOS frame has codec config flag set and decoder
return status is bitstream error, then driver was
handling EOS done before the core returned with EOS done.

Fixed by adding a check in the driver to not handle EOS done
until the core returns with EOS done.

CRs-Fixed: 320107
Change-Id: If2c6dc67e5d8e7df54b17443c753f0325b6f5175
Signed-off-by: Deepika Pepakayala <deepikap@codeaurora.org>
vidc: Make more pr_info()s into pr_debug()s

The logging messages in the vdec driver are for debug purposes.
Replace the info printks with debug printks. If desired they can
be turned on individually via

 # mount -t debugfs none /sys/kernel/debug
 # echo -n "file vdec.c +p" > /sys/kernel/debug/dynamic_debug/control

Finer based prints can be done on a line by line basis as well.

Change-Id: I5b6f94e13724036d02c25d1d478d25ca2555dfa2
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
vidc: Add metabuffer mode support for encoder driver.

Video encoder driver when configured in meta buffer mode,
will allow clients to register buffers in data path.

Change-Id: I23e2cb07386461275da5731134d8aad7df1cd060
Signed-off-by: Gopikrishnaiah Anandan <gopikr@codeaurora.org>
msm: vidc: Driver changes to disable demux in core decoder.

Added the following driver changes to support demux
disabling in video core.

	- IOCTLs to check if feature can be enabled.
	- set/get feature properties
	- descriptor buffer handling
	- HAL changes to enable/disable feature in
          video core
	- Resource tracker changes

Change-Id: I86cf4c959175aba954339fff9f78dae6b5be740c
Signed-off-by: Deepika Pepakayala <deepikap@codeaurora.org>
vidc: Add metabuffer mode support for 720p encoder driver

Added 720p core video encoder driver changes, this change
depends-on 93816, which allows clients to register buffers
in data path in meta buffer mode.

Change-Id: I41f74ceabe348de37763d9728090238d71a786bd
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
vidc: Add video driver support for h264 level 3.2

Add video encoding support for h264 level 3.2
in video encoder.

Change-Id: I0d661cceace46e5059538ae348fa3b3e60a9f62f
CRs-fixed: 313116

Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
vidc: Check for return value of ion alloc.

Check for the proper retrun value of ion alloc
using the macros.

Change-Id: I01dec7391807e7811f677c9c475c714135b88749
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
vidc: fix for memset crash.

Check if the luma size is less that or equal to frame size
and then do the memset else return error.

Change-Id: I975ece55437499efe8988c06d367a33bdd8ff6b6
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
vidc: remove klocwork warnings

Changes made to remove klocwork warnings
in vidc.

CRs-Fixed: 314450

Change-Id: Ia239c93f078d1f9312092e8672b354bc9f849646
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>