]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: fbcon: Keep atleast one mode in modelist
authorNaveen Kumar S <nkumars@nvidia.com>
Tue, 1 Sep 2015 06:35:54 +0000 (12:05 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 8 Sep 2015 11:35:48 +0000 (04:35 -0700)
Framebuffer console init requires atleast one valid
mode to exist for it to succeed.
Virtual terminals relies on the success of fbcon_init
without really checking the return value of this function.

tegra_dc_vga_mode already defined in dc.c. Removed duplicate
defination in hdmi.c and hdmi2.0.c

bug 200036424
bug 200130124
bug 200129681

Change-Id: Ia34da6ab3814f667a485d23ef88e1a52f8b5519b
Signed-off-by: Pankaj Dabade <pdabade@nvidia.com>
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/707309
(cherry picked from commit 73a561a53469912d94c0dea866646c87ec257bef)
Reviewed-on: http://git-master/r/792235
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/hdmi.c
drivers/video/tegra/dc/hdmi2.0.c
drivers/video/tegra/fb.c

index 58783cde8e3352fc34bb681af6a09f06bfde1e76..eee3b3fadcf5cc36b3d754112b701105bcdb554e 100644 (file)
@@ -56,6 +56,8 @@
 
 extern atomic_t sd_brightness;
 
+extern struct fb_videomode tegra_dc_vga_mode;
+
 enum {
        TEGRA_HPD_STATE_FORCE_DEASSERT = -1,
        TEGRA_HPD_STATE_NORMAL = 0,
index 252a2b31125931e45402d02aad006c5ec3cbef75..d4245cbd77643a663d7b7f4cf55cd54017529dce 100644 (file)
@@ -94,7 +94,7 @@ EXPORT_TRACEPOINT_SYMBOL(display_readl);
 #define DC_COM_PIN_OUTPUT_POLARITY1_INIT_VAL   0x01000000
 #define DC_COM_PIN_OUTPUT_POLARITY3_INIT_VAL   0x0
 
-static struct fb_videomode tegra_dc_vga_mode = {
+struct fb_videomode tegra_dc_vga_mode = {
        .refresh = 60,
        .xres = 640,
        .yres = 480,
index 3174a0e689505e5cb9d26c67566273a10044e8a5..d6e55f5de249b2738fccb0727207d1709b123430 100644 (file)
@@ -99,21 +99,6 @@ static struct kobj_attribute hdmi_audio_channel_config =
 
 static struct kobject *hdmi_audio;
 
-
-static struct fb_videomode tegra_dc_vga_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,
-};
 #if defined(CONFIG_ARCH_TEGRA_3x_SOC)
 const struct tmds_config tmds_config[] = {
        { /* 480p modes */
index 45732e585bc8e3dd900746756952a9e354763157..43d9133cb3411209dae7ea4b88f7dbd7d2a1da53 100644 (file)
 
 #define TMDS_NODE      "/host1x/sor1"
 
-/* Possibly should be moved to hdmi_common.h */
-static struct fb_videomode tegra_dc_vga_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,
-};
-
 extern bool G_RECOVERY_HACK;
 
 static ssize_t hdmi_ddc_power_toggle(struct kobject *kobj,
index 397ddd9ac7e9d6d7684bccfe65771f5d264c835f..2c39683c39938b3586a480c3a95fd7d531783bea 100644 (file)
@@ -649,6 +649,10 @@ void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info,
                 * displayed on 'mode' device.
                 */
                fb_info->info->mode = (struct fb_videomode*) NULL;
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE
+               fb_add_videomode(&tegra_dc_vga_mode, &fb_info->info->modelist);
+               fb_videomode_to_var(&fb_info->info->var, &tegra_dc_vga_mode);
+#endif
 
                /* For L4T - After the next hotplug, framebuffer console will
                 * use the old variable screeninfo by default, only video-mode