msm_fb: display: add ioctl for mixer info

Add new ioctl to allow user to query mdp mixer detail configuration.
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>
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.

Change-Id: Ib151970eacab4df36fb8274be0079bc814e93efe
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
semc: add second panel mode
msm_fb: Allow panels to specify a second mode

This allows for panels that support more than one mode
to specify the maximum configuration. The framebuffer
size is now based on the larger of the primary and
alternate modes.  The alternate mode is also used to
check parameters when userspace is requesting a change
to the framebuffer configuration.

Change-Id: Icf644b0fb5e54fc95f45ea8c5ed97f6243cb886c
Signed-off-by: Philip Elcan <pelcan@codeaurora.org>
msm_fb: Make buffers aligned to 4K page boundary

This change makes the frame buffers aligned to the page
boundary. Improves GPU performance since accessing the
frame buffer from page boundary is faster.

CRs-fixed: 325134
Change-Id: I6ce4477f62536a3cd81064e26dc08f2b199e181b
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: Clean up of frame buffer 4KB alignment changes

Remove redundant code from the 4 KB alignment patch
and reduce the overhead of calculation of the hole
size by using bitwise operators in its calculation.

Change-Id: I1706484249bf8e01b250e91fa87e00f6021d9a72
CRs-fixed: 325134
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: fix y-res offset for ics
msm_fb: display: disable pan display and memory access to fb1 and fb2

The native fb1 and fb2 framebuffer memory is not used and not
allocated on the board file. So on the driver side, pan display ioctl
or other operations on fb1 or fb2 framebuffer memory is checked and
invalidated.

Change-Id: Ie3e85e20f5675f9cfe02c4587f0fe119e8d57e76
CRs-fixed: 357242
Signed-off-by: Huaibin Yang <huaibiny@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>
msm_fb: display: disable pan display and memory access to fb1 and fb2

The native fb1 and fb2 framebuffer memory is not used and not
allocated on the board file. So on the driver side, pan display ioctl
or other operations on fb1 or fb2 framebuffer memory is checked and
invalidated.

CRs-fixed: 357242
Change-Id: I2883926251a0465f69f18c442d5867556a4651bf
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: some caf changes
msm_fb: display: add mdp version info for later mdp h/w

fbtest needs to get the correct mdp version number, but now only the
version up to mdp4.0 is returned. Add the latest mdp version up to
4.4.

Change-Id: If1ff302bb4a02ed13bb4dcabcb933fd5adfbec6d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@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.

Change-Id: I0ff5eb65364d2a370e0973da7e84f738bd042a20
CRs-Fixed: 356328
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
mdp4_overlay: some caf changes
msm_fb: display: fix mdp blending logic

Handle case where blending downscaled VG pipe with alpha channel since
alpha channel will be dropped by MDP hw. Also propagate framebuffer pipe
alpha to top layers only if they are opaque to avoid picking up from
layers which contain alpha.

CRs-Fixed: 326178
Change-Id: I73cfc0716d1f5f8a803a645bdc09b97f909e593d
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm_fb: display: perform mixer flush on every commit

Mixer needs to be flushed on every commit instead of just when mixer cfg
changes to flush changes in blending configuration

CRs-Fixed: 336655
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit 9919b7e5503bc078720337da27a421ec3833e528)

Change-Id: If07e58bf625d3934ad994904deae189e259a687b
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
mdp4_overlay: fix for mdpi