msm_fb: display: fix incorrect MDP formats components unpack pattern

Many of MDP input formats don't have correct unpack pattern, so image
displayed on screen is not in the actual format set.

CRs-fixed: 339114,337040
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit c5638f898324df37e40e402d208b0e97337d536b)

Change-Id: I66a404db039502d0511cd3d7dc34e81c0eca1d61
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
power-supply: Limit the duration of psy_changed wakelocks
netfilter: xt_qtaguid: fix ipv6 protocol lookup

When updating the stats for a given uid it would incorrectly assume
IPV4 and pick up the wrong protocol when IPV6.

Change-Id: Iea4a635012b4123bf7aa93809011b7b2040bb3d5
Signed-off-by: JP Abgrall <jpa@google.com>
base: genlock: Properly destroy handle resources

The resources allocated for a handle were not being freed on device
release.  This included releasing the lock.  Unfortunately, the
lock release had a fput() too many which was screwing up the
reference counting on the file descriptors.  When attaching a lock,
we only need the file pointer for a short time so fput() it back
immediately.  That way, only there will only be one reference to
the lock per process, and the process will be responsible for
closing the fd directly and the fput() in genlock_release_lock
is no longer needed.

CRs-fixed: 322645
Change-Id: Ic0dedbad55300a2f8463c800cf8361719583b0b8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Avoid a race condition when releasing locks

Avoid a race condition if a lock gets released by all owners
but a process fails to close a lock file descriptor and tries
to reuse it.  Clearing the pointers to the data will ensure
that attaching a dead lock will return an error.

Change-Id: Ic0dedbadd693c7a22b027052cdd247370b28a7c5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Add error messages for failure cases

Signed-off-by: Naomi Luis <nluis@codeaurora.org>
Change-Id: I833e480abfc11ce4aa00a5ae46144895429a0339
base: genlock: Check for instances where handle is NULL

Check for the possibility of NULL handles passed into the
in-kernel API functions and return error where appropriate.
There is a non-zero chance that the private_data will be
cleared while the FD is still active, so check in the ioctl()
function as well.

CRs-fixed: 332835
Change-Id: Ic0dedbada2713080fef79ca188a87c578bec6d2f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
pmem: ensure SMI correctness

Due to hardware constraints, the SMI should not be mapped
in the kernel space when not in use. Unmap the SMI from
the kernel address space when the last allocation is freed.
Vote for bus bandwidth as well while the SMI is allocated.

Change-Id: Icdbdbdf984e210d55645d7baf81f2eb43593ccc8
CRs-Fixed: 281723
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
pmem: Actually request the memory region

The logic of the code flow prevented the memory region
request function from ever being called. Fix this logic
properly.

Change-Id: I3d681c80872160d6323da6852d2fd7f16d772a11
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
pmem: ensure SMI correctness

Due to hardware constraints, the SMI should not be mapped
in the kernel space when not in use. Unmap the SMI from
the kernel address space when the last allocation is freed.
Vote for bus bandwidth as well while the SMI is allocated.

Change-Id: Icdbdbdf984e210d55645d7baf81f2eb43593ccc8
CRs-Fixed: 281723
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: camera: snapshot interface redesign

Created pic node and associated snapshot functionality
to the new node.
Fixed pmem lookup error for raw snapshot.

Change-Id: I3fe532d9818f9dfb2ad8157b6e1ff98dfce8dfff
Signed-off-by: Sunid Wilson <sunid@codeaurora.org>
media: camera: Remove unused scaler configurations from vfe 3.1

Remove unused scaler configurations from vfe31_reset_internal_variables
function

Change-Id: I9ba09671bc35273653f2ded21e590b7aaefcfb7d
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
msm: camera: multiframe HJR fix for snapshot redesign

Updated the post processing code to handle multiframe HJR
which is aligned with new snapshot design

Change-Id: I939b5339f731beefa7f42dcd2c6509d689087b9c
Signed-off-by: Sunid Wilson <sunid@codeaurora.org>
media: camera: Remove hard code values for xbar config on vfe 3.1

Change-Id: Ia9010db630dd4ca28eaf99185485e7103f2918a7
CRs-Fixed: 274919
Signed-off-by: Nagesh Subba Reddy <nageshsreddy@codeaurora.org>
msm: v4l2: Remove old V4L2 code

Removed obsolete file msm_v4l2.c and other related
old V4L2 code from camera.h and msm_camera.c.

Change-Id: Ib3a54d3d61f181aad6ec7719327eff3051d0ab3c
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
msm: camera: Zero Shutter Lag feature support

Changes include
- VFE 3 output configuration
- ZSL streaming mode support
- Handling of raw snapshot, regular snapshot and
zsl streaming in IRQ1.

Change-Id: If94135d4d6a6ed0a8344413725ded2e45f5f7a5a
Signed-off-by: Sunid Wilson <sunid@codeaurora.org>
msm: camera: Add retry mechanism for i2c failures

Issue:
Due to i2c transfer failures msm_open function is failed and
returned error to conf thread. conf thread returns error to
upper layers. Upper layers are not handling the error and
it leads to ANR in camera.

Solution:
Retry 3 times in case of i2c transfer failure.

Change-Id: I0f6a7711c914ecbb3e3f616b6cdb4c2050607e1b
CRs-Fixed: 276412
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: camera: Fix for I2c failures

Issue:
mt9p012 sensor driver is not handling the return value
of i2c transfers correct. It leads to camera open failure

Solution:
Check the return value of i2c transfer properly

CRs-Fixed: 278218
Change-Id: Idc7db8b605a4090fc80792d7670c6768e34d1894
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
media: camera: Fix for kernel lock up issue on VFE 3.1

Need to ensure AXI bus is halted before resetting the VFE.
Instead of polling AXI_STATUS bit, poll AXI_HALT_IRQ and
then issue a reset.

Change-Id: I433ad8ccf2eee19e874e4d7f61091680ea7ddb9c
Signed-off-by: Nagesh Subba Reddy <nageshsreddy@codeaurora.org>
media: camera: Fix for stray lines in preview for ZSL

Updated the Gamma and Luma LUT Bank selection only once
per reg update.

Change-Id: I0eb7ed700ccf32b35b3ee8642b7d73cbb44b577b
Signed-off-by: Nagesh Subba Reddy <nageshsreddy@codeaurora.org>