rtc: alarm: Update hrtimer if alarm at the head of the queue is reprogrammed

If an alarm was restarted with a value that moved it away from the head
of a queue, the hrtimer would not be updated. This would cause unnecessary
wakeups.

Change-Id: If379f8dd92b0bdb3173bd8d057adfe0dc1d15259
Signed-off-by: Arve Hjønnevåg <arve@android.com>
rtc alarm: fix bad index when canceling alarms[]

It was using ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK as an
index.

Change-Id: I919860cc71254453e382616bce9fd5455802cb3d
Signed-off-by: JP Abgrall <jpa@google.com>
msm_sdcc: Modify the max_blk_count value to prevent overflow.

CRs-Fixed: 275988
Change-Id: I0a1cdee060cdbd725e39615158eec5036d1e85d6
Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
msm_fb: display: Use spinlock instead of mutex in vsync timer handler

Use spinlock instead of mutex in vsync timer handler to avoid sleeping
from timer context through mutex locks

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: Use __va instead of ioremap for framebuffer memory map

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: Add panel vertical porches into TE logic

Panel vertical porches are not considered into tear check logic
which cause TE can not tolerate panel vsync frequency variation
after panel heating up. This cause mdp to hang up and no screen
updated after that. This patch will have panel vertical porches
considered in during configure TE registers.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm:display:hdmi: Fix for EDID read/parse block[1]

HDCP enabled DVI monitors with block 0 and block 1 EDID always
switched to 640x480 even though they supported higher resolutions.
This patch reads DTD data from the correct offset from block[1]
and reads correct bits for interlaced format recognition.

CRs-Fixed: 290391
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
video: msm: Defining functions for MIPI CMD panel

Defining do_histogram and lut_update functions for MIPI CMD panel

CRs-Fixed: 294029
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: vidc: Fix performance level computation

The required performance level is rounded off to the incorrect
value due to the order of execution of the operations. Fixed
the issue by ensuring correct order of execution when computing
this value.

Signed-off-by: Deepika Pepakayala <deepikap@codeaurora.org>
video: msm: Block histogram requests with powered down panel

This causes MSMFB_HISTOGRAM ioctls to return an error when they are called
after the panel has entered a powered down state.

CRs-Fixed: 310429
Change-Id: I39c768c62a37ca83df2db2309230971cb6492bab
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm_fb: Discontinue use of clk_set_min_rate()

This proprietary API will soon be removed. Replace use of it with a
combination of clk_round_rate() and clk_set_rate() where appropriate.

Calls to clk_set_min_rate() with a rate of 0Hz followed immediately
by a clk_disable() served no purpose and are removed entirely.

Change-Id: I56d680ee36cc6292dcc436eeec7acdc57f3c243a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/clock-7x30.c
	arch/arm/mach-msm/clock-pcom-lookup.c
video: msm: Add mhl api header file

MHL API defines an interface for HDMI driver.

The API provides the information of the MHL connection state
for HDMI to transmit the MHL supported video format.

Change-Id: If19e497b7a238eb0465f9fb13b5586d3b9043360
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
msm_fb: Fixing Aspect Ratio

Non-standard resolution, like 531*398, is treated as 720*480 instead of
640*480 , as it has non 4:3 aspect ratio.Chanding aspect ration calculation
to be in a range , rather than absolute.

CRs-Fixed: 320022
Change-Id: Ie3b1ebefe48ef648720f06336239af907c3468d2
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
msm_fb: display: Report correct fps to user space

There are only 30 pan updates per second due to MDDI
Type 1 interface bandwidth limitation. Hence, 30 fps
needs to reported to user space for MDDI Type 1 Panels
though the panel refreshes at 60Hz. Make change to all
type 1 panels to report only 30 fps to userspace.

CRs-fixed: 330584
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
(cherry picked from commit 033ee132dd50dfb4ca11f8c87d1a3f1c988b0a74)

Change-Id: Iadb9ab77179b373e417a565d26581ebab5799661
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>

Conflicts:

	drivers/video/msm/mddi_toshiba_wvga_pt.c
msm_fb: display: Assign proper destination rectangles to mdp blit

Add check for (90 + Flip Horizontal) and Flip Vertical cases to assign
proper destination rectangle parameters to avoid corrupted frame
buffer content.

CRs-Fixed: 344807
Change-Id: I7e7b0b8d26f08f63a6f9c55eedd37f31cf0348d7
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
(cherry picked from commit 07c82d6ca63c6be28ab897fdb3ccfc1a448c342f)
msm_fb: Fix error in y-offset check logic in FB driver

After 4 KB alignment changes, the frame from 3rd buffer doesn't
get updated since during PUT_VSCREEN_INFO ioctl, the driver
returns -1 to userspace due to error in logic because the hole
size is not considered in calculating the logic for validity of
the y-offset. Change fixes this error.

CRs-fixed: 325134
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit d37b52404236bf4cadf530a238cafc5d6499d32a)

Change-Id: Ifccfa25a37fe0f8d86bf5b822d9affe7fa41203a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Fix build error for a3ee2237dbd06da76b6fc9a34fe3f1969b0560a5
msm_fb: Clean up the fix for error in y-offset check in FB driver

There is a failure observed in yres_virtual offset check and every
third frame gets skipped without an error message. Due to this high
fps is noticed in the test applications. Correct the yres_virtual
offset check.

CRs-fixed: 325134
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 2bd101d5bed1729b317114456360605e86289c15)

Change-Id: I35af570df2d6d2609562203f30f3caa1506b9b1d
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: display: Update video format on fps change

Added check for frame rate change. Corner case if there is no
change in xres,yres and pixclock.

CRs-Fixed: 356328
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
(cherry picked from commit 1b92af6e05320b6f5858a0e4b5c9aa40e54a9b54)

Change-Id: I43cb099068ef4c69a364b142eb3c34a3fc426db6
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb_panel.h
msm:vidc: Fix buffer pool index

While searching for the available buffer entry
in the buffer pool the search should begin from
index 1 as zeroth entry is reserved.

CRs-fixed: 366361
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
(cherry picked from commit 8c7e367a5ccd1c78c728657a14f08d6956b72e50)

Change-Id: I754fac98ce14f28cede1cb590c62784ad303a645
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>