msm: camera: composite stats support for bayer hist

Add composite stats support for bayer hist

Change-Id: Ib6759fdbc791604f9d8b1cef0103cc3b72e24aa1
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
Merge "msm: camera: composite stats support for bayer hist"
msm: kgsl: Properly record the size of the sglist in the memdesc

It was possible to fail out of kgsl_sharedmem_alloc after a sglist was
allocated but before we saved the size of the allocation which caused
problems when the sglist was freed during cleanup.

CRs-fixed: 464289
Change-Id: Ic0dedbadd57ec4d9422b5e3a873243d0ffed51f7
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: vidc: Remove delayed unmap flag in ion_map_iommu()

This change fixes the iommu map failure in movie studio
application by removing the delayed unmap flag in
ion_map_iommu(). The delayed unmap will cause the
iommu buffer to be unmapped only when all the clients
unmap the buffer.

Change-Id: I9e226fd56fecfa292e4d77aa94b2883bcfbf6ec2
CRs-fixed: 464374
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
asoc: msm: Add flexible period count to pcm record driver

 In pcm recording, if buffers are not requested from dsp at real
 time then dsp drops the buffers and sends partial buffers. This
 is causing record failures. Pcm record platform driver has two
 periods. If system is loaded, read request will not be at real
 time. Add flexible period count to pcm record platform driver
 so client can configure the period count.

CRs-Fixed: 467746
Change-Id: Iadd47979f7b29a01fb8e6479383094a2ed1d93c5
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
msm: kgsl: initialize kgsl_sync_timeline_ops properly

CRs-fixed: 471346
Change-Id: Ib8dccb60ead6fcecc0f9beaf271ba28199d404a2
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Jeff Boody <jboody@quicinc.com>
Merge "msm: kgsl: Properly record the size of the sglist in the memdesc"
Merge "msm: vidc: Remove delayed unmap flag in ion_map_iommu()"
Merge "asoc: msm: Add flexible period count to pcm record driver"
Merge "msm: kgsl: initialize kgsl_sync_timeline_ops properly"
msm:kgsl: Remove NORETRY flag in memory allocations

With NORETRY flag kernel will not try to reclaim memory
incase of memory allocation failures.With NORETRY flag
being removed, kernel makes mutliple attempts in order to make memory
allocation sucessfull, before returning failure.

Change-Id: I7d71954eba723ce6a8a79b63f54bea1e5b6618f1
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
msm: kgsl: Fault tolernace for context with pagefault

If pagefault happened in same global timestamp
as the hang do not attempt replay for fault tolerance.
This is an improvement from previous policy of not
attempting fault tolerance for the context
with pagefault.

CRs-Fixed: 469807
Change-Id: Idc9512b9fab3c9a2bf0b33a7e06f3070075427ba
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Allocate space in ringbuffer for EOF commands

When userspace passes end of frame (EOF) flag, ringbuffer is
inserted with EOF marker commands. Allocate ringbuffer space
for EOF marker commands.

CRs-Fixed: 469807
Change-Id: I7de8d1b81d358a8d8753ac84fbdceddad27bb17d
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Add barriers to GPU fault tolerance memory reads

In GPU fault tolerance When reading from memstore add
memory barriers. This ensures memstore reads are
completed and makes GPU fault tolerance code robust.

CRs-Fixed: 469807
Change-Id: Iefb950ae2647eb8ae16bfb9a8d7ee9885636d920
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Prevent fault tolerance memory free twice

There is a possibility of fault tolerance data to be freed twice
if fault tolerance fails. Do not free the data when the data allocation
fails, take the decision to free the data only at the end of
fault tolerance.

CRs-Fixed: 469807
Change-Id: Ifcc9a75e70440be6471b32d8413f4faa01a9ee47
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: msm_bus: Fix the 64-bit division during interleaving

When interleaving flag is enabled, the bandwidth is divided
between ports. There was an error in the division as the
macro was not correctly updated with the right order of using
bandwidth and port number when 64-bit division function
was used by the bus driver.
Correcting this for fixing the token allocation issues
observed.

CRs-Fixed: 472791
Change-Id: Ie7c7f9557006cbb946eaa9eff4b50771cc60525e
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
USB: ci13xxx_udc: Don't free dTD immediately after active bit is cleared

USB controller may access the dTD one more time after clearing the active
bit in token field.  There is a possibility of software freeing it in this
window.  When this happens, USB controller may access incorrect memory and
leads to system level issues.

dTDs are freed when requests are freed by function drivers during
disconnect or unbind.  The above race condition will come into effect only
for zero length packets.  dTDs are dynamically created for sending zero
length packets on IN endpoints.  These dTDs are immediately freed after
active bit is cleared.  Defer this to next dTD completion.  It is safe to
assume that hardware will no longer access the previous dTD when the next
dTD is completed.

Don't allocate/free setup status phase and GET_STATUS data phase requests
dynamically.  Use  one request for both cases and allocate it during bind.

CRs-Fixed: 474557
Change-Id: I5d41c310e1bb35d93b5af7d90a24ce5aab24f5f9
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
msm: thermal: Use signed int for temperature

Temperatures could be in negative and negative signed ints may be
incorrectly read as unsigned int.

Change-Id: I817db2756c54816296a700ffcd004a83161f2b95
CRs-Fixed: 441632, 473507
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Merge "msm:kgsl: Remove NORETRY flag in memory allocations"
Merge "msm: msm_bus: Fix the 64-bit division during interleaving"