vidc: Adjust core timeout based on current core frequency.

Core timeout value is calculated based on the current core
clock rate during video play back.

Change-Id: I52f38560eda71dd0eaf208da68b4c3f74955661b
CRs-fixed: 354069
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>

Conflicts:

	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker_api.h

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

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.h
vidc:1080p: Set video core timeout value for Thumbnail mode

Video core timeout value is set only for thumbnail mode.
For normal playback senario default value is set.

CRs-fixed: 367222
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
(cherry picked from commit 740d5ad28484b42ae675721a66a1bd93081712c8)
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Change-Id: I32ee573b21fd79d44d578a773294ba9973f1c00d
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm_fb: display: remove mixer1 waiting4vsync when staging down the pipe

dtv_pipe is the base layer pipe for mixer1. Waiting for vsync when
staging down this pipe (it happens when we unplug HDMI cable) causes
mixer1 under run because at the vsync moment dtv_pipe is disconnected
to mixer1.

CRs-fixed: 349765, 355110
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit b2bdae8ee4262a4e1d8e8e7f9c91b80790bdff27)

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

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: kgsl: Write the retired timestamp on resume

Write the retired timestamp into the expected location. This fixes
userspace crashes after resume when the retired timestamp is read
as 0 instead of the expected last timestamp.

CRs-Fixed: 350556
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
(cherry picked from commit 68dba7b544a9f2351d61dff7f7c47aaff96d0413)

Change-Id: Ib44eb3c48f642d3b3b219f3ce666175472f03196
Signed-off-by: Zhoulu <zluo@codeaurora.org>
msm: kgsl: Only return tlb flush flag if bit is set for given device.

We should only return the tlb flush flag if the bit corresponding
to the given device is set in the tlb flags. Earlier we were returning
the flush flag always if the tlb flags had the flush bit set for any
device.

Change-Id: Ia598694b295e650ce97dde83ccd89c99e5811d06
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit dfbdeaed6c088e402dc3b5eeeaea8b5835dcd48e)
video: msm: wfd: Make logs clearer

The normal log printed after a successful stream_off is too scary.
Amended the log to be more accurate.

Change-Id: I0ee6cc2b15bf0cdfb77026ea5c6adece32a91ad7
CRs-Fixed: 358796
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit b3280be7a418e5a6923cacfae4079a9fc9bda376)
(cherry picked from commit 34b15e8a3cf127ff4b6d1dedfde96c727305cf81)
msm: vidc: Fixes bug in handling duplicate frames.

Fixes bug while closing encoder which supports
duplicate input frames. This fix decrements
the reference count of original frames
appropriately.

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

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

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
base: genlock: protect kref counting with spinlock

A race condition exists where the attach may not kref_get
before the kref_put finished. The genlock_file_lock was
originally added to protect against this case however it
was not protecting the kref.

CRs-fixed: 359649
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
(cherry picked from commit d6f534fc51eb5fc23d08dacceecd42a4b98747a6)

Change-Id: I4115ea1cc39ebe38ad0032ebf86871ac9d23a312
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
(cherry picked from commit 295371180c3c46c0078ad247a53e1c8364aeee1b)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>

Conflicts:

	drivers/base/genlock.c