diff options
Diffstat (limited to 'drivers/video/matrox')
-rw-r--r-- | drivers/video/matrox/matroxfb_base.c | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index 23c1827b2d0b..f4ddd3431f17 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c | |||
@@ -102,6 +102,8 @@ | |||
102 | #include <linux/config.h> | 102 | #include <linux/config.h> |
103 | #include <linux/version.h> | 103 | #include <linux/version.h> |
104 | 104 | ||
105 | #define __OLD_VIDIOC_ | ||
106 | |||
105 | #include "matroxfb_base.h" | 107 | #include "matroxfb_base.h" |
106 | #include "matroxfb_misc.h" | 108 | #include "matroxfb_misc.h" |
107 | #include "matroxfb_accel.h" | 109 | #include "matroxfb_accel.h" |
@@ -158,9 +160,9 @@ static void update_crtc2(WPMINFO unsigned int pos) { | |||
158 | 160 | ||
159 | /* Make sure that displays are compatible */ | 161 | /* Make sure that displays are compatible */ |
160 | if (info && (info->fbcon.var.bits_per_pixel == ACCESS_FBINFO(fbcon).var.bits_per_pixel) | 162 | if (info && (info->fbcon.var.bits_per_pixel == ACCESS_FBINFO(fbcon).var.bits_per_pixel) |
161 | && (info->fbcon.var.xres_virtual == ACCESS_FBINFO(fbcon).var.xres_virtual) | 163 | && (info->fbcon.var.xres_virtual == ACCESS_FBINFO(fbcon).var.xres_virtual) |
162 | && (info->fbcon.var.green.length == ACCESS_FBINFO(fbcon).var.green.length) | 164 | && (info->fbcon.var.green.length == ACCESS_FBINFO(fbcon).var.green.length) |
163 | ) { | 165 | ) { |
164 | switch (ACCESS_FBINFO(fbcon).var.bits_per_pixel) { | 166 | switch (ACCESS_FBINFO(fbcon).var.bits_per_pixel) { |
165 | case 16: | 167 | case 16: |
166 | case 32: | 168 | case 32: |
@@ -224,7 +226,7 @@ static irqreturn_t matrox_irq(int irq, void *dev_id, struct pt_regs *fp) | |||
224 | 226 | ||
225 | int matroxfb_enable_irq(WPMINFO int reenable) { | 227 | int matroxfb_enable_irq(WPMINFO int reenable) { |
226 | u_int32_t bm; | 228 | u_int32_t bm; |
227 | 229 | ||
228 | if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG400) | 230 | if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG400) |
229 | bm = 0x220; | 231 | bm = 0x220; |
230 | else | 232 | else |
@@ -241,7 +243,7 @@ int matroxfb_enable_irq(WPMINFO int reenable) { | |||
241 | mga_outl(M_IEN, mga_inl(M_IEN) | bm); | 243 | mga_outl(M_IEN, mga_inl(M_IEN) | bm); |
242 | } else if (reenable) { | 244 | } else if (reenable) { |
243 | u_int32_t ien; | 245 | u_int32_t ien; |
244 | 246 | ||
245 | ien = mga_inl(M_IEN); | 247 | ien = mga_inl(M_IEN); |
246 | if ((ien & bm) != bm) { | 248 | if ((ien & bm) != bm) { |
247 | printk(KERN_DEBUG "matroxfb: someone disabled IRQ [%08X]\n", ien); | 249 | printk(KERN_DEBUG "matroxfb: someone disabled IRQ [%08X]\n", ien); |
@@ -347,7 +349,7 @@ static void matrox_pan_var(WPMINFO struct fb_var_screeninfo *var) { | |||
347 | mga_setr(M_EXTVGA_INDEX, 0x00, p2); | 349 | mga_setr(M_EXTVGA_INDEX, 0x00, p2); |
348 | } | 350 | } |
349 | matroxfb_DAC_unlock_irqrestore(flags); | 351 | matroxfb_DAC_unlock_irqrestore(flags); |
350 | 352 | ||
351 | update_crtc2(PMINFO pos); | 353 | update_crtc2(PMINFO pos); |
352 | 354 | ||
353 | CRITEND | 355 | CRITEND |
@@ -390,7 +392,7 @@ static void matroxfb_remove(WPMINFO int dummy) { | |||
390 | static int matroxfb_open(struct fb_info *info, int user) | 392 | static int matroxfb_open(struct fb_info *info, int user) |
391 | { | 393 | { |
392 | MINFO_FROM_INFO(info); | 394 | MINFO_FROM_INFO(info); |
393 | 395 | ||
394 | DBG_LOOP(__FUNCTION__) | 396 | DBG_LOOP(__FUNCTION__) |
395 | 397 | ||
396 | if (ACCESS_FBINFO(dead)) { | 398 | if (ACCESS_FBINFO(dead)) { |
@@ -406,7 +408,7 @@ static int matroxfb_open(struct fb_info *info, int user) | |||
406 | static int matroxfb_release(struct fb_info *info, int user) | 408 | static int matroxfb_release(struct fb_info *info, int user) |
407 | { | 409 | { |
408 | MINFO_FROM_INFO(info); | 410 | MINFO_FROM_INFO(info); |
409 | 411 | ||
410 | DBG_LOOP(__FUNCTION__) | 412 | DBG_LOOP(__FUNCTION__) |
411 | 413 | ||
412 | if (user) { | 414 | if (user) { |
@@ -854,7 +856,7 @@ static int matroxfb_get_vblank(WPMINFO struct fb_vblank *vblank) | |||
854 | vblank->flags |= FB_VBLANK_VBLANKING; | 856 | vblank->flags |= FB_VBLANK_VBLANKING; |
855 | if (test_bit(0, &ACCESS_FBINFO(irq_flags))) { | 857 | if (test_bit(0, &ACCESS_FBINFO(irq_flags))) { |
856 | vblank->flags |= FB_VBLANK_HAVE_COUNT; | 858 | vblank->flags |= FB_VBLANK_HAVE_COUNT; |
857 | /* Only one writer, aligned int value... | 859 | /* Only one writer, aligned int value... |
858 | it should work without lock and without atomic_t */ | 860 | it should work without lock and without atomic_t */ |
859 | vblank->count = ACCESS_FBINFO(crtc1).vsync.cnt; | 861 | vblank->count = ACCESS_FBINFO(crtc1).vsync.cnt; |
860 | } | 862 | } |
@@ -870,7 +872,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
870 | { | 872 | { |
871 | void __user *argp = (void __user *)arg; | 873 | void __user *argp = (void __user *)arg; |
872 | MINFO_FROM_INFO(info); | 874 | MINFO_FROM_INFO(info); |
873 | 875 | ||
874 | DBG(__FUNCTION__) | 876 | DBG(__FUNCTION__) |
875 | 877 | ||
876 | if (ACCESS_FBINFO(dead)) { | 878 | if (ACCESS_FBINFO(dead)) { |
@@ -1081,7 +1083,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
1081 | case VIDIOC_QUERYCAP: | 1083 | case VIDIOC_QUERYCAP: |
1082 | { | 1084 | { |
1083 | struct v4l2_capability r; | 1085 | struct v4l2_capability r; |
1084 | 1086 | ||
1085 | memset(&r, 0, sizeof(r)); | 1087 | memset(&r, 0, sizeof(r)); |
1086 | strcpy(r.driver, "matroxfb"); | 1088 | strcpy(r.driver, "matroxfb"); |
1087 | strcpy(r.card, "Matrox"); | 1089 | strcpy(r.card, "Matrox"); |
@@ -1091,7 +1093,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
1091 | if (copy_to_user(argp, &r, sizeof(r))) | 1093 | if (copy_to_user(argp, &r, sizeof(r))) |
1092 | return -EFAULT; | 1094 | return -EFAULT; |
1093 | return 0; | 1095 | return 0; |
1094 | 1096 | ||
1095 | } | 1097 | } |
1096 | case VIDIOC_QUERYCTRL: | 1098 | case VIDIOC_QUERYCTRL: |
1097 | { | 1099 | { |
@@ -1690,8 +1692,8 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
1690 | pci_read_config_dword(ACCESS_FBINFO(pcidev), PCI_COMMAND, &cmd); | 1692 | pci_read_config_dword(ACCESS_FBINFO(pcidev), PCI_COMMAND, &cmd); |
1691 | mga_option &= 0x7FFFFFFF; /* clear BIG_ENDIAN */ | 1693 | mga_option &= 0x7FFFFFFF; /* clear BIG_ENDIAN */ |
1692 | mga_option |= MX_OPTION_BSWAP; | 1694 | mga_option |= MX_OPTION_BSWAP; |
1693 | /* disable palette snooping */ | 1695 | /* disable palette snooping */ |
1694 | cmd &= ~PCI_COMMAND_VGA_PALETTE; | 1696 | cmd &= ~PCI_COMMAND_VGA_PALETTE; |
1695 | if (pci_dev_present(intel_82437)) { | 1697 | if (pci_dev_present(intel_82437)) { |
1696 | if (!(mga_option & 0x20000000) && !ACCESS_FBINFO(devflags.nopciretry)) { | 1698 | if (!(mga_option & 0x20000000) && !ACCESS_FBINFO(devflags.nopciretry)) { |
1697 | printk(KERN_WARNING "matroxfb: Disabling PCI retries due to i82437 present\n"); | 1699 | printk(KERN_WARNING "matroxfb: Disabling PCI retries due to i82437 present\n"); |
@@ -1809,12 +1811,12 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
1809 | 1811 | ||
1810 | if (fv) { | 1812 | if (fv) { |
1811 | tmp = fv * (vesafb_defined.upper_margin + vesafb_defined.yres | 1813 | tmp = fv * (vesafb_defined.upper_margin + vesafb_defined.yres |
1812 | + vesafb_defined.lower_margin + vesafb_defined.vsync_len); | 1814 | + vesafb_defined.lower_margin + vesafb_defined.vsync_len); |
1813 | if ((tmp < fh) || (fh == 0)) fh = tmp; | 1815 | if ((tmp < fh) || (fh == 0)) fh = tmp; |
1814 | } | 1816 | } |
1815 | if (fh) { | 1817 | if (fh) { |
1816 | tmp = fh * (vesafb_defined.left_margin + vesafb_defined.xres | 1818 | tmp = fh * (vesafb_defined.left_margin + vesafb_defined.xres |
1817 | + vesafb_defined.right_margin + vesafb_defined.hsync_len); | 1819 | + vesafb_defined.right_margin + vesafb_defined.hsync_len); |
1818 | if ((tmp < maxclk) || (maxclk == 0)) maxclk = tmp; | 1820 | if ((tmp < maxclk) || (maxclk == 0)) maxclk = tmp; |
1819 | } | 1821 | } |
1820 | tmp = (maxclk + 499) / 500; | 1822 | tmp = (maxclk + 499) / 500; |
@@ -1890,14 +1892,14 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
1890 | 1892 | ||
1891 | /* there is no console on this fb... but we have to initialize hardware | 1893 | /* there is no console on this fb... but we have to initialize hardware |
1892 | * until someone tells me what is proper thing to do */ | 1894 | * until someone tells me what is proper thing to do */ |
1893 | if (!ACCESS_FBINFO(initialized)) { | 1895 | if (!ACCESS_FBINFO(initialized)) { |
1894 | printk(KERN_INFO "fb%d: initializing hardware\n", | 1896 | printk(KERN_INFO "fb%d: initializing hardware\n", |
1895 | ACCESS_FBINFO(fbcon.node)); | 1897 | ACCESS_FBINFO(fbcon.node)); |
1896 | /* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var | 1898 | /* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var |
1897 | * already before, so register_framebuffer works correctly. */ | 1899 | * already before, so register_framebuffer works correctly. */ |
1898 | vesafb_defined.activate |= FB_ACTIVATE_FORCE; | 1900 | vesafb_defined.activate |= FB_ACTIVATE_FORCE; |
1899 | fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined); | 1901 | fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined); |
1900 | } | 1902 | } |
1901 | 1903 | ||
1902 | return 0; | 1904 | return 0; |
1903 | failVideoIO:; | 1905 | failVideoIO:; |
@@ -2356,7 +2358,7 @@ static int __init matroxfb_setup(char *options) { | |||
2356 | else if (!strncmp(this_opt, "dfp:", 4)) { | 2358 | else if (!strncmp(this_opt, "dfp:", 4)) { |
2357 | dfp_type = simple_strtoul(this_opt+4, NULL, 0); | 2359 | dfp_type = simple_strtoul(this_opt+4, NULL, 0); |
2358 | dfp = 1; | 2360 | dfp = 1; |
2359 | } | 2361 | } |
2360 | #ifdef CONFIG_PPC_PMAC | 2362 | #ifdef CONFIG_PPC_PMAC |
2361 | else if (!strncmp(this_opt, "vmode:", 6)) { | 2363 | else if (!strncmp(this_opt, "vmode:", 6)) { |
2362 | unsigned int vmode = simple_strtoul(this_opt+6, NULL, 0); | 2364 | unsigned int vmode = simple_strtoul(this_opt+6, NULL, 0); |