omaplfb: Add omaplfb to the kernel tree

omaplfb has dependencies on several kernel components and it will
be easier to maintain it in the kernel tree.

Sync'd to DDK omaplfb patch:
omaplfb: Allocate a clear buffer with 8 pixel stride per GC requirement

Change-Id: I0c781007350fea724aa498f7f8d328db66f9d41c
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
omaplfb: add rotation check to pass the correct stride

Currently omaplfb_bv does calculate stride correctly for NV12.
This patch fixed the stride calculation based on rotation angle.

Change-Id: Icf4b099b2b6780a9e8743c8e712e00d580d1acf4
Signed-off-by: Jack Yen <jyen@ti.com>
omaplfb: Adds missing length assignment to clear buffer

Adds missing length assignment to the buffdesc used to clear
(fill) the framebuffer. This was leading to problems in the GC
driver buffer geometry validation.

Change-Id: Ie75c48b530539f27cb977d3b7eda6fe2dd56901f
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
OMAPLFB: Dont foward compositions to DSSCOMP if overlay is Zero

Do not foward compositions to DSSCOMP in case overlay number
passed by HWC is zero. The dsscomp->num_overlay = 0 means
that there is no primary display and no rendering is required.

Change-Id: If7b582efeb55ce84878d0bfbd19eabd2ebd3afaa
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
Signed-off-by: Dandawate Saket <dsaket@ti.com>
Remove PVR.

Conflicts:
	drivers/gpu/pvr/Kconfig
	drivers/gpu/pvr/Makefile
	drivers/gpu/pvr/omap4/sysconfig.h
	drivers/gpu/pvr/omap4/sysutils_linux.c
	drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c
	drivers/gpu/pvr/pvrsrv.c
OMAP4: ion: remove hardcoded carveout sizes

These are no longer used as android-display is calculating the
carveout sizes.

Change-Id: I3dcaec56158da1a573cb8de9ec3761db94d1a698
Signed-off-by: Lajos Molnar <lajos@ti.com>
Singed-off-by: Dima Svetlov <svetlov@ti.com>

Conflicts:
	arch/arm/mach-omap2/include/mach/omap4_ion.h

Conflicts:
	arch/arm/mach-omap2/include/mach/omap4_ion.h
omap: ion: define carveouts as per system memory configuration

Carveout address and sizes are hardcoded as per 1GB configuration.
512MB configuration will have reduced carveouts and needs
redifinition of carveouts. Static carveout parameters are made
dynamic and calclulated runtime as per system configuration.

Carveout address,size parameters,calculation are made more
easily readable and perceivable.
All carveout parameter initialization needs to happen at
the earliest possible, which is triggerd by board file.

Change-Id: I32bb9e04ef40f5d7d6f7548bba9ab5878bfcb56d
Signed-off-by: Devaraj Rangasamy <dev@ti.com>

Conflicts:
	arch/arm/mach-omap2/omap4_ion.c
OMAPDSS: DSSCOMP: move device to omap plat to configure tiler1d slot

Different devices will have varying requirements on tiler resources. This
change moves the platform device registration for dsscomp to the omap
platform level so at device initialization time we can set the appropriate
Tiler1D slot size.

Change-Id: I5edf5b7cfb056a45ab038b244d2efc758a840b00
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
omap: fix dsscomp platform default to configure a 16MB slot size

Initial commit over allocated the default tiler slot

Change-Id: Ic5ac1048a9f4e43f44c2d568de0903aa7f33a5ba
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
sgx_omaplfb: Create omaplfb platform device file to permit device configuration

Change-Id: Ic790a0440d19d862d981a230470523409b25b9a3
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>

Conflicts:
	arch/arm/plat-omap/sgx_omaplfb.c
OMAP2: generic Android display configuration setup

Added android_display methods to allow runtime configuration of
Android display resources, such as:

- FB0's vram is dynamically calculated from the number of
  buffers SGX requires in VRAM (swap chain and/or composition
  buffers), and the FB0 display size.
- OMAP VRAM is calculated from FB0's vram need + any other
  specified FB's vram.  (If command line is used to specify
  FB vrams, omap vram must also be specified.)
