v4l2-ioctl.c: handle PREPARE_BUF like QUERYBUF

The core code for PREPARE_BUF didn't take the multiplanar case into account,
which might cause page faults. Handle PREPARE_BUF just like QUERYBUF and
QBUF/DQBUF.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: vidc: Add 5.2 level support

4k resolution clips require different level
information. This change adds 5.2 level
support for such high resolution videos.

Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
[neo: we already added 5.2 level support to vidc earlier.
 This should complement it very well.]
Signed-off-by: neobuddy89 <neobuddy89@gmail.com>

Signed-off-by: Dan Trifan <jimsth@gmail.com>
v4l2-ctrl: add constrained high h.264 profile to menu

Constrained high profile was added as a profile option but the menu was
not updated. This causes dereference an invalid area in case this
profile is selected.

Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Revert "[media] videobuf2-core: Use current->mm_active when locking USERPTR"

Reverting commit 705d2156b85febeb47509e9d955052790b9025e0 because using
mm_active seems too unreliable. When current is a kthread, there's no
guarantee that there will not be a context switch between down_read and
up_read, which causes panic due to mismatched up/down_reads.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
videobuf2-core: Avoid locking userpages if no current->mm

If vb2_qbuf is called within the context of a kthread with no "user
memory map", current->mm will be NULL causing a fault when attempt to
lock the non-existent pages.

As such, perform a cursory check for a non-NULL current->mm before
locking the userspace pages.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
cpufreq: Break out early if freq equals to target_freq

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: Dan Trifan <jimsth@gmail.com>