Revert "vidc: 1080p : Add support for slice delivery mode to encoder"

This reverts commit ba6554ece73d515328f67fe2076fd38a1824299c.
video: msm: wfd: Delete from free_queue before freeing memory

VSG has a stale pointer to deallocated memory that is accessed, causing
a page fault.

Change-Id: I036293950795f601c0592c39b6da20d3c0cbb77f
CRs-Fixed: 348977
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
(cherry picked from commit c73f497b1ce2d267c1b9b5b272f625b406ab36b2)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm_fb: hdmi: Disable 1.1_FEATURE

Some displays support Enhanced Link Verfications(1.1_FEATURE)
which makes HDMI Tx to verify Pj on every 16th frame. Three
consecutive Pj mismatch will result in HDCP authentication
failure. If 1.1_FEATURE is supported(this can be detected by
reading BCAPS), it needs to be enabled by writing into AInfo
of display. Default is disbaled.
This change sets HDMI Tx core to disable 1.1_FEATURE by
default so that we don't see Pj mismatch error unless the
feature is enabled.

CRs-fixed: 348752
Change-Id: I996f60b852a7e867e8e13e700beecbac8190a59e
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit 97e2fcf862d913feff157f536ee14cfc5f3197f7)
(cherry picked from commit 88cb4da47697fe407b013554678ec68d7c8ab93c)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
video: msm: wfd: Reduce first frame latency in CFR mode

When we get the first frame, push it immediately to the encoder rather
than waiting for the timer to expire.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit 47ef81ffe4ffd35db48a0a8795697a910378664a)

Change-Id: If7f85e747646a5022b416d1189d5d55d16b19343
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit bf844198db86317b2e73c98dab5b2f85f08f7555)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: kgsl: Allocate physical pages instead of using vmalloc

Replace vmalloc allocation with physical page allocation. For most
allocations we do not need a kernel virual address. vmalloc uses up
the kernel virtual address space. By replacing vmalloc with physical
page alloction and mapping that allocation to kernel space only
when it is required prevents the kgsl driver from using unnecessary
vmalloc virtual space.

CRs-Fixed: 346921

Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
(cherry picked from commit 8cb835b656ae2c3faa79af4f374563d344b46d4a)

Conflicts:

	drivers/gpu/msm/kgsl_sharedmem.c

Change-Id: I88e1eb282cc4822970811728d00b1096188f64e9
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit d5fa912f599a71223496d2ff97ecd5040b95baaf)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm:kgsl: set state as requested state when in NAP

Fix the state to requested state so that when both ISR and
timer fire at the same time, the state is set as SLEEP

CRs-Fixed: 340484
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
(cherry picked from commit 9b6110bb38c7acf61e065ec206b62b1e1f089908)

Change-Id: Ie625aba09feddf495647be2844dc0a4014605141
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit 7704bbd086590ef68aa30530c0ea18dc7f379780)

Conflicts:

	drivers/gpu/msm/kgsl_pwrctrl.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: vidc: Adds API to request performance level.

Adds API to request for a particular performance
level from video core. This is needed for Wi-fi
display (WFD) to reduce end to end latency.

Change-Id: Ib4133b8cd62ccad286be1984f944911754b887c5
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
(cherry picked from commit 3c51cb669e9ca03773444f69aa9c7fb6131cb726)

Conflicts:

	drivers/media/video/msm/wfd/enc-subdev.c
	drivers/video/msm/vidc/common/vcd/vcd_client_sm.c
	include/media/msm/vcd_property.h

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: kgsl: flush outer cache for alloc_page() pages

The outer cache needs to be flushed for these pages
after they are allocated so that the GPU and CPU
have a consistent view of them.

CRs-Fixed: 346921
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
(cherry picked from commit 7018a21bf2b52f1296557d1f6ec9ed64e9169de7)

Change-Id: Id5c11ab8d856fc270330fd3258baa51b8efca192
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit a240fca76b5562d3ca53677151213286306bbc96)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: vidc: Use pre-computed frame delta values in WFD use case

In WFD use case with frame skipping enabled, we wish to fool the core
into thinking that that the frames are coming at a consistent rate so
that we don't run into any issues with the core's rate control
mechanism.

The following change introduces a property that the client may set that
dictates what the timestamp delta between any two frames might be.

Change-Id: Iea3f97879227b7932543d3449d311758dc4a2f59
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
(cherry picked from commit 806e8d1cf43de34ad38181a227bbcebb64a5fd9e)
msm: kgsl: call sysfs_notify when a hang snapshot is made

/sys/class/kgsl/kgsl-3d0/snapshot/timestamp will have sysfs_notify()
called when a hang happens, so that a userspace process can
poll(2) on this file to detect a hang.

CRs-Fixed: 354385
Change-Id: I0a3c8fcbe3fb09256bcd12f6e63c107536734485
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
(cherry picked from commit 90812c8eac42b5ce7bb48e35897537021e01e6de)
(cherry picked from commit 15456a25c55409ee3032c4e083d232a3d3aedf6e)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
vidc: send flush done if flush is issued in EoS while encoding

There is a race condition in encoder, when an input buffer
is received with an EoS flag but doesn't have an output
buffer to process that and if simultaneously flush is issued.
This is fixed by sending flush done if flush is issued in EoS.

CRs-Fixed: 353081
Change-Id: I925f49779ed5cb91bfab805ba4b7102c1e3f728b
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
base: genlock: allow synchronization with a single gralloc handle

In order to support synchronization in a process with a single
gralloc handle we require the ability to write lock a buffer
while it is already read locked by the same handle. This change
extends the concept of an exclusive write lock or recursive read
locks to a genlock handle (rather than the genlock lock).
Genlock cannot provide deadlock protection because the same
handle can be used simultaneously by a producer and consumer.
In practice an error will still be generated when the timeout
expires.

CRs-fixed: 356263
Change-Id: I322e7fadc8b43287f53b211242b176d3de731db2
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:

	drivers/base/genlock.c