提交 13147f29 编写于 作者: F Florian Tobias Schandinat 提交者: Linus Torvalds

viafb: remove duplicated mode information

Remove the mode information from viafbdev.c and uses the one of viamode.c
instead.  This is possible because horizontal and vertical address are the
same as horizontal and vertical resolution.  The reduced blanking modes in
the table are no problem because they have a higher index than the normal
modes and therefore always the normal modes are selected just as the old
behaviour.
Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Harald Welte <laforge@gnumonks.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 deb7aab6
...@@ -53,51 +53,6 @@ static void retrieve_device_setting(struct viafb_ioctl_setting ...@@ -53,51 +53,6 @@ static void retrieve_device_setting(struct viafb_ioctl_setting
static void viafb_set_video_device(u32 video_dev_info); static void viafb_set_video_device(u32 video_dev_info);
static void viafb_get_video_device(u32 *video_dev_info); static void viafb_get_video_device(u32 *video_dev_info);
/* Mode information */
static const struct viafb_modeinfo viafb_modentry[] = {
{480, 640, VIA_RES_480X640},
{640, 480, VIA_RES_640X480},
{800, 480, VIA_RES_800X480},
{800, 600, VIA_RES_800X600},
{1024, 768, VIA_RES_1024X768},
{1152, 864, VIA_RES_1152X864},
{1280, 1024, VIA_RES_1280X1024},
{1600, 1200, VIA_RES_1600X1200},
{1440, 1050, VIA_RES_1440X1050},
{1280, 768, VIA_RES_1280X768,},
{1280, 800, VIA_RES_1280X800},
{1280, 960, VIA_RES_1280X960},
{1920, 1440, VIA_RES_1920X1440},
{848, 480, VIA_RES_848X480},
{1400, 1050, VIA_RES_1400X1050},
{720, 480, VIA_RES_720X480},
{720, 576, VIA_RES_720X576},
{1024, 512, VIA_RES_1024X512},
{1024, 576, VIA_RES_1024X576},
{1024, 600, VIA_RES_1024X600},
{1280, 720, VIA_RES_1280X720},
{1920, 1080, VIA_RES_1920X1080},
{1366, 768, VIA_RES_1368X768},
{1680, 1050, VIA_RES_1680X1050},
{960, 600, VIA_RES_960X600},
{1000, 600, VIA_RES_1000X600},
{1024, 576, VIA_RES_1024X576},
{1024, 600, VIA_RES_1024X600},
{1088, 612, VIA_RES_1088X612},
{1152, 720, VIA_RES_1152X720},
{1200, 720, VIA_RES_1200X720},
{1280, 600, VIA_RES_1280X600},
{1360, 768, VIA_RES_1360X768},
{1440, 900, VIA_RES_1440X900},
{1600, 900, VIA_RES_1600X900},
{1600, 1024, VIA_RES_1600X1024},
{1792, 1344, VIA_RES_1792X1344},
{1856, 1392, VIA_RES_1856X1392},
{1920, 1200, VIA_RES_1920X1200},
{2048, 1536, VIA_RES_2048X1536},
{0, 0, VIA_RES_INVALID}
};
static struct fb_ops viafb_ops; static struct fb_ops viafb_ops;
...@@ -1239,12 +1194,16 @@ int viafb_get_mode_index(int hres, int vres) ...@@ -1239,12 +1194,16 @@ int viafb_get_mode_index(int hres, int vres)
u32 i; u32 i;
DEBUG_MSG(KERN_INFO "viafb_get_mode_index!\n"); DEBUG_MSG(KERN_INFO "viafb_get_mode_index!\n");
for (i = 0; viafb_modentry[i].mode_index != VIA_RES_INVALID; i++) for (i = 0; i < NUM_TOTAL_MODETABLE; i++)
if (viafb_modentry[i].xres == hres && if (CLE266Modes[i].mode_array &&
viafb_modentry[i].yres == vres) CLE266Modes[i].crtc[0].crtc.hor_addr == hres &&
CLE266Modes[i].crtc[0].crtc.ver_addr == vres)
break; break;
return viafb_modentry[i].mode_index; if (i == NUM_TOTAL_MODETABLE)
return VIA_RES_INVALID;
return CLE266Modes[i].ModeIndex;
} }
static void check_available_device_to_enable(int device_id) static void check_available_device_to_enable(int device_id)
......
...@@ -70,11 +70,7 @@ struct viafb_par { ...@@ -70,11 +70,7 @@ struct viafb_par {
int video_on_lcd; int video_on_lcd;
}; };
struct viafb_modeinfo {
u32 xres;
u32 yres;
int mode_index;
};
extern unsigned int viafb_second_virtual_yres; extern unsigned int viafb_second_virtual_yres;
extern unsigned int viafb_second_virtual_xres; extern unsigned int viafb_second_virtual_xres;
extern unsigned int viafb_second_offset; extern unsigned int viafb_second_offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册