From dd73d6868b9ecb4841def0c6ff0a25da27db33ba Mon Sep 17 00:00:00 2001 From: Florian Tobias Schandinat Date: Wed, 10 Mar 2010 15:21:28 -0800 Subject: viafb: split global index up This is the first step to remove an artificial global index that was used in two ways: 1. As a pseudo index in the mode table. Pseudo as you had to search through the table to find the referenced entry. This was replaced by using a pointer to the entry. 2. As a shortcut to compare a combination of horizontal and vertical resolution at the same time. This was replaced by a "(hres<<16) | vres" which is good enough for now and the near future. If vres or hres become greater than 2^16 this might indeed cause problems but this solution allows to split this indexing mess up without the requirement to do even more code changes. This is a big change that will allow more clean ups. It should be a bit faster but that is probably not relevant for normal operation. No regressions expected but as this is a relatively big step heavy testing is appreciated. Signed-off-by: Florian Tobias Schandinat Cc: Joseph Chan Cc: Scott Fang Cc: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/via/viamode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/video/via/viamode.h') diff --git a/drivers/video/via/viamode.h b/drivers/video/via/viamode.h index a9d6554fabd..5b1ced86514 100644 --- a/drivers/video/via/viamode.h +++ b/drivers/video/via/viamode.h @@ -32,13 +32,11 @@ struct VPITTable { }; struct VideoModeTable { - int ModeIndex; struct crt_mode_table *crtc; int mode_array; }; struct patch_table { - int mode_index; int table_length; struct io_reg *io_reg_table; }; @@ -59,13 +57,11 @@ extern int NUM_TOTAL_CX700_ModeXregs; extern int NUM_TOTAL_VX855_ModeXregs; extern int NUM_TOTAL_CLE266_ModeXregs; extern int NUM_TOTAL_PATCH_MODE; -extern int NUM_TOTAL_MODETABLE; /********************/ /* Mode Table */ /********************/ -extern struct VideoModeTable CLE266Modes[]; extern struct crt_mode_table CEAM1280x720[]; extern struct crt_mode_table CEAM1920x1080[]; extern struct VideoModeTable CEA_HDMI_Modes[]; @@ -81,4 +77,8 @@ extern struct io_reg CLE266_ModeXregs[]; extern struct io_reg PM1024x768[]; extern struct patch_table res_patch_table[]; extern struct VPITTable VPIT; + +struct VideoModeTable *viafb_get_mode(int hres, int vres); +struct VideoModeTable *viafb_get_rb_mode(int hres, int vres); + #endif /* __VIAMODE_H__ */ -- cgit v1.2.3