fix mis
msm: mdss: Prevent multiple completions for each read request

Each read request should only capture one histogram done. completion to
prevent future histograms from trying to read unavailable data. Makes sure
that the read request is set for both pipes before waiting for a new
histogram. Likewise, make sure the read request is unset for both pipes
after waiting. To prevent accumulation of histogram bins, only kick off
histograms when histogram state is IDLE (i.e. read or reset(recently
 zeroed) bins).

Change-Id: Idc1ebb14dce500a6e5dfc0261ecec992e727a380
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Fix ARGC error when writing LUT to registers

When updating the ARGC LUT registers, the data is incorrectly written
such that the arrays are off by one index. This patch fixes that error
by starting from the correct index.

Also, when the READ flag is enabled for ARGC, the dirty flag is no longer
set.

[myfluxi: This fixes lcd kcal lut access as well]

Change-Id: I7e8e19c51d5891cd11344a425f1a8ac47d57368c
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Move histogram disable complete_all after intr disable

Previously, complete_all was called during histogram disablement before
the histogram interrupts were disabled, which can lead to issues if an
interrupt comes in between complete_all and interrupt disablement. Now
complete_all is called afterwards, which guarantees no more interrupts
will come.

Change-Id: I831a01ce8433470b337a42a644d98ab5807fdbd7
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Fix locking errors in histogram disable

There is a histogram variable that was missing the spinlock while it
was being read. It has been added.

Change-Id: I5f6d4246332a84c6a4cb3503ad7bbfaddb4a0fa8
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Fix locking errors in histogram setup

There is a check on histogram enable in histogram setup that was not
protected by the spinlock. It has been added.

Change-Id: I769422c803bb12de2030115a08d60ad7c7f38f15
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Correct ARGC read write for all DSPP

Currently ARGC read write is done for DSPP0 irrespective of
dspp_num, as the dspp_num corresponding to the block provided
is not calculated.

Added the calculation of the dspp_num to get correct address
of ARGC registers.

Change-Id: Id787e76debb26d23d75d3cdb859a697b6f0016f5
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Copy IGC LUT data correctly to userspace

During IGC read operation, IGC LUT's data was copied to
userspace incorrectly because of swapping color components.

Fix component data swapping during IGC LUT data copy to
user space to provide the correct IGC LUT data to user space.

Change-Id: I301a3500f0e0c4bbf9f52affa66373585c72d987
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>