vidc: fixes squashed from caf

* vidc: Send port reconfiguration for interlaced clips.

Component is not getting port reconfiguration request
from driver for an interlaced clip. Fix it by
modifying the condition for triggering the
reconfiguration request.

CRs-Fixed: 352456
Change-Id: I65ce5987f31915f45a13767965918b61e32db7a7
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
(cherry picked from commit c264eed)
Signed-off-by: Darescu Ionut <johnny@esi.ro>

* vidc: Free shared memory when video core is in error.

When the video core is in error, the core times out.
At this instant, all the client buffers are freed,
but the shared memory is not freed. Free the shared
memory in this case.

CRs-Fixed: 357990
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
(cherry picked from commit 17ca368)

Change-Id: I7695d4b101d8b769276a73100de9cb2495d1ccb9
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
framebuffer: Align framebuffers to 4k page boundary

Change-Id: I6bd382993dd2601a70ffb417a95aba96df736ff3
mdp4 overlay: fixes, squashed, solid fill underrun, formats

* msm_fb: display: fix underrun seen due to scaling accuracy

When making scale phase step ratio calculation, accuracy is lost when
sizes are big since calculation is done in 32 bit and some truncation
happens; this leads to underrun in mdp hw since scaling ratio doesn't
match the src/dst rectangle. Increase accuracy by performing division
again on remainder and appending to lsb of ratio.

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit 1af8a35)

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

* mdp4 overlay additional pixel formats introduced to handling

* msm_fb: display: disable mdp flip when enabling mdp solid fill

If both solid fill and flip mode are enabled, MDP underruns. So for
any pipe, if solid fill bit is set, flip operation modes including
left/right or/and up/done are disabled.

CRs-fixed: 334782
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit 917ed68)

Change-Id: I479285e5036b05b1997e66592fe178803ad990ee
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>

* msm_fb: display: disable mdp flip when enabling mdp solid fill

If both solid fill and flip mode are enabled, MDP underruns. So for
any pipe, if solid fill bit is set, flip operation modes including
left/right or/and up/done are disabled.

CRs-fixed: 334782
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit 917ed68)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
Change-Id: I479285e5036b05b1997e66592fe178803ad990ee
cpufreq: interactive: handle errors from cpufreq_frequency_table_target

Add checks for error return from cpufreq_frequency_table_target, and be
less noisy on the existing call with an error check.  CPU hotplug and
system shutdown may cause this call to return -EINVAL.

Bug: 8613560
Change-Id: Id78d8829920462c0db1c7e14e717d91740d6cb44
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: reduce chance of zero time delta on load eval

Reschedule load sampling timer after timestamp of sample start taken,
hold spinlock across entire sequence to avoid preemption.  Avoid the
WARN for zero time delta in the load sampling timer function.

Change-Id: Idc10a756f09141decb6df92669521a1ebf0dbc10
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: avoid underflow on active time calculation

Check for idle time delta less than elapsed time delta, avoid
underflow computing active time.

Change-Id: I3e4c6ef1ad794eec49ed379c0c50fa727fd6ad28
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
cpufreq: interactive: fix race on cpufreq TRANSITION notifier

The cpufreq TRANSTION notifier callback does not check the
governor_enabled state on affected CPUS, which will case
kernel panic in update_load because the policy object maybe
NULL or invalid when governor_enabled is false.

Change-Id: Ie0f1718124f61e2f9b5da57abc6981ada5b83908
Signed-off-by: Lianwei Wang <a22439@motorola.com>
cpufreq: interactive: resched timer if max freq raised

When the policy max freq is raised, and before the timer is
rescheduled in idle callback, the cpu freq may stuck at a
lower freq.

The target_freq shall be updated too, else on a high load
situation, the new_freq is always equal to target_freq and
which will cause freq stuck at a lower freq too.

Reschedule the timer on gov limits callback.

Change-Id: I6c187001ab43e859731429b64f75a74eebc37a24
Signed-off-by: Lianwei Wang <a22439@motorola.com>