msm:mdss: Add support for show blank sysfs entry

Currently there is no support for show blank sysfs entry
in mdss. Hence, added this entry to check if panel is
power on or off.

Change-Id: Ifa50bf373590556f88b8f8196353dffefe2d2559
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Revert "msm: mdss: Disable solid fill on pipe remains"

This reverts commit 58430ec5412e9ab7b86f1d4ac8c2114fac0f9e1a.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Remove additional clk refcnts in dual-dsi

When dual-dsi panel is attached to a device, both DSI controllers
are registered to mdss. But only one registration done notification
needs to be sent. Currently two notifications are sent and it leads
to an additional refcnt on mdp clocks which in turn prevents proper
suspend. Fix this by sending notification only once.

Change-Id: I29e3c92e9ab0cccd9314cc5428b4accc31b0d0d9
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Notify userspace of idle screen case

Expose two new sysfs nodes - idle_time and idle_notify - that
are used to notify userspace whenever the display is idle with
no screen updates. The idle_time node needs to be configured
with the duration in milliseconds to detect no screen updates.
The userspace app can poll on the idle_notify node to get
notifications of the idle state.

Change-Id: I7435a084ad2c928d952c5d106ff9ef92aaa385b9
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Add data check before pipes are programmed

Move the mdss_mdp_data_check call to image_setup instead
of src_addr_setup. Return a failure in image setup so
that the new parameters won't be programmed

Change-Id: Ib35b41eadf4cb50225866b7056670323cc8e8eac
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Program unpack pattern for pipes with solidfill

When a pipe is staged with a solidfill color, we need to also
program the correct unpack pattern for the color format. If the
unpack pattern is not specified, the corresponding color layer may
not be display correctly.

Change-Id: Ic52fe29235813faa788745dd72f82edaca2635f1
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Fix BWC width alignment

BWC src width is segmented into 16 aligned RAUs. The segmentation
into 16 RAUs needs to be rounded up for corner cases.

Change-Id: Idbf675d7adfb45cb28e6c456dd4fd7c7f41ea280
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Edit MDP sysfs node text layout

Display kernel driver uses a sysfs node for outputting MDP capabilities.
This data needs to be written in a proper format. Editing the
current format to have a single keyword instead of spaces. Also,
using an "equal to" sign instead of colon.

Change-Id: I2d2b71f27194cc50bfe1b7395cc0910896f499f4
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Parse max bandwidth property from device tree

Maximum bandwidth on the AXI bus supported by MDSS is a hardware
capability that needs to be exposed to userspace process via
sysfs node for MDP composition decisions.

Change-Id: I60e74e96666ca97f21a9880f49a95c3264d01870
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: MISR based CRC validation

MISR allows a CRC to be generated from contents of a
particular hw block which can be used for validation.
Enable setup of misr and APIs to obtain CRC from hw blocks.

Change-Id: Ib07e31cba45d242922bd28b6b306220efece7b8d
Acked-by: Sachin Bhayare <sbhayare@qti.qualcomm.com>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Increase commit count for first kickoff

During panel unblank a kickoff is done to turn on the panel so that the
first update is not delayed. It is also used to give buffer to command
mode panel prior to enabling backlight prevent junk data from appearing.
In order to prevent release fence timeline from being signaled too
early we will increase the commit count. This allow next sync point
to be added to the appropriate point on timeline, instead of relying
on frame done being called before sync/commit calls.

Change-Id: I566f90b3013b59dedbe42bbb9fdf6fa37d65e779
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: fb: null check mfd data

Add appropriate null check for mfd data structure
before accessing it's members. This prevents null
pointer accesses in the driver.

Change-Id: Id301d4a90c9a52049944c7e3b31aa1a34ad292d7
CRs-Fixed: 526286
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Use async wait fences only when dsi clocks are on

A race happens when we use async fences and the panel is being
turned on. So start with synced fences and wait until dsi is
fully started and it's clocks are on before we switch to async
fences.

Signed-off-by: Dan Trifan <jimsth@gmail.com>