diff options
author | James Simmons <jsimmons@infradead.org> | 2005-09-09 16:04:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:59 -0400 |
commit | 4c7ffe0b9f7f40bd818fe3af51342f64c483908e (patch) | |
tree | 2827dd7904f46cbaff935e221563cd017707f10f /drivers | |
parent | d2d58384fc5d4c0fe2d8e34bc2d15a90a9bb372a (diff) |
[PATCH] fbdev: prevent drivers that have hardware cursors from calling software cursor code
This patch removes drivers that have hardware cursors from calling the
software cursor code. Also if the driver sets a no hardware cursor flag
then the driver reports a error it someone attempts to use the cursor.
Signed-off-by: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/Kconfig | 4 | ||||
-rw-r--r-- | drivers/video/i810/i810.h | 1 | ||||
-rw-r--r-- | drivers/video/i810/i810_main.c | 6 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfb.h | 1 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 21 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbhw.c | 4 | ||||
-rw-r--r-- | drivers/video/nvidia/nvidia.c | 4 |
7 files changed, 6 insertions, 35 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index cde0ed097af6..3c91c3a5cc58 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -650,7 +650,6 @@ config FB_NVIDIA | |||
650 | select FB_CFB_FILLRECT | 650 | select FB_CFB_FILLRECT |
651 | select FB_CFB_COPYAREA | 651 | select FB_CFB_COPYAREA |
652 | select FB_CFB_IMAGEBLIT | 652 | select FB_CFB_IMAGEBLIT |
653 | select FB_SOFT_CURSOR | ||
654 | help | 653 | help |
655 | This driver supports graphics boards with the nVidia chips, TNT | 654 | This driver supports graphics boards with the nVidia chips, TNT |
656 | and newer. For very old chipsets, such as the RIVA128, then use | 655 | and newer. For very old chipsets, such as the RIVA128, then use |
@@ -681,7 +680,6 @@ config FB_RIVA | |||
681 | select FB_CFB_FILLRECT | 680 | select FB_CFB_FILLRECT |
682 | select FB_CFB_COPYAREA | 681 | select FB_CFB_COPYAREA |
683 | select FB_CFB_IMAGEBLIT | 682 | select FB_CFB_IMAGEBLIT |
684 | select FB_SOFT_CURSOR | ||
685 | help | 683 | help |
686 | This driver supports graphics boards with the nVidia Riva/Geforce | 684 | This driver supports graphics boards with the nVidia Riva/Geforce |
687 | chips. | 685 | chips. |
@@ -720,7 +718,6 @@ config FB_I810 | |||
720 | select FB_CFB_FILLRECT | 718 | select FB_CFB_FILLRECT |
721 | select FB_CFB_COPYAREA | 719 | select FB_CFB_COPYAREA |
722 | select FB_CFB_IMAGEBLIT | 720 | select FB_CFB_IMAGEBLIT |
723 | select FB_SOFT_CURSOR | ||
724 | help | 721 | help |
725 | This driver supports the on-board graphics built in to the Intel 810 | 722 | This driver supports the on-board graphics built in to the Intel 810 |
726 | and 815 chipsets. Say Y if you have and plan to use such a board. | 723 | and 815 chipsets. Say Y if you have and plan to use such a board. |
@@ -763,7 +760,6 @@ config FB_INTEL | |||
763 | select FB_CFB_FILLRECT | 760 | select FB_CFB_FILLRECT |
764 | select FB_CFB_COPYAREA | 761 | select FB_CFB_COPYAREA |
765 | select FB_CFB_IMAGEBLIT | 762 | select FB_CFB_IMAGEBLIT |
766 | select FB_SOFT_CURSOR | ||
767 | help | 763 | help |
768 | This driver supports the on-board graphics built in to the Intel | 764 | This driver supports the on-board graphics built in to the Intel |
769 | 830M/845G/852GM/855GM/865G chipsets. | 765 | 830M/845G/852GM/855GM/865G chipsets. |
diff --git a/drivers/video/i810/i810.h b/drivers/video/i810/i810.h index fe3b75794756..f59af3335ccf 100644 --- a/drivers/video/i810/i810.h +++ b/drivers/video/i810/i810.h | |||
@@ -201,7 +201,6 @@ | |||
201 | #define HAS_ACCELERATION 2 | 201 | #define HAS_ACCELERATION 2 |
202 | #define ALWAYS_SYNC 4 | 202 | #define ALWAYS_SYNC 4 |
203 | #define LOCKUP 8 | 203 | #define LOCKUP 8 |
204 | #define USE_HWCUR 16 | ||
205 | 204 | ||
206 | struct gtt_data { | 205 | struct gtt_data { |
207 | struct agp_memory *i810_fb_memory; | 206 | struct agp_memory *i810_fb_memory; |
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 6db183462b92..d07b1f203fc4 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
@@ -1375,7 +1375,6 @@ static int i810fb_set_par(struct fb_info *info) | |||
1375 | decode_var(&info->var, par); | 1375 | decode_var(&info->var, par); |
1376 | i810_load_regs(par); | 1376 | i810_load_regs(par); |
1377 | i810_init_cursor(par); | 1377 | i810_init_cursor(par); |
1378 | |||
1379 | encode_fix(&info->fix, info); | 1378 | encode_fix(&info->fix, info); |
1380 | 1379 | ||
1381 | if (info->var.accel_flags && !(par->dev_flags & LOCKUP)) { | 1380 | if (info->var.accel_flags && !(par->dev_flags & LOCKUP)) { |
@@ -1418,9 +1417,8 @@ static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
1418 | struct i810fb_par *par = (struct i810fb_par *)info->par; | 1417 | struct i810fb_par *par = (struct i810fb_par *)info->par; |
1419 | u8 __iomem *mmio = par->mmio_start_virtual; | 1418 | u8 __iomem *mmio = par->mmio_start_virtual; |
1420 | 1419 | ||
1421 | if (!(par->dev_flags & USE_HWCUR) || !info->var.accel_flags || | 1420 | if (!par->dev_flags & LOCKUP) |
1422 | par->dev_flags & LOCKUP) | 1421 | return -ENXIO; |
1423 | return soft_cursor(info, cursor); | ||
1424 | 1422 | ||
1425 | if (cursor->image.width > 64 || cursor->image.height > 64) | 1423 | if (cursor->image.width > 64 || cursor->image.height > 64) |
1426 | return -ENXIO; | 1424 | return -ENXIO; |
diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index 6680ec9ba69e..011e11626558 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h | |||
@@ -234,7 +234,6 @@ struct intelfb_info { | |||
234 | 234 | ||
235 | /* palette */ | 235 | /* palette */ |
236 | u32 pseudo_palette[17]; | 236 | u32 pseudo_palette[17]; |
237 | struct { u8 red, green, blue, pad; } palette[256]; | ||
238 | 237 | ||
239 | /* chip info */ | 238 | /* chip info */ |
240 | int pci_chipset; | 239 | int pci_chipset; |
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index a112a1786855..bf62e6ed0382 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -117,14 +117,10 @@ | |||
117 | #include <linux/slab.h> | 117 | #include <linux/slab.h> |
118 | #include <linux/delay.h> | 118 | #include <linux/delay.h> |
119 | #include <linux/fb.h> | 119 | #include <linux/fb.h> |
120 | #include <linux/console.h> | ||
121 | #include <linux/selection.h> | ||
122 | #include <linux/ioport.h> | 120 | #include <linux/ioport.h> |
123 | #include <linux/init.h> | 121 | #include <linux/init.h> |
124 | #include <linux/pci.h> | 122 | #include <linux/pci.h> |
125 | #include <linux/vmalloc.h> | 123 | #include <linux/vmalloc.h> |
126 | #include <linux/kd.h> | ||
127 | #include <linux/vt_kern.h> | ||
128 | #include <linux/pagemap.h> | 124 | #include <linux/pagemap.h> |
129 | #include <linux/version.h> | 125 | #include <linux/version.h> |
130 | 126 | ||
@@ -242,7 +238,7 @@ static int voffset = 48; | |||
242 | static char *mode = NULL; | 238 | static char *mode = NULL; |
243 | 239 | ||
244 | module_param(accel, bool, S_IRUGO); | 240 | module_param(accel, bool, S_IRUGO); |
245 | MODULE_PARM_DESC(accel, "Enable console acceleration"); | 241 | MODULE_PARM_DESC(accel, "Enable hardware acceleration"); |
246 | module_param(vram, int, S_IRUGO); | 242 | module_param(vram, int, S_IRUGO); |
247 | MODULE_PARM_DESC(vram, "System RAM to allocate to framebuffer in MiB"); | 243 | MODULE_PARM_DESC(vram, "System RAM to allocate to framebuffer in MiB"); |
248 | module_param(voffset, int, S_IRUGO); | 244 | module_param(voffset, int, S_IRUGO); |
@@ -498,7 +494,7 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
498 | { | 494 | { |
499 | struct fb_info *info; | 495 | struct fb_info *info; |
500 | struct intelfb_info *dinfo; | 496 | struct intelfb_info *dinfo; |
501 | int i, j, err, dvo; | 497 | int i, err, dvo; |
502 | int aperture_size, stolen_size; | 498 | int aperture_size, stolen_size; |
503 | struct agp_kern_info gtt_info; | 499 | struct agp_kern_info gtt_info; |
504 | int agp_memtype; | 500 | int agp_memtype; |
@@ -845,13 +841,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
845 | if (bailearly == 5) | 841 | if (bailearly == 5) |
846 | bailout(dinfo); | 842 | bailout(dinfo); |
847 | 843 | ||
848 | for (i = 0; i < 16; i++) { | ||
849 | j = color_table[i]; | ||
850 | dinfo->palette[i].red = default_red[j]; | ||
851 | dinfo->palette[i].green = default_grn[j]; | ||
852 | dinfo->palette[i].blue = default_blu[j]; | ||
853 | } | ||
854 | |||
855 | if (bailearly == 6) | 844 | if (bailearly == 6) |
856 | bailout(dinfo); | 845 | bailout(dinfo); |
857 | 846 | ||
@@ -1363,10 +1352,6 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
1363 | green >>= 8; | 1352 | green >>= 8; |
1364 | blue >>= 8; | 1353 | blue >>= 8; |
1365 | 1354 | ||
1366 | dinfo->palette[regno].red = red; | ||
1367 | dinfo->palette[regno].green = green; | ||
1368 | dinfo->palette[regno].blue = blue; | ||
1369 | |||
1370 | intelfbhw_setcolreg(dinfo, regno, red, green, blue, | 1355 | intelfbhw_setcolreg(dinfo, regno, red, green, blue, |
1371 | transp); | 1356 | transp); |
1372 | } | 1357 | } |
@@ -1499,7 +1484,7 @@ intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
1499 | #endif | 1484 | #endif |
1500 | 1485 | ||
1501 | if (!dinfo->hwcursor) | 1486 | if (!dinfo->hwcursor) |
1502 | return soft_cursor(info, cursor); | 1487 | return -ENXIO; |
1503 | 1488 | ||
1504 | intelfbhw_cursor_hide(dinfo); | 1489 | intelfbhw_cursor_hide(dinfo); |
1505 | 1490 | ||
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c index f5bed581dc45..5bafc3c54db7 100644 --- a/drivers/video/intelfb/intelfbhw.c +++ b/drivers/video/intelfb/intelfbhw.c | |||
@@ -29,14 +29,10 @@ | |||
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
31 | #include <linux/fb.h> | 31 | #include <linux/fb.h> |
32 | #include <linux/console.h> | ||
33 | #include <linux/selection.h> | ||
34 | #include <linux/ioport.h> | 32 | #include <linux/ioport.h> |
35 | #include <linux/init.h> | 33 | #include <linux/init.h> |
36 | #include <linux/pci.h> | 34 | #include <linux/pci.h> |
37 | #include <linux/vmalloc.h> | 35 | #include <linux/vmalloc.h> |
38 | #include <linux/kd.h> | ||
39 | #include <linux/vt_kern.h> | ||
40 | #include <linux/pagemap.h> | 36 | #include <linux/pagemap.h> |
41 | #include <linux/version.h> | 37 | #include <linux/version.h> |
42 | 38 | ||
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index 30f80c23f934..af99ea96012e 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c | |||
@@ -893,7 +893,7 @@ static int nvidiafb_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
893 | int i, set = cursor->set; | 893 | int i, set = cursor->set; |
894 | u16 fg, bg; | 894 | u16 fg, bg; |
895 | 895 | ||
896 | if (cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS) | 896 | if (!hwcur || cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS) |
897 | return -ENXIO; | 897 | return -ENXIO; |
898 | 898 | ||
899 | NVShowHideCursor(par, 0); | 899 | NVShowHideCursor(par, 0); |
@@ -1356,8 +1356,6 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info) | |||
1356 | info->pixmap.size = 8 * 1024; | 1356 | info->pixmap.size = 8 * 1024; |
1357 | info->pixmap.flags = FB_PIXMAP_SYSTEM; | 1357 | info->pixmap.flags = FB_PIXMAP_SYSTEM; |
1358 | 1358 | ||
1359 | if (!hwcur) | ||
1360 | info->fbops->fb_cursor = soft_cursor; | ||
1361 | info->var.accel_flags = (!noaccel); | 1359 | info->var.accel_flags = (!noaccel); |
1362 | 1360 | ||
1363 | switch (par->Architecture) { | 1361 | switch (par->Architecture) { |