Backport cpuidle from msm-3.7

Change-Id: If13afe85ce4a1567b83b74a25e2776b5afb04ac8
msm_fb: Update backlight level on resume after first pan display

Use shared workqueue to delay the update of backlight after
a first valid frame is displayed on the panel. This avoids any
transients being displayed during resume.

CRs-fixed: 361002
Change-Id: Ia2c2e39aae62e9ddfebe3a26fb4dbc969d0892c2
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: Create sysfs nodes during frame buffer initialization

During boot up, create two sysfs nodes and write the xres and
yres details of the panel used. This is required to support
dynamic DPI value setting based on panel resolution.

CRs-fixed: 443699
Change-Id: I5b85c95653e6cb7aba2aea103c23b587ac01795e
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: Fix blending logic for formats with per-pixel alpha

Currently if a layer with per-pixel alpha (eg. RGBA) is fed
for composition with z-order as zero (FG), per-pixel alpha
blending is applied along with the BG frame present on frame
buffer and hence we see the previous frame on the panel. Hence,
apply constant alpha blending if these formats are fed as FG.

(cherry picked from commit dd10bf1007a50b8b6956a5470ff92a2b4ddf9971)

Change-Id: I1ad8ea37b1281ad6f430ce60aa5c1dae9e5701d3
CRs-fixed: 405802
CRs-fixed: 435800
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Revert "msm_fb: Update backlight level on resume after first pan display"

This reverts commit e51424ed193c6c2d740a65423a9291682a84e495.

Conflicts:

	drivers/video/msm/msm_fb.c

Change-Id: If2358de69520e9f364c2d2468a0ab8771a34f061
framebuffer: add a pollable sysfs entry for display status

Wakeup the userspace poll on change of display status. The
userspace then may take action to change the
power/performance characteristics of the device.

Change-Id: I9bd11f3d895d3d83230104f5d8dcd1deeaa754cd
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
msm: cpufreq: Add API to allow limiting of min and max cpu frequencies

CPUFreq provides scaling sysfs nodes to set min and max frequencies, but
there are times when the operating range has to be controlled
irrespective of the scaling limits, to ensure the thermal stability of
the device.

The API allows kernel thermal safeguards to pitch in and limit the
frequencies.

Change-Id: I3dc7496747792e6223695131f1644dd87054b025
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
msm: cpufreq: increase priority of thread that increases frequencies

When the cpufreq governors request for increase in frequency from kworker
threads, there is chance that the kworker thread is cpu starved due to
other high priority threads, leading to undesirable increase in frequency
ramp-up latency. Add the calling thread to SCHED_FIFO policy when
requesting for increase in frequency and restore back to original policy
after ramp-up is completed.

Change-Id: Ie4fa199b7f9087717cb94dfcc2eddea27cc0012b
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>