fix compiling on Mac with non-GZIP kernel compressions

  * Non-GZIP compressions do not include the size in the file. Makefile.lib
    uses the stat command to determine the size of the file and then append
    the file size to the end of the image.
  * On BSD systems like Mac, stat does not recognize -c "%s" instead it
    needs -f "%z". This resulted in a non-booting kernel since the appended
    file size was either corrupt or 0.
  * Run both forms of stat, using whichever does not error out.
  * Allow the 2nd form to print to stderr if something goes wrong to help
    with debug.

Change-Id: I3295d4f59a3f43af476f891aad47f7962ed34a3e
jf: compress kernel with xz compression

Change-Id: I82153602b47f70d5cea4757ab765e7b2b9cdce7e
1
board-8064: pmic: enable RTC write

Change-Id: I8772a6844d3079cf65c769b5429649bae4720aad
jf: add support for panel color shifting based on a sysfs interface

Adapted from work by morfic and ktoonsez

Creates a syfs interface here:
  /sys/devices/virtual/sec/tsp/panel_colors

Will accept 0-4 for parameters:
  0 - Cold (more blues)
  1 - Cool
  2 - Normal (stock colors)
  3 - Warm
  4 - Hot (more reds)

Change-Id: I5cc6853d6a33108ece8d0c22fd1866d9fe104efc
Merge "board-8064: pmic: enable RTC write" into cm-10.1
ARM: mutex: use generic atomic_dec-based implementation for ARMv6+

