summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Zhang <mzhang@nvidia.com>2012-06-15 16:10:43 -0700
committerRyan Wong <ryanw@nvidia.com>2012-06-18 18:45:06 -0700
commit12a12a3ad4bf4d54bfeefa75b42bae2801472e82 (patch)
tree42f78d84c8dc81bd76af269f59cf13d4e93efb49
parent2590264e5d3c59e299a00572a5b26bf96c244c3e (diff)
video: tegra: dc: move set default videomode out of _tegra_dc_enable.tegra-15r7.1-android-4.0
Set default videomode happens during probe and resume. _tegra_dc_enable is also called during hotplug, setting default videomode there causes hdcp test failure. Also, fixes checkpatch.pl errors. bug 991805 Change-Id: Ica3cab9dd96d9766bd63301000ec29edc510ee34 Reviewed-on: http://git-master/r/109362 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: Marvin Zhang <mzhang@nvidia.com> Tested-by: Marvin Zhang <mzhang@nvidia.com> Reviewed-by: Ryan Wong <ryanw@nvidia.com>
-rw-r--r--drivers/video/tegra/dc/dc.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 935f18b..7e6c8d7 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -660,7 +660,7 @@ static u32 blend_topwin(u32 flags)
return BLEND(NOKEY, FIX, 0xff, 0xff);
}
-static u32 blend_2win(int idx, unsigned long behind_mask, u32* flags, int xy)
+static u32 blend_2win(int idx, unsigned long behind_mask, u32 *flags, int xy)
{
int other;
@@ -676,7 +676,7 @@ static u32 blend_2win(int idx, unsigned long behind_mask, u32* flags, int xy)
return BLEND(NOKEY, FIX, 0x00, 0x00);
}
-static u32 blend_3win(int idx, unsigned long behind_mask, u32* flags)
+static u32 blend_3win(int idx, unsigned long behind_mask, u32 *flags)
{
unsigned long infront_mask;
int first;
@@ -1418,7 +1418,7 @@ u32 tegra_dc_incr_syncpt_max(struct tegra_dc *dc, int i)
void tegra_dc_incr_syncpt_min(struct tegra_dc *dc, int i, u32 val)
{
mutex_lock(&dc->lock);
- if ( dc->enabled )
+ if (dc->enabled)
while (dc->syncpt[i].min < val) {
dc->syncpt[i].min++;
nvhost_syncpt_cpu_incr(
@@ -2668,19 +2668,13 @@ static bool _tegra_dc_controller_reset_enable(struct tegra_dc *dc)
static int _tegra_dc_set_default_videomode(struct tegra_dc *dc)
{
- return tegra_dc_set_fb_mode(dc, &tegra_dc_hdmi_fallback_mode, 0);
-}
-
-static bool _tegra_dc_enable(struct tegra_dc *dc)
-{
if (dc->mode.pclk == 0) {
switch (dc->out->type) {
case TEGRA_DC_OUT_HDMI:
/* DC enable called but no videomode is loaded.
Check if HDMI is connected, then set fallback mdoe */
if (tegra_dc_hpd(dc)) {
- if (_tegra_dc_set_default_videomode(dc))
- return false;
+ return tegra_dc_set_fb_mode(dc, &tegra_dc_hdmi_fallback_mode, 0);
} else
return false;
@@ -2695,6 +2689,12 @@ static bool _tegra_dc_enable(struct tegra_dc *dc)
return false;
}
}
+}
+
+static bool _tegra_dc_enable(struct tegra_dc *dc)
+{
+ if (dc->mode.pclk == 0)
+ return false;
if (!dc->out)
return false;
@@ -3063,8 +3063,10 @@ static int tegra_dc_probe(struct nvhost_device *ndev,
}
mutex_lock(&dc->lock);
- if (dc->pdata->flags & TEGRA_DC_FLAG_ENABLED)
+ if (dc->pdata->flags & TEGRA_DC_FLAG_ENABLED) {
dc->enabled = _tegra_dc_enable(dc);
+ _tegra_dc_set_default_videomode(dc);
+ }
mutex_unlock(&dc->lock);
/* interrupt handler must be registered before tegra_fb_register() */
@@ -3206,8 +3208,10 @@ static int tegra_dc_resume(struct nvhost_device *ndev)
mutex_lock(&dc->lock);
dc->suspended = false;
- if (dc->enabled)
+ if (dc->enabled) {
_tegra_dc_enable(dc);
+ _tegra_dc_set_default_videomode(dc);
+ }
if (dc->out && dc->out->hotplug_init)
dc->out->hotplug_init();