Forráskód Böngészése

[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>
James Simmons 19 éve
szülő
commit
4c7ffe0b9f

+ 0 - 4
drivers/video/Kconfig

@@ -650,7 +650,6 @@ config FB_NVIDIA
 	select FB_CFB_FILLRECT
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select FB_CFB_IMAGEBLIT
-	select FB_SOFT_CURSOR
 	help
 	help
 	  This driver supports graphics boards with the nVidia chips, TNT
 	  This driver supports graphics boards with the nVidia chips, TNT
 	  and newer. For very old chipsets, such as the RIVA128, then use
 	  and newer. For very old chipsets, such as the RIVA128, then use
@@ -681,7 +680,6 @@ config FB_RIVA
 	select FB_CFB_FILLRECT
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select FB_CFB_IMAGEBLIT
-	select FB_SOFT_CURSOR
 	help
 	help
 	  This driver supports graphics boards with the nVidia Riva/Geforce
 	  This driver supports graphics boards with the nVidia Riva/Geforce
 	  chips.
 	  chips.
@@ -720,7 +718,6 @@ config FB_I810
 	select FB_CFB_FILLRECT
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select FB_CFB_IMAGEBLIT
-	select FB_SOFT_CURSOR
 	help
 	help
 	  This driver supports the on-board graphics built in to the Intel 810 
 	  This driver supports the on-board graphics built in to the Intel 810 
           and 815 chipsets.  Say Y if you have and plan to use such a board.
           and 815 chipsets.  Say Y if you have and plan to use such a board.
@@ -763,7 +760,6 @@ config FB_INTEL
 	select FB_CFB_FILLRECT
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select FB_CFB_IMAGEBLIT
-	select FB_SOFT_CURSOR
 	help
 	help
 	  This driver supports the on-board graphics built in to the Intel
 	  This driver supports the on-board graphics built in to the Intel
           830M/845G/852GM/855GM/865G chipsets.
           830M/845G/852GM/855GM/865G chipsets.

+ 0 - 1
drivers/video/i810/i810.h

@@ -201,7 +201,6 @@
 #define HAS_ACCELERATION            2
 #define HAS_ACCELERATION            2
 #define ALWAYS_SYNC                 4
 #define ALWAYS_SYNC                 4
 #define LOCKUP                      8
 #define LOCKUP                      8
-#define USE_HWCUR                  16
 
 
 struct gtt_data {
 struct gtt_data {
 	struct agp_memory *i810_fb_memory;
 	struct agp_memory *i810_fb_memory;

+ 2 - 4
drivers/video/i810/i810_main.c

@@ -1375,7 +1375,6 @@ static int i810fb_set_par(struct fb_info *info)
 	decode_var(&info->var, par);
 	decode_var(&info->var, par);
 	i810_load_regs(par);
 	i810_load_regs(par);
 	i810_init_cursor(par);
 	i810_init_cursor(par);
-
 	encode_fix(&info->fix, info);
 	encode_fix(&info->fix, info);
 
 
 	if (info->var.accel_flags && !(par->dev_flags & LOCKUP)) {
 	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)
 	struct i810fb_par *par = (struct i810fb_par *)info->par;
 	struct i810fb_par *par = (struct i810fb_par *)info->par;
 	u8 __iomem *mmio = par->mmio_start_virtual;
 	u8 __iomem *mmio = par->mmio_start_virtual;
 
 
-	if (!(par->dev_flags & USE_HWCUR) || !info->var.accel_flags ||
-	    par->dev_flags & LOCKUP)
-		return soft_cursor(info, cursor);
+	if (!par->dev_flags & LOCKUP)
+		return -ENXIO;
 
 
 	if (cursor->image.width > 64 || cursor->image.height > 64)
 	if (cursor->image.width > 64 || cursor->image.height > 64)
 		return -ENXIO;
 		return -ENXIO;

+ 0 - 1
drivers/video/intelfb/intelfb.h

@@ -234,7 +234,6 @@ struct intelfb_info {
 
 
 	/* palette */
 	/* palette */
 	u32 pseudo_palette[17];
 	u32 pseudo_palette[17];
-	struct { u8 red, green, blue, pad; } palette[256];
 
 
 	/* chip info */
 	/* chip info */
 	int pci_chipset;
 	int pci_chipset;

+ 3 - 18
drivers/video/intelfb/intelfbdrv.c

@@ -117,14 +117,10 @@
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/fb.h>
-#include <linux/console.h>
-#include <linux/selection.h>
 #include <linux/ioport.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
 #include <linux/vmalloc.h>
-#include <linux/kd.h>
-#include <linux/vt_kern.h>
 #include <linux/pagemap.h>
 #include <linux/pagemap.h>
 #include <linux/version.h>
 #include <linux/version.h>
 
 
@@ -242,7 +238,7 @@ static int voffset	= 48;
 static char *mode       = NULL;
 static char *mode       = NULL;
 
 
 module_param(accel, bool, S_IRUGO);
 module_param(accel, bool, S_IRUGO);
-MODULE_PARM_DESC(accel, "Enable console acceleration");
+MODULE_PARM_DESC(accel, "Enable hardware acceleration");
 module_param(vram, int, S_IRUGO);
 module_param(vram, int, S_IRUGO);
 MODULE_PARM_DESC(vram, "System RAM to allocate to framebuffer in MiB");
 MODULE_PARM_DESC(vram, "System RAM to allocate to framebuffer in MiB");
 module_param(voffset, int, S_IRUGO);
 module_param(voffset, int, S_IRUGO);
@@ -498,7 +494,7 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 {
 	struct fb_info *info;
 	struct fb_info *info;
 	struct intelfb_info *dinfo;
 	struct intelfb_info *dinfo;
-	int i, j, err, dvo;
+	int i, err, dvo;
 	int aperture_size, stolen_size;
 	int aperture_size, stolen_size;
 	struct agp_kern_info gtt_info;
 	struct agp_kern_info gtt_info;
 	int agp_memtype;
 	int agp_memtype;
@@ -845,13 +841,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (bailearly == 5)
 	if (bailearly == 5)
 		bailout(dinfo);
 		bailout(dinfo);
 
 
-	for (i = 0; i < 16; i++) {
-		j = color_table[i];
-		dinfo->palette[i].red = default_red[j];
-		dinfo->palette[i].green = default_grn[j];
-		dinfo->palette[i].blue = default_blu[j];
-	}
-
 	if (bailearly == 6)
 	if (bailearly == 6)
 		bailout(dinfo);
 		bailout(dinfo);
 
 
@@ -1363,10 +1352,6 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green,
 			green >>= 8;
 			green >>= 8;
 			blue >>= 8;
 			blue >>= 8;
 
 
-			dinfo->palette[regno].red = red;
-			dinfo->palette[regno].green = green;
-			dinfo->palette[regno].blue = blue;
-
 			intelfbhw_setcolreg(dinfo, regno, red, green, blue,
 			intelfbhw_setcolreg(dinfo, regno, red, green, blue,
 					    transp);
 					    transp);
 		}
 		}
@@ -1499,7 +1484,7 @@ intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 #endif
 #endif
 
 
 	if (!dinfo->hwcursor)
 	if (!dinfo->hwcursor)
-		return soft_cursor(info, cursor);
+		return -ENXIO;
 
 
 	intelfbhw_cursor_hide(dinfo);
 	intelfbhw_cursor_hide(dinfo);
 
 

+ 0 - 4
drivers/video/intelfb/intelfbhw.c

@@ -29,14 +29,10 @@
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/fb.h>
-#include <linux/console.h>
-#include <linux/selection.h>
 #include <linux/ioport.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
 #include <linux/vmalloc.h>
-#include <linux/kd.h>
-#include <linux/vt_kern.h>
 #include <linux/pagemap.h>
 #include <linux/pagemap.h>
 #include <linux/version.h>
 #include <linux/version.h>
 
 

+ 1 - 3
drivers/video/nvidia/nvidia.c

@@ -893,7 +893,7 @@ static int nvidiafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 	int i, set = cursor->set;
 	int i, set = cursor->set;
 	u16 fg, bg;
 	u16 fg, bg;
 
 
-	if (cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS)
+	if (!hwcur || cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS)
 		return -ENXIO;
 		return -ENXIO;
 
 
 	NVShowHideCursor(par, 0);
 	NVShowHideCursor(par, 0);
@@ -1356,8 +1356,6 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
 	info->pixmap.size = 8 * 1024;
 	info->pixmap.size = 8 * 1024;
 	info->pixmap.flags = FB_PIXMAP_SYSTEM;
 	info->pixmap.flags = FB_PIXMAP_SYSTEM;
 
 
-	if (!hwcur)
-		info->fbops->fb_cursor = soft_cursor;
 	info->var.accel_flags = (!noaccel);
 	info->var.accel_flags = (!noaccel);
 
 
 	switch (par->Architecture) {
 	switch (par->Architecture) {