UPDATE: Improve latencies under load by decreasing minimum scheduling granularity

Mathieu reported bad latencies with make -j10 kind of kbuild
workloads - which is mostly caused by us scheduling with a
too coarse granularity.

Reduce the minimum granularity some more, to make sure we
can meet the latency target.

I got the following results (make -j10 kbuild load, average of 3
runs):

 vanilla:

  maximum latency: 38278.9 µs
  average latency:  7730.1 µs

 patched:

  maximum latency: 22702.1 µs
  average latency:  6684.8 µs

Mathieu also measured it:

|
| * wakeup-latency.c (SIGEV_THREAD) with make -j10
|
| - Mainline 2.6.35.2 kernel
|
| maximum latency: 45762.1 µs
| average latency: 7348.6 µs
|
| - With only Peter's smaller min_gran (shown below):
|
| maximum latency: 29100.6 µs
| average latency: 6684.1 µs
|

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Suggested-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <AANLkTi=8m4g01wZPacySoF7U0PevTNVgJoZZrHiUD-pN@mail.gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Conflicts:

	kernel/sched_fair.c
UPDATE: vidc: 720p: Add IDR Frame type support for H264 format [Code Aurora]

Read IDR frame type from 720p core register set and
propagate it to user space using new IDR frame type
enumeration added in api header file. The IDR frame
type info is used in SYNCFRAME logic for H264 format
in userspace.

CRs-Fixed: 296738
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
UPDATE: Improve initial frequency selection [Code Aurora]

    Instead of failing init when a supported scaling frequency >=
    the current CPU frequency cannot be found, also try looking for
    a supported frequency <= the current CPU rate.

    This prevents a crash if the CPU happens to be running faster
    than the highest scaling frequency at boot.

    Change-Id: I4109279055bfe72dfe35e43bb9a7bad46dd3048e
    Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
UPDATE: msm: kgsl: Use timer instead of loop count to wait gpu to idle

Previously kgsl_yamato_idle() used a loop count to check gpu hang.
This count is not big enough for the test app so a gpu hang was
reported too soon. A drawback of using loop constant is inconsistent
waiting time for different cpu speeds. To fix this, read cpu time to
check timeout. Also leave more time to wait for gpu to finish its work.

cherry-picked from:
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commitdiff;h=d86b52649abab4adddd672537ea0c9e9e9e4ee73
UPDATE: msm: kgsl: Remove idle command submission

Remove the idle command in the ringbuffer that is
added before the interrupt generation commands. The
user space driver will add the required idle commands
along with the ib's(indirect buffers)

cherry-picked from:
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commitdiff;h=8b03e783c4cfe50593f2684c025588db425f3bb6
UPDATE: msm: kgsl: Remove superfluous printk from 2D driver

Remove a not-very-useful printk from the 2D driver to help
cut down on dmesg spamming.

cherry-picked from:
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commitdiff;h=79e6bbddf6adb3f6b110f1971b2423a36d777aac
UPDATE: msm: kgsl: fix race condition between devices

fine-grained locking mechanism was being dodged by
the kgsl_runpending_all function during ioctl. removes
the kgsl_runpending_all function

cherry-picked from:
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commitdiff;h=e5f1dca393a43d463b4b787ca96dff76d328c97d
UPDATE: vidc: 720p: Set DB line buffers in case of reconfig [Code Aurora]

In the case of multi resolution H263 clip, there is
no response from the core. With fixes in video f/w,
there is a problem in reconfig. Fixed by setting the
DB line buffers to the core again in the case of
reconfiguration.

CRs-Fixed: 303874
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
(cherry picked from commit d292ddd67b5eb550d02520403ea2ad1d72957189)

Change-Id: I5c794bb016636780cf0f37426d91c4ed9935a80c
Signed-off-by: swetha <sbasin@codeaurora.org>