vidc: Add extra cases for error handling in vidc init

Currently error conditions are not handled properly
if failures occur during irq request or while creating
work queue. With this commit these error conditions
are properly handled.

Change-Id: I618ca5c2a4f6bd09a3edd164a7867a90a9ed9f9a
CRs-Fixed: 355753
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
(cherry picked from commit c9a9332a743459e44744e630f3e734e7788c477d)
(cherry picked from commit efb9b72a643d6e499e5e5b94c5cc1fe32b652851)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
video: msm: wfd: Don't signal HDMIDaemon to mirror on FB1

Remove obsolete code that signalled HDMIDaemon to mirror the
display on FB1.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
CRs-Fixed: 352830
(cherry picked from commit 4102d704243cf0ff297cdbe8d5b731da4c0bb9d5)

Change-Id: I07fabb754a49fe398813e864067f96c66a47f489
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: vidc: Metadata memory release issue.

Metadata memory is not freed when there is
memory allocation failure in ddl open. Fixed
this issue by freeing the metadata memory.

CRs-Fixed: 353109
Change-Id: I3f6fd93498aea0ce78092bd3a28cf08625b0ca77
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
(cherry picked from commit af296715bd5db6c38997d1171d079331c8650287)
(cherry picked from commit 572e147402717bb0c77ecc807659d05a617e370f)
msm: video: wfd: Fix array out of bounds and stale pointer issue

The following change fixes two issues.  The first being a stale pointer
in which the driver accesses memory that has already been freed.  The
second is an array out of bounds bug, where the venc-subdev iterates
VIDC_MAX_NUM_CLIENTS-times over an array whose size is only
VID_ENC_MAX_ENCODER_CLIENTS.

Change-Id: I35de18fd042181d9358f534908bb785dea630294
CRs-Fixed: 350398
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit a6bde8d3a940446a3dae1124ab60c616938b9c52)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:

	drivers/media/video/msm/wfd/wfd-ioctl.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: video: wfd: Disable multiple clients for wfd capture device

Explicitly check to see if the device is in use before allowing client
to open either of the wfd capture devices.

Change-Id: I70bd275c5e0f058b7905abe7b7639342d07fe0e2
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
CRs-Fixed: 350398
(cherry picked from commit d22c43a3a2b0448e5cba25950ece2ad3e90e9ec8)

Conflicts:

	drivers/media/video/msm/wfd/wfd-ioctl.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:

	drivers/media/video/msm/wfd/wfd-ioctl.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
vidc: Check for proper buffer handle before free.

Check for proper buffer handle and client handle
before unmapping and freeing the buffer.

CRs-Fixed: 351100
Change-Id: I88f5e142839f12cc19360dbe26a8d4e6a7ec99de
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
(cherry picked from commit 974a96c1634659213f7d226fa5092398ddd46398)
(cherry picked from commit 222e467f121840d69ff2701682bc7ece7420a502)

Conflicts:

	drivers/video/msm/vidc/common/dec/vdec.c
	drivers/video/msm/vidc/common/init/vidc_init.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
(cherry picked from commit a46d7d966ce99a55a5806f48de50d407c1dbb77a)