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>
Revert "msm_fb: display: allocate RGB pipes properly for external"

This reverts commit 9b3e56051e45726862a738c4b5e202933faa0ad0.
Revert "msm_fb: display: extend mutex protection for mdp pan display"

This reverts commit 8d28053ba306ad5d95f63adfd0f9349fb9da4306.

Change-Id: Iea53ac96f2c7fe993d9d025742db217dfdacb480
mdp: dtv: Fix pipe staging, again

Change-Id: I3ad7483368a99674504e4d0d24a17865b0219b50
msm: audio: qdsp6v2: Add size safety check to ACDB driver

Check that the size sent by userspace is not larger
then the internal amount allowed. This protects
against overflowing the stack due to an invalid size.

Change-Id: I8230fdb00a7b57d398929e8ab0eb6587476f3db1
CRs-fixed: 470222
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
msm: msm_fb: remove mmio access through mmap

Disable access to mm io and add
appropriate range checks to ensure valid accesses
through framebuffer mmap. This prevents illegal
access into memory.

CRs-Fixed: 474706
Change-Id: If25166f2732433ef967e99c716440030b567aae9
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
(cherry picked from commit b571bef36cf51f9bb4cd1ad3ba23e3cee6d1d3cb)

Conflicts:

	drivers/video/msm/msm_fb.c

Signed-off-by: Raviteja <adimur@codeaurora.org>
video: msm: Add QSEED API to MDP_PP IOCTL

Add the ability to program the QSEED Table 1 coefficients to the features
supported by the MSMFB_MDP_PP IOCTL

Doesn't support table2 writes currently, however, the code to write to them
is already present.

QSEED support is currently only configurable via a tuneable parameter that
maps to a small subset of possible  QSEED settings. By moving to the
MSMFB_MDP_PP IOCTL, QSEEDs tables will be able to programmed to any value
requested by userspace. This also allows for future expasion of the QSEED
feature by allowing dynamic loading of the table2 coefficients (rather than
only configuring them at init).

Change-Id: I7394e211169efb0e677391e2c150a6a6b8d0477c
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Add QSEED Table reading support

Add support to read the tables of QSEED values. When the values of the
QSEED tables are able to be written to, it is beneficial to be able to read
what's there as well.

CRs-Fixed: 380315
Change-Id: I3110721906424f70a12bf5736de7875dec03f4c6
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Add QSEED Table2 Support

Add support for QSEED Table2 reads/writes. Table 2 is a table of coeffients
for QSEED Table 1 to offset into. Table 2 is quite large, caution should be
taken when writing into it.

CRs-Fixed: 380315
Change-Id: I89be18c0047dcf1d9a3bcd538967b2bbe7b4efe1
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Remove old post processing overlay integration

Remove old implementation of HSIC and QSEED smoothing/sharpening overlay
integration. Need to replace with new implementation that better integrates
the existing functions of the two APIs.

CRs-Fixed: 380750
Change-Id: Id3469fad16764ed88e74a8da75bb873f726ba366
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
msm_fb: Provide IOCTL to configure QSEED tables

Provide sub-operation for MSMFB_MDP_PP IOCTL to configure QSEED tables.
QSEED is used for smoothing, sharpening and scaling of content on video
pipes in MDP.

Change-Id: I069d9c793553cb4c400973690ebd7f8d3bcc1c68
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
video: msm: Add CSC and QSEED support to Overlay API

Add support for CSC and QSEED configuration through MSMFB_OVERLAY_SET and
MSMFB_OVERLAY_PLAY ioctls. Provide better integration than previous attempt
with the existing Overlay and PostProcessing APIs.

CRs-Fixed: 380750
Change-Id: If895391074ef1e7d7a6824d289e1ed9da6a52180
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Revert "msm_fb: display: remove background invert alpha option for alpha drop pipe"

This reverts commit 17c4280b967552a0997cc8c334679ad8e8b56d7d.

Conflicts:
	drivers/video/msm/mdp4_overlay.c

Change-Id: I5a4074bd541106181e29ce9d4ac00c406ccbfc48
msm: display: plane alpha support

Clean up the blending rule to follow blend_op set from hwc.
Use modulate alpha for plane alpha when it is not 0xff.
Keep backward compatibility if blend_op is not set.

Change-Id: I02fd3c3c7b5ace2e6eec22b2db0284161404a0fc
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
remove compilation error by changing int to uint32_t Signed-off-by: Supreet Mysore Suresh <supreet@codeaurora.org>

Change-Id: Ia7de2f4a9eae4cc16f957163683ddf83c135d379
Signed-off-by: Supreet Mysore Suresh <supreet@codeaurora.org>
msm: vidc: Add PAR value extradata support for H264 and Mpeg2

Core gives aspect ratio information for H264/Mpeg2 in a
shared memory register. This change will fetch the value
of the aspect ratio from the designated register and append
this information to the frame_info extradata which can be
used by the client.

Change-Id: Iacacaf1b1181546ba2d09362a51bbe5178a63999
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: Reduce the priority of incorrect PAR value message

We get the error message for the incorrect aspect ratio
with each frame of the video. By reducing the priority,
error message will appear only when we enable it.

Change-Id: Iacb8002383ea6c0b7ee86e9cfe14478c0e5ca5c3
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
vidc: Adjust core timeout based on input frame size

Video core is dropping certain IDR frames due to timeout.
This is resulting in video corruption. Computing the core
timeout based on input frame size and programming it for
each input frame fixes the issue.

Change-Id: I75d5039bc09f9be6a3028461ee4a2f13064bf53a
CRs-fixed: 370570
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
vidc: upgrade video core clock rate based on time taken to decode a frame

Currently video clock rate is set based on the resolution
and fps of the given clip. But some clips have a high bit
rate for a given resolution which causes high decode time.
Changes were made to consider frame decode time and upgrade
the clock rate accordingly

CRs-fixed: 346580
Change-Id: Ie89a736eb9f93286486ae7688633a828c7415fd2
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
msm:vidc: Add temporary buffer for MPEG-2 extension and user data.

Support is added to enable temporary buffer for processing
the MPEG-2 extension and user data for the first sequence
done.

Change-Id: Ib7fdc8bfd50bfb0da651e8da6fca26a3542c671e
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>