diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2019-02-20 20:51:33 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2019-02-20 20:51:33 +0100 |
commit | 4509209f8bfe158403a29d713bd3b2cb8fc2b534 (patch) | |
tree | 952962ad15753569bce64df01410217f900e06aa /drivers/video/fbdev/controlfb.c | |
parent | 35c0272502cca0a1b461d310c23aac94a503983d (diff) | |
parent | 32ea33a044842ae6c5fc7e33426e0a7bd50f8801 (diff) | |
download | linux-4509209f8bfe158403a29d713bd3b2cb8fc2b534.tar.bz2 |
Pull in char-misc-next from Greg
We need 32ea33a04484 ("mei: bus: export to_mei_cl_device for mei
client devices drivers") for the mei-hdcp patches.
References: https://lkml.org/lkml/2019/2/19/356
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/video/fbdev/controlfb.c')
-rw-r--r-- | drivers/video/fbdev/controlfb.c | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 9cb0ef7ac29e..7af8db28bb80 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -411,35 +411,23 @@ static int __init init_control(struct fb_info_control *p) full = p->total_vram == 0x400000; /* Try to pick a video mode out of NVRAM if we have one. */ -#ifdef CONFIG_NVRAM - if (default_cmode == CMODE_NVRAM) { + cmode = default_cmode; + if (IS_REACHABLE(CONFIG_NVRAM) && cmode == CMODE_NVRAM) cmode = nvram_read_byte(NV_CMODE); - if(cmode < CMODE_8 || cmode > CMODE_32) - cmode = CMODE_8; - } else -#endif - cmode=default_cmode; -#ifdef CONFIG_NVRAM - if (default_vmode == VMODE_NVRAM) { + if (cmode < CMODE_8 || cmode > CMODE_32) + cmode = CMODE_8; + + vmode = default_vmode; + if (IS_REACHABLE(CONFIG_NVRAM) && vmode == VMODE_NVRAM) vmode = nvram_read_byte(NV_VMODE); - if (vmode < 1 || vmode > VMODE_MAX || - control_mac_modes[vmode - 1].m[full] < cmode) { - sense = read_control_sense(p); - printk("Monitor sense value = 0x%x, ", sense); - vmode = mac_map_monitor_sense(sense); - if (control_mac_modes[vmode - 1].m[full] < cmode) - vmode = VMODE_640_480_60; - } - } else -#endif - { - vmode=default_vmode; - if (control_mac_modes[vmode - 1].m[full] < cmode) { - if (cmode > CMODE_8) - cmode--; - else - vmode = VMODE_640_480_60; - } + if (vmode < 1 || vmode > VMODE_MAX || + control_mac_modes[vmode - 1].m[full] < cmode) { + sense = read_control_sense(p); + printk(KERN_CONT "Monitor sense value = 0x%x, ", sense); + vmode = mac_map_monitor_sense(sense); + if (control_mac_modes[vmode - 1].m[full] < 0) + vmode = VMODE_640_480_60; + cmode = min(cmode, control_mac_modes[vmode - 1].m[full]); } /* Initialize info structure */ |