summaryrefslogtreecommitdiff
path: root/drivers/video/tegra
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra')
-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 935f18bc8cfd..7e6c8d7ecbda 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();