video: tegra: host: Merge tegra_grhost and host1x devices

- tegra_grhost is a platform device that represents host1x
- nvhost has device host1x which represents the same hardware
- merge these two device structs
- as the new struct is a nvhost_device, platform_driver
is also converted into a nvhost_driver
- register nvhost device before other graphics devices.
this ensures that nvhost_probe() is called as soon as
nvhost_driver is registered with the core.
- this also ensures that nvmap is probed first, followed
by nvhost, followed by tegra-dc and nvavp (if they
are enabled).

Change-Id: Ic420a6516a9cb20d6f481692a4db10fa6053dd90
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/82631
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
video: tegra: host: register nvhost master device in board-xxx-panel.c

- the suspend order of devices is governed by the order
in which devices are registered
- this commit ensures that nvhost master is registered before
any of the graphics devices
- previously this was done in rootfs_init call which is
later than arch_init calls of board-xxx-panel.c
- this caused tegra-dc device to be registered *before* nvhost
master device. as a result it was suspended *later* than nvhost
master device. this is a clear violation of dependency rule
for nvhost. this caused suspend-resume to fail for L4T
- this worked on android as it has CONFIG early suspend enabled
while it failed for L4T which doesn't have CONFIG early suspend
enabled

Bug 947617

Change-Id: I6cd405f3ba23d004e7659140019f5130e6c25159
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/87756
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
kernel:mm: Backported vzalloc to support ZRAM
video: tegra: host: convert kzalloc to vzalloc

nvhost_job uses kzalloc to hold meta data. Convert
it to vzalloc to avoid large physically contiguous
allocations at runtime.

Change-Id: I13d7e7d60e93354fcf69e5478437fa206b880dcc
Signed-off-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-on: http://git-master/r/87967
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
video: tegra: host: Disable irq on shutdown

Disable interrupts when driver is being removed.

Bug 952600

Change-Id: I1d697c3c87aca935deadfe20b5e8fa8852b0e556
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/89405
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
video: tegra: clean-up warnings and code style

fix some build warnings and bad code style.

Change-Id: I907296ce0e5437dfd6acd0b2b3c119b6dbde7b1c
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/89634
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
video: tegra: host: Correct waitchk comparison logic

Change waitchk comparison logic to use the new
nvhost_syncpt_is_expired().

Bug 941327

Change-Id: Ib7de04ad7663990bb416e39f8d79a46a9f5955fa
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/89769
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
video: tegra: host: Remove pre-check in syncpt wait

Remove the check and debug dump for cases where we compare against
an old syncpt value. Also removes an extra check that is already done
by wait_event_interruptible_timeout();

Bug 941327

Change-Id: Icbaf70b04a8bd070c3fdd3467b981de11219d2b9
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/92283
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
video: tegra: host: api clean-up

- remove redundant 2nd argument to nvhost_module_suspend()
- also remove the debug_not_idle() as it redundant after
refactor of host1x code
- debug_not_idle() iterates through host1x's private instance
of channels to find out which client module is active (along
with host1x itself). we are going to remove these instances of
channels from host1x's device private data
- reduce the prints during suspend

Bug 871237

Change-Id: I66c7c4d8f35c157b1626784a6a27166442a50557
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/92550
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>