mmc: core: fix the issue with clock scaling in HS400 mode

Clock scaling feature would scale up/down the MMC interface clock
frequency based on the load on storage. During clock scale up in HS400
bus speed mode, SW is unncesserily doing the tuning even after HS400
switch is done. This change fixes this bug.

CRs-Fixed: 660534
Change-Id: I4de06962a3fe6dba2e7ff8420d9a3e3997b33ba1
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mdss: Start wait for hist ready state past first kickoff

When the first histogram kickoff is done past reset, it might
be too late into the waiting period of completion. This
would cause a timeout even though data for the frame is made
available and interrupt is generated after timeout. This
causes a histogram read call to return with an error and
delay reading the data.

Edit to make the wait for ready to start after the first
kickoff. Add additional completion to denote first kickoff
and start wait after first kickoff wait has completed.

Change-Id: Ic9156b4d8852520715324707290287eb09df6195
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: refactor pipe retrieval and ref count logic

Allow only retrieval of pipes that are on particular framebuffer device
used list. This ensures that pipe is not modified from a different fb
device node and cause potential issues.

Also, modify the ref count logic to use kref and ensure pipe is freed
only while holding mutex in case there could be race condition that
pipe is allocated while being freed.

Change-Id: I626323b5df981a7ed1e03196126cd4376b5ba6a6
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
msm: mdss: set default value of panel mode gpio to -EINVAL

Default value of panel mode gpio is set to 0 which is still a
valid gpio and preventing access to legitimate owners when not
provided explicitly in device tree file. This patch addresses
the issue by changing default value to -EINVAL.

Change-Id: Ifc34513d21323af9843f6bbc85a3afca79891357
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
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>
msm: kgsl: hold a process_private refcount in process_mem_print

There is a possible race condition where the process can be going
away while its debugfs 'mem' file is being read, which could cause
memory corruption.

Conflicts:

	drivers/gpu/msm/kgsl.c

CRs-Fixed: 627780
Change-Id: I697486faeb3f186fd1220d0acc1e449a4f7b77b0
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Look up the process struct in process_mem_open()

The pointer to an active process struct stands the risk of going stale
if process_mem_open() is called just before the debugfs dentry is
destroyed. Instead of storing and using the pointer pass the process pid
to process_mem_open() and do a lookup to ensure that we always get active
processes.

Conflicts:
        drivers/gpu/msm/kgsl_debugfs.c

Change-Id: Ic0dedbad3a3b54dc96251663fdf89c466fef3ca5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: mdss: Add support for ULPS mode for DSI

For smart panels that can refresh display from their internal
RAMs, it is possible to configure the DSI clock and data lanes
in Ultra Low Power State (ULPS) during idle static screen
usecase. Add support for this feature.

Change-Id: I4e94d6a0201262f0675322efc9e39dd93c86edda
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Merge "msm: mdss: Increase commit count for first kickoff"
Merge "Merge "msm: mdss: Increase commit count for first kickoff""
mmc: core: fix the issue with clock scaling in HS400 mode

Clock scaling feature would scale up/down the MMC interface clock
frequency based on the load on storage. During clock scale up in HS400
bus speed mode, SW is unncesserily doing the tuning even after HS400
switch is done. This change fixes this bug.

Change-Id: Ica39acc41b14095438a7ccf536c3c7e5792d9c41
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Merge "mmc: core: fix the issue with clock scaling in HS400 mode"
Merge "msm: mdss: Add support for ULPS mode for DSI"
Merge "mmc: core: fix the issue with clock scaling in HS400 mode"
Merge "Merge "msm: mdss: Add support for ULPS mode for DSI""
Merge "Merge "mmc: core: fix the issue with clock scaling in HS400 mode""
msm: mdss: Turn off MDP GDSC in idle screen for cmd mode panels

For command mode panels, the DSI lanes can be configured to an
Ultra Low Power State (ULPS) during idle screen use case. In such
cases, it is possible to turn off the MDP GDSC as MDP is completely
idle. This would result in reducing any leakage current. Add
support for this feature.

Change-Id: Ic4074f9e12a27fe0fbe95219ffaa2f466abee307
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
msm: mdss: add a separate register region for DSI PHY

The DSI PHY register offset from the controller base is
different for different targets. So, add a separate register
region for DSI PHY in the device tree. This register base and
offset will be used to access the DSI PHY registers. Also
change the register offsets which are dependent on the
controller base address.

Change-Id: Ie1d08950f3c8c8801908a1b3cf7db46a44b4e8c3
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Merge "mdss: Start wait for hist ready state past first kickoff"
Merge "msm: mdss: Turn off MDP GDSC in idle screen for cmd mode panels"