From 54c32208ccb8866575a2f7d9f4faa7878f54e7ad Mon Sep 17 00:00:00 2001 From: Jon Mayo Date: Fri, 16 Mar 2012 12:50:59 -0700 Subject: Revert "video: tegra: dc: load video mode during vblank" Change-Id: Ib1b0fc6015a9dd45982a97231972dadba6b5a92e Reviewed-on: http://git-master/r/96966 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- drivers/video/tegra/dc/dc.c | 84 +-------------------------------------------- 1 file changed, 1 insertion(+), 83 deletions(-) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 51af1e008e8b..20f80f940650 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -64,8 +63,6 @@ #define ALL_UF_INT (0) #endif -static int calc_refresh(const struct tegra_dc_mode *m); - static int no_vsync; static void _tegra_dc_controller_disable(struct tegra_dc *dc); @@ -1614,6 +1611,7 @@ static bool check_ref_to_sync(struct tegra_dc_mode *mode) return true; } +#ifdef DEBUG /* return in 1000ths of a Hertz */ static int calc_refresh(const struct tegra_dc_mode *m) { @@ -1628,7 +1626,6 @@ static int calc_refresh(const struct tegra_dc_mode *m) return refresh; } -#ifdef DEBUG static void print_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode, const char *note) { @@ -1739,12 +1736,7 @@ static int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode int tegra_dc_set_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode) { - unsigned long flags; - - spin_lock_irqsave(&dc->mode_lock, flags); memcpy(&dc->mode, mode, sizeof(dc->mode)); - dc->mode_dirty = true; - spin_unlock_irqrestore(&dc->mode_lock, flags); print_mode(dc, mode, __func__); @@ -1752,46 +1744,6 @@ int tegra_dc_set_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode) } EXPORT_SYMBOL(tegra_dc_set_mode); -/* convert tegra_dc_mode to fb_videomode - * return non-zero on error. */ -int tegra_dc_to_fb_videomode(struct fb_videomode *fbmode, - const struct tegra_dc_mode *mode) -{ - if (!fbmode || !mode || !mode->pclk) - return -EINVAL; - - memset(fbmode, 0, sizeof(*fbmode)); - - if (mode->rated_pclk >= 1000) - fbmode->pixclock = KHZ2PICOS(mode->rated_pclk / 1000); - else if (mode->pclk >= 1000) - fbmode->pixclock = KHZ2PICOS(mode->pclk / 1000); - fbmode->hsync_len = mode->h_sync_width; - fbmode->vsync_len = mode->v_sync_width; - fbmode->left_margin = mode->h_back_porch; - fbmode->upper_margin = mode->v_back_porch; - fbmode->xres = mode->h_active; - fbmode->yres = mode->v_active; - fbmode->right_margin = mode->h_front_porch; - fbmode->lower_margin = mode->v_front_porch; - fbmode->vmode = FB_VMODE_NONINTERLACED; - fbmode->vmode |= mode->stereo_mode ? -#ifndef CONFIG_TEGRA_HDMI_74MHZ_LIMIT - FB_VMODE_STEREO_FRAME_PACK -#else - FB_VMODE_STEREO_LEFT_RIGHT -#endif - : 0; - fbmode->sync |= (mode->flags & TEGRA_DC_MODE_FLAG_NEG_H_SYNC) ? - 0 : FB_SYNC_HOR_HIGH_ACT; - fbmode->sync |= (mode->flags & TEGRA_DC_MODE_FLAG_NEG_V_SYNC) ? - 0 : FB_SYNC_VERT_HIGH_ACT; - fbmode->refresh = (calc_refresh(mode) + 500) / 1000; - - return 0; -} -EXPORT_SYMBOL(tegra_dc_to_fb_videomode); - int tegra_dc_set_fb_mode(struct tegra_dc *dc, const struct fb_videomode *fbmode, bool stereo_mode) { @@ -2180,18 +2132,6 @@ static bool tegra_dc_windows_are_dirty(struct tegra_dc *dc) return false; } -static void tegra_dc_update_mode(struct tegra_dc *dc) -{ - unsigned long flags; - - spin_lock_irqsave(&dc->mode_lock, flags); - if (dc->mode_dirty) { - tegra_dc_program_mode(dc, &dc->mode); - dc->mode_dirty = false; - } - spin_unlock_irqrestore(&dc->mode_lock, flags); -} - static void tegra_dc_trigger_windows(struct tegra_dc *dc) { u32 val, i; @@ -2251,9 +2191,6 @@ static void tegra_dc_one_shot_irq(struct tegra_dc *dc, unsigned long status) /* Mark the frame_end as complete. */ if (!completion_done(&dc->frame_end_complete)) complete(&dc->frame_end_complete); - - /* handle a mode change, if it was scheduled */ - tegra_dc_update_mode(dc); } } @@ -2278,8 +2215,6 @@ static void tegra_dc_continuous_irq(struct tegra_dc *dc, unsigned long status) if (!completion_done(&dc->frame_end_complete)) complete(&dc->frame_end_complete); - /* handle a mode change, if it was scheduled */ - tegra_dc_update_mode(dc); tegra_dc_trigger_windows(dc); } } @@ -2932,7 +2867,6 @@ static int tegra_dc_probe(struct nvhost_device *ndev) mutex_init(&dc->lock); mutex_init(&dc->one_shot_lock); - spin_lock_init(&dc->mode_lock); init_completion(&dc->frame_end_complete); init_waitqueue_head(&dc->wq); #ifdef CONFIG_ARCH_TEGRA_2x_SOC @@ -3019,22 +2953,6 @@ static int tegra_dc_probe(struct nvhost_device *ndev) dc->fb = NULL; } - if (dc->out && dc->out->n_modes) { - struct fb_monspecs specs; - int i; - - memset(&specs, 0, sizeof(specs)); - specs.max_x = dc->mode.h_active * 1000; - specs.max_y = dc->mode.v_active * 1000; - specs.modedb_len = dc->out->n_modes; - specs.modedb = kzalloc(specs.modedb_len * - sizeof(struct fb_videomode), GFP_KERNEL); - for (i = 0; i < dc->out->n_modes; i++) - tegra_dc_to_fb_videomode(&specs.modedb[i], - &dc->out->modes[i]); - tegra_fb_update_monspecs(dc->fb, &specs, NULL); - } - if (dc->out && dc->out->hotplug_init) dc->out->hotplug_init(); -- cgit v1.2.3 From b26d1dbafda0ff28b3aa2811b185411f67c0a768 Mon Sep 17 00:00:00 2001 From: Adam Cheney Date: Tue, 20 Mar 2012 18:07:12 -0700 Subject: video: tegra: dc: update windows after set lut TEGRA_DC_EXT_SET_LUT programmed the proper shadow registers but did not copy the shadow registers to the active set. Signed-off-by: Adam Cheney bug 947281 Change-Id: Id734e128bb708f1a75c0cad22b0c51b083d8df3b Reviewed-on: http://git-master/r/91368 Reviewed-by: Simone Willett Tested-by: Simone Willett --- drivers/video/tegra/dc/dc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 20f80f940650..b2a7281757a4 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -764,6 +764,8 @@ static int tegra_dc_update_winlut(struct tegra_dc *dc, int win_idx, int fbovr) mutex_unlock(&dc->lock); + tegra_dc_update_windows(&win, 1); + return 0; } -- cgit v1.2.3 From a60c525119bfbe1b4f2fa5655be0d087dfa4017b Mon Sep 17 00:00:00 2001 From: Jon Mayo Date: Tue, 14 Feb 2012 13:12:04 -0800 Subject: video: tegra: dc: add tracing information add trace_printk to log useful debug information. Bug 870685 Change-Id: I29c0b1600f234ebb06d19c8b6c713b16f6e7643c Signed-off-by: Jon Mayo Reviewed-on: http://git-master/r/89204 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Prashant Malani --- drivers/video/tegra/dc/dc.c | 76 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 5 deletions(-) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index b2a7281757a4..5f44b373fc11 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -168,6 +168,34 @@ static inline bool tegra_dc_is_yuv_planar(int fmt) print(data, buff); \ } while (0) +#define print_mode_info(dc, mode) do { \ + trace_printk("%s:Mode settings: " \ + "ref_to_sync: H = %d V = %d, " \ + "sync_width: H = %d V = %d, " \ + "back_porch: H = %d V = %d, " \ + "active: H = %d V = %d, " \ + "front_porch: H = %d V = %d, " \ + "pclk = %d, stereo mode = %d\n", \ + dc->ndev->name, \ + mode.h_ref_to_sync, mode.v_ref_to_sync, \ + mode.h_sync_width, mode.v_sync_width, \ + mode.h_back_porch, mode.v_back_porch, \ + mode.h_active, mode.v_active, \ + mode.h_front_porch, mode.v_front_porch, \ + mode.pclk, mode.stereo_mode); \ + } while (0) + +#define print_underflow_info(dc) do { \ + trace_printk("%s:Underflow stats: underflows : %llu, " \ + "undeflows_a : %llu, " \ + "underflows_b : %llu, " \ + "underflows_c : %llu\n", \ + dc->ndev->name, \ + dc->stats.underflows, \ + dc->stats.underflows_a, dc->stats.underflows_b, \ + dc->stats.underflows_c); \ + } while (0) + static void _dump_regs(struct tegra_dc *dc, void *data, void (* print)(void *data, const char *str)) { @@ -980,6 +1008,8 @@ static unsigned long tegra_dc_get_bandwidth( /* to save power, call when display memory clients would be idle */ static void tegra_dc_clear_bandwidth(struct tegra_dc *dc) { + trace_printk("%s:%s rate=%d\n", dc->ndev->name, __func__, + dc->emc_clk_rate); if (tegra_is_clk_enabled(dc->emc_clk)) clk_disable(dc->emc_clk); dc->emc_clk_rate = 0; @@ -1006,6 +1036,8 @@ static void tegra_dc_program_bandwidth(struct tegra_dc *dc) if (w->bandwidth != w->new_bandwidth && w->new_bandwidth != 0) tegra_dc_set_latency_allowance(dc, w); + trace_printk("%s:win%u bandwidth=%d\n", dc->ndev->name, w->idx, + w->bandwidth); } } @@ -1029,6 +1061,7 @@ static int tegra_dc_set_dynamic_emc(struct tegra_dc_win *windows[], int n) if (tegra_dc_has_multiple_dc()) new_rate = ULONG_MAX; + trace_printk("%s:new_emc_clk_rate=%ld\n", dc->ndev->name, new_rate); dc->new_emc_clk_rate = new_rate; return 0; @@ -1258,6 +1291,9 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) dfixed_trunc(win->w), dfixed_trunc(win->h), win->out_x, win->out_y, win->out_w, win->out_h, win->fmt, yuvp, Bpp, filter_h, filter_v); + trace_printk("%s:win%u in:%ux%u out:%ux%u fmt=%d\n", + dc->ndev->name, win->idx, dfixed_trunc(win->w), + dfixed_trunc(win->h), win->out_w, win->out_h, win->fmt); } if (update_blend) { @@ -1295,6 +1331,7 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) update_mask |= NC_HOST_TRIG; tegra_dc_writel(dc, update_mask, DC_CMD_STATE_CONTROL); + trace_printk("%s:update_mask=%#lx\n", dc->ndev->name, update_mask); mutex_unlock(&dc->lock); if (dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE) @@ -1352,6 +1389,7 @@ static bool tegra_dc_windows_are_clean(struct tegra_dc_win *windows[], /* does not support syncing windows on multiple dcs in one call */ int tegra_dc_sync_windows(struct tegra_dc_win *windows[], int n) { + int ret; if (n < 1 || n > DC_N_WINDOWS) return -EINVAL; @@ -1360,13 +1398,18 @@ int tegra_dc_sync_windows(struct tegra_dc_win *windows[], int n) #ifdef CONFIG_TEGRA_SIMULATION_PLATFORM /* Don't want to timeout on simulator */ - return wait_event_interruptible(windows[0]->dc->wq, + ret = wait_event_interruptible(windows[0]->dc->wq, tegra_dc_windows_are_clean(windows, n)); #else - return wait_event_interruptible_timeout(windows[0]->dc->wq, + trace_printk("%s:Before wait_event_interruptible_timeout\n", + windows[0]->dc->ndev->name); + ret = wait_event_interruptible_timeout(windows[0]->dc->wq, tegra_dc_windows_are_clean(windows, n), HZ); + trace_printk("%s:After wait_event_interruptible_timeout\n", + windows[0]->dc->ndev->name); #endif + return ret; } EXPORT_SYMBOL(tegra_dc_sync_windows); @@ -1707,6 +1750,7 @@ static int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode rate = tegra_dc_clk_get_rate(dc); pclk = tegra_dc_pclk_round_rate(dc, mode->pclk); + trace_printk("%s:pclk=%ld\n", dc->ndev->name, pclk); if (pclk < (mode->pclk / 100 * 99) || pclk > (mode->pclk / 100 * 109)) { dev_err(&dc->ndev->dev, @@ -1718,6 +1762,7 @@ static int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode } div = (rate * 2 / pclk) - 2; + trace_printk("%s:div=%ld\n", dc->ndev->name, div); tegra_dc_writel(dc, 0x00010001, DC_DISP_SHIFT_CLOCK_OPTIONS); @@ -1732,6 +1777,7 @@ static int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode tegra_dc_writel(dc, GENERAL_UPDATE, DC_CMD_STATE_CONTROL); tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); + print_mode_info(dc, dc->mode); return 0; } @@ -2087,15 +2133,21 @@ static void tegra_dc_underflow_handler(struct tegra_dc *dc) int i; dc->stats.underflows++; - if (dc->underflow_mask & WIN_A_UF_INT) + if (dc->underflow_mask & WIN_A_UF_INT) { dc->stats.underflows_a += tegra_dc_underflow_count(dc, DC_WINBUF_AD_UFLOW_STATUS); - if (dc->underflow_mask & WIN_B_UF_INT) + trace_printk("%s:Window A Underflow\n", dc->ndev->name); + } + if (dc->underflow_mask & WIN_B_UF_INT) { dc->stats.underflows_b += tegra_dc_underflow_count(dc, DC_WINBUF_BD_UFLOW_STATUS); - if (dc->underflow_mask & WIN_C_UF_INT) + trace_printk("%s:Window B Underflow\n", dc->ndev->name); + } + if (dc->underflow_mask & WIN_C_UF_INT) { dc->stats.underflows_c += tegra_dc_underflow_count(dc, DC_WINBUF_CD_UFLOW_STATUS); + trace_printk("%s:Window C Underflow\n", dc->ndev->name); + } /* Check for any underflow reset conditions */ for (i = 0; i < DC_N_WINDOWS; i++) { @@ -2107,6 +2159,9 @@ static void tegra_dc_underflow_handler(struct tegra_dc *dc) schedule_work(&dc->reset_work); /* reset counter */ dc->windows[i].underflows = 0; + trace_printk("%s:Reset work scheduled for " + "window %c\n", + dc->ndev->name, (65 + i)); } #endif } else { @@ -2119,6 +2174,7 @@ static void tegra_dc_underflow_handler(struct tegra_dc *dc) dc->underflow_mask = 0; val = tegra_dc_readl(dc, DC_CMD_INT_MASK); tegra_dc_writel(dc, val | ALL_UF_INT, DC_CMD_INT_MASK); + print_underflow_info(dc); } #ifndef CONFIG_TEGRA_FPGA_PLATFORM @@ -2488,6 +2544,7 @@ static bool _tegra_dc_controller_enable(struct tegra_dc *dc) tegra_dc_ext_enable(dc->ext); + trace_printk("%s:enable\n", dc->ndev->name); return true; } @@ -2549,6 +2606,7 @@ static bool _tegra_dc_controller_reset_enable(struct tegra_dc *dc) _tegra_dc_controller_disable(dc); } + trace_printk("%s:reset enable\n", dc->ndev->name); return ret; } #endif @@ -2574,6 +2632,7 @@ void tegra_dc_enable(struct tegra_dc *dc) dc->enabled = _tegra_dc_enable(dc); mutex_unlock(&dc->lock); + print_mode_info(dc, dc->mode); } static void _tegra_dc_controller_disable(struct tegra_dc *dc) @@ -2606,12 +2665,15 @@ static void _tegra_dc_controller_disable(struct tegra_dc *dc) /* flush any pending syncpt waits */ while (dc->syncpt[i].min < dc->syncpt[i].max) { + trace_printk("%s:syncpt flush id=%d\n", dc->ndev->name, + dc->syncpt[i].id); dc->syncpt[i].min++; nvhost_syncpt_cpu_incr( &nvhost_get_host(dc->ndev)->syncpt, dc->syncpt[i].id); } } + trace_printk("%s:disabled\n", dc->ndev->name); } void tegra_dc_stats_enable(struct tegra_dc *dc, bool enable) @@ -2696,6 +2758,7 @@ void tegra_dc_disable(struct tegra_dc *dc) mutex_unlock(&dc->lock); if (dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE) mutex_unlock(&dc->one_shot_lock); + print_mode_info(dc, dc->mode); } #ifdef CONFIG_ARCH_TEGRA_2x_SOC @@ -2749,6 +2812,7 @@ static void tegra_dc_reset_worker(struct work_struct *work) unlock: mutex_unlock(&dc->lock); mutex_unlock(&shared_lock); + trace_printk("%s:reset complete\n", dc->ndev->name); } #endif @@ -3025,6 +3089,7 @@ static int tegra_dc_suspend(struct nvhost_device *ndev, pm_message_t state) { struct tegra_dc *dc = nvhost_get_drvdata(ndev); + trace_printk("%s:suspend\n", dc->ndev->name); dev_info(&ndev->dev, "suspend\n"); tegra_dc_ext_disable(dc->ext); @@ -3058,6 +3123,7 @@ static int tegra_dc_resume(struct nvhost_device *ndev) { struct tegra_dc *dc = nvhost_get_drvdata(ndev); + trace_printk("%s:resume\n", dc->ndev->name); dev_info(&ndev->dev, "resume\n"); mutex_lock(&dc->lock); -- cgit v1.2.3 From fbfd93a5d14f4eda665f56b748da037b8194b1d3 Mon Sep 17 00:00:00 2001 From: Jon Mayo Date: Fri, 13 May 2011 11:55:16 -0700 Subject: ARM: tegra: dc: support YUV422 format Change-Id: I8aa25b03fe6801882b65209cb1a6e125ef27ac2c Signed-off-by: Michael I. Gold Reviewed-on: http://git-master/r/98319 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- drivers/video/tegra/dc/dc.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 5f44b373fc11..228cbf1ae575 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -138,14 +138,32 @@ static inline int tegra_dc_fmt_bpp(int fmt) case TEGRA_WIN_FMT_YUV422RA: return 8; + /* YUYV packed into 32-bits */ case TEGRA_WIN_FMT_YCbCr422: case TEGRA_WIN_FMT_YUV422: - /* FIXME: need to know the bpp of these formats */ - return 0; + return 16; } return 0; } +static inline bool tegra_dc_is_yuv(int fmt) +{ + switch (fmt) { + case TEGRA_WIN_FMT_YUV420P: + case TEGRA_WIN_FMT_YCbCr420P: + case TEGRA_WIN_FMT_YCbCr422P: + case TEGRA_WIN_FMT_YUV422P: + case TEGRA_WIN_FMT_YCbCr422: + case TEGRA_WIN_FMT_YUV422: + case TEGRA_WIN_FMT_YCbCr422R: + case TEGRA_WIN_FMT_YUV422R: + case TEGRA_WIN_FMT_YCbCr422RA: + case TEGRA_WIN_FMT_YUV422RA: + return true; + } + return false; +} + static inline bool tegra_dc_is_yuv_planar(int fmt) { switch (fmt) { @@ -1161,6 +1179,7 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) fixed20_12 h_offset, v_offset; bool invert_h = (win->flags & TEGRA_WIN_FLAG_INVERT_H) != 0; bool invert_v = (win->flags & TEGRA_WIN_FLAG_INVERT_V) != 0; + bool yuv = tegra_dc_is_yuv(win->fmt); bool yuvp = tegra_dc_is_yuv_planar(win->fmt); unsigned Bpp = tegra_dc_fmt_bpp(win->fmt) / 8; /* Bytes per pixel of bandwidth, used for dda_inc calculation */ @@ -1190,8 +1209,8 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) continue; } - tegra_dc_writel(dc, win->fmt, DC_WIN_COLOR_DEPTH); - tegra_dc_writel(dc, 0, DC_WIN_BYTE_SWAP); + tegra_dc_writel(dc, win->fmt & 0x1f, DC_WIN_COLOR_DEPTH); + tegra_dc_writel(dc, win->fmt >> 6, DC_WIN_BYTE_SWAP); tegra_dc_writel(dc, V_POSITION(win->out_y) | H_POSITION(win->out_x), @@ -1261,7 +1280,7 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) DC_WIN_BUFFER_ADDR_MODE); val = WIN_ENABLE; - if (yuvp) + if (yuv) val |= CSC_ENABLE; else if (tegra_dc_fmt_bpp(win->fmt) < 24) val |= COLOR_EXPAND; -- cgit v1.2.3 From d5e341a0b8bbabf9096bb5d271c49b40b29da42a Mon Sep 17 00:00:00 2001 From: Kevin Huang Date: Thu, 26 Apr 2012 16:45:05 -0700 Subject: Revert "video: tegra: dc: Clear window option before window update." This reverts commit 90b79e5712300baab889772a5af348559ac95836. Bug 955393 Change-Id: I0e2a15b7d0898dbbb62f09d8bd3502ec93366664 Signed-off-by: Kevin Huang Reviewed-on: http://git-master/r/99261 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo Reviewed-by: Nirav Patel Reviewed-by: Adam Cheney Tested-by: Adam Cheney --- drivers/video/tegra/dc/dc.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 228cbf1ae575..11e62815f45a 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -1164,14 +1164,6 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) else tegra_dc_writel(dc, WRITE_MUX_ASSEMBLY | READ_MUX_ASSEMBLY, DC_CMD_STATE_ACCESS); - for (i = 0; i < DC_N_WINDOWS; i++) { - tegra_dc_writel(dc, WINDOW_A_SELECT << i, - DC_CMD_DISPLAY_WINDOW_HEADER); - tegra_dc_writel(dc, 0, DC_WIN_WIN_OPTIONS); - if (!no_vsync) - update_mask |= WIN_A_ACT_REQ << i; - } - for (i = 0; i < n; i++) { struct tegra_dc_win *win = windows[i]; unsigned h_dda; -- cgit v1.2.3 From 9349cedf17f9b3c10760c8d48f831473f87a3a15 Mon Sep 17 00:00:00 2001 From: Shashank Sharma Date: Mon, 30 Apr 2012 17:36:24 +0530 Subject: video: tegra: dc: Set default videomode Set default videomode during the dc probe. This patch enables HDMI during the probe only and fixes following issues: 1. Until Xinit there was no display on HDMI. 2. Framebuffer console on HDMI needs it to be enabled well before Xinit. Bug: 930136 Change-Id: Ieaf5c69eefa4a6584893425ad4fd772bcd91ea11 Signed-off-by: Shashank Sharma Reviewed-on: http://git-master/r/99635 Reviewed-by: Simone Willett Tested-by: Simone Willett --- drivers/video/tegra/dc/dc.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 11e62815f45a..7161d8bf1694 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -64,6 +64,20 @@ #endif static int no_vsync; +static struct fb_videomode tegra_dc_hdmi_fallback_mode = { + .refresh = 60, + .xres = 640, + .yres = 480, + .pixclock = KHZ2PICOS(25200), + .hsync_len = 96, /* h_sync_width */ + .vsync_len = 2, /* v_sync_width */ + .left_margin = 48, /* h_back_porch */ + .upper_margin = 33, /* v_back_porch */ + .right_margin = 16, /* h_front_porch */ + .lower_margin = 10, /* v_front_porch */ + .vmode = 0, + .sync = 0, +}; static void _tegra_dc_controller_disable(struct tegra_dc *dc); @@ -2622,10 +2636,19 @@ static bool _tegra_dc_controller_reset_enable(struct tegra_dc *dc) } #endif +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) - return false; + if (dc->mode.pclk == 0) { + /* DC enable called but no videomode is loaded. + Set fallback mode to enable driver with.*/ + if (_tegra_dc_set_default_videomode(dc)) + return false; + } if (!dc->out) return false; -- cgit v1.2.3 From 9c36a7d25b978864c25a5c5649cd803898872600 Mon Sep 17 00:00:00 2001 From: Hunk Lin Date: Thu, 3 May 2012 05:35:47 +0800 Subject: Revert "video: tegra: dc: Set default videomode" This reverts commit 9349cedf17f9b3c10760c8d48f831473f87a3a15. It is reviewed on http://git-master/r/99635 It will cause HDMI power ON and emc clock bump up to 667Mhz after resume from LP0. bug 930136 Change-Id: I130494fdb381b3d322ac0e3fc8be2e44f2c2d7a7 Signed-off-by: Hunk Lin Reviewed-on: http://git-master/r/100202 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo --- drivers/video/tegra/dc/dc.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 7161d8bf1694..11e62815f45a 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -64,20 +64,6 @@ #endif static int no_vsync; -static struct fb_videomode tegra_dc_hdmi_fallback_mode = { - .refresh = 60, - .xres = 640, - .yres = 480, - .pixclock = KHZ2PICOS(25200), - .hsync_len = 96, /* h_sync_width */ - .vsync_len = 2, /* v_sync_width */ - .left_margin = 48, /* h_back_porch */ - .upper_margin = 33, /* v_back_porch */ - .right_margin = 16, /* h_front_porch */ - .lower_margin = 10, /* v_front_porch */ - .vmode = 0, - .sync = 0, -}; static void _tegra_dc_controller_disable(struct tegra_dc *dc); @@ -2636,19 +2622,10 @@ static bool _tegra_dc_controller_reset_enable(struct tegra_dc *dc) } #endif -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) { - /* DC enable called but no videomode is loaded. - Set fallback mode to enable driver with.*/ - if (_tegra_dc_set_default_videomode(dc)) - return false; - } + if (dc->mode.pclk == 0) + return false; if (!dc->out) return false; -- cgit v1.2.3 From dfd813141283891e397d73958aabad38eddfe350 Mon Sep 17 00:00:00 2001 From: Shashank Sharma Date: Mon, 30 Apr 2012 17:36:24 +0530 Subject: video: tegra: dc: Set default videomode Set default videomode during the dc probe. This patch enables HDMI during the probe only and fixes following issues: 1. Until Xinit there was no display on HDMI. 2. Framebuffer console on HDMI needs it to be enabled well before Xinit. To avoide un-necessary powering on HDMI,Check HPD and enable HDMI only if it's present. Bug: 930136 Bug: 977705 Change-Id: Ifb71328e5df0ccbb5751669db71fd24719fe3738 Signed-off-by: Shashank Sharma Reviewed-on: http://git-master/r/100656 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- drivers/video/tegra/dc/dc.c | 65 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 7 deletions(-) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 11e62815f45a..c42df4c1957e 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -33,6 +33,7 @@ #include #include #include +#include #include