video: tegra: dsi: WAR to stop on going host write

WAR comprises of soft reset dsi controller followed by
explicitly clearing host trigger.

Bug 982919

Change-Id: Ia8c497dd496435e429cd5b5ee8aaf1b7d78dc797
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/102204
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
video: tegra: dc: recover underflow error

1. set UF_LINE_FLUSH to 0 by default.
2. if it gets 4 consecutive frames with underflows, enable UF_LINE_FLUSH to
get rid of underflow condition.

Signed-off-by: Jay Cheng <jacheng@nvidia.com>
Change-Id: I6d647d958484ee355809036bec7ca1b0c716017b
Reviewed-on: http://git-master/r/103227
Reviewed-by: Michael I Gold <gold@nvidia.com>
video: tegra: host: Exclude suspend/resume if disabled

Compile power management suspend and resume functions only when
CONFIG_PM is enabled.

Change-Id: If349984d62ed002594ba60ac25cd4dddd956aa6c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/109425
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
video: tegra: host: resolve compilation time warnings

- Handled warning of, possible use of uninitialized variable and unused
function.

bug 949219

Change-Id: I0d7d345e66774f08e52a12e653a5e7aa6a7a8591
Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com>
Reviewed-on: http://git-master/r/113905
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
video: tegra: dsi: Fix host HS transmission

Fixing host transmission with HS enabled.

Bug 999141

Change-Id: I9dcc5282971830865dacf16dbbbebf4096aeb00e
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/118315
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
video: tegra: hdcp: Fix Locking Issue

Locking in nvhdcp was set up in such a way that we couldn't
change the state of the HDMI plug while negotiating the HDCP connection.

Another lock was added that is only taken when the state of the plug or
hdcp session are changed.  This enables correct failure if the plug is removed
during negotiation.

Bug 1024031

Reviewed-on: http://git-master/r/120546
(cherry picked from commit 51f746421b73f8f378bd7908b35fd6c79687e239)

Change-Id: Id9a9b09f2cd03a1b51e7334391f35fc076a1e1dd
Signed-off-by: Matt Wagner <mwagner@nvidia.com>
Reviewed-on: http://git-master/r/121399
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jon Mayo <jmayo@nvidia.com>

Fix Graphic driver update from endeavoru.
Add mutex state lock/unlock at nvhdcp->state = STATE_UNAUTHENTICATED;

Signed-off-by: demetris <ierokipides.dem@gmail.com>
Revert "video: tegra: hdcp: Add Missing Lock"

This reverts commit 77c8da0aa18fad9e33fd8b1afb2013b1a476d74e.

Bug 1030468
Bug 1030415

Signed-off-by: Matt Wagner <mwagner@nvidia.com>
Change-Id: I2b85159dfcfc40b3a3632dc1300c729e0977a18f
Reviewed-on: http://git-master/r/126946
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Revert "video: tegra: hdcp: Fix Locking Issue"

This reverts commit 51f746421b73f8f378bd7908b35fd6c79687e239.

Bug 1030468
Bug 1030415

Signed-off-by: Matt Wagner <mwagner@nvidia.com>
Change-Id: If9b5febd812e84848913431dcaf0bdefc518e5d1
Reviewed-on: http://git-master/r/126948
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
arm: tegra: fb: Update fix line_length

Update framebuffer's fix line_length parameter when changing
video mode dynamically.The new line_length should be according
to new x resolution. On addition, check the return value from
dc driver while setting a mode.

Bug 1163682
Bug 1056767
Bug 1056782
Signed-off-by: Shashank Sharma <shashanks@nvidia.com>
Change-Id: Ib0ab48474f0af3235556a7f7f0d8354af3b50994
Reviewed-on: http://git-master/r/147511
(cherry picked from commit 5856c4afde9459ba6afaf2cdcb07361d9fbf8c79)
Reviewed-on: http://git-master/r/160788
Tested-by: Matthew Pedro <mapedro@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
tegra: Add function to release resources

