msm: mdss: Make wait_for_complete calls uninterruptible

The wait_for_complete calls in the MDSS driver are associated
with an acceptable timeout value which would remove the need for
making them interruptible. Also, this prevents unwanted signal
interrupts before the call is finished.

Change-Id: If4013b0d74bc9f717c4a63d961f2a34753320e87
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: Change vsync dispatch mechanism

Notify the userspace when to read vsync instead of userspace
blocking on the vsync show event. Use a work queue to call
sysfs_notify to accomplish this.

Change-Id: I2d6ea6a6c4683cbd4c3ed9ca355546282e375194
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm: mdss: Introduce error checks for rotator sessions

When there are more virtual rotator sessions allocated than
DMA pipes available, rotator pipe allocations might fail and
corresponding error messages are printed which can lead to a
watchdog bark. This change silences those error messages and
also implements an extra check to avoid null pointer
dereference when a session is dequeued without a pipe.

CRs-fixed: 523701
Change-Id: I128ab85aac9e091b13a8772a43342d655c6f736f
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
mdss: clock: add edp dynamic clock rate support

Add edp both main link clock and pixel clock related
support functions so that clock rate of both clock can
be configured dynamically.

Change-Id: I749c79923d7e7db1d722dab6628d58f88d178de9
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: vidc: Add logic to unregister input buffers

Unregister input buffers when reqbufs is called for input
port with zero buffer count.

Change-Id: I676fa0857d675ae45f4328b26c2f82d7397315b1
Signed-off-by: Surajit Podder <spodder@codeaurora.org>
Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
Revert "msm: vidc: Decrease the size of decoder compressed buffer"

For some codecs like VP8 the compression is not high. So the
compressed stream length could be more than 1/4th of the size
of the uncompressed stream. This change sets the size of the
compressed stream to to half of the uncompressed stream.

This reverts commit 2d72071c8759589048094adbbdc302591532ac74.

CRs-Fixed: 525713
Change-Id: I103d862c41e9dd8c4971870c5bb82a93bd0c073b
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
msm: vidc: ensure safe deletions of session instances

Session instance should acquire lock before
cleaning up the session.

Change-Id: I0e496579794291a8115286c9550c5028c7391d55
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Increase maximum buffer count limit

Some clients want to allocate more buffers on decoder
input port than required (mainly for performance reasons).
Video decoder should honor the client request as long as
V4L2 framework permits.

Change-Id: I1c5c90f18b723504d4287ee3fca3c427392c1129
CRs-fixed: 509088
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
msm: vidc: Set error concealment color to FW

Add property to inform error concealment color to firmware.
With this change error concealment color is set to green.
If the error concealment color is set to any other color besides
green, then some frames have green padding and some will have non-green
padding(because error concealment color is mostly set on only first frame).
This can cause YUV mismatches between runs resulting in failure in
certification testcases.

Change-Id: I705037b93f7b0e10630e749aa807487f45e6e393
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
Signed-off-by: Vishwanatha Kumar Ultur <cvulthu@codeaurora.org>
msm: acpuclock-8974: Modify L2 table for 8974

Currently 1.26 GHz and 1.49 GHz in the L2 tables for 8974
map to 800 MHz DDR. With this change the above frequencies
now get mapped to 614 MHz DDR. This change maps the above
two frequencies to lower DDR and will thereby help save power
for use cases which spend majority of time at above frequencies.

Change-Id: I7f1cbc12ff7dae28f65863d5c41e68de2db40bfe
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
msm: mdss: copy gamut conf tables from kernel mem

Read the gamut config data from hardware into kernel's
memory and copy back to user space address using copy_to_user
API. This prevents MDP PP driver from writing directly into
userspace virtual address to copy gamut config data.

CRs-Fixed: 516720
Change-Id: Ib1f53e949696f7d4a45410c529fe9375c502090f
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
mdss: display: add mdp core clock to dsi clock control

Since mdss interrupts are generated in mdp core clock domain,
mdp clock need to be enabled to have dsi interrupt be delivered
during dsi dcs command send and receive. Request of bus bandwidth
also needed to allow dsi controller to fetch dcs commands over
AXI bus.

