aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/arcfb.c2
-rw-r--r--drivers/video/bw2.c1
-rw-r--r--drivers/video/cfbcopyarea.c8
-rw-r--r--drivers/video/cfbfillrect.c16
-rw-r--r--drivers/video/cfbimgblt.c35
-rw-r--r--drivers/video/cg14.c1
-rw-r--r--drivers/video/cg3.c1
-rw-r--r--drivers/video/cg6.c3
-rw-r--r--drivers/video/console/fbcon.c42
-rw-r--r--drivers/video/console/fbcon_ud.c8
-rw-r--r--drivers/video/cyber2000fb.c4
-rw-r--r--drivers/video/fbmem.c26
-rw-r--r--drivers/video/ffb.c1
-rw-r--r--drivers/video/intelfb/intelfb.h5
-rw-r--r--drivers/video/intelfb/intelfbdrv.c51
-rw-r--r--drivers/video/leo.c1
-rw-r--r--drivers/video/p9100.c1
-rw-r--r--drivers/video/pxafb.c3
-rw-r--r--drivers/video/tcx.c3
19 files changed, 115 insertions, 97 deletions
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 080db812ca48..2784f0a9d693 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -441,7 +441,7 @@ static int arcfb_ioctl(struct inode *inode, struct file *file,
441 * the fb. it's inefficient for them to do anything less than 64*8 441 * the fb. it's inefficient for them to do anything less than 64*8
442 * writes since we update the lcd in each write() anyway. 442 * writes since we update the lcd in each write() anyway.
443 */ 443 */
444static ssize_t arcfb_write(struct file *file, const char *buf, size_t count, 444static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t count,
445 loff_t *ppos) 445 loff_t *ppos)
446{ 446{
447 /* modded from epson 1355 */ 447 /* modded from epson 1355 */
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index d3728f60961e..9248fe1fbb1a 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -121,7 +121,6 @@ struct bw2_par {
121 unsigned long fbsize; 121 unsigned long fbsize;
122 122
123 struct sbus_dev *sdev; 123 struct sbus_dev *sdev;
124 struct list_head list;
125}; 124};
126 125
127/** 126/**
diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c
index cdc71572cf35..74415325b016 100644
--- a/drivers/video/cfbcopyarea.c
+++ b/drivers/video/cfbcopyarea.c
@@ -64,8 +64,8 @@ bitcpy(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem *src
64 int const shift = dst_idx-src_idx; 64 int const shift = dst_idx-src_idx;
65 int left, right; 65 int left, right;
66 66
67 first = ~0UL >> dst_idx; 67 first = FB_SHIFT_HIGH(~0UL, dst_idx);
68 last = ~(~0UL >> ((dst_idx+n) % bits)); 68 last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
69 69
70 if (!shift) { 70 if (!shift) {
71 // Same alignment for source and dest 71 // Same alignment for source and dest
@@ -216,8 +216,8 @@ bitcpy_rev(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem
216 216
217 shift = dst_idx-src_idx; 217 shift = dst_idx-src_idx;
218 218
219 first = ~0UL << (bits - 1 - dst_idx); 219 first = FB_SHIFT_LOW(~0UL, bits - 1 - dst_idx);
220 last = ~(~0UL << (bits - 1 - ((dst_idx-n) % bits))); 220 last = ~(FB_SHIFT_LOW(~0UL, bits - 1 - ((dst_idx-n) % bits)));
221 221
222 if (!shift) { 222 if (!shift) {
223 // Same alignment for source and dest 223 // Same alignment for source and dest
diff --git a/drivers/video/cfbfillrect.c b/drivers/video/cfbfillrect.c
index 167d9314e6eb..e5ff62e9cfb8 100644
--- a/drivers/video/cfbfillrect.c
+++ b/drivers/video/cfbfillrect.c
@@ -110,8 +110,8 @@ bitfill_aligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat, unsi
110 if (!n) 110 if (!n)
111 return; 111 return;
112 112
113 first = ~0UL >> dst_idx; 113 first = FB_SHIFT_HIGH(~0UL, dst_idx);
114 last = ~(~0UL >> ((dst_idx+n) % bits)); 114 last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
115 115
116 if (dst_idx+n <= bits) { 116 if (dst_idx+n <= bits) {
117 // Single word 117 // Single word
@@ -167,8 +167,8 @@ bitfill_unaligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat,
167 if (!n) 167 if (!n)
168 return; 168 return;
169 169
170 first = ~0UL >> dst_idx; 170 first = FB_SHIFT_HIGH(~0UL, dst_idx);
171 last = ~(~0UL >> ((dst_idx+n) % bits)); 171 last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
172 172
173 if (dst_idx+n <= bits) { 173 if (dst_idx+n <= bits) {
174 // Single word 174 // Single word
@@ -221,8 +221,8 @@ bitfill_aligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat,
221 if (!n) 221 if (!n)
222 return; 222 return;
223 223
224 first = ~0UL >> dst_idx; 224 first = FB_SHIFT_HIGH(~0UL, dst_idx);
225 last = ~(~0UL >> ((dst_idx+n) % bits)); 225 last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
226 226
227 if (dst_idx+n <= bits) { 227 if (dst_idx+n <= bits) {
228 // Single word 228 // Single word
@@ -290,8 +290,8 @@ bitfill_unaligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat
290 if (!n) 290 if (!n)
291 return; 291 return;
292 292
293 first = ~0UL >> dst_idx; 293 first = FB_SHIFT_HIGH(~0UL, dst_idx);
294 last = ~(~0UL >> ((dst_idx+n) % bits)); 294 last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
295 295
296 if (dst_idx+n <= bits) { 296 if (dst_idx+n <= bits) {
297 // Single word 297 // Single word
diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c
index a7770c4f17d0..910e2338a27e 100644
--- a/drivers/video/cfbimgblt.c
+++ b/drivers/video/cfbimgblt.c
@@ -76,18 +76,6 @@ static u32 cfb_tab32[] = {
76#define FB_WRITEL fb_writel 76#define FB_WRITEL fb_writel
77#define FB_READL fb_readl 77#define FB_READL fb_readl
78 78
79#if defined (__BIG_ENDIAN)
80#define LEFT_POS(bpp) (32 - bpp)
81#define SHIFT_HIGH(val, bits) ((val) >> (bits))
82#define SHIFT_LOW(val, bits) ((val) << (bits))
83#define BIT_NR(b) (7 - (b))
84#else
85#define LEFT_POS(bpp) (0)
86#define SHIFT_HIGH(val, bits) ((val) << (bits))
87#define SHIFT_LOW(val, bits) ((val) >> (bits))
88#define BIT_NR(b) (b)
89#endif
90
91static inline void color_imageblit(const struct fb_image *image, 79static inline void color_imageblit(const struct fb_image *image,
92 struct fb_info *p, u8 __iomem *dst1, 80 struct fb_info *p, u8 __iomem *dst1,
93 u32 start_index, 81 u32 start_index,
@@ -109,7 +97,7 @@ static inline void color_imageblit(const struct fb_image *image,
109 val = 0; 97 val = 0;
110 98
111 if (start_index) { 99 if (start_index) {
112 u32 start_mask = ~(SHIFT_HIGH(~(u32)0, start_index)); 100 u32 start_mask = ~(FB_SHIFT_HIGH(~(u32)0, start_index));
113 val = FB_READL(dst) & start_mask; 101 val = FB_READL(dst) & start_mask;
114 shift = start_index; 102 shift = start_index;
115 } 103 }
@@ -119,20 +107,20 @@ static inline void color_imageblit(const struct fb_image *image,
119 color = palette[*src]; 107 color = palette[*src];
120 else 108 else
121 color = *src; 109 color = *src;
122 color <<= LEFT_POS(bpp); 110 color <<= FB_LEFT_POS(bpp);
123 val |= SHIFT_HIGH(color, shift); 111 val |= FB_SHIFT_HIGH(color, shift);
124 if (shift >= null_bits) { 112 if (shift >= null_bits) {
125 FB_WRITEL(val, dst++); 113 FB_WRITEL(val, dst++);
126 114
127 val = (shift == null_bits) ? 0 : 115 val = (shift == null_bits) ? 0 :
128 SHIFT_LOW(color, 32 - shift); 116 FB_SHIFT_LOW(color, 32 - shift);
129 } 117 }
130 shift += bpp; 118 shift += bpp;
131 shift &= (32 - 1); 119 shift &= (32 - 1);
132 src++; 120 src++;
133 } 121 }
134 if (shift) { 122 if (shift) {
135 u32 end_mask = SHIFT_HIGH(~(u32)0, shift); 123 u32 end_mask = FB_SHIFT_HIGH(~(u32)0, shift);
136 124
137 FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); 125 FB_WRITEL((FB_READL(dst) & end_mask) | val, dst);
138 } 126 }
@@ -162,6 +150,8 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
162 u32 i, j, l; 150 u32 i, j, l;
163 151
164 dst2 = (u32 __iomem *) dst1; 152 dst2 = (u32 __iomem *) dst1;
153 fgcolor <<= FB_LEFT_POS(bpp);
154 bgcolor <<= FB_LEFT_POS(bpp);
165 155
166 for (i = image->height; i--; ) { 156 for (i = image->height; i--; ) {
167 shift = val = 0; 157 shift = val = 0;
@@ -172,22 +162,21 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
172 162
173 /* write leading bits */ 163 /* write leading bits */
174 if (start_index) { 164 if (start_index) {
175 u32 start_mask = ~(SHIFT_HIGH(~(u32)0, start_index)); 165 u32 start_mask = ~(FB_SHIFT_HIGH(~(u32)0,start_index));
176 val = FB_READL(dst) & start_mask; 166 val = FB_READL(dst) & start_mask;
177 shift = start_index; 167 shift = start_index;
178 } 168 }
179 169
180 while (j--) { 170 while (j--) {
181 l--; 171 l--;
182 color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor; 172 color = (*s & 1 << (FB_BIT_NR(l))) ? fgcolor : bgcolor;
183 color <<= LEFT_POS(bpp); 173 val |= FB_SHIFT_HIGH(color, shift);
184 val |= SHIFT_HIGH(color, shift);
185 174
186 /* Did the bitshift spill bits to the next long? */ 175 /* Did the bitshift spill bits to the next long? */
187 if (shift >= null_bits) { 176 if (shift >= null_bits) {
188 FB_WRITEL(val, dst++); 177 FB_WRITEL(val, dst++);
189 val = (shift == null_bits) ? 0 : 178 val = (shift == null_bits) ? 0 :
190 SHIFT_LOW(color,32 - shift); 179 FB_SHIFT_LOW(color,32 - shift);
191 } 180 }
192 shift += bpp; 181 shift += bpp;
193 shift &= (32 - 1); 182 shift &= (32 - 1);
@@ -196,7 +185,7 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
196 185
197 /* write trailing bits */ 186 /* write trailing bits */
198 if (shift) { 187 if (shift) {
199 u32 end_mask = SHIFT_HIGH(~(u32)0, shift); 188 u32 end_mask = FB_SHIFT_HIGH(~(u32)0, shift);
200 189
201 FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); 190 FB_WRITEL((FB_READL(dst) & end_mask) | val, dst);
202 } 191 }
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index 1bed50f2a276..a56147102abb 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -206,7 +206,6 @@ struct cg14_par {
206 int mode; 206 int mode;
207 int ramsize; 207 int ramsize;
208 struct sbus_dev *sdev; 208 struct sbus_dev *sdev;
209 struct list_head list;
210}; 209};
211 210
212static void __cg14_reset(struct cg14_par *par) 211static void __cg14_reset(struct cg14_par *par)
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index a1354e7e0513..9fcd89608ed7 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -124,7 +124,6 @@ struct cg3_par {
124 unsigned long fbsize; 124 unsigned long fbsize;
125 125
126 struct sbus_dev *sdev; 126 struct sbus_dev *sdev;
127 struct list_head list;
128}; 127};
129 128
130/** 129/**
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 9debe642fd2f..050835e39aa3 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -265,7 +265,6 @@ struct cg6_par {
265 unsigned long fbsize; 265 unsigned long fbsize;
266 266
267 struct sbus_dev *sdev; 267 struct sbus_dev *sdev;
268 struct list_head list;
269}; 268};
270 269
271static int cg6_sync(struct fb_info *info) 270static int cg6_sync(struct fb_info *info)
@@ -612,7 +611,7 @@ static void cg6_chip_init(struct fb_info *info)
612 struct cg6_par *par = (struct cg6_par *) info->par; 611 struct cg6_par *par = (struct cg6_par *) info->par;
613 struct cg6_tec __iomem *tec = par->tec; 612 struct cg6_tec __iomem *tec = par->tec;
614 struct cg6_fbc __iomem *fbc = par->fbc; 613 struct cg6_fbc __iomem *fbc = par->fbc;
615 u32 rev, conf, mode, tmp; 614 u32 rev, conf, mode;
616 int i; 615 int i;
617 616
618 /* Turn off stuff in the Transform Engine. */ 617 /* Turn off stuff in the Transform Engine. */
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index bcea87c3cc06..3660e51b2612 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2048,7 +2048,7 @@ static int fbcon_switch(struct vc_data *vc)
2048 struct fbcon_ops *ops; 2048 struct fbcon_ops *ops;
2049 struct display *p = &fb_display[vc->vc_num]; 2049 struct display *p = &fb_display[vc->vc_num];
2050 struct fb_var_screeninfo var; 2050 struct fb_var_screeninfo var;
2051 int i, prev_console; 2051 int i, prev_console, charcnt = 256;
2052 2052
2053 info = registered_fb[con2fb_map[vc->vc_num]]; 2053 info = registered_fb[con2fb_map[vc->vc_num]];
2054 ops = info->fbcon_par; 2054 ops = info->fbcon_par;
@@ -2103,7 +2103,8 @@ static int fbcon_switch(struct vc_data *vc)
2103 fb_set_var(info, &var); 2103 fb_set_var(info, &var);
2104 ops->var = info->var; 2104 ops->var = info->var;
2105 2105
2106 if (old_info != NULL && old_info != info) { 2106 if (old_info != NULL && (old_info != info ||
2107 info->flags & FBINFO_MISC_ALWAYS_SETPAR)) {
2107 if (info->fbops->fb_set_par) 2108 if (info->fbops->fb_set_par)
2108 info->fbops->fb_set_par(info); 2109 info->fbops->fb_set_par(info);
2109 fbcon_del_cursor_timer(old_info); 2110 fbcon_del_cursor_timer(old_info);
@@ -2120,6 +2121,13 @@ static int fbcon_switch(struct vc_data *vc)
2120 2121
2121 vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1); 2122 vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1);
2122 vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800; 2123 vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
2124
2125 if (p->userfont)
2126 charcnt = FNTCHARCNT(vc->vc_font.data);
2127
2128 if (charcnt > 256)
2129 vc->vc_complement_mask <<= 1;
2130
2123 updatescrollmode(p, info, vc); 2131 updatescrollmode(p, info, vc);
2124 2132
2125 switch (p->scrollmode) { 2133 switch (p->scrollmode) {
@@ -2139,8 +2147,12 @@ static int fbcon_switch(struct vc_data *vc)
2139 2147
2140 scrollback_max = 0; 2148 scrollback_max = 0;
2141 scrollback_current = 0; 2149 scrollback_current = 0;
2142 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2150
2143 ops->update_start(info); 2151 if (!fbcon_is_inactive(vc, info)) {
2152 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
2153 ops->update_start(info);
2154 }
2155
2144 fbcon_set_palette(vc, color_table); 2156 fbcon_set_palette(vc, color_table);
2145 fbcon_clear_margins(vc, 0); 2157 fbcon_clear_margins(vc, 0);
2146 2158
@@ -2184,11 +2196,14 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
2184 ops->graphics = 1; 2196 ops->graphics = 1;
2185 2197
2186 if (!blank) { 2198 if (!blank) {
2199 if (info->fbops->fb_save_state)
2200 info->fbops->fb_save_state(info);
2187 var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; 2201 var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
2188 fb_set_var(info, &var); 2202 fb_set_var(info, &var);
2189 ops->graphics = 0; 2203 ops->graphics = 0;
2190 ops->var = info->var; 2204 ops->var = info->var;
2191 } 2205 } else if (info->fbops->fb_restore_state)
2206 info->fbops->fb_restore_state(info);
2192 } 2207 }
2193 2208
2194 if (!fbcon_is_inactive(vc, info)) { 2209 if (!fbcon_is_inactive(vc, info)) {
@@ -2736,8 +2751,12 @@ static void fbcon_modechanged(struct fb_info *info)
2736 updatescrollmode(p, info, vc); 2751 updatescrollmode(p, info, vc);
2737 scrollback_max = 0; 2752 scrollback_max = 0;
2738 scrollback_current = 0; 2753 scrollback_current = 0;
2739 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2754
2740 ops->update_start(info); 2755 if (!fbcon_is_inactive(vc, info)) {
2756 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
2757 ops->update_start(info);
2758 }
2759
2741 fbcon_set_palette(vc, color_table); 2760 fbcon_set_palette(vc, color_table);
2742 update_screen(vc); 2761 update_screen(vc);
2743 if (softback_buf) 2762 if (softback_buf)
@@ -2774,8 +2793,13 @@ static void fbcon_set_all_vcs(struct fb_info *info)
2774 updatescrollmode(p, info, vc); 2793 updatescrollmode(p, info, vc);
2775 scrollback_max = 0; 2794 scrollback_max = 0;
2776 scrollback_current = 0; 2795 scrollback_current = 0;
2777 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2796
2778 ops->update_start(info); 2797 if (!fbcon_is_inactive(vc, info)) {
2798 ops->var.xoffset = ops->var.yoffset =
2799 p->yscroll = 0;
2800 ops->update_start(info);
2801 }
2802
2779 fbcon_set_palette(vc, color_table); 2803 fbcon_set_palette(vc, color_table);
2780 update_screen(vc); 2804 update_screen(vc);
2781 if (softback_buf) 2805 if (softback_buf)
diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c
index c4d7c89212b4..9dd059e8b645 100644
--- a/drivers/video/console/fbcon_ud.c
+++ b/drivers/video/console/fbcon_ud.c
@@ -420,13 +420,15 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info,
420int ud_update_start(struct fb_info *info) 420int ud_update_start(struct fb_info *info)
421{ 421{
422 struct fbcon_ops *ops = info->fbcon_par; 422 struct fbcon_ops *ops = info->fbcon_par;
423 u32 xoffset, yoffset; 423 int xoffset, yoffset;
424 u32 vyres = GETVYRES(ops->p->scrollmode, info); 424 u32 vyres = GETVYRES(ops->p->scrollmode, info);
425 u32 vxres = GETVXRES(ops->p->scrollmode, info); 425 u32 vxres = GETVXRES(ops->p->scrollmode, info);
426 int err; 426 int err;
427 427
428 xoffset = (vxres - info->var.xres) - ops->var.xoffset; 428 xoffset = vxres - info->var.xres - ops->var.xoffset;
429 yoffset = (vyres - info->var.yres) - ops->var.yoffset; 429 yoffset = vyres - info->var.yres - ops->var.yoffset;
430 if (yoffset < 0)
431 yoffset += vyres;
430 ops->var.xoffset = xoffset; 432 ops->var.xoffset = xoffset;
431 ops->var.yoffset = yoffset; 433 ops->var.yoffset = yoffset;
432 err = fb_pan_display(info, &ops->var); 434 err = fb_pan_display(info, &ops->var);
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index c589d23e7f91..a9300f930ef2 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1512,7 +1512,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
1512 * I/O cycles storing into a reserved memory space at 1512 * I/O cycles storing into a reserved memory space at
1513 * physical address 0x3000000 1513 * physical address 0x3000000
1514 */ 1514 */
1515 unsigned char *iop; 1515 unsigned char __iomem *iop;
1516 1516
1517 iop = ioremap(0x3000000, 0x5000); 1517 iop = ioremap(0x3000000, 0x5000);
1518 if (iop == NULL) { 1518 if (iop == NULL) {
@@ -1526,7 +1526,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
1526 writeb(EXT_BIU_MISC, iop + 0x3ce); 1526 writeb(EXT_BIU_MISC, iop + 0x3ce);
1527 writeb(EXT_BIU_MISC_LIN_ENABLE, iop + 0x3cf); 1527 writeb(EXT_BIU_MISC_LIN_ENABLE, iop + 0x3cf);
1528 1528
1529 iounmap((void *)iop); 1529 iounmap(iop);
1530#else 1530#else
1531 /* 1531 /*
1532 * Most other machine types are "normal", so 1532 * Most other machine types are "normal", so
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 6240aedb4154..10dfdf035264 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -722,14 +722,30 @@ static void try_to_load(int fb)
722int 722int
723fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) 723fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
724{ 724{
725 struct fb_fix_screeninfo *fix = &info->fix;
725 int xoffset = var->xoffset; 726 int xoffset = var->xoffset;
726 int yoffset = var->yoffset; 727 int yoffset = var->yoffset;
727 int err; 728 int err = 0, yres = info->var.yres;
729
730 if (var->yoffset > 0) {
731 if (var->vmode & FB_VMODE_YWRAP) {
732 if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep))
733 err = -EINVAL;
734 else
735 yres = 0;
736 } else if (!fix->ypanstep || (var->yoffset % fix->ypanstep))
737 err = -EINVAL;
738 }
739
740 if (var->xoffset > 0 && (!fix->xpanstep ||
741 (var->xoffset % fix->xpanstep)))
742 err = -EINVAL;
743
744 if (err || !info->fbops->fb_pan_display || xoffset < 0 ||
745 yoffset < 0 || var->yoffset + yres > info->var.yres_virtual ||
746 var->xoffset + info->var.xres > info->var.xres_virtual)
747 return -EINVAL;
728 748
729 if (xoffset < 0 || yoffset < 0 || !info->fbops->fb_pan_display ||
730 xoffset + info->var.xres > info->var.xres_virtual ||
731 yoffset + info->var.yres > info->var.yres_virtual)
732 return -EINVAL;
733 if ((err = info->fbops->fb_pan_display(var, info))) 749 if ((err = info->fbops->fb_pan_display(var, info)))
734 return err; 750 return err;
735 info->var.xoffset = var->xoffset; 751 info->var.xoffset = var->xoffset;
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index 2584daec7bbf..c4870d559afc 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -359,7 +359,6 @@ struct ffb_par {
359 int prom_parent_node; 359 int prom_parent_node;
360 int dac_rev; 360 int dac_rev;
361 int board_type; 361 int board_type;
362 struct list_head list;
363}; 362};
364 363
365static void FFBFifo(struct ffb_par *par, int n) 364static void FFBFifo(struct ffb_par *par, int n)
diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
index f077ca34faba..da29d007f215 100644
--- a/drivers/video/intelfb/intelfb.h
+++ b/drivers/video/intelfb/intelfb.h
@@ -41,6 +41,10 @@
41 41
42/*** hw-related values ***/ 42/*** hw-related values ***/
43 43
44/* Resource Allocation */
45#define INTELFB_FB_ACQUIRED 1
46#define INTELFB_MMIO_ACQUIRED 2
47
44/* PCI ids for supported devices */ 48/* PCI ids for supported devices */
45#define PCI_DEVICE_ID_INTEL_830M 0x3577 49#define PCI_DEVICE_ID_INTEL_830M 0x3577
46#define PCI_DEVICE_ID_INTEL_845G 0x2562 50#define PCI_DEVICE_ID_INTEL_845G 0x2562
@@ -257,6 +261,7 @@ struct intelfb_info {
257 int hwcursor; 261 int hwcursor;
258 int fixed_mode; 262 int fixed_mode;
259 int ring_active; 263 int ring_active;
264 int flag;
260 265
261 /* hw cursor */ 266 /* hw cursor */
262 int cursor_on; 267 int cursor_on;
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 427689e584da..0090544842f5 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -135,9 +135,6 @@
135static void __devinit get_initial_mode(struct intelfb_info *dinfo); 135static void __devinit get_initial_mode(struct intelfb_info *dinfo);
136static void update_dinfo(struct intelfb_info *dinfo, 136static void update_dinfo(struct intelfb_info *dinfo,
137 struct fb_var_screeninfo *var); 137 struct fb_var_screeninfo *var);
138static int intelfb_get_fix(struct fb_fix_screeninfo *fix,
139 struct fb_info *info);
140
141static int intelfb_check_var(struct fb_var_screeninfo *var, 138static int intelfb_check_var(struct fb_var_screeninfo *var,
142 struct fb_info *info); 139 struct fb_info *info);
143static int intelfb_set_par(struct fb_info *info); 140static int intelfb_set_par(struct fb_info *info);
@@ -473,9 +470,9 @@ cleanup(struct intelfb_info *dinfo)
473 if (dinfo->aperture.virtual) 470 if (dinfo->aperture.virtual)
474 iounmap((void __iomem *)dinfo->aperture.virtual); 471 iounmap((void __iomem *)dinfo->aperture.virtual);
475 472
476 if (dinfo->mmio_base_phys) 473 if (dinfo->flag & INTELFB_MMIO_ACQUIRED)
477 release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); 474 release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE);
478 if (dinfo->aperture.physical) 475 if (dinfo->flag & INTELFB_FB_ACQUIRED)
479 release_mem_region(dinfo->aperture.physical, 476 release_mem_region(dinfo->aperture.physical,
480 dinfo->aperture.size); 477 dinfo->aperture.size);
481 framebuffer_release(dinfo->info); 478 framebuffer_release(dinfo->info);
@@ -572,6 +569,9 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
572 cleanup(dinfo); 569 cleanup(dinfo);
573 return -ENODEV; 570 return -ENODEV;
574 } 571 }
572
573 dinfo->flag |= INTELFB_FB_ACQUIRED;
574
575 if (!request_mem_region(dinfo->mmio_base_phys, 575 if (!request_mem_region(dinfo->mmio_base_phys,
576 INTEL_REG_SIZE, 576 INTEL_REG_SIZE,
577 INTELFB_MODULE_NAME)) { 577 INTELFB_MODULE_NAME)) {
@@ -580,6 +580,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
580 return -ENODEV; 580 return -ENODEV;
581 } 581 }
582 582
583 dinfo->flag |= INTELFB_MMIO_ACQUIRED;
584
583 /* Get the chipset info. */ 585 /* Get the chipset info. */
584 dinfo->pci_chipset = pdev->device; 586 dinfo->pci_chipset = pdev->device;
585 587
@@ -1091,7 +1093,17 @@ intelfb_set_fbinfo(struct intelfb_info *dinfo)
1091 return 1; 1093 return 1;
1092 1094
1093 info->pixmap.scan_align = 1; 1095 info->pixmap.scan_align = 1;
1094 1096 strcpy(info->fix.id, dinfo->name);
1097 info->fix.smem_start = dinfo->fb.physical;
1098 info->fix.smem_len = dinfo->fb.size;
1099 info->fix.type = FB_TYPE_PACKED_PIXELS;
1100 info->fix.type_aux = 0;
1101 info->fix.xpanstep = 8;
1102 info->fix.ypanstep = 1;
1103 info->fix.ywrapstep = 0;
1104 info->fix.mmio_start = dinfo->mmio_base_phys;
1105 info->fix.mmio_len = INTEL_REG_SIZE;
1106 info->fix.accel = FB_ACCEL_I830;
1095 update_dinfo(dinfo, &info->var); 1107 update_dinfo(dinfo, &info->var);
1096 1108
1097 return 0; 1109 return 0;
@@ -1109,7 +1121,8 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var)
1109 dinfo->yres = var->xres; 1121 dinfo->yres = var->xres;
1110 dinfo->pixclock = var->pixclock; 1122 dinfo->pixclock = var->pixclock;
1111 1123
1112 intelfb_get_fix(&dinfo->info->fix, dinfo->info); 1124 dinfo->info->fix.visual = dinfo->visual;
1125 dinfo->info->fix.line_length = dinfo->pitch;
1113 1126
1114 switch (dinfo->bpp) { 1127 switch (dinfo->bpp) {
1115 case 8: 1128 case 8:
@@ -1139,30 +1152,6 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var)
1139 1152
1140/* fbops functions */ 1153/* fbops functions */
1141 1154
1142static int
1143intelfb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
1144{
1145 struct intelfb_info *dinfo = GET_DINFO(info);
1146
1147 DBG_MSG("intelfb_get_fix\n");
1148
1149 memset(fix, 0, sizeof(*fix));
1150 strcpy(fix->id, dinfo->name);
1151 fix->smem_start = dinfo->fb.physical;
1152 fix->smem_len = dinfo->fb.size;
1153 fix->type = FB_TYPE_PACKED_PIXELS;
1154 fix->type_aux = 0;
1155 fix->visual = dinfo->visual;
1156 fix->xpanstep = 8;
1157 fix->ypanstep = 1;
1158 fix->ywrapstep = 0;
1159 fix->line_length = dinfo->pitch;
1160 fix->mmio_start = dinfo->mmio_base_phys;
1161 fix->mmio_len = INTEL_REG_SIZE;
1162 fix->accel = FB_ACCEL_I830;
1163 return 0;
1164}
1165
1166/*************************************************************** 1155/***************************************************************
1167 * fbdev interface * 1156 * fbdev interface *
1168 ***************************************************************/ 1157 ***************************************************************/
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 376d4a171ec7..494287f8f8bf 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -197,7 +197,6 @@ struct leo_par {
197 unsigned long fbsize; 197 unsigned long fbsize;
198 198
199 struct sbus_dev *sdev; 199 struct sbus_dev *sdev;
200 struct list_head list;
201}; 200};
202 201
203static void leo_wait(struct leo_lx_krn __iomem *lx_krn) 202static void leo_wait(struct leo_lx_krn __iomem *lx_krn)
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index 18bcda23d2cf..b251e754e16c 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -140,7 +140,6 @@ struct p9100_par {
140 unsigned long fbsize; 140 unsigned long fbsize;
141 141
142 struct sbus_dev *sdev; 142 struct sbus_dev *sdev;
143 struct list_head list;
144}; 143};
145 144
146/** 145/**
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 7b4cd250bec8..9fc10b9e6f57 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -1396,7 +1396,8 @@ static struct platform_driver pxafb_driver = {
1396int __devinit pxafb_setup(char *options) 1396int __devinit pxafb_setup(char *options)
1397{ 1397{
1398# ifdef CONFIG_FB_PXA_PARAMETERS 1398# ifdef CONFIG_FB_PXA_PARAMETERS
1399 strlcpy(g_options, options, sizeof(g_options)); 1399 if (options)
1400 strlcpy(g_options, options, sizeof(g_options));
1400# endif 1401# endif
1401 return 0; 1402 return 0;
1402} 1403}
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index fe4f63f3849d..2b27b4474001 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -125,7 +125,6 @@ struct tcx_par {
125 int lowdepth; 125 int lowdepth;
126 126
127 struct sbus_dev *sdev; 127 struct sbus_dev *sdev;
128 struct list_head list;
129}; 128};
130 129
131/* Reset control plane so that WID is 8-bit plane. */ 130/* Reset control plane so that WID is 8-bit plane. */
@@ -444,7 +443,7 @@ static void tcx_init_one(struct sbus_dev *sdev)
444 443
445 tcx_reset(&all->info); 444 tcx_reset(&all->info);
446 445
447 tcx_blank(0, &all->info); 446 tcx_blank(FB_BLANK_UNBLANK, &all->info);
448 447
449 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 448 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) {
450 printk(KERN_ERR "tcx: Could not allocate color map.\n"); 449 printk(KERN_ERR "tcx: Could not allocate color map.\n");