diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2009-09-22 19:47:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:52 -0400 |
commit | 13147f291cb18489cbaa550b100dee6f9defd007 (patch) | |
tree | 5ef3b63cf751e5b026f110dff9f6cd1ac22a48c5 | |
parent | deb7aab6379502fd173cd34efa005108eb0b111b (diff) |
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: Florian 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/via/viafbdev.c | 57 | ||||
-rw-r--r-- | drivers/video/via/viafbdev.h | 6 |
2 files changed, 9 insertions, 54 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 72759b620e7f..50e9300d0de0 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -53,51 +53,6 @@ static void retrieve_device_setting(struct viafb_ioctl_setting | |||
53 | static void viafb_set_video_device(u32 video_dev_info); | 53 | static void viafb_set_video_device(u32 video_dev_info); |
54 | static void viafb_get_video_device(u32 *video_dev_info); | 54 | static void viafb_get_video_device(u32 *video_dev_info); |
55 | 55 | ||
56 | /* Mode information */ | ||
57 | static const struct viafb_modeinfo viafb_modentry[] = { | ||
58 | {480, 640, VIA_RES_480X640}, | ||
59 | {640, 480, VIA_RES_640X480}, | ||
60 | {800, 480, VIA_RES_800X480}, | ||
61 | {800, 600, VIA_RES_800X600}, | ||
62 | {1024, 768, VIA_RES_1024X768}, | ||
63 | {1152, 864, VIA_RES_1152X864}, | ||
64 | {1280, 1024, VIA_RES_1280X1024}, | ||
65 | {1600, 1200, VIA_RES_1600X1200}, | ||
66 | {1440, 1050, VIA_RES_1440X1050}, | ||
67 | {1280, 768, VIA_RES_1280X768,}, | ||
68 | {1280, 800, VIA_RES_1280X800}, | ||
69 | {1280, 960, VIA_RES_1280X960}, | ||
70 | {1920, 1440, VIA_RES_1920X1440}, | ||
71 | {848, 480, VIA_RES_848X480}, | ||
72 | {1400, 1050, VIA_RES_1400X1050}, | ||
73 | {720, 480, VIA_RES_720X480}, | ||
74 | {720, 576, VIA_RES_720X576}, | ||
75 | {1024, 512, VIA_RES_1024X512}, | ||
76 | {1024, 576, VIA_RES_1024X576}, | ||
77 | {1024, 600, VIA_RES_1024X600}, | ||
78 | {1280, 720, VIA_RES_1280X720}, | ||
79 | {1920, 1080, VIA_RES_1920X1080}, | ||
80 | {1366, 768, VIA_RES_1368X768}, | ||
81 | {1680, 1050, VIA_RES_1680X1050}, | ||
82 | {960, 600, VIA_RES_960X600}, | ||
83 | {1000, 600, VIA_RES_1000X600}, | ||
84 | {1024, 576, VIA_RES_1024X576}, | ||
85 | {1024, 600, VIA_RES_1024X600}, | ||
86 | {1088, 612, VIA_RES_1088X612}, | ||
87 | {1152, 720, VIA_RES_1152X720}, | ||
88 | {1200, 720, VIA_RES_1200X720}, | ||
89 | {1280, 600, VIA_RES_1280X600}, | ||
90 | {1360, 768, VIA_RES_1360X768}, | ||
91 | {1440, 900, VIA_RES_1440X900}, | ||
92 | {1600, 900, VIA_RES_1600X900}, | ||
93 | {1600, 1024, VIA_RES_1600X1024}, | ||
94 | {1792, 1344, VIA_RES_1792X1344}, | ||
95 | {1856, 1392, VIA_RES_1856X1392}, | ||
96 | {1920, 1200, VIA_RES_1920X1200}, | ||
97 | {2048, 1536, VIA_RES_2048X1536}, | ||
98 | {0, 0, VIA_RES_INVALID} | ||
99 | }; | ||
100 | |||
101 | static struct fb_ops viafb_ops; | 56 | static struct fb_ops viafb_ops; |
102 | 57 | ||
103 | 58 | ||
@@ -1239,12 +1194,16 @@ int viafb_get_mode_index(int hres, int vres) | |||
1239 | u32 i; | 1194 | u32 i; |
1240 | DEBUG_MSG(KERN_INFO "viafb_get_mode_index!\n"); | 1195 | DEBUG_MSG(KERN_INFO "viafb_get_mode_index!\n"); |
1241 | 1196 | ||
1242 | for (i = 0; viafb_modentry[i].mode_index != VIA_RES_INVALID; i++) | 1197 | for (i = 0; i < NUM_TOTAL_MODETABLE; i++) |
1243 | if (viafb_modentry[i].xres == hres && | 1198 | if (CLE266Modes[i].mode_array && |
1244 | viafb_modentry[i].yres == vres) | 1199 | CLE266Modes[i].crtc[0].crtc.hor_addr == hres && |
1200 | CLE266Modes[i].crtc[0].crtc.ver_addr == vres) | ||
1245 | break; | 1201 | break; |
1246 | 1202 | ||
1247 | return viafb_modentry[i].mode_index; | 1203 | if (i == NUM_TOTAL_MODETABLE) |
1204 | return VIA_RES_INVALID; | ||
1205 | |||
1206 | return CLE266Modes[i].ModeIndex; | ||
1248 | } | 1207 | } |
1249 | 1208 | ||
1250 | static void check_available_device_to_enable(int device_id) | 1209 | static void check_available_device_to_enable(int device_id) |
diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h index ea0df4f96842..cd3dff7cc170 100644 --- a/drivers/video/via/viafbdev.h +++ b/drivers/video/via/viafbdev.h | |||
@@ -70,11 +70,7 @@ struct viafb_par { | |||
70 | int video_on_lcd; | 70 | int video_on_lcd; |
71 | 71 | ||
72 | }; | 72 | }; |
73 | struct viafb_modeinfo { | 73 | |
74 | u32 xres; | ||
75 | u32 yres; | ||
76 | int mode_index; | ||
77 | }; | ||
78 | extern unsigned int viafb_second_virtual_yres; | 74 | extern unsigned int viafb_second_virtual_yres; |
79 | extern unsigned int viafb_second_virtual_xres; | 75 | extern unsigned int viafb_second_virtual_xres; |
80 | extern unsigned int viafb_second_offset; | 76 | extern unsigned int viafb_second_offset; |