- TILER1D area reserved for use as DSS MMU by DSSCOMP is
  calculated from default display size.  It can be overriden
  by board file.
- TILER2D carveout size is reduced by TILER1D area (if coallocated
  with TILER2D) and by the TILER2D SGX buffers (swapchain and/or
  composition buffers)
- nonsecure TILER2D carveout size is set to the backpages needed
  by TILER2D SGX buffers.

All of this is coordinated by omap_android_display_setup.  It
takes pointers to the DSS board info, FB platform data, and
optionally to the ION, SGX and DSSCOMP platform data.  It should
be called in board_reserve before omap_ion_init.

If SGX data is provided, it is set as the SGX platform data for
FB0.  Similarly, if DSSCOMP platform data is provided it is
also set.  This can be used to set a preferred tiler1d slot size.
If ION platform data is provided, it is updated with the required
tiler2d carveout sizes.

NOTE:

To maximize TILER2D space, the TILER1D area reserved for android
display is not aligned to 1MB, but is aligned to 32 pages as the
smallest 2D allocation needs a 32-page band.  We further reduce
TILER2D space by the container space lost by the SGX buffers,
which may be larger than the actual backpages bneeded for the
SGX buffers.

Therefore the sum of secure + nonsecure + 1D tiler space may
be smaller than the available container space.

Ported to latest SGX DDK by Dima Svetlov.

Change-Id: I5d8858c38efd842452994e3a3476463083d200d7
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
OMAP2: correction in early params functions for android-display

Correction in early params functions in android-display.c

Change-Id: I2bef7e62cc96f75ef23690e29213c8e6d4d545ea
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
plat-omap: android-display: Set min number of vram buffers

Omapfb requires at least one vram buffer

Change-Id: I7d719856e3360314f8bccfba8fcbd3b518496b8b
Signed-off-by: Peter Nordström <nordstrom@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
plat-omap: android-display: add 2 extra VRAM buffers for gc320

2 extra VRAM buffers are needed to gc320 composition

Change-Id: I5e02392f32a93c2eb12314151cd3a72b44fd4ae9
Signed-off-by: Dima Svetlov <svetlov@ti.com>
ION : ION buffers caching support (ION, TILER 1D buffers)

ION map is enhanced to map ion buffers as cached pages
This patch also adds IOCTLs in ION to flush and invalidate
the cached buffers
Note: TILER 2D buffers cant be mapped as cached regions to
MPU due to DMM limitation

Complete list of feature patchset (cross project dependencies)
  http://review.omapzoom.org/18390  kernel/omap
  http://review.omapzoom.org/18391  external/kernel-headers
  http://review.omapzoom.org/18392  bionic
  http://review.omapzoom.org/18393  hardware/ti/omap4xxx
  http://review.omapzoom.org/18394  hardware/ti/domx

Change-Id: I8c7c3f0375a4b3fae13f46a657d0c2eec703f72b
Signed-off-by: Kalpesh Patil <kalpeshpatil@ti.com>
Signed-off-by: Devaraj Rangasamy <dev@ti.com>

Conflicts:
	drivers/gpu/ion/omap/omap_tiler_heap.c

Conflicts:
	drivers/gpu/ion/ion_carveout_heap.c
	drivers/gpu/ion/ion_priv.h
board-tuna: add android-display dependencies
tuna: Update defconfig.

Conflicts:
	arch/arm/configs/nuked_defconfig
tuna: remove duplicate call to set vram
android-display manages this now
rpmsg: omx: add return values to the pa to da convert function

This patch adds return values to the pa to da conversion function.
This will help in propagation of proper error codes to the calling
functions.

Change-Id: Ie547f7b7e7c51eff4b7998cbd336a61663995708
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: store rproc reference during virtio device creation

Get and store a reference to the rproc associated with the
virtio device. This can later be used by rpmsg drivers to
exercise rproc API (for eg: rproc_da_to_pa).

An API is provided to get this reference from a given rpmsg
channel device.

Change-Id: Ieb397a8cbdd9897a09d631f902c37364fa612210
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>