This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / video / matrox / matroxfb_base.c
index 5cffad2..e2a2290 100644 (file)
@@ -835,7 +835,6 @@ static int matroxfb_set_par(struct fb_info *info)
                        matrox_cfbX_init(PMINFO2);
                }
        }
-       ACCESS_FBINFO(initialized) = 1;
        return 0;
 }
 
@@ -1144,7 +1143,6 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
                                        return -EFAULT;
                                return err;
                        }
-               case VIDIOC_S_CTRL_OLD:
                case VIDIOC_S_CTRL:
                        {
                                struct v4l2_control ctrl;
@@ -1183,11 +1181,11 @@ static int matroxfb_blank(int blank, struct fb_info *info)
                return 1;
 
        switch (blank) {
-       case FB_BLANK_NORMAL:  seq = 0x20; crtc = 0x00; break; /* works ??? */
-       case FB_BLANK_VSYNC_SUSPEND:  seq = 0x20; crtc = 0x10; break;
-       case FB_BLANK_HSYNC_SUSPEND:  seq = 0x20; crtc = 0x20; break;
-       case FB_BLANK_POWERDOWN:  seq = 0x20; crtc = 0x30; break;
-       default: seq = 0x00; crtc = 0x00; break;
+               case 1:  seq = 0x20; crtc = 0x00; break; /* works ??? */
+               case 2:  seq = 0x20; crtc = 0x10; break;
+               case 3:  seq = 0x20; crtc = 0x20; break;
+               case 4:  seq = 0x20; crtc = 0x30; break;
+               default: seq = 0x00; crtc = 0x00; break;
        }
 
        CRITBEGIN
@@ -1580,11 +1578,6 @@ static int initMatrox2(WPMINFO struct board* b){
        unsigned int memsize;
        int err;
 
-       static struct pci_device_id intel_82437[] = {
-               { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437) },
-               { },
-       };
-
        DBG(__FUNCTION__)
 
        /* set default values... */
@@ -1689,7 +1682,7 @@ static int initMatrox2(WPMINFO struct board* b){
                mga_option |= MX_OPTION_BSWAP;
                 /* disable palette snooping */
                 cmd &= ~PCI_COMMAND_VGA_PALETTE;
-               if (pci_dev_present(intel_82437)) {
+               if (pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437, NULL)) {
                        if (!(mga_option & 0x20000000) && !ACCESS_FBINFO(devflags.nopciretry)) {
                                printk(KERN_WARNING "matroxfb: Disabling PCI retries due to i82437 present\n");
                        }
@@ -1718,6 +1711,7 @@ static int initMatrox2(WPMINFO struct board* b){
        }
        ACCESS_FBINFO(devflags.ydstorg) = 0;
 
+       ACCESS_FBINFO(fbcon.currcon) = -1;
        ACCESS_FBINFO(video.base) = video_base_phys;
        ACCESS_FBINFO(video.len_usable) = ACCESS_FBINFO(video.len);
        if (ACCESS_FBINFO(video.len_usable) > b->base->maxdisplayable)
@@ -1756,12 +1750,6 @@ static int initMatrox2(WPMINFO struct board* b){
        ACCESS_FBINFO(fbcon.pseudo_palette) = ACCESS_FBINFO(cmap);
        /* after __init time we are like module... no logo */
        ACCESS_FBINFO(fbcon.flags) = hotplug ? FBINFO_FLAG_MODULE : FBINFO_FLAG_DEFAULT;
-       ACCESS_FBINFO(fbcon.flags) |= FBINFO_PARTIAL_PAN_OK |    /* Prefer panning for scroll under MC viewer/edit */
-                                     FBINFO_HWACCEL_COPYAREA |  /* We have hw-assisted bmove */
-                                     FBINFO_HWACCEL_FILLRECT |  /* And fillrect */
-                                     FBINFO_HWACCEL_IMAGEBLIT | /* And imageblit */
-                                     FBINFO_HWACCEL_XPAN |      /* And we support both horizontal */
-                                     FBINFO_HWACCEL_YPAN;       /* And vertical panning */
        ACCESS_FBINFO(video.len_usable) &= PAGE_MASK;
        fb_alloc_cmap(&ACCESS_FBINFO(fbcon.cmap), 256, 1);
 
@@ -1876,24 +1864,21 @@ static int initMatrox2(WPMINFO struct board* b){
 /* We do not have to set currcon to 0... register_framebuffer do it for us on first console
  * and we do not want currcon == 0 for subsequent framebuffers */
 
-       ACCESS_FBINFO(fbcon).device = &ACCESS_FBINFO(pcidev)->dev;
        if (register_framebuffer(&ACCESS_FBINFO(fbcon)) < 0) {
                goto failVideoIO;
        }
        printk("fb%d: %s frame buffer device\n",
               ACCESS_FBINFO(fbcon.node), ACCESS_FBINFO(fbcon.fix.id));
-
-       /* there is no console on this fb... but we have to initialize hardware
-        * until someone tells me what is proper thing to do */
-       if (!ACCESS_FBINFO(initialized)) {
-               printk(KERN_INFO "fb%d: initializing hardware\n",
-                      ACCESS_FBINFO(fbcon.node));
-               /* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var
-                * already before, so register_framebuffer works correctly. */
-               vesafb_defined.activate |= FB_ACTIVATE_FORCE;
-               fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined);
-       }
-
+       if (ACCESS_FBINFO(fbcon.currcon) < 0) {
+               /* there is no console on this fb... but we have to initialize hardware
+                * until someone tells me what is proper thing to do */
+               printk(KERN_INFO "fb%d: initializing hardware\n",
+                       ACCESS_FBINFO(fbcon.node));
+               /* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var
+                * already before, so register_framebuffer works correctly. */
+               vesafb_defined.activate |= FB_ACTIVATE_FORCE;
+               fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined);
+       }
        return 0;
 failVideoIO:;
        matroxfb_g450_shutdown(PMINFO2);