drm/exynos: page flip fixes

The event wouldn't be on any list at this point, so nothing to delete
it from.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drm/exynos: use drm_send_vblank_event() helper

Rebased.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drm/exynos: accept flip requests when the crtc is off

Previously, we were rejecting flip requests when off. But
Mali does not like being told 'no' for an answer, and ignores it.
So let's honour these requests as if the display were powered up.
drm/exynos: disable 800x600 for odroid

Can't figure out how to make this resolution be displayed acceptably.
mm: Don't put CMA Pages on per-cpu lists

Author: Laura Abbottt - lauraa@codeaurora.org

When freeing zero order pages, CMA pages are treated the same as regular
movable pages. This means CMA pages are likely to be allocated for something
other than contiguous memory. This patch frees CMA pages directly.

http://lists.linaro.org/pipermail/linaro-mm-sig/2012-June/002093.html

Change-Id: I07b285121a7d4110a4e7fda1509e037e19607ea9
s5p-fimc: Fix RGB32 to BGR32 as this is what the HW produces

Testing showed that HW produces BGR32 rather then RGB32 as exposed in the
driver. The documentation seems to state the pixels are stored in little endian order.
s5p-fimc: Align imagesize to row size for tiled formats

For tiled format, we need to allocated a multiple of the row size. A good
example is for 1280x720, wich get adjusted to 1280x736. In tiles this mean Y
plane is 20x23 and UV plane 20x12. Because of the rounding, the previous code
would only have enough space to fit half of the last row.
s5p-fimc: Backport bytesperline calculation fix

The supported planar YUV format (YUV420P and YUV422P) has 3 planes, where
the bytesperline for each should be width, widht/2, width/2. It is expected that
width has been aligned to a multiple of 4 to stay word aligned.
s5p-fimc: Iterate for each memory plane

Depth and payload is defined per memory plane. It's better to iterate using
number of memory planes. this was not causing much issue since the rest
of the arrays involved where intialized to zero.
s5p-fimc: Fix YUV422P depth

All YUV 422 has 16bit per pixels.
s5p-fimc: Reuse calculated sizes

This formula did not take into account the required tiled alignement for
NV12MT format. As this was already computed an store in payload array
initially, simply reuse that value.
s5p-fimc: Use roundup() instead of ALIGN()

The size of a row is not always a power of two, so ALIGN cannot be used.
s5p-fimc: Fix tile width alignment

Because of the Z pattern used in 64x32 tiles format, the width must be aligned to
a multiple of 128. Otherwise we end up with image size shorter then required.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
[media] v4l2-mem2mem: drop rdy_queue on STREAMOFF

When a v4l2-mem2mem context gets a STREAMOFF call on either its CAPTURE
or OUTPUT queues, we should:
* Drop the corresponding rdy_queue, since a subsequent STREAMON expects
  an empty queue.
* Deschedule the context, as it now has at least one empty queue and
  cannot run.

Signed-off-by: John Sheu <sheu@google.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] exynos4-is: Copy timestamps from M2M OUTPUT to CAPTURE buffer queue

Backport of linux f0c24fd81f704730c529dc69aa57f21c1ade5c4e. The timestamp_type
field was introduce in later kernels, so not set in this backport.

original ommit message:
   Add copying of buffer timestamps and set the timestamp_type to
   V4L2_BUF_FLAG_TIMESTAMP_COPY to avoid warnings about UNDEFINED
   timestamp type like:
    WARNING: at drivers/media/v4l2-core/videobuf2-core.c:2042 vb2_queue_init+0xe0/0x18c()
    Modules linked in:
    [<c0016ef0>] (unwind_backtrace+0x0/0x13c) from [<c0029b3c>] (warn_slowpath_common+0x54/0x64)
    [<c0029b3c>] (warn_slowpath_common+0x54/0x64) from [<c0029b68>] (warn_slowpath_null+0x1c/0x24)
    [<c0029b68>] (warn_slowpath_null+0x1c/0x24) from [<c03b7018>] (vb2_queue_init+0xe0/0x18c)
    [<c03b7018>] (vb2_queue_init+0xe0/0x18c) from [<c03b4e08>] (v4l2_m2m_ctx_init+0xa0/0xc4)
    [<c03b4e08>] (v4l2_m2m_ctx_init+0xa0/0xc4) from [<c03ca6c4>] (fimc_m2m_open+0x130/0x1f8)
    [<c03ca6c4>] (fimc_m2m_open+0x130/0x1f8) from [<c03a5dd4>] (v4l2_open+0xac/0xe8)
    [<c03a5dd4>] (v4l2_open+0xac/0xe8) from [<c0113920>] (chrdev_open+0x9c/0x158)
    [<c0113920>] (chrdev_open+0x9c/0x158) from [<c010e488>] (do_dentry_open+0x1f8/0x280)
    [<c010e488>] (do_dentry_open+0x1f8/0x280) from [<c010e600>] (finish_open+0x34/0x50)
    [<c010e600>] (finish_open+0x34/0x50) from [<c011cc58>] (do_last+0x5bc/0xc00)
    [<c011cc58>] (do_last+0x5bc/0xc00) from [<c011d34c>] (path_openat+0xb0/0x484)
    [<c011d34c>] (path_openat+0xb0/0x484) from [<c011d824>] (do_filp_open+0x30/0x84)
    [<c011d824>] (do_filp_open+0x30/0x84) from [<c010e0f8>] (do_sys_open+0xe8/0x170)
    [<c010e0f8>] (do_sys_open+0xe8/0x170) from [<c000f040>] (ret_fast_syscall+0x0/0x30)

    Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
videobuf2: Add support for file access mode flags for DMABUF exporting

Currently it is not possible for userspace to map a DMABUF exported buffer
with write permissions. This patch allows to also pass O_RDONLY/O_RDWR when
exporting the buffer, so that userspace may map it with write permissions.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Update to Mali/UMP R4P0-00rel0

Straight from ARM tarballs.
Mali/UMP build fixes

Adds an arch config for UMP to enable 512mb of OS-managed memory.
Mali customization for ODROID
ARM: plat-samsung: allow Mali GPU Utilization to work even if there's not DVFS