CRs-fixed: 516172
Change-Id: I6e10cc5a193c9eb06803637e0432ec72f069377b
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
netfilter: xt_qtaguid: Protect iface list access with necessary lock

This fixes a bug where the list is accessed without a lock,
potentially causing corruption when there is a race.

Change-Id: I084dcadb537de00a4be6fa09e31ec693443d3986
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
netfilter: xt_qtaguid: report only uid tags to non-privileged processes

In the past, a process could only see its own stats (uid-based summary,
and details).
Now we allow any process to see other UIDs uid-based stats, but still
hide the detailed stats.

Change-Id: I7666961ed244ac1d9359c339b048799e5db9facc
Signed-off-by: JP Abgrall <jpa@google.com>
Git-commit: 776488328c5e70ee917e320e6d8d09ecfc85ec14
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
netfilter: xt_qtaguid: fix error exit that would keep a spinlock.

qtudev_open() could return with a uid_tag_data_tree_lock held
when an kzalloc(..., GFP_ATOMIC) would fail.
Very unlikely to get triggered AND survive the mayhem of running out of mem.

Change-Id: I442dd68826a8f5ff7a02423f6f3832228c2f21ab
Signed-off-by: JP Abgrall <jpa@google.com>
Git-commit: fc36cc2104855ca64ab74b76d20ff27259cdae62
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
netfilter: qtaguid: Don't BUG_ON if create_if_tag_stat fails

If create_if_tag_stat fails to allocate memory (GFP_ATOMIC) the
following will happen:

qtaguid: iface_stat: tag stat alloc failed
...
kernel BUG at xt_qtaguid.c:1482!

Change-Id: I46bee5b6eacc070e604df15ed69f46edf87c148a
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Git-commit: 0310b9d5c7a0cd38433148b05992b180ec358676
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
netfilter: xt_qtaguid: extend iface stat to report protocols

In the past the iface_stat_fmt would only show global bytes/packets
for the skb-based numbers.
For stall detection in userspace, distinguishing tcp vs other protocols
makes it easier.
Now we report
  ifname total_skb_rx_bytes total_skb_rx_packets total_skb_tx_bytes
  total_skb_tx_packets {rx,tx}_{tcp,udp,ohter}_{bytes,packets}

Bug: 6818637
Change-Id: Ic5041f61bc010e535e119f769a65caa4779a5a81
Signed-off-by: JP Abgrall <jpa@google.com>
Git-commit: 01d1733e27c7c03dc700cd8cd7658b326bc0b1b2
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
netfilter: xt_qtaguid: remove AID_* dependency for access control

qtaguid limits what can be done with /ctrl and /stats based on group
membership.
This changes removes AID_NET_BW_STATS and AID_NET_BW_ACCT, and picks
up the groups from the gid of the matching proc entry files.

Signed-off-by: JP Abgrall <jpa@google.com>
Git-commit: 7c060bfc57364ee541b1d9b534262f73c1b42b0d
Git-repo: https://android.googlesource.com/kernel/common/
Change-Id: I42e477adde78a12ed5eb58fbc0b277cdaadb6f94
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
netfilter: xt_qtaguid: Allow tracking loopback

In the past it would always ignore interfaces with loopback addresses.
Now we just treat them like any other.
This also helps with writing tests that check for the presence
of the qtaguid module.

Change-Id: If0b5444b0a6e23a4089b0dd00a0d820f262f9fa7
Signed-off-by: JP Abgrall <jpa@google.com>
Git-commit: ab3801efc6d2e7b4610071ac87c6977ac9042ad9
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
netfilter: qtaguid: rate limit some of the printks

Some of the printks are in the packet handling path.
We now ratelimit the very unlikely errors to avoid
kmsg spamming.

Change-Id: If03d6b90bf367a356069f46aa5926a96fa508966
Signed-off-by: JP Abgrall <jpa@google.com>
Git-commit: bd91f6b21861cde78d800deede8ebeca0cc0cdd2
Git-repo: https://android.googlesource.com/kernel/common/
[subbaram@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>