aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-12-13 01:43:33 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-13 01:43:33 -0500
commitd00d598ffbba974d9045ba8b95296655fe2162c5 (patch)
tree93bdc3bf4ec728d554c54e3f1f51cb5597f53a31 /drivers
parentb5632303401c231bf270ef36f1013e52caf4caf9 (diff)
parentbe0d9b6c7aeaad1683059c00131cabd4c894c17c (diff)
Merge branch 'master'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/cciss.c4
-rw-r--r--drivers/char/drm/radeon_cp.c2
-rw-r--r--drivers/net/skge.c10
-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/console/fbcon.c42
-rw-r--r--drivers/video/fbmem.c26
8 files changed, 88 insertions, 55 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index e34104d32637..c3441b3f086e 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1464,8 +1464,10 @@ static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,
1464 request_queue_t *q = disk->queue; 1464 request_queue_t *q = disk->queue;
1465 if (disk->flags & GENHD_FL_UP) 1465 if (disk->flags & GENHD_FL_UP)
1466 del_gendisk(disk); 1466 del_gendisk(disk);
1467 if (q) 1467 if (q) {
1468 blk_cleanup_queue(q); 1468 blk_cleanup_queue(q);
1469 drv->queue = NULL;
1470 }
1469 } 1471 }
1470 } 1472 }
1471 1473
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 03839ea31092..9f2b4efd0c7a 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1522,7 +1522,7 @@ static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
1522 1522
1523 dev_priv->gart_size = init->gart_size; 1523 dev_priv->gart_size = init->gart_size;
1524 dev_priv->gart_vm_start = dev_priv->fb_location 1524 dev_priv->gart_vm_start = dev_priv->fb_location
1525 + RADEON_READ(RADEON_CONFIG_APER_SIZE); 1525 + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;
1526 1526
1527#if __OS_HAS_AGP 1527#if __OS_HAS_AGP
1528 if (!dev_priv->is_pci) 1528 if (!dev_priv->is_pci)
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 716467879b9c..8b6e2a11e28d 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2280,11 +2280,13 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
2280 } 2280 }
2281 2281
2282 if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { 2282 if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) {
2283 netif_stop_queue(dev); 2283 if (!netif_stopped(dev)) {
2284 spin_unlock_irqrestore(&skge->tx_lock, flags); 2284 netif_stop_queue(dev);
2285 2285
2286 printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", 2286 printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",
2287 dev->name); 2287 dev->name);
2288 }
2289 spin_unlock_irqrestore(&skge->tx_lock, flags);
2288 return NETDEV_TX_BUSY; 2290 return NETDEV_TX_BUSY;
2289 } 2291 }
2290 2292
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/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/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;