Add a companion function to nvhost_client_device_get_resources()
called nvhost_client_device_put_resources() that does the opposite
thing. This is useful for any nvhost clients that need to be loaded
as modules, since the driver removal path will be exercised in that
case.

Change-Id: Ib5cec6fce7b05c780b135b03fcd88e068f772244
Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/169833
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
tegra: Add nvmap_mark_global()

Add this function, to be able to set the global field of an
nvmap_handle while preserving the nvmap API's encapsulation
mechanisms.

Change-Id: I62de773a65119722f059b114e2d0e906c7e04e83
Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/169834
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
arm: tegra: fb: Update line_length using display width

Unconditionally update line_length using disply width to avoid discrepancy
between line_length and actual display width.

bug 1186388

Change-Id: I8ef2f9cf76a61764c2121f3c2c013b72b830ce2e
Signed-off-by: Jong Kim <jongk@nvidia.com>
Reviewed-on: http://git-master/r/170664
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
arm: tegra: dc: corrct order to enable/disable dc irq

When porting change from mainline to balance dc irq, the change
of enable/disable order was not ported, thus dc irq is disabled
if dc is enabled during probe.

This is part of http://git-master/r/146107.
Original change is big for many bugs, only port one here.

bug 1173177
bug 1173038
bug 1008313

Change-Id: Idd703daca9f980e905b185eeeae19dc6309d76e5
Signed-off-by: Dongfang Shi <dshi@nvidia.com>
Reviewed-on: http://git-master/r/162868
(cherry picked from commit 6ddd8b02f7a17d2269290d06159c20860ffb92e9)
Signed-off-by: Jong Kim <jongk@nvidia.com>
Reviewed-on: http://git-master/r/173249
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
arm: tegra: fb: Set new mode to all vc's

Send change all vc's notification from HDMI hot-plug reader to
fbcon, so that the new selected mode can be applied on all the
vc's from vc1 to vc6. This sometimes causes corruption on HDMI
hot plugin, when fbcon is mapped to HDMI

Bug 1166008
Signed-off-by: Shashank Sharma <shashanks@nvidia.com>
Change-Id: Id173de3014597f79c8c8b31bbbee7c9c560547b6
Reviewed-on: http://git-master/r/168683
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Tested-by: Matthew Pedro <mapedro@nvidia.com>

Conflicts:
	drivers/video/tegra/dc/dc.c
arm: tegra: fb: Fix merge error

Fix manual rebase error

Change-Id: I3b2165488b11bddda271cecdc979341c130def9b
Signed-off-by: Shashank Sharma <shashanks@nvidia.com>
Reviewed-on: http://git-master/r/173554
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
video: tegra: dc: minimum window size is 1x1

Use 1x1 as the minimum window size.

Bug 1193195

Change-Id: I42e13fec82bbc2dc37bde6416088f3ae49b304b7
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/173302
(cherry picked from commit 3f160560b48fdf501547b9fc1f7c5bf8bd5e32af)
Reviewed-on: http://git-master/r/190810
Reviewed-by: Eric Brower <ebrower@nvidia.com>
Tested-by: Eric Brower <ebrower@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
tegra: Make tegra_vi01_device accessible

Make it accessible outside of drivers/video/tegra. V4L2 driver needs
to set some platform_data.

Add suport for T20.

Change-Id: I98353c2874ea28cfa0a7a5dd8a1dc4c586af4dd7
Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/200220
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
tegra: When using V4L2, don't use vi client.

The VI client within drivers/video/tegra is mutually exclusive with the
Tegra V4L2 framework, since they both want to own the camera hardware.

Change-Id: Idebd0f619f5fc7eb6323b2e08c29c9692c8887a0
Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/200221
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
video: tegra: dc: Bail out on incorrect window attributes

bug 1066942

Change-Id: I139b6a340ba570ff020cc41ec6ad219c578e14f9
Signed-off-by: Raghavendra VK <rvk@nvidia.com>
Reviewed-on: http://git-master/r/192455
(cherry picked from commit ba14b64bd23027a336fa70a2e2ee9264c36d4b94)
Reviewed-on: http://git-master/r/201261
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jon Mayo <jmayo@nvidia.com>