Commit a76d7bd96d65 ("ARM: 7467/1: mutex: use generic xchg-based
implementation for ARMv6+") removed the barrier-less, ARM-specific
mutex implementation in favour of the generic xchg-based code.

Since then, a bug was uncovered in the xchg code when running on SMP
platforms, due to interactions between the locking paths and the
MUTEX_SPIN_ON_OWNER code. This was fixed in 0bce9c46bf3b ("mutex: place
lock in contended state after fastpath_lock failure"), however, the
atomic_dec-based mutex algorithm is now marginally more efficient for
ARM (~0.5% improvement in hackbench scores on dual A15).

This patch moves ARMv6+ platforms to the atomic_dec-based mutex code.

Change-Id: I5cb600b15f891dc692356322b38cae1d692a084c
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
jf: update to MDL source drop

Conflicts:
	drivers/video/msm/msm_fb.c

Change-Id: Iaef87dd70eda0f6d3260331714518f6e6cc0a0d8
jf: update to MDM source drop

Change-Id: I6d6f527c306b0ed4ca996d91d0bcff8ea80314cc
me4 upddate

* revert video/msm to current state

Conflicts:
	arch/arm/kernel/process.c
	arch/arm/mach-msm/msm_bus/msm_bus_board_8064.c
	arch/arm/mach-msm/msm_bus/msm_bus_core.h
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/msm_fb.c
	include/linux/msm_ion.h
Change-Id: I0686ef4ee1fe9b34ac9beaaa2bd43555234f5f6d
mdp: update to me4.

Conflicts:
	arch/arm/kernel/process.c
	arch/arm/mach-msm/msm_bus/msm_bus_board_8064.c
	arch/arm/mach-msm/msm_bus/msm_bus_core.h
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/msm_fb.c
	include/linux/msm_ion.h

Change-Id: I53986dd9758c7ac7ea64ab5a336b9e51645dedc0
jf: JC: allow non samsung app to update firmware

insure stability
Change-Id: I5eb80edbcdfe48a86668461d781decd5bedef027
perf: Treat attr.config as u64 in perf_swevent_init()

Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().

Introduced in commit b0a873ebb ("perf: Register PMU
implementations").

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: davej@redhat.com
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Link: http://lkml.kernel.org/r/1365882554-30259-1-git-send-email-tt.rantala@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

Change-Id: I117496399c6bbd94faaef5912d18bdb7f44bcc67
Add and enable kexec hardboot support.

Consists of squashed commits from:
https://github.com/mkasick/android_kernel_samsung_jfltespr.git

commit 750bb80f2854d6af5273e55ea179a4c60b2d9efc
Author: Mike Kasick <mike@kasick.org>
Date:   Sun Jun 2 23:11:24 2013 -0400

    Clear download mode flag on kexec hardboot.

commit 138ba851ee949af291eae914f410aea2d85ed9f5
Author: Mike Kasick <mike@kasick.org>
Date:   Sun May 12 22:39:26 2013 -0400

    Support hard booting to a kexec kernel.

    See KEXEC_HARDBOOT config option help for details.

commit 3ab41019a7af08395c233bebb605c2f1ea49c8e0
Author: Mike Kasick <mike@kasick.org>
Date:   Sat Jul 7 23:10:24 2012 -0400

    Support copying of kernel tagged list (atags) in the decompressor.

    This is needed to hardboot kexec a kernel with a new tags list (including a
    new kernel command line), since the new atags would otherwise be lost with
    the limited kernel memory mapping.  Without this patch, a hardboot-kexec'd
    kernel uses the atags provided by the bootloader.

commit 446c3d7a6631877f7dc9142359cf0eae300e9a08
Author: Mike Kasick <mike@kasick.org>
Date:   Sat Jul 7 23:09:39 2012 -0400

    Enable caching and buffering for all of physical RAM in the decompressor.

    Old method is to enable caching and buffering only for the 256 MB at the
    start of the decompressor image.  This makes a hardboot-kexec'd kernel very
    slow to decompress since the decompressor is located far above the kernel
    destination.  This patch reduces boot time from 35 to 8 seconds on epicmtd.

commit d3646be88f5b1f9a8ae714c922ec50c681b7157f
Author: Mike Kasick <mike@kasick.org>
Date:   Sat Jul 7 19:00:47 2012 -0400

    Enable and fix kexec syscall support.

    Use mem_text_write_kernel_word when assigning reboot_code_buffer parameters
    to avoid protection faults (writes to read-only kernel memory) when
    CONFIG_STRICT_MEMORY_RWX is enabled.

Change-Id: I0400ad00fcf02b8ad017f8aa371724a659b930b4
msm: vidc: Separate meta buffers support in secure mode

Extradata is appended at the end of each output buffer
in non secure video use case but in secure video playback,
the client/CPU don't have access to the output buffer
to parse the extradata. This change allows the client/CPU
to parse the extradata by allocating separate buffers for
video hardware to store extradata.

Change-Id: I12927ea3d142b9cecd6fb1ae1086c5624d0e08d6
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: Free meta buffers during address table cleanup

This change frees the allocated meta buffers, if any
present, during video core address table cleanup.

Change-Id: Id8c42491040bc5be09f3bb59780d376e6921c76e
CRs-fixed: 459980
Signed-off-by: Deepak Verma <dverma@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>
msm: vidc: Remove kernel mapping on input/output buffers

This change will remove the kernel mapping of input and
output buffers for both video encoder and decoder to
avoid the errors resulting from ion_map_kernel() for
high resolution video concurrency use cases due to the
limited vmalloc space. It also removed the metadata
processing in kerner video driver as kernel virtual
address is removed. The metadata processing can be
done in user space video component.

Change-Id: I3f2c9b7c13b3e09097ce07ca7b59154b97401052
CRs-fixed: 471135
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: Fix iommu pagefault in concurrent scenario

IOMMU pagefault is seen while running decoder and
encoder concurrently for specific codec combination.
Map double the buffer size to ion_map_iommu() API for
encoder reconstruction buffers to avoid the pagefault.

Change-Id: Ib5546a42a75c4c628767310f1a291e7ed443056c
CRs-fixed: 450621
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: unsecure heaps in the right order during error handling

Unsecure MM and CP heaps in the right order in case of failure
CRs-Fixed: 445400

Change-Id: I2b5d414c5d9f109740a931b75b0cfbdb196c465f
Signed-off-by: Praveen Chavan <pchava@codeaurora.org>
msm:vidc: Initialize meta buffer header during secure session

Meta buffer header initialization is required if we process
extradata in secure playback.

Change-Id: Ic8a068e99351f2c970643200d03b1a580ead7480
Signed-off-by: Deepak Verma <dverma@codeaurora.org>