diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2009-09-22 19:47:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:53 -0400 |
commit | 2d6e8851f608bd0c811f2df83eeff4ad8631e723 (patch) | |
tree | 76aad6e6e48a294d742acc4a0751e5d8ab86bf50 /drivers/video/via/hw.h | |
parent | 5016af53ebbd1450c2656c94dfbd1dad15c19f60 (diff) |
viafb: improve pitch handling
Split the pitch handling up and replaces the calculation from virtual xres
and bpp with fix.line_length which already contains the pitch and does not
add any constrains for the virtual resolution.
Also add a bit to the second pitch which the documentation mentions but
which was ignored by the driver.
Although it is a bit unclear what the right pitch for some LCD modes is
this patch should have no negative runtime impact.
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>
Diffstat (limited to 'drivers/video/via/hw.h')
-rw-r--r-- | drivers/video/via/hw.h | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h index cf1dfd5c7fdf..817033d2d3be 100644 --- a/drivers/video/via/hw.h +++ b/drivers/video/via/hw.h | |||
@@ -147,14 +147,8 @@ is reserved, so it may have problem to set 1600x1200 on IGA2. */ | |||
147 | /* location: {CR5F,0,4} */ | 147 | /* location: {CR5F,0,4} */ |
148 | #define IGA2_VER_SYNC_END_REG_NUM 1 | 148 | #define IGA2_VER_SYNC_END_REG_NUM 1 |
149 | 149 | ||
150 | /* Define Offset and Fetch Count Register*/ | 150 | /* Define Fetch Count Register*/ |
151 | 151 | ||
152 | /* location: {CR13,0,7},{CR35,5,7} */ | ||
153 | #define IGA1_OFFSET_REG_NUM 2 | ||
154 | /* 8 bytes alignment. */ | ||
155 | #define IGA1_OFFSER_ALIGN_BYTE 8 | ||
156 | /* x: H resolution, y: color depth */ | ||
157 | #define IGA1_OFFSET_FORMULA(x, y) ((x*y)/IGA1_OFFSER_ALIGN_BYTE) | ||
158 | /* location: {SR1C,0,7},{SR1D,0,1} */ | 152 | /* location: {SR1C,0,7},{SR1D,0,1} */ |
159 | #define IGA1_FETCH_COUNT_REG_NUM 2 | 153 | #define IGA1_FETCH_COUNT_REG_NUM 2 |
160 | /* 16 bytes alignment. */ | 154 | /* 16 bytes alignment. */ |
@@ -164,11 +158,6 @@ is reserved, so it may have problem to set 1600x1200 on IGA2. */ | |||
164 | #define IGA1_FETCH_COUNT_FORMULA(x, y) \ | 158 | #define IGA1_FETCH_COUNT_FORMULA(x, y) \ |
165 | (((x*y)/IGA1_FETCH_COUNT_ALIGN_BYTE) + IGA1_FETCH_COUNT_PATCH_VALUE) | 159 | (((x*y)/IGA1_FETCH_COUNT_ALIGN_BYTE) + IGA1_FETCH_COUNT_PATCH_VALUE) |
166 | 160 | ||
167 | /* location: {CR66,0,7},{CR67,0,1} */ | ||
168 | #define IGA2_OFFSET_REG_NUM 2 | ||
169 | #define IGA2_OFFSET_ALIGN_BYTE 8 | ||
170 | /* x: H resolution, y: color depth */ | ||
171 | #define IGA2_OFFSET_FORMULA(x, y) ((x*y)/IGA2_OFFSET_ALIGN_BYTE) | ||
172 | /* location: {CR65,0,7},{CR67,2,3} */ | 161 | /* location: {CR65,0,7},{CR67,2,3} */ |
173 | #define IGA2_FETCH_COUNT_REG_NUM 2 | 162 | #define IGA2_FETCH_COUNT_REG_NUM 2 |
174 | #define IGA2_FETCH_COUNT_ALIGN_BYTE 16 | 163 | #define IGA2_FETCH_COUNT_ALIGN_BYTE 16 |
@@ -617,23 +606,6 @@ struct iga2_ver_sync_end { | |||
617 | struct io_register reg[IGA2_VER_SYNC_END_REG_NUM]; | 606 | struct io_register reg[IGA2_VER_SYNC_END_REG_NUM]; |
618 | }; | 607 | }; |
619 | 608 | ||
620 | /* IGA1 Offset Register */ | ||
621 | struct iga1_offset { | ||
622 | int reg_num; | ||
623 | struct io_register reg[IGA1_OFFSET_REG_NUM]; | ||
624 | }; | ||
625 | |||
626 | /* IGA2 Offset Register */ | ||
627 | struct iga2_offset { | ||
628 | int reg_num; | ||
629 | struct io_register reg[IGA2_OFFSET_REG_NUM]; | ||
630 | }; | ||
631 | |||
632 | struct offset { | ||
633 | struct iga1_offset iga1_offset_reg; | ||
634 | struct iga2_offset iga2_offset_reg; | ||
635 | }; | ||
636 | |||
637 | /* IGA1 Fetch Count Register */ | 609 | /* IGA1 Fetch Count Register */ |
638 | struct iga1_fetch_count { | 610 | struct iga1_fetch_count { |
639 | int reg_num; | 611 | int reg_num; |
@@ -904,7 +876,6 @@ void viafb_write_reg(u8 index, u16 io_port, u8 data); | |||
904 | u8 viafb_read_reg(int io_port, u8 index); | 876 | u8 viafb_read_reg(int io_port, u8 index); |
905 | void viafb_lock_crt(void); | 877 | void viafb_lock_crt(void); |
906 | void viafb_unlock_crt(void); | 878 | void viafb_unlock_crt(void); |
907 | void viafb_load_offset_reg(int h_addr, int bpp_byte, int set_iga); | ||
908 | void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga); | 879 | void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga); |
909 | void viafb_write_regx(struct io_reg RegTable[], int ItemNum); | 880 | void viafb_write_regx(struct io_reg RegTable[], int ItemNum); |
910 | struct VideoModeTable *viafb_get_modetbl_pointer(int Index); | 881 | struct VideoModeTable *viafb_get_modetbl_pointer(int Index); |
@@ -928,6 +899,8 @@ void viafb_get_mmio_info(unsigned long *mmio_base, u32 *mmio_len); | |||
928 | void viafb_set_iga_path(void); | 899 | void viafb_set_iga_path(void); |
929 | void viafb_set_primary_address(u32 addr); | 900 | void viafb_set_primary_address(u32 addr); |
930 | void viafb_set_secondary_address(u32 addr); | 901 | void viafb_set_secondary_address(u32 addr); |
902 | void viafb_set_primary_pitch(u32 pitch); | ||
903 | void viafb_set_secondary_pitch(u32 pitch); | ||
931 | void viafb_get_fb_info(unsigned int *fb_base, unsigned int *fb_len); | 904 | void viafb_get_fb_info(unsigned int *fb_base, unsigned int *fb_len); |
932 | 905 | ||
933 | #endif /* __HW_H__ */ | 906 | #endif /* __HW_H__ */ |