msm_fb: Increase base fence timeout

The earlier value of 1 second caused unnecessary warnings on
heavy workloads by the GPU.

Change-Id: Ib4a5b098267251d5c63c4d8d2a2f51b339acc1d2
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: msm_fb: Add range checks for fb cmap.

Add appropriate range checks to ensure valid access
through framebuffer cmap. This prevents illegal
access into memory.

Change-Id: I9e82a27a2d12f31d8150ea577514576824f8b1f5
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm_fb: Set RR sched policy for Glupdator thread

Set Round Robin Scheduling policy for GLUpdator
thread to improve performance.

Change-Id: I637ca364d325d6c847c73e8eec403e76094d93c5
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: msm_fb: remove mmio access through mmap

Disable access to mm io and add
appropriate range checks to ensure valid accesses
through framebuffer mmap. This prevents illegal
access into memory.

CRs-Fixed: 474706
Change-Id: If25166f2732433ef967e99c716440030b567aae9
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
sync: don't log wait timeouts when timeout = 0

Change-Id: If7542002e10da886af7e7cbc06a0abf023c15893
Signed-off-by: Erik Gilling <konkers@android.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
sync: fix timeout = 0 wait behavior

Change-Id: I8b9254e92c26d9f44abbc0c77fb44624de947013
Signed-off-by: Jamie Gennis <jgennis@google.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm:board-8064: Correct ab/ib values of 1080p turbo vectors

This change corrects the ab/ib values of turbo vectors
intended for 1080p encoder.

CRs-Fixed: 473197

Change-Id: I172b241e7b8b7b2d8600647ac35af78ed928e052
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
defconfig: add aokp defconfig
touchscreen: allow changing fw flash support at compile time
USB: ks_bridge: add compatibility flag for old device names switchable on compile time
defconfig: enable input mediator
msm: cpufreq: when breaking out early set return value to good
msm: display: vsync usage in turning off dsi video

Add timeout to waiting for vsync so that it can come out
when vsync interrupt is not working.
Need not wait for vsync after timing engine is off.

CRs-Fixed: 458419

Change-Id: Ib989e435405613d891024ba15144723730454e34
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
msm_fb: display: fix iommu page fault when iommu buffer freed

There has possibility that pipe commit come very close to next vsync.
This may cause two consecutive pipe_commits happen within same vsync
period which cause iommu page fault when previous iommu buffer is
freed since mdp stil fetching it. Set ION_IOMMU_UNMAP_DELAYED flag
at ion_map_iommu() to add delay un mapping iommu buffer to fix this problem.
Otherwise four buffer mechanism is needed to avoid this problem..
Also ion_unmap_iommu() may take long time to free an ion buffer. Move
mdp4_overlay_iommu_unmap_freelist(mixer) called after stage_commit()
to increase chance to have pipe_commit (up to stage_commit) is completed
within same vsync period
This patch also fix an potential race condition at wait_for_completion
between show_event thread and wait4vsync thread.

Change-Id: I089950ac61c0bd3c4207b8925817577e42fbb258
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: display: Fix composition issues when framework rebooted in suspend.

Currently, if framework is rebooted while in suspend mode, borderfill
is not unset due to which MDP composition can not be enabled. This patch
fixes the issue.

Change-Id: I8b671eccedebf2bb08724cf2d284d4ab27a71360
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm_fb: display: add one more pipe_commit delay before free ion buffer

It is possible that two consective pipe_commits happen within
same vsync period.  This will cause iommu page fault due to an ion buffer
that is being fetched by mdp's pipe is freed. It needs one pipe_commit
delay to free ion buffer to prevent iommu page from happening. Therefore
an extra free stage is needed to empty ion buffer free list.
Also, ION_IOMMU_UNMAP_DELAYED flag is not necessary at mapping of an
ion buffer since one pipe_commit delay had been added.

Change-Id: I340e002e8dc30b6faa0c095ba042eab50e8b7c88
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix the suspend/resume hang caused by wait4vsync stuck

wait_for_completion in wait4vsync stucks after multiple suspend/resume
tests. The cause is that when show_event timeout happens, or vsync isr
is disabled for long time, wait_vsync_cnt resets to zero, and in vsync
isr complete_all has no chance to be called which caused mdp hang. So
complete_all needs to be called whenever show_event has timeouts.

Change-Id: I124899ff95fd5550d2759d215f16fa9cb8c0c211
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: issue completion when disabling vsync irq

When vsync irq is disabled, vsync_wait_cnt is reset to zero and
completion is issued out as they are done in isr to make sure all
wait_for_completion is released.

Change-Id: I689f0c8cde43404d0caf5bb4644efa6385798d0e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
mms_fb: display: init pipe default configure as solidfill

Initialize mdp pipes default config as solid fill so that
there will have no memory fetch if pipe are staged into
mixer while flush bits are left behind and set at next vsync.
This is will prevent mdp iommu page fault from happening
at address 0x00000000 during resume.

Change-Id: Ide944ec1d069629f1ae2ecd0daf49c69ce2af2eb
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: Do a pre-fill to writeback buffers.

When switching mdp operating mode to blt, writeback buffers need
pre-fill. Move the pre-fill code from isr routine to do_blt, where
actual switch to blt mode happens.

CRs-fixed: 471098
Change-Id: I0f845397894c749ac518a1fa605f84cd5fc2ad15
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>