diff options
| author | Jean Delvare <khali@linux-fr.org> | 2009-09-22 19:47:48 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:57 -0400 |
| commit | fc2d10ddfc8989e82f74d2a38c7d6bfa45bcaba9 (patch) | |
| tree | bda524a0244bb7df1e0f315b1344989564f63765 /drivers/video/matrox/matroxfb_base.c | |
| parent | 0728bacbba3b0267fa8ca8be69aa43d81b57ab51 (diff) | |
matroxfb: get rid of unneeded macros ACCESS_FBINFO and MINFO
With multihead support always enabled, these macros are no longer needed
and make the code harder to read.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Petr Vandrovec <vandrove@vc.cvut.cz>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/matrox/matroxfb_base.c')
| -rw-r--r-- | drivers/video/matrox/matroxfb_base.c | 604 |
1 files changed, 302 insertions, 302 deletions
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index 6ede98da4618..867a4d915e77 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c | |||
| @@ -155,20 +155,20 @@ static struct fb_var_screeninfo vesafb_defined = { | |||
| 155 | 155 | ||
| 156 | /* --------------------------------------------------------------------- */ | 156 | /* --------------------------------------------------------------------- */ |
| 157 | static void update_crtc2(WPMINFO unsigned int pos) { | 157 | static void update_crtc2(WPMINFO unsigned int pos) { |
| 158 | struct matroxfb_dh_fb_info* info = ACCESS_FBINFO(crtc2.info); | 158 | struct matroxfb_dh_fb_info *info = minfo->crtc2.info; |
| 159 | 159 | ||
| 160 | /* Make sure that displays are compatible */ | 160 | /* Make sure that displays are compatible */ |
| 161 | if (info && (info->fbcon.var.bits_per_pixel == ACCESS_FBINFO(fbcon).var.bits_per_pixel) | 161 | if (info && (info->fbcon.var.bits_per_pixel == minfo->fbcon.var.bits_per_pixel) |
| 162 | && (info->fbcon.var.xres_virtual == ACCESS_FBINFO(fbcon).var.xres_virtual) | 162 | && (info->fbcon.var.xres_virtual == minfo->fbcon.var.xres_virtual) |
| 163 | && (info->fbcon.var.green.length == ACCESS_FBINFO(fbcon).var.green.length) | 163 | && (info->fbcon.var.green.length == minfo->fbcon.var.green.length) |
| 164 | ) { | 164 | ) { |
| 165 | switch (ACCESS_FBINFO(fbcon).var.bits_per_pixel) { | 165 | switch (minfo->fbcon.var.bits_per_pixel) { |
| 166 | case 16: | 166 | case 16: |
| 167 | case 32: | 167 | case 32: |
| 168 | pos = pos * 8; | 168 | pos = pos * 8; |
| 169 | if (info->interlaced) { | 169 | if (info->interlaced) { |
| 170 | mga_outl(0x3C2C, pos); | 170 | mga_outl(0x3C2C, pos); |
| 171 | mga_outl(0x3C28, pos + ACCESS_FBINFO(fbcon).var.xres_virtual * ACCESS_FBINFO(fbcon).var.bits_per_pixel / 8); | 171 | mga_outl(0x3C28, pos + minfo->fbcon.var.xres_virtual * minfo->fbcon.var.bits_per_pixel / 8); |
| 172 | } else { | 172 | } else { |
| 173 | mga_outl(0x3C28, pos); | 173 | mga_outl(0x3C28, pos); |
| 174 | } | 174 | } |
| @@ -178,16 +178,16 @@ static void update_crtc2(WPMINFO unsigned int pos) { | |||
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | static void matroxfb_crtc1_panpos(WPMINFO2) { | 180 | static void matroxfb_crtc1_panpos(WPMINFO2) { |
| 181 | if (ACCESS_FBINFO(crtc1.panpos) >= 0) { | 181 | if (minfo->crtc1.panpos >= 0) { |
| 182 | unsigned long flags; | 182 | unsigned long flags; |
| 183 | int panpos; | 183 | int panpos; |
| 184 | 184 | ||
| 185 | matroxfb_DAC_lock_irqsave(flags); | 185 | matroxfb_DAC_lock_irqsave(flags); |
| 186 | panpos = ACCESS_FBINFO(crtc1.panpos); | 186 | panpos = minfo->crtc1.panpos; |
| 187 | if (panpos >= 0) { | 187 | if (panpos >= 0) { |
| 188 | unsigned int extvga_reg; | 188 | unsigned int extvga_reg; |
| 189 | 189 | ||
| 190 | ACCESS_FBINFO(crtc1.panpos) = -1; /* No update pending anymore */ | 190 | minfo->crtc1.panpos = -1; /* No update pending anymore */ |
| 191 | extvga_reg = mga_inb(M_EXTVGA_INDEX); | 191 | extvga_reg = mga_inb(M_EXTVGA_INDEX); |
| 192 | mga_setr(M_EXTVGA_INDEX, 0x00, panpos); | 192 | mga_setr(M_EXTVGA_INDEX, 0x00, panpos); |
| 193 | if (extvga_reg != 0x00) { | 193 | if (extvga_reg != 0x00) { |
| @@ -209,15 +209,15 @@ static irqreturn_t matrox_irq(int irq, void *dev_id) | |||
| 209 | 209 | ||
| 210 | if (status & 0x20) { | 210 | if (status & 0x20) { |
| 211 | mga_outl(M_ICLEAR, 0x20); | 211 | mga_outl(M_ICLEAR, 0x20); |
| 212 | ACCESS_FBINFO(crtc1.vsync.cnt)++; | 212 | minfo->crtc1.vsync.cnt++; |
| 213 | matroxfb_crtc1_panpos(PMINFO2); | 213 | matroxfb_crtc1_panpos(PMINFO2); |
| 214 | wake_up_interruptible(&ACCESS_FBINFO(crtc1.vsync.wait)); | 214 | wake_up_interruptible(&minfo->crtc1.vsync.wait); |
| 215 | handled = 1; | 215 | handled = 1; |
| 216 | } | 216 | } |
| 217 | if (status & 0x200) { | 217 | if (status & 0x200) { |
| 218 | mga_outl(M_ICLEAR, 0x200); | 218 | mga_outl(M_ICLEAR, 0x200); |
| 219 | ACCESS_FBINFO(crtc2.vsync.cnt)++; | 219 | minfo->crtc2.vsync.cnt++; |
| 220 | wake_up_interruptible(&ACCESS_FBINFO(crtc2.vsync.wait)); | 220 | wake_up_interruptible(&minfo->crtc2.vsync.wait); |
| 221 | handled = 1; | 221 | handled = 1; |
| 222 | } | 222 | } |
| 223 | return IRQ_RETVAL(handled); | 223 | return IRQ_RETVAL(handled); |
| @@ -226,15 +226,15 @@ static irqreturn_t matrox_irq(int irq, void *dev_id) | |||
| 226 | int matroxfb_enable_irq(WPMINFO int reenable) { | 226 | int matroxfb_enable_irq(WPMINFO int reenable) { |
| 227 | u_int32_t bm; | 227 | u_int32_t bm; |
| 228 | 228 | ||
| 229 | if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG400) | 229 | if (minfo->devflags.accelerator == FB_ACCEL_MATROX_MGAG400) |
| 230 | bm = 0x220; | 230 | bm = 0x220; |
| 231 | else | 231 | else |
| 232 | bm = 0x020; | 232 | bm = 0x020; |
| 233 | 233 | ||
| 234 | if (!test_and_set_bit(0, &ACCESS_FBINFO(irq_flags))) { | 234 | if (!test_and_set_bit(0, &minfo->irq_flags)) { |
| 235 | if (request_irq(ACCESS_FBINFO(pcidev)->irq, matrox_irq, | 235 | if (request_irq(minfo->pcidev->irq, matrox_irq, |
| 236 | IRQF_SHARED, "matroxfb", MINFO)) { | 236 | IRQF_SHARED, "matroxfb", minfo)) { |
| 237 | clear_bit(0, &ACCESS_FBINFO(irq_flags)); | 237 | clear_bit(0, &minfo->irq_flags); |
| 238 | return -EINVAL; | 238 | return -EINVAL; |
| 239 | } | 239 | } |
| 240 | /* Clear any pending field interrupts */ | 240 | /* Clear any pending field interrupts */ |
| @@ -253,14 +253,14 @@ int matroxfb_enable_irq(WPMINFO int reenable) { | |||
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | static void matroxfb_disable_irq(WPMINFO2) { | 255 | static void matroxfb_disable_irq(WPMINFO2) { |
| 256 | if (test_and_clear_bit(0, &ACCESS_FBINFO(irq_flags))) { | 256 | if (test_and_clear_bit(0, &minfo->irq_flags)) { |
| 257 | /* Flush pending pan-at-vbl request... */ | 257 | /* Flush pending pan-at-vbl request... */ |
| 258 | matroxfb_crtc1_panpos(PMINFO2); | 258 | matroxfb_crtc1_panpos(PMINFO2); |
| 259 | if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG400) | 259 | if (minfo->devflags.accelerator == FB_ACCEL_MATROX_MGAG400) |
| 260 | mga_outl(M_IEN, mga_inl(M_IEN) & ~0x220); | 260 | mga_outl(M_IEN, mga_inl(M_IEN) & ~0x220); |
| 261 | else | 261 | else |
| 262 | mga_outl(M_IEN, mga_inl(M_IEN) & ~0x20); | 262 | mga_outl(M_IEN, mga_inl(M_IEN) & ~0x20); |
| 263 | free_irq(ACCESS_FBINFO(pcidev)->irq, MINFO); | 263 | free_irq(minfo->pcidev->irq, minfo); |
| 264 | } | 264 | } |
| 265 | } | 265 | } |
| 266 | 266 | ||
| @@ -271,13 +271,13 @@ int matroxfb_wait_for_sync(WPMINFO u_int32_t crtc) { | |||
| 271 | 271 | ||
| 272 | switch (crtc) { | 272 | switch (crtc) { |
| 273 | case 0: | 273 | case 0: |
| 274 | vs = &ACCESS_FBINFO(crtc1.vsync); | 274 | vs = &minfo->crtc1.vsync; |
| 275 | break; | 275 | break; |
| 276 | case 1: | 276 | case 1: |
| 277 | if (ACCESS_FBINFO(devflags.accelerator) != FB_ACCEL_MATROX_MGAG400) { | 277 | if (minfo->devflags.accelerator != FB_ACCEL_MATROX_MGAG400) { |
| 278 | return -ENODEV; | 278 | return -ENODEV; |
| 279 | } | 279 | } |
| 280 | vs = &ACCESS_FBINFO(crtc2.vsync); | 280 | vs = &minfo->crtc2.vsync; |
| 281 | break; | 281 | break; |
| 282 | default: | 282 | default: |
| 283 | return -ENODEV; | 283 | return -ENODEV; |
| @@ -314,18 +314,18 @@ static void matrox_pan_var(WPMINFO struct fb_var_screeninfo *var) { | |||
| 314 | 314 | ||
| 315 | DBG(__func__) | 315 | DBG(__func__) |
| 316 | 316 | ||
| 317 | if (ACCESS_FBINFO(dead)) | 317 | if (minfo->dead) |
| 318 | return; | 318 | return; |
| 319 | 319 | ||
| 320 | ACCESS_FBINFO(fbcon).var.xoffset = var->xoffset; | 320 | minfo->fbcon.var.xoffset = var->xoffset; |
| 321 | ACCESS_FBINFO(fbcon).var.yoffset = var->yoffset; | 321 | minfo->fbcon.var.yoffset = var->yoffset; |
| 322 | pos = (ACCESS_FBINFO(fbcon).var.yoffset * ACCESS_FBINFO(fbcon).var.xres_virtual + ACCESS_FBINFO(fbcon).var.xoffset) * ACCESS_FBINFO(curr.final_bppShift) / 32; | 322 | pos = (minfo->fbcon.var.yoffset * minfo->fbcon.var.xres_virtual + minfo->fbcon.var.xoffset) * minfo->curr.final_bppShift / 32; |
| 323 | pos += ACCESS_FBINFO(curr.ydstorg.chunks); | 323 | pos += minfo->curr.ydstorg.chunks; |
| 324 | p0 = ACCESS_FBINFO(hw).CRTC[0x0D] = pos & 0xFF; | 324 | p0 = minfo->hw.CRTC[0x0D] = pos & 0xFF; |
| 325 | p1 = ACCESS_FBINFO(hw).CRTC[0x0C] = (pos & 0xFF00) >> 8; | 325 | p1 = minfo->hw.CRTC[0x0C] = (pos & 0xFF00) >> 8; |
| 326 | p2 = ACCESS_FBINFO(hw).CRTCEXT[0] = (ACCESS_FBINFO(hw).CRTCEXT[0] & 0xB0) | ((pos >> 16) & 0x0F) | ((pos >> 14) & 0x40); | 326 | p2 = minfo->hw.CRTCEXT[0] = (minfo->hw.CRTCEXT[0] & 0xB0) | ((pos >> 16) & 0x0F) | ((pos >> 14) & 0x40); |
| 327 | #ifdef CONFIG_FB_MATROX_32MB | 327 | #ifdef CONFIG_FB_MATROX_32MB |
| 328 | p3 = ACCESS_FBINFO(hw).CRTCEXT[8] = pos >> 21; | 328 | p3 = minfo->hw.CRTCEXT[8] = pos >> 21; |
| 329 | #endif | 329 | #endif |
| 330 | 330 | ||
| 331 | /* FB_ACTIVATE_VBL and we can acquire interrupts? Honor FB_ACTIVATE_VBL then... */ | 331 | /* FB_ACTIVATE_VBL and we can acquire interrupts? Honor FB_ACTIVATE_VBL then... */ |
| @@ -337,14 +337,14 @@ static void matrox_pan_var(WPMINFO struct fb_var_screeninfo *var) { | |||
| 337 | mga_setr(M_CRTC_INDEX, 0x0D, p0); | 337 | mga_setr(M_CRTC_INDEX, 0x0D, p0); |
| 338 | mga_setr(M_CRTC_INDEX, 0x0C, p1); | 338 | mga_setr(M_CRTC_INDEX, 0x0C, p1); |
| 339 | #ifdef CONFIG_FB_MATROX_32MB | 339 | #ifdef CONFIG_FB_MATROX_32MB |
| 340 | if (ACCESS_FBINFO(devflags.support32MB)) | 340 | if (minfo->devflags.support32MB) |
| 341 | mga_setr(M_EXTVGA_INDEX, 0x08, p3); | 341 | mga_setr(M_EXTVGA_INDEX, 0x08, p3); |
| 342 | #endif | 342 | #endif |
| 343 | if (vbl) { | 343 | if (vbl) { |
| 344 | ACCESS_FBINFO(crtc1.panpos) = p2; | 344 | minfo->crtc1.panpos = p2; |
| 345 | } else { | 345 | } else { |
| 346 | /* Abort any pending change */ | 346 | /* Abort any pending change */ |
| 347 | ACCESS_FBINFO(crtc1.panpos) = -1; | 347 | minfo->crtc1.panpos = -1; |
| 348 | mga_setr(M_EXTVGA_INDEX, 0x00, p2); | 348 | mga_setr(M_EXTVGA_INDEX, 0x00, p2); |
| 349 | } | 349 | } |
| 350 | matroxfb_DAC_unlock_irqrestore(flags); | 350 | matroxfb_DAC_unlock_irqrestore(flags); |
| @@ -363,22 +363,22 @@ static void matroxfb_remove(WPMINFO int dummy) { | |||
| 363 | * write data without causing too much damage... | 363 | * write data without causing too much damage... |
| 364 | */ | 364 | */ |
| 365 | 365 | ||
| 366 | ACCESS_FBINFO(dead) = 1; | 366 | minfo->dead = 1; |
| 367 | if (ACCESS_FBINFO(usecount)) { | 367 | if (minfo->usecount) { |
| 368 | /* destroy it later */ | 368 | /* destroy it later */ |
| 369 | return; | 369 | return; |
| 370 | } | 370 | } |
| 371 | matroxfb_unregister_device(MINFO); | 371 | matroxfb_unregister_device(minfo); |
| 372 | unregister_framebuffer(&ACCESS_FBINFO(fbcon)); | 372 | unregister_framebuffer(&minfo->fbcon); |
| 373 | matroxfb_g450_shutdown(PMINFO2); | 373 | matroxfb_g450_shutdown(PMINFO2); |
| 374 | #ifdef CONFIG_MTRR | 374 | #ifdef CONFIG_MTRR |
| 375 | if (ACCESS_FBINFO(mtrr.vram_valid)) | 375 | if (minfo->mtrr.vram_valid) |
| 376 | mtrr_del(ACCESS_FBINFO(mtrr.vram), ACCESS_FBINFO(video.base), ACCESS_FBINFO(video.len)); | 376 | mtrr_del(minfo->mtrr.vram, minfo->video.base, minfo->video.len); |
| 377 | #endif | 377 | #endif |
| 378 | mga_iounmap(ACCESS_FBINFO(mmio.vbase)); | 378 | mga_iounmap(minfo->mmio.vbase); |
| 379 | mga_iounmap(ACCESS_FBINFO(video.vbase)); | 379 | mga_iounmap(minfo->video.vbase); |
| 380 | release_mem_region(ACCESS_FBINFO(video.base), ACCESS_FBINFO(video.len_maximum)); | 380 | release_mem_region(minfo->video.base, minfo->video.len_maximum); |
| 381 | release_mem_region(ACCESS_FBINFO(mmio.base), 16384); | 381 | release_mem_region(minfo->mmio.base, 16384); |
| 382 | kfree(minfo); | 382 | kfree(minfo); |
| 383 | } | 383 | } |
| 384 | 384 | ||
| @@ -392,12 +392,12 @@ static int matroxfb_open(struct fb_info *info, int user) | |||
| 392 | 392 | ||
| 393 | DBG_LOOP(__func__) | 393 | DBG_LOOP(__func__) |
| 394 | 394 | ||
| 395 | if (ACCESS_FBINFO(dead)) { | 395 | if (minfo->dead) { |
| 396 | return -ENXIO; | 396 | return -ENXIO; |
| 397 | } | 397 | } |
| 398 | ACCESS_FBINFO(usecount)++; | 398 | minfo->usecount++; |
| 399 | if (user) { | 399 | if (user) { |
| 400 | ACCESS_FBINFO(userusecount)++; | 400 | minfo->userusecount++; |
| 401 | } | 401 | } |
| 402 | return(0); | 402 | return(0); |
| 403 | } | 403 | } |
| @@ -409,11 +409,11 @@ static int matroxfb_release(struct fb_info *info, int user) | |||
| 409 | DBG_LOOP(__func__) | 409 | DBG_LOOP(__func__) |
| 410 | 410 | ||
| 411 | if (user) { | 411 | if (user) { |
| 412 | if (0 == --ACCESS_FBINFO(userusecount)) { | 412 | if (0 == --minfo->userusecount) { |
| 413 | matroxfb_disable_irq(PMINFO2); | 413 | matroxfb_disable_irq(PMINFO2); |
| 414 | } | 414 | } |
| 415 | } | 415 | } |
| 416 | if (!(--ACCESS_FBINFO(usecount)) && ACCESS_FBINFO(dead)) { | 416 | if (!(--minfo->usecount) && minfo->dead) { |
| 417 | matroxfb_remove(PMINFO 0); | 417 | matroxfb_remove(PMINFO 0); |
| 418 | } | 418 | } |
| 419 | return(0); | 419 | return(0); |
| @@ -438,9 +438,9 @@ static int matroxfb_get_final_bppShift(CPMINFO int bpp) { | |||
| 438 | if (!bppshft2) { | 438 | if (!bppshft2) { |
| 439 | return 8; | 439 | return 8; |
| 440 | } | 440 | } |
| 441 | if (isInterleave(MINFO)) | 441 | if (isInterleave(minfo)) |
| 442 | bppshft2 >>= 1; | 442 | bppshft2 >>= 1; |
| 443 | if (ACCESS_FBINFO(devflags.video64bits)) | 443 | if (minfo->devflags.video64bits) |
| 444 | bppshft2 >>= 1; | 444 | bppshft2 >>= 1; |
| 445 | return bppshft2; | 445 | return bppshft2; |
| 446 | } | 446 | } |
| @@ -463,11 +463,11 @@ static int matroxfb_test_and_set_rounding(CPMINFO int xres, int bpp) { | |||
| 463 | break; | 463 | break; |
| 464 | default: rounding = 16; | 464 | default: rounding = 16; |
| 465 | /* on G400, 16 really does not work */ | 465 | /* on G400, 16 really does not work */ |
| 466 | if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG400) | 466 | if (minfo->devflags.accelerator == FB_ACCEL_MATROX_MGAG400) |
| 467 | rounding = 32; | 467 | rounding = 32; |
| 468 | break; | 468 | break; |
| 469 | } | 469 | } |
| 470 | if (isInterleave(MINFO)) { | 470 | if (isInterleave(minfo)) { |
| 471 | rounding *= 2; | 471 | rounding *= 2; |
| 472 | } | 472 | } |
| 473 | over = xres % rounding; | 473 | over = xres % rounding; |
| @@ -484,9 +484,9 @@ static int matroxfb_pitch_adjust(CPMINFO int xres, int bpp) { | |||
| 484 | 484 | ||
| 485 | if (!bpp) return xres; | 485 | if (!bpp) return xres; |
| 486 | 486 | ||
| 487 | width = ACCESS_FBINFO(capable.vxres); | 487 | width = minfo->capable.vxres; |
| 488 | 488 | ||
| 489 | if (ACCESS_FBINFO(devflags.precise_width)) { | 489 | if (minfo->devflags.precise_width) { |
| 490 | while (*width) { | 490 | while (*width) { |
| 491 | if ((*width >= xres) && (matroxfb_test_and_set_rounding(PMINFO *width, bpp) == *width)) { | 491 | if ((*width >= xres) && (matroxfb_test_and_set_rounding(PMINFO *width, bpp) == *width)) { |
| 492 | break; | 492 | break; |
| @@ -549,7 +549,7 @@ static int matroxfb_decode_var(CPMINFO struct fb_var_screeninfo *var, int *visua | |||
| 549 | DBG(__func__) | 549 | DBG(__func__) |
| 550 | 550 | ||
| 551 | switch (bpp) { | 551 | switch (bpp) { |
| 552 | case 4: if (!ACCESS_FBINFO(capable.cfb4)) return -EINVAL; | 552 | case 4: if (!minfo->capable.cfb4) return -EINVAL; |
| 553 | break; | 553 | break; |
| 554 | case 8: break; | 554 | case 8: break; |
| 555 | case 16: break; | 555 | case 16: break; |
| @@ -558,7 +558,7 @@ static int matroxfb_decode_var(CPMINFO struct fb_var_screeninfo *var, int *visua | |||
| 558 | default: return -EINVAL; | 558 | default: return -EINVAL; |
| 559 | } | 559 | } |
| 560 | *ydstorg = 0; | 560 | *ydstorg = 0; |
| 561 | vramlen = ACCESS_FBINFO(video.len_usable); | 561 | vramlen = minfo->video.len_usable; |
| 562 | if (var->yres_virtual < var->yres) | 562 | if (var->yres_virtual < var->yres) |
| 563 | var->yres_virtual = var->yres; | 563 | var->yres_virtual = var->yres; |
| 564 | if (var->xres_virtual < var->xres) | 564 | if (var->xres_virtual < var->xres) |
| @@ -573,7 +573,7 @@ static int matroxfb_decode_var(CPMINFO struct fb_var_screeninfo *var, int *visua | |||
| 573 | /* There is hardware bug that no line can cross 4MB boundary */ | 573 | /* There is hardware bug that no line can cross 4MB boundary */ |
| 574 | /* give up for CFB24, it is impossible to easy workaround it */ | 574 | /* give up for CFB24, it is impossible to easy workaround it */ |
| 575 | /* for other try to do something */ | 575 | /* for other try to do something */ |
| 576 | if (!ACCESS_FBINFO(capable.cross4MB) && (memlen > 0x400000)) { | 576 | if (!minfo->capable.cross4MB && (memlen > 0x400000)) { |
| 577 | if (bpp == 24) { | 577 | if (bpp == 24) { |
| 578 | /* sorry */ | 578 | /* sorry */ |
| 579 | } else { | 579 | } else { |
| @@ -653,20 +653,20 @@ static int matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
| 653 | * != 0 for invalid regno. | 653 | * != 0 for invalid regno. |
| 654 | */ | 654 | */ |
| 655 | 655 | ||
| 656 | if (regno >= ACCESS_FBINFO(curr.cmap_len)) | 656 | if (regno >= minfo->curr.cmap_len) |
| 657 | return 1; | 657 | return 1; |
| 658 | 658 | ||
| 659 | if (ACCESS_FBINFO(fbcon).var.grayscale) { | 659 | if (minfo->fbcon.var.grayscale) { |
| 660 | /* gray = 0.30*R + 0.59*G + 0.11*B */ | 660 | /* gray = 0.30*R + 0.59*G + 0.11*B */ |
| 661 | red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8; | 661 | red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8; |
| 662 | } | 662 | } |
| 663 | 663 | ||
| 664 | red = CNVT_TOHW(red, ACCESS_FBINFO(fbcon).var.red.length); | 664 | red = CNVT_TOHW(red, minfo->fbcon.var.red.length); |
| 665 | green = CNVT_TOHW(green, ACCESS_FBINFO(fbcon).var.green.length); | 665 | green = CNVT_TOHW(green, minfo->fbcon.var.green.length); |
| 666 | blue = CNVT_TOHW(blue, ACCESS_FBINFO(fbcon).var.blue.length); | 666 | blue = CNVT_TOHW(blue, minfo->fbcon.var.blue.length); |
| 667 | transp = CNVT_TOHW(transp, ACCESS_FBINFO(fbcon).var.transp.length); | 667 | transp = CNVT_TOHW(transp, minfo->fbcon.var.transp.length); |
| 668 | 668 | ||
| 669 | switch (ACCESS_FBINFO(fbcon).var.bits_per_pixel) { | 669 | switch (minfo->fbcon.var.bits_per_pixel) { |
| 670 | case 4: | 670 | case 4: |
| 671 | case 8: | 671 | case 8: |
| 672 | mga_outb(M_DAC_REG, regno); | 672 | mga_outb(M_DAC_REG, regno); |
| @@ -679,22 +679,22 @@ static int matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
| 679 | break; | 679 | break; |
| 680 | { | 680 | { |
| 681 | u_int16_t col = | 681 | u_int16_t col = |
| 682 | (red << ACCESS_FBINFO(fbcon).var.red.offset) | | 682 | (red << minfo->fbcon.var.red.offset) | |
| 683 | (green << ACCESS_FBINFO(fbcon).var.green.offset) | | 683 | (green << minfo->fbcon.var.green.offset) | |
| 684 | (blue << ACCESS_FBINFO(fbcon).var.blue.offset) | | 684 | (blue << minfo->fbcon.var.blue.offset) | |
| 685 | (transp << ACCESS_FBINFO(fbcon).var.transp.offset); /* for 1:5:5:5 */ | 685 | (transp << minfo->fbcon.var.transp.offset); /* for 1:5:5:5 */ |
| 686 | ACCESS_FBINFO(cmap[regno]) = col | (col << 16); | 686 | minfo->cmap[regno] = col | (col << 16); |
| 687 | } | 687 | } |
| 688 | break; | 688 | break; |
| 689 | case 24: | 689 | case 24: |
| 690 | case 32: | 690 | case 32: |
| 691 | if (regno >= 16) | 691 | if (regno >= 16) |
| 692 | break; | 692 | break; |
| 693 | ACCESS_FBINFO(cmap[regno]) = | 693 | minfo->cmap[regno] = |
| 694 | (red << ACCESS_FBINFO(fbcon).var.red.offset) | | 694 | (red << minfo->fbcon.var.red.offset) | |
| 695 | (green << ACCESS_FBINFO(fbcon).var.green.offset) | | 695 | (green << minfo->fbcon.var.green.offset) | |
| 696 | (blue << ACCESS_FBINFO(fbcon).var.blue.offset) | | 696 | (blue << minfo->fbcon.var.blue.offset) | |
| 697 | (transp << ACCESS_FBINFO(fbcon).var.transp.offset); /* 8:8:8:8 */ | 697 | (transp << minfo->fbcon.var.transp.offset); /* 8:8:8:8 */ |
| 698 | break; | 698 | break; |
| 699 | } | 699 | } |
| 700 | return 0; | 700 | return 0; |
| @@ -702,7 +702,7 @@ static int matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
| 702 | 702 | ||
| 703 | static void matroxfb_init_fix(WPMINFO2) | 703 | static void matroxfb_init_fix(WPMINFO2) |
| 704 | { | 704 | { |
| 705 | struct fb_fix_screeninfo *fix = &ACCESS_FBINFO(fbcon).fix; | 705 | struct fb_fix_screeninfo *fix = &minfo->fbcon.fix; |
| 706 | DBG(__func__) | 706 | DBG(__func__) |
| 707 | 707 | ||
| 708 | strcpy(fix->id,"MATROX"); | 708 | strcpy(fix->id,"MATROX"); |
| @@ -710,20 +710,20 @@ static void matroxfb_init_fix(WPMINFO2) | |||
| 710 | fix->xpanstep = 8; /* 8 for 8bpp, 4 for 16bpp, 2 for 32bpp */ | 710 | fix->xpanstep = 8; /* 8 for 8bpp, 4 for 16bpp, 2 for 32bpp */ |
| 711 | fix->ypanstep = 1; | 711 | fix->ypanstep = 1; |
| 712 | fix->ywrapstep = 0; | 712 | fix->ywrapstep = 0; |
| 713 | fix->mmio_start = ACCESS_FBINFO(mmio.base); | 713 | fix->mmio_start = minfo->mmio.base; |
| 714 | fix->mmio_len = ACCESS_FBINFO(mmio.len); | 714 | fix->mmio_len = minfo->mmio.len; |
| 715 | fix->accel = ACCESS_FBINFO(devflags.accelerator); | 715 | fix->accel = minfo->devflags.accelerator; |
| 716 | } | 716 | } |
| 717 | 717 | ||
| 718 | static void matroxfb_update_fix(WPMINFO2) | 718 | static void matroxfb_update_fix(WPMINFO2) |
| 719 | { | 719 | { |
| 720 | struct fb_fix_screeninfo *fix = &ACCESS_FBINFO(fbcon).fix; | 720 | struct fb_fix_screeninfo *fix = &minfo->fbcon.fix; |
| 721 | DBG(__func__) | 721 | DBG(__func__) |
| 722 | 722 | ||
| 723 | mutex_lock(&ACCESS_FBINFO(fbcon).mm_lock); | 723 | mutex_lock(&minfo->fbcon.mm_lock); |
| 724 | fix->smem_start = ACCESS_FBINFO(video.base) + ACCESS_FBINFO(curr.ydstorg.bytes); | 724 | fix->smem_start = minfo->video.base + minfo->curr.ydstorg.bytes; |
| 725 | fix->smem_len = ACCESS_FBINFO(video.len_usable) - ACCESS_FBINFO(curr.ydstorg.bytes); | 725 | fix->smem_len = minfo->video.len_usable - minfo->curr.ydstorg.bytes; |
| 726 | mutex_unlock(&ACCESS_FBINFO(fbcon).mm_lock); | 726 | mutex_unlock(&minfo->fbcon.mm_lock); |
| 727 | } | 727 | } |
| 728 | 728 | ||
| 729 | static int matroxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 729 | static int matroxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
| @@ -734,7 +734,7 @@ static int matroxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *inf | |||
| 734 | unsigned int ydstorg; | 734 | unsigned int ydstorg; |
| 735 | MINFO_FROM_INFO(info); | 735 | MINFO_FROM_INFO(info); |
| 736 | 736 | ||
| 737 | if (ACCESS_FBINFO(dead)) { | 737 | if (minfo->dead) { |
| 738 | return -ENXIO; | 738 | return -ENXIO; |
| 739 | } | 739 | } |
| 740 | if ((err = matroxfb_decode_var(PMINFO var, &visual, &cmap_len, &ydstorg)) != 0) | 740 | if ((err = matroxfb_decode_var(PMINFO var, &visual, &cmap_len, &ydstorg)) != 0) |
| @@ -753,31 +753,31 @@ static int matroxfb_set_par(struct fb_info *info) | |||
| 753 | 753 | ||
| 754 | DBG(__func__) | 754 | DBG(__func__) |
| 755 | 755 | ||
| 756 | if (ACCESS_FBINFO(dead)) { | 756 | if (minfo->dead) { |
| 757 | return -ENXIO; | 757 | return -ENXIO; |
| 758 | } | 758 | } |
| 759 | 759 | ||
| 760 | var = &info->var; | 760 | var = &info->var; |
| 761 | if ((err = matroxfb_decode_var(PMINFO var, &visual, &cmap_len, &ydstorg)) != 0) | 761 | if ((err = matroxfb_decode_var(PMINFO var, &visual, &cmap_len, &ydstorg)) != 0) |
| 762 | return err; | 762 | return err; |
| 763 | ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase)) + ydstorg; | 763 | minfo->fbcon.screen_base = vaddr_va(minfo->video.vbase) + ydstorg; |
| 764 | matroxfb_update_fix(PMINFO2); | 764 | matroxfb_update_fix(PMINFO2); |
| 765 | ACCESS_FBINFO(fbcon).fix.visual = visual; | 765 | minfo->fbcon.fix.visual = visual; |
| 766 | ACCESS_FBINFO(fbcon).fix.type = FB_TYPE_PACKED_PIXELS; | 766 | minfo->fbcon.fix.type = FB_TYPE_PACKED_PIXELS; |
| 767 | ACCESS_FBINFO(fbcon).fix.type_aux = 0; | 767 | minfo->fbcon.fix.type_aux = 0; |
| 768 | ACCESS_FBINFO(fbcon).fix.line_length = (var->xres_virtual * var->bits_per_pixel) >> 3; | 768 | minfo->fbcon.fix.line_length = (var->xres_virtual * var->bits_per_pixel) >> 3; |
| 769 | { | 769 | { |
| 770 | unsigned int pos; | 770 | unsigned int pos; |
| 771 | 771 | ||
| 772 | ACCESS_FBINFO(curr.cmap_len) = cmap_len; | 772 | minfo->curr.cmap_len = cmap_len; |
| 773 | ydstorg += ACCESS_FBINFO(devflags.ydstorg); | 773 | ydstorg += minfo->devflags.ydstorg; |
| 774 | ACCESS_FBINFO(curr.ydstorg.bytes) = ydstorg; | 774 | minfo->curr.ydstorg.bytes = ydstorg; |
| 775 | ACCESS_FBINFO(curr.ydstorg.chunks) = ydstorg >> (isInterleave(MINFO)?3:2); | 775 | minfo->curr.ydstorg.chunks = ydstorg >> (isInterleave(minfo) ? 3 : 2); |
| 776 | if (var->bits_per_pixel == 4) | 776 | if (var->bits_per_pixel == 4) |
| 777 | ACCESS_FBINFO(curr.ydstorg.pixels) = ydstorg; | 777 | minfo->curr.ydstorg.pixels = ydstorg; |
| 778 | else | 778 | else |
| 779 | ACCESS_FBINFO(curr.ydstorg.pixels) = (ydstorg * 8) / var->bits_per_pixel; | 779 | minfo->curr.ydstorg.pixels = (ydstorg * 8) / var->bits_per_pixel; |
| 780 | ACCESS_FBINFO(curr.final_bppShift) = matroxfb_get_final_bppShift(PMINFO var->bits_per_pixel); | 780 | minfo->curr.final_bppShift = matroxfb_get_final_bppShift(PMINFO var->bits_per_pixel); |
| 781 | { struct my_timming mt; | 781 | { struct my_timming mt; |
| 782 | struct matrox_hw_state* hw; | 782 | struct matrox_hw_state* hw; |
| 783 | int out; | 783 | int out; |
| @@ -793,46 +793,46 @@ static int matroxfb_set_par(struct fb_info *info) | |||
| 793 | default: mt.delay = 31 + 8; break; | 793 | default: mt.delay = 31 + 8; break; |
| 794 | } | 794 | } |
| 795 | 795 | ||
| 796 | hw = &ACCESS_FBINFO(hw); | 796 | hw = &minfo->hw; |
| 797 | 797 | ||
| 798 | down_read(&ACCESS_FBINFO(altout).lock); | 798 | down_read(&minfo->altout.lock); |
| 799 | for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { | 799 | for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { |
| 800 | if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC1 && | 800 | if (minfo->outputs[out].src == MATROXFB_SRC_CRTC1 && |
| 801 | ACCESS_FBINFO(outputs[out]).output->compute) { | 801 | minfo->outputs[out].output->compute) { |
| 802 | ACCESS_FBINFO(outputs[out]).output->compute(ACCESS_FBINFO(outputs[out]).data, &mt); | 802 | minfo->outputs[out].output->compute(minfo->outputs[out].data, &mt); |
| 803 | } | 803 | } |
| 804 | } | 804 | } |
| 805 | up_read(&ACCESS_FBINFO(altout).lock); | 805 | up_read(&minfo->altout.lock); |
| 806 | ACCESS_FBINFO(crtc1).pixclock = mt.pixclock; | 806 | minfo->crtc1.pixclock = mt.pixclock; |
| 807 | ACCESS_FBINFO(crtc1).mnp = mt.mnp; | 807 | minfo->crtc1.mnp = mt.mnp; |
| 808 | ACCESS_FBINFO(hw_switch->init(PMINFO &mt)); | 808 | minfo->hw_switch->init(PMINFO &mt); |
| 809 | pos = (var->yoffset * var->xres_virtual + var->xoffset) * ACCESS_FBINFO(curr.final_bppShift) / 32; | 809 | pos = (var->yoffset * var->xres_virtual + var->xoffset) * minfo->curr.final_bppShift / 32; |
| 810 | pos += ACCESS_FBINFO(curr.ydstorg.chunks); | 810 | pos += minfo->curr.ydstorg.chunks; |
| 811 | 811 | ||
| 812 | hw->CRTC[0x0D] = pos & 0xFF; | 812 | hw->CRTC[0x0D] = pos & 0xFF; |
| 813 | hw->CRTC[0x0C] = (pos & 0xFF00) >> 8; | 813 | hw->CRTC[0x0C] = (pos & 0xFF00) >> 8; |
| 814 | hw->CRTCEXT[0] = (hw->CRTCEXT[0] & 0xF0) | ((pos >> 16) & 0x0F) | ((pos >> 14) & 0x40); | 814 | hw->CRTCEXT[0] = (hw->CRTCEXT[0] & 0xF0) | ((pos >> 16) & 0x0F) | ((pos >> 14) & 0x40); |
| 815 | hw->CRTCEXT[8] = pos >> 21; | 815 | hw->CRTCEXT[8] = pos >> 21; |
| 816 | ACCESS_FBINFO(hw_switch->restore(PMINFO2)); | 816 | minfo->hw_switch->restore(PMINFO2); |
| 817 | update_crtc2(PMINFO pos); | 817 | update_crtc2(PMINFO pos); |
| 818 | down_read(&ACCESS_FBINFO(altout).lock); | 818 | down_read(&minfo->altout.lock); |
| 819 | for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { | 819 | for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { |
| 820 | if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC1 && | 820 | if (minfo->outputs[out].src == MATROXFB_SRC_CRTC1 && |
| 821 | ACCESS_FBINFO(outputs[out]).output->program) { | 821 | minfo->outputs[out].output->program) { |
| 822 | ACCESS_FBINFO(outputs[out]).output->program(ACCESS_FBINFO(outputs[out]).data); | 822 | minfo->outputs[out].output->program(minfo->outputs[out].data); |
| 823 | } | 823 | } |
| 824 | } | 824 | } |
| 825 | for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { | 825 | for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { |
| 826 | if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC1 && | 826 | if (minfo->outputs[out].src == MATROXFB_SRC_CRTC1 && |
| 827 | ACCESS_FBINFO(outputs[out]).output->start) { | 827 | minfo->outputs[out].output->start) { |
| 828 | ACCESS_FBINFO(outputs[out]).output->start(ACCESS_FBINFO(outputs[out]).data); | 828 | minfo->outputs[out].output->start(minfo->outputs[out].data); |
| 829 | } | 829 | } |
| 830 | } | 830 | } |
| 831 | up_read(&ACCESS_FBINFO(altout).lock); | 831 | up_read(&minfo->altout.lock); |
| 832 | matrox_cfbX_init(PMINFO2); | 832 | matrox_cfbX_init(PMINFO2); |
| 833 | } | 833 | } |
| 834 | } | 834 | } |
| 835 | ACCESS_FBINFO(initialized) = 1; | 835 | minfo->initialized = 1; |
| 836 | return 0; | 836 | return 0; |
| 837 | } | 837 | } |
| 838 | 838 | ||
| @@ -853,13 +853,13 @@ static int matroxfb_get_vblank(WPMINFO struct fb_vblank *vblank) | |||
| 853 | vblank->flags |= FB_VBLANK_HBLANKING; | 853 | vblank->flags |= FB_VBLANK_HBLANKING; |
| 854 | if (sts1 & 8) | 854 | if (sts1 & 8) |
| 855 | vblank->flags |= FB_VBLANK_VSYNCING; | 855 | vblank->flags |= FB_VBLANK_VSYNCING; |
| 856 | if (vblank->vcount >= ACCESS_FBINFO(fbcon).var.yres) | 856 | if (vblank->vcount >= minfo->fbcon.var.yres) |
| 857 | vblank->flags |= FB_VBLANK_VBLANKING; | 857 | vblank->flags |= FB_VBLANK_VBLANKING; |
| 858 | if (test_bit(0, &ACCESS_FBINFO(irq_flags))) { | 858 | if (test_bit(0, &minfo->irq_flags)) { |
| 859 | vblank->flags |= FB_VBLANK_HAVE_COUNT; | 859 | vblank->flags |= FB_VBLANK_HAVE_COUNT; |
| 860 | /* Only one writer, aligned int value... | 860 | /* Only one writer, aligned int value... |
| 861 | it should work without lock and without atomic_t */ | 861 | it should work without lock and without atomic_t */ |
| 862 | vblank->count = ACCESS_FBINFO(crtc1).vsync.cnt; | 862 | vblank->count = minfo->crtc1.vsync.cnt; |
| 863 | } | 863 | } |
| 864 | return 0; | 864 | return 0; |
| 865 | } | 865 | } |
| @@ -876,7 +876,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 876 | 876 | ||
| 877 | DBG(__func__) | 877 | DBG(__func__) |
| 878 | 878 | ||
| 879 | if (ACCESS_FBINFO(dead)) { | 879 | if (minfo->dead) { |
| 880 | return -ENXIO; | 880 | return -ENXIO; |
| 881 | } | 881 | } |
| 882 | 882 | ||
| @@ -912,8 +912,8 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 912 | return -EFAULT; | 912 | return -EFAULT; |
| 913 | if (mom.output >= MATROXFB_MAX_OUTPUTS) | 913 | if (mom.output >= MATROXFB_MAX_OUTPUTS) |
| 914 | return -ENXIO; | 914 | return -ENXIO; |
| 915 | down_read(&ACCESS_FBINFO(altout.lock)); | 915 | down_read(&minfo->altout.lock); |
| 916 | oproc = ACCESS_FBINFO(outputs[mom.output]).output; | 916 | oproc = minfo->outputs[mom.output].output; |
| 917 | if (!oproc) { | 917 | if (!oproc) { |
| 918 | val = -ENXIO; | 918 | val = -ENXIO; |
| 919 | } else if (!oproc->verifymode) { | 919 | } else if (!oproc->verifymode) { |
| @@ -923,18 +923,18 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 923 | val = -EINVAL; | 923 | val = -EINVAL; |
| 924 | } | 924 | } |
| 925 | } else { | 925 | } else { |
| 926 | val = oproc->verifymode(ACCESS_FBINFO(outputs[mom.output]).data, mom.mode); | 926 | val = oproc->verifymode(minfo->outputs[mom.output].data, mom.mode); |
| 927 | } | 927 | } |
| 928 | if (!val) { | 928 | if (!val) { |
| 929 | if (ACCESS_FBINFO(outputs[mom.output]).mode != mom.mode) { | 929 | if (minfo->outputs[mom.output].mode != mom.mode) { |
| 930 | ACCESS_FBINFO(outputs[mom.output]).mode = mom.mode; | 930 | minfo->outputs[mom.output].mode = mom.mode; |
| 931 | val = 1; | 931 | val = 1; |
| 932 | } | 932 | } |
| 933 | } | 933 | } |
| 934 | up_read(&ACCESS_FBINFO(altout.lock)); | 934 | up_read(&minfo->altout.lock); |
| 935 | if (val != 1) | 935 | if (val != 1) |
| 936 | return val; | 936 | return val; |
| 937 | switch (ACCESS_FBINFO(outputs[mom.output]).src) { | 937 | switch (minfo->outputs[mom.output].src) { |
| 938 | case MATROXFB_SRC_CRTC1: | 938 | case MATROXFB_SRC_CRTC1: |
| 939 | matroxfb_set_par(info); | 939 | matroxfb_set_par(info); |
| 940 | break; | 940 | break; |
| @@ -942,11 +942,11 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 942 | { | 942 | { |
| 943 | struct matroxfb_dh_fb_info* crtc2; | 943 | struct matroxfb_dh_fb_info* crtc2; |
| 944 | 944 | ||
| 945 | down_read(&ACCESS_FBINFO(crtc2.lock)); | 945 | down_read(&minfo->crtc2.lock); |
| 946 | crtc2 = ACCESS_FBINFO(crtc2.info); | 946 | crtc2 = minfo->crtc2.info; |
| 947 | if (crtc2) | 947 | if (crtc2) |
| 948 | crtc2->fbcon.fbops->fb_set_par(&crtc2->fbcon); | 948 | crtc2->fbcon.fbops->fb_set_par(&crtc2->fbcon); |
| 949 | up_read(&ACCESS_FBINFO(crtc2.lock)); | 949 | up_read(&minfo->crtc2.lock); |
| 950 | } | 950 | } |
| 951 | break; | 951 | break; |
| 952 | } | 952 | } |
| @@ -962,15 +962,15 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 962 | return -EFAULT; | 962 | return -EFAULT; |
| 963 | if (mom.output >= MATROXFB_MAX_OUTPUTS) | 963 | if (mom.output >= MATROXFB_MAX_OUTPUTS) |
| 964 | return -ENXIO; | 964 | return -ENXIO; |
| 965 | down_read(&ACCESS_FBINFO(altout.lock)); | 965 | down_read(&minfo->altout.lock); |
| 966 | oproc = ACCESS_FBINFO(outputs[mom.output]).output; | 966 | oproc = minfo->outputs[mom.output].output; |
| 967 | if (!oproc) { | 967 | if (!oproc) { |
| 968 | val = -ENXIO; | 968 | val = -ENXIO; |
| 969 | } else { | 969 | } else { |
| 970 | mom.mode = ACCESS_FBINFO(outputs[mom.output]).mode; | 970 | mom.mode = minfo->outputs[mom.output].mode; |
| 971 | val = 0; | 971 | val = 0; |
| 972 | } | 972 | } |
| 973 | up_read(&ACCESS_FBINFO(altout.lock)); | 973 | up_read(&minfo->altout.lock); |
| 974 | if (val) | 974 | if (val) |
| 975 | return val; | 975 | return val; |
| 976 | if (copy_to_user(argp, &mom, sizeof(mom))) | 976 | if (copy_to_user(argp, &mom, sizeof(mom))) |
| @@ -989,9 +989,9 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 989 | if (tmp & (1 << i)) { | 989 | if (tmp & (1 << i)) { |
| 990 | if (i >= MATROXFB_MAX_OUTPUTS) | 990 | if (i >= MATROXFB_MAX_OUTPUTS) |
| 991 | return -ENXIO; | 991 | return -ENXIO; |
| 992 | if (!ACCESS_FBINFO(outputs[i]).output) | 992 | if (!minfo->outputs[i].output) |
| 993 | return -ENXIO; | 993 | return -ENXIO; |
| 994 | switch (ACCESS_FBINFO(outputs[i]).src) { | 994 | switch (minfo->outputs[i].src) { |
| 995 | case MATROXFB_SRC_NONE: | 995 | case MATROXFB_SRC_NONE: |
| 996 | case MATROXFB_SRC_CRTC1: | 996 | case MATROXFB_SRC_CRTC1: |
| 997 | break; | 997 | break; |
| @@ -1000,12 +1000,12 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1000 | } | 1000 | } |
| 1001 | } | 1001 | } |
| 1002 | } | 1002 | } |
| 1003 | if (ACCESS_FBINFO(devflags.panellink)) { | 1003 | if (minfo->devflags.panellink) { |
| 1004 | if (tmp & MATROXFB_OUTPUT_CONN_DFP) { | 1004 | if (tmp & MATROXFB_OUTPUT_CONN_DFP) { |
| 1005 | if (tmp & MATROXFB_OUTPUT_CONN_SECONDARY) | 1005 | if (tmp & MATROXFB_OUTPUT_CONN_SECONDARY) |
| 1006 | return -EINVAL; | 1006 | return -EINVAL; |
| 1007 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { | 1007 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { |
| 1008 | if (ACCESS_FBINFO(outputs[i]).src == MATROXFB_SRC_CRTC2) { | 1008 | if (minfo->outputs[i].src == MATROXFB_SRC_CRTC2) { |
| 1009 | return -EBUSY; | 1009 | return -EBUSY; |
| 1010 | } | 1010 | } |
| 1011 | } | 1011 | } |
| @@ -1014,13 +1014,13 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1014 | changes = 0; | 1014 | changes = 0; |
| 1015 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { | 1015 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { |
| 1016 | if (tmp & (1 << i)) { | 1016 | if (tmp & (1 << i)) { |
| 1017 | if (ACCESS_FBINFO(outputs[i]).src != MATROXFB_SRC_CRTC1) { | 1017 | if (minfo->outputs[i].src != MATROXFB_SRC_CRTC1) { |
| 1018 | changes = 1; | 1018 | changes = 1; |
| 1019 | ACCESS_FBINFO(outputs[i]).src = MATROXFB_SRC_CRTC1; | 1019 | minfo->outputs[i].src = MATROXFB_SRC_CRTC1; |
| 1020 | } | 1020 | } |
| 1021 | } else if (ACCESS_FBINFO(outputs[i]).src == MATROXFB_SRC_CRTC1) { | 1021 | } else if (minfo->outputs[i].src == MATROXFB_SRC_CRTC1) { |
| 1022 | changes = 1; | 1022 | changes = 1; |
| 1023 | ACCESS_FBINFO(outputs[i]).src = MATROXFB_SRC_NONE; | 1023 | minfo->outputs[i].src = MATROXFB_SRC_NONE; |
| 1024 | } | 1024 | } |
| 1025 | } | 1025 | } |
| 1026 | if (!changes) | 1026 | if (!changes) |
| @@ -1034,7 +1034,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1034 | int i; | 1034 | int i; |
| 1035 | 1035 | ||
| 1036 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { | 1036 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { |
| 1037 | if (ACCESS_FBINFO(outputs[i]).src == MATROXFB_SRC_CRTC1) { | 1037 | if (minfo->outputs[i].src == MATROXFB_SRC_CRTC1) { |
| 1038 | conn |= 1 << i; | 1038 | conn |= 1 << i; |
| 1039 | } | 1039 | } |
| 1040 | } | 1040 | } |
| @@ -1048,8 +1048,8 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1048 | int i; | 1048 | int i; |
| 1049 | 1049 | ||
| 1050 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { | 1050 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { |
| 1051 | if (ACCESS_FBINFO(outputs[i]).output) { | 1051 | if (minfo->outputs[i].output) { |
| 1052 | switch (ACCESS_FBINFO(outputs[i]).src) { | 1052 | switch (minfo->outputs[i].src) { |
| 1053 | case MATROXFB_SRC_NONE: | 1053 | case MATROXFB_SRC_NONE: |
| 1054 | case MATROXFB_SRC_CRTC1: | 1054 | case MATROXFB_SRC_CRTC1: |
| 1055 | conn |= 1 << i; | 1055 | conn |= 1 << i; |
| @@ -1057,7 +1057,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1057 | } | 1057 | } |
| 1058 | } | 1058 | } |
| 1059 | } | 1059 | } |
| 1060 | if (ACCESS_FBINFO(devflags.panellink)) { | 1060 | if (minfo->devflags.panellink) { |
| 1061 | if (conn & MATROXFB_OUTPUT_CONN_DFP) | 1061 | if (conn & MATROXFB_OUTPUT_CONN_DFP) |
| 1062 | conn &= ~MATROXFB_OUTPUT_CONN_SECONDARY; | 1062 | conn &= ~MATROXFB_OUTPUT_CONN_SECONDARY; |
| 1063 | if (conn & MATROXFB_OUTPUT_CONN_SECONDARY) | 1063 | if (conn & MATROXFB_OUTPUT_CONN_SECONDARY) |
| @@ -1073,7 +1073,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1073 | int i; | 1073 | int i; |
| 1074 | 1074 | ||
| 1075 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { | 1075 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { |
| 1076 | if (ACCESS_FBINFO(outputs[i]).output) { | 1076 | if (minfo->outputs[i].output) { |
| 1077 | conn |= 1 << i; | 1077 | conn |= 1 << i; |
| 1078 | } | 1078 | } |
| 1079 | } | 1079 | } |
| @@ -1088,7 +1088,7 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1088 | memset(&r, 0, sizeof(r)); | 1088 | memset(&r, 0, sizeof(r)); |
| 1089 | strcpy(r.driver, "matroxfb"); | 1089 | strcpy(r.driver, "matroxfb"); |
| 1090 | strcpy(r.card, "Matrox"); | 1090 | strcpy(r.card, "Matrox"); |
| 1091 | sprintf(r.bus_info, "PCI:%s", pci_name(ACCESS_FBINFO(pcidev))); | 1091 | sprintf(r.bus_info, "PCI:%s", pci_name(minfo->pcidev)); |
| 1092 | r.version = KERNEL_VERSION(1,0,0); | 1092 | r.version = KERNEL_VERSION(1,0,0); |
| 1093 | r.capabilities = V4L2_CAP_VIDEO_OUTPUT; | 1093 | r.capabilities = V4L2_CAP_VIDEO_OUTPUT; |
| 1094 | if (copy_to_user(argp, &r, sizeof(r))) | 1094 | if (copy_to_user(argp, &r, sizeof(r))) |
| @@ -1104,15 +1104,15 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1104 | if (copy_from_user(&qctrl, argp, sizeof(qctrl))) | 1104 | if (copy_from_user(&qctrl, argp, sizeof(qctrl))) |
| 1105 | return -EFAULT; | 1105 | return -EFAULT; |
| 1106 | 1106 | ||
| 1107 | down_read(&ACCESS_FBINFO(altout).lock); | 1107 | down_read(&minfo->altout.lock); |
| 1108 | if (!ACCESS_FBINFO(outputs[1]).output) { | 1108 | if (!minfo->outputs[1].output) { |
| 1109 | err = -ENXIO; | 1109 | err = -ENXIO; |
| 1110 | } else if (ACCESS_FBINFO(outputs[1]).output->getqueryctrl) { | 1110 | } else if (minfo->outputs[1].output->getqueryctrl) { |
| 1111 | err = ACCESS_FBINFO(outputs[1]).output->getqueryctrl(ACCESS_FBINFO(outputs[1]).data, &qctrl); | 1111 | err = minfo->outputs[1].output->getqueryctrl(minfo->outputs[1].data, &qctrl); |
| 1112 | } else { | 1112 | } else { |
| 1113 | err = -EINVAL; | 1113 | err = -EINVAL; |
| 1114 | } | 1114 | } |
| 1115 | up_read(&ACCESS_FBINFO(altout).lock); | 1115 | up_read(&minfo->altout.lock); |
| 1116 | if (err >= 0 && | 1116 | if (err >= 0 && |
| 1117 | copy_to_user(argp, &qctrl, sizeof(qctrl))) | 1117 | copy_to_user(argp, &qctrl, sizeof(qctrl))) |
| 1118 | return -EFAULT; | 1118 | return -EFAULT; |
| @@ -1126,15 +1126,15 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1126 | if (copy_from_user(&ctrl, argp, sizeof(ctrl))) | 1126 | if (copy_from_user(&ctrl, argp, sizeof(ctrl))) |
| 1127 | return -EFAULT; | 1127 | return -EFAULT; |
| 1128 | 1128 | ||
| 1129 | down_read(&ACCESS_FBINFO(altout).lock); | 1129 | down_read(&minfo->altout.lock); |
| 1130 | if (!ACCESS_FBINFO(outputs[1]).output) { | 1130 | if (!minfo->outputs[1].output) { |
| 1131 | err = -ENXIO; | 1131 | err = -ENXIO; |
| 1132 | } else if (ACCESS_FBINFO(outputs[1]).output->getctrl) { | 1132 | } else if (minfo->outputs[1].output->getctrl) { |
| 1133 | err = ACCESS_FBINFO(outputs[1]).output->getctrl(ACCESS_FBINFO(outputs[1]).data, &ctrl); | 1133 | err = minfo->outputs[1].output->getctrl(minfo->outputs[1].data, &ctrl); |
| 1134 | } else { | 1134 | } else { |
| 1135 | err = -EINVAL; | 1135 | err = -EINVAL; |
| 1136 | } | 1136 | } |
| 1137 | up_read(&ACCESS_FBINFO(altout).lock); | 1137 | up_read(&minfo->altout.lock); |
| 1138 | if (err >= 0 && | 1138 | if (err >= 0 && |
| 1139 | copy_to_user(argp, &ctrl, sizeof(ctrl))) | 1139 | copy_to_user(argp, &ctrl, sizeof(ctrl))) |
| 1140 | return -EFAULT; | 1140 | return -EFAULT; |
| @@ -1149,15 +1149,15 @@ static int matroxfb_ioctl(struct fb_info *info, | |||
| 1149 | if (copy_from_user(&ctrl, argp, sizeof(ctrl))) | 1149 | if (copy_from_user(&ctrl, argp, sizeof(ctrl))) |
| 1150 | return -EFAULT; | 1150 | return -EFAULT; |
| 1151 | 1151 | ||
| 1152 | down_read(&ACCESS_FBINFO(altout).lock); | 1152 | down_read(&minfo->altout.lock); |
| 1153 | if (!ACCESS_FBINFO(outputs[1]).output) { | 1153 | if (!minfo->outputs[1].output) { |
| 1154 | err = -ENXIO; | 1154 | err = -ENXIO; |
| 1155 | } else if (ACCESS_FBINFO(outputs[1]).output->setctrl) { | 1155 | } else if (minfo->outputs[1].output->setctrl) { |
| 1156 | err = ACCESS_FBINFO(outputs[1]).output->setctrl(ACCESS_FBINFO(outputs[1]).data, &ctrl); | 1156 | err = minfo->outputs[1].output->setctrl(minfo->outputs[1].data, &ctrl); |
| 1157 | } else { | 1157 | } else { |
| 1158 | err = -EINVAL; | 1158 | err = -EINVAL; |
| 1159 | } | 1159 | } |
| 1160 | up_read(&ACCESS_FBINFO(altout).lock); | 1160 | up_read(&minfo->altout.lock); |
| 1161 | return err; | 1161 | return err; |
| 1162 | } | 1162 | } |
| 1163 | } | 1163 | } |
| @@ -1175,7 +1175,7 @@ static int matroxfb_blank(int blank, struct fb_info *info) | |||
| 1175 | 1175 | ||
| 1176 | DBG(__func__) | 1176 | DBG(__func__) |
| 1177 | 1177 | ||
| 1178 | if (ACCESS_FBINFO(dead)) | 1178 | if (minfo->dead) |
| 1179 | return 1; | 1179 | return 1; |
| 1180 | 1180 | ||
| 1181 | switch (blank) { | 1181 | switch (blank) { |
| @@ -1287,7 +1287,7 @@ static int matroxfb_getmemory(WPMINFO unsigned int maxSize, unsigned int *realSi | |||
| 1287 | 1287 | ||
| 1288 | DBG(__func__) | 1288 | DBG(__func__) |
| 1289 | 1289 | ||
| 1290 | vm = ACCESS_FBINFO(video.vbase); | 1290 | vm = minfo->video.vbase; |
| 1291 | maxSize &= ~0x1FFFFF; /* must be X*2MB (really it must be 2 or X*4MB) */ | 1291 | maxSize &= ~0x1FFFFF; /* must be X*2MB (really it must be 2 or X*4MB) */ |
| 1292 | /* at least 2MB */ | 1292 | /* at least 2MB */ |
| 1293 | if (maxSize < 0x0200000) return 0; | 1293 | if (maxSize < 0x0200000) return 0; |
| @@ -1319,7 +1319,7 @@ static int matroxfb_getmemory(WPMINFO unsigned int maxSize, unsigned int *realSi | |||
| 1319 | 1319 | ||
| 1320 | *realSize = offs - 0x100000; | 1320 | *realSize = offs - 0x100000; |
| 1321 | #ifdef CONFIG_FB_MATROX_MILLENIUM | 1321 | #ifdef CONFIG_FB_MATROX_MILLENIUM |
| 1322 | ACCESS_FBINFO(interleave) = !(!isMillenium(MINFO) || ((offs - 0x100000) & 0x3FFFFF)); | 1322 | minfo->interleave = !(!isMillenium(minfo) || ((offs - 0x100000) & 0x3FFFFF)); |
| 1323 | #endif | 1323 | #endif |
| 1324 | return 1; | 1324 | return 1; |
| 1325 | } | 1325 | } |
| @@ -1558,12 +1558,12 @@ static void setDefaultOutputs(WPMINFO2) { | |||
| 1558 | unsigned int i; | 1558 | unsigned int i; |
| 1559 | const char* ptr; | 1559 | const char* ptr; |
| 1560 | 1560 | ||
| 1561 | ACCESS_FBINFO(outputs[0]).default_src = MATROXFB_SRC_CRTC1; | 1561 | minfo->outputs[0].default_src = MATROXFB_SRC_CRTC1; |
| 1562 | if (ACCESS_FBINFO(devflags.g450dac)) { | 1562 | if (minfo->devflags.g450dac) { |
| 1563 | ACCESS_FBINFO(outputs[1]).default_src = MATROXFB_SRC_CRTC1; | 1563 | minfo->outputs[1].default_src = MATROXFB_SRC_CRTC1; |
| 1564 | ACCESS_FBINFO(outputs[2]).default_src = MATROXFB_SRC_CRTC1; | 1564 | minfo->outputs[2].default_src = MATROXFB_SRC_CRTC1; |
| 1565 | } else if (dfp) { | 1565 | } else if (dfp) { |
| 1566 | ACCESS_FBINFO(outputs[2]).default_src = MATROXFB_SRC_CRTC1; | 1566 | minfo->outputs[2].default_src = MATROXFB_SRC_CRTC1; |
| 1567 | } | 1567 | } |
| 1568 | ptr = outputs; | 1568 | ptr = outputs; |
| 1569 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { | 1569 | for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { |
| @@ -1573,11 +1573,11 @@ static void setDefaultOutputs(WPMINFO2) { | |||
| 1573 | break; | 1573 | break; |
| 1574 | } | 1574 | } |
| 1575 | if (c == '0') { | 1575 | if (c == '0') { |
| 1576 | ACCESS_FBINFO(outputs[i]).default_src = MATROXFB_SRC_NONE; | 1576 | minfo->outputs[i].default_src = MATROXFB_SRC_NONE; |
| 1577 | } else if (c == '1') { | 1577 | } else if (c == '1') { |
| 1578 | ACCESS_FBINFO(outputs[i]).default_src = MATROXFB_SRC_CRTC1; | 1578 | minfo->outputs[i].default_src = MATROXFB_SRC_CRTC1; |
| 1579 | } else if (c == '2' && ACCESS_FBINFO(devflags.crtc2)) { | 1579 | } else if (c == '2' && minfo->devflags.crtc2) { |
| 1580 | ACCESS_FBINFO(outputs[i]).default_src = MATROXFB_SRC_CRTC2; | 1580 | minfo->outputs[i].default_src = MATROXFB_SRC_CRTC2; |
| 1581 | } else { | 1581 | } else { |
| 1582 | printk(KERN_ERR "matroxfb: Unknown outputs setting\n"); | 1582 | printk(KERN_ERR "matroxfb: Unknown outputs setting\n"); |
| 1583 | break; | 1583 | break; |
| @@ -1603,58 +1603,58 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
| 1603 | /* set default values... */ | 1603 | /* set default values... */ |
| 1604 | vesafb_defined.accel_flags = FB_ACCELF_TEXT; | 1604 | vesafb_defined.accel_flags = FB_ACCELF_TEXT; |
| 1605 | 1605 | ||
| 1606 | ACCESS_FBINFO(hw_switch) = b->base->lowlevel; | 1606 | minfo->hw_switch = b->base->lowlevel; |
| 1607 | ACCESS_FBINFO(devflags.accelerator) = b->base->accelID; | 1607 | minfo->devflags.accelerator = b->base->accelID; |
| 1608 | ACCESS_FBINFO(max_pixel_clock) = b->maxclk; | 1608 | minfo->max_pixel_clock = b->maxclk; |
| 1609 | 1609 | ||
| 1610 | printk(KERN_INFO "matroxfb: Matrox %s detected\n", b->name); | 1610 | printk(KERN_INFO "matroxfb: Matrox %s detected\n", b->name); |
| 1611 | ACCESS_FBINFO(capable.plnwt) = 1; | 1611 | minfo->capable.plnwt = 1; |
| 1612 | ACCESS_FBINFO(chip) = b->chip; | 1612 | minfo->chip = b->chip; |
| 1613 | ACCESS_FBINFO(capable.srcorg) = b->flags & DEVF_SRCORG; | 1613 | minfo->capable.srcorg = b->flags & DEVF_SRCORG; |
| 1614 | ACCESS_FBINFO(devflags.video64bits) = b->flags & DEVF_VIDEO64BIT; | 1614 | minfo->devflags.video64bits = b->flags & DEVF_VIDEO64BIT; |
| 1615 | if (b->flags & DEVF_TEXT4B) { | 1615 | if (b->flags & DEVF_TEXT4B) { |
| 1616 | ACCESS_FBINFO(devflags.vgastep) = 4; | 1616 | minfo->devflags.vgastep = 4; |
| 1617 | ACCESS_FBINFO(devflags.textmode) = 4; | 1617 | minfo->devflags.textmode = 4; |
| 1618 | ACCESS_FBINFO(devflags.text_type_aux) = FB_AUX_TEXT_MGA_STEP16; | 1618 | minfo->devflags.text_type_aux = FB_AUX_TEXT_MGA_STEP16; |
| 1619 | } else if (b->flags & DEVF_TEXT16B) { | 1619 | } else if (b->flags & DEVF_TEXT16B) { |
| 1620 | ACCESS_FBINFO(devflags.vgastep) = 16; | 1620 | minfo->devflags.vgastep = 16; |
| 1621 | ACCESS_FBINFO(devflags.textmode) = 1; | 1621 | minfo->devflags.textmode = 1; |
| 1622 | ACCESS_FBINFO(devflags.text_type_aux) = FB_AUX_TEXT_MGA_STEP16; | 1622 | minfo->devflags.text_type_aux = FB_AUX_TEXT_MGA_STEP16; |
| 1623 | } else { | 1623 | } else { |
| 1624 | ACCESS_FBINFO(devflags.vgastep) = 8; | 1624 | minfo->devflags.vgastep = 8; |
| 1625 | ACCESS_FBINFO(devflags.textmode) = 1; | 1625 | minfo->devflags.textmode = 1; |
| 1626 | ACCESS_FBINFO(devflags.text_type_aux) = FB_AUX_TEXT_MGA_STEP8; | 1626 | minfo->devflags.text_type_aux = FB_AUX_TEXT_MGA_STEP8; |
| 1627 | } | 1627 | } |
| 1628 | #ifdef CONFIG_FB_MATROX_32MB | 1628 | #ifdef CONFIG_FB_MATROX_32MB |
| 1629 | ACCESS_FBINFO(devflags.support32MB) = (b->flags & DEVF_SUPPORT32MB) != 0; | 1629 | minfo->devflags.support32MB = (b->flags & DEVF_SUPPORT32MB) != 0; |
| 1630 | #endif | 1630 | #endif |
| 1631 | ACCESS_FBINFO(devflags.precise_width) = !(b->flags & DEVF_ANY_VXRES); | 1631 | minfo->devflags.precise_width = !(b->flags & DEVF_ANY_VXRES); |
| 1632 | ACCESS_FBINFO(devflags.crtc2) = (b->flags & DEVF_CRTC2) != 0; | 1632 | minfo->devflags.crtc2 = (b->flags & DEVF_CRTC2) != 0; |
| 1633 | ACCESS_FBINFO(devflags.maven_capable) = (b->flags & DEVF_MAVEN_CAPABLE) != 0; | 1633 | minfo->devflags.maven_capable = (b->flags & DEVF_MAVEN_CAPABLE) != 0; |
| 1634 | ACCESS_FBINFO(devflags.dualhead) = (b->flags & DEVF_DUALHEAD) != 0; | 1634 | minfo->devflags.dualhead = (b->flags & DEVF_DUALHEAD) != 0; |
| 1635 | ACCESS_FBINFO(devflags.dfp_type) = dfp_type; | 1635 | minfo->devflags.dfp_type = dfp_type; |
| 1636 | ACCESS_FBINFO(devflags.g450dac) = (b->flags & DEVF_G450DAC) != 0; | 1636 | minfo->devflags.g450dac = (b->flags & DEVF_G450DAC) != 0; |
| 1637 | ACCESS_FBINFO(devflags.textstep) = ACCESS_FBINFO(devflags.vgastep) * ACCESS_FBINFO(devflags.textmode); | 1637 | minfo->devflags.textstep = minfo->devflags.vgastep * minfo->devflags.textmode; |
| 1638 | ACCESS_FBINFO(devflags.textvram) = 65536 / ACCESS_FBINFO(devflags.textmode); | 1638 | minfo->devflags.textvram = 65536 / minfo->devflags.textmode; |
| 1639 | setDefaultOutputs(PMINFO2); | 1639 | setDefaultOutputs(PMINFO2); |
| 1640 | if (b->flags & DEVF_PANELLINK_CAPABLE) { | 1640 | if (b->flags & DEVF_PANELLINK_CAPABLE) { |
| 1641 | ACCESS_FBINFO(outputs[2]).data = MINFO; | 1641 | minfo->outputs[2].data = minfo; |
| 1642 | ACCESS_FBINFO(outputs[2]).output = &panellink_output; | 1642 | minfo->outputs[2].output = &panellink_output; |
| 1643 | ACCESS_FBINFO(outputs[2]).src = ACCESS_FBINFO(outputs[2]).default_src; | 1643 | minfo->outputs[2].src = minfo->outputs[2].default_src; |
| 1644 | ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR; | 1644 | minfo->outputs[2].mode = MATROXFB_OUTPUT_MODE_MONITOR; |
| 1645 | ACCESS_FBINFO(devflags.panellink) = 1; | 1645 | minfo->devflags.panellink = 1; |
| 1646 | } | 1646 | } |
| 1647 | 1647 | ||
| 1648 | if (ACCESS_FBINFO(capable.cross4MB) < 0) | 1648 | if (minfo->capable.cross4MB < 0) |
| 1649 | ACCESS_FBINFO(capable.cross4MB) = b->flags & DEVF_CROSS4MB; | 1649 | minfo->capable.cross4MB = b->flags & DEVF_CROSS4MB; |
| 1650 | if (b->flags & DEVF_SWAPS) { | 1650 | if (b->flags & DEVF_SWAPS) { |
| 1651 | ctrlptr_phys = pci_resource_start(ACCESS_FBINFO(pcidev), 1); | 1651 | ctrlptr_phys = pci_resource_start(minfo->pcidev, 1); |
| 1652 | video_base_phys = pci_resource_start(ACCESS_FBINFO(pcidev), 0); | 1652 | video_base_phys = pci_resource_start(minfo->pcidev, 0); |
| 1653 | ACCESS_FBINFO(devflags.fbResource) = PCI_BASE_ADDRESS_0; | 1653 | minfo->devflags.fbResource = PCI_BASE_ADDRESS_0; |
| 1654 | } else { | 1654 | } else { |
| 1655 | ctrlptr_phys = pci_resource_start(ACCESS_FBINFO(pcidev), 0); | 1655 | ctrlptr_phys = pci_resource_start(minfo->pcidev, 0); |
| 1656 | video_base_phys = pci_resource_start(ACCESS_FBINFO(pcidev), 1); | 1656 | video_base_phys = pci_resource_start(minfo->pcidev, 1); |
| 1657 | ACCESS_FBINFO(devflags.fbResource) = PCI_BASE_ADDRESS_1; | 1657 | minfo->devflags.fbResource = PCI_BASE_ADDRESS_1; |
| 1658 | } | 1658 | } |
| 1659 | err = -EINVAL; | 1659 | err = -EINVAL; |
| 1660 | if (!ctrlptr_phys) { | 1660 | if (!ctrlptr_phys) { |
| @@ -1672,7 +1672,7 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
| 1672 | if (!request_mem_region(video_base_phys, memsize, "matroxfb FB")) { | 1672 | if (!request_mem_region(video_base_phys, memsize, "matroxfb FB")) { |
| 1673 | goto failCtrlMR; | 1673 | goto failCtrlMR; |
| 1674 | } | 1674 | } |
| 1675 | ACCESS_FBINFO(video.len_maximum) = memsize; | 1675 | minfo->video.len_maximum = memsize; |
| 1676 | /* convert mem (autodetect k, M) */ | 1676 | /* convert mem (autodetect k, M) */ |
| 1677 | if (mem < 1024) mem *= 1024; | 1677 | if (mem < 1024) mem *= 1024; |
| 1678 | if (mem < 0x00100000) mem *= 1024; | 1678 | if (mem < 0x00100000) mem *= 1024; |
| @@ -1680,14 +1680,14 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
| 1680 | if (mem && (mem < memsize)) | 1680 | if (mem && (mem < memsize)) |
| 1681 | memsize = mem; | 1681 | memsize = mem; |
| 1682 | err = -ENOMEM; | 1682 | err = -ENOMEM; |
| 1683 | if (mga_ioremap(ctrlptr_phys, 16384, MGA_IOREMAP_MMIO, &ACCESS_FBINFO(mmio.vbase))) { | 1683 | if (mga_ioremap(ctrlptr_phys, 16384, MGA_IOREMAP_MMIO, &minfo->mmio.vbase)) { |
| 1684 | printk(KERN_ERR "matroxfb: cannot ioremap(%lX, 16384), matroxfb disabled\n", ctrlptr_phys); | 1684 | printk(KERN_ERR "matroxfb: cannot ioremap(%lX, 16384), matroxfb disabled\n", ctrlptr_phys); |
| 1685 | goto failVideoMR; | 1685 | goto failVideoMR; |
| 1686 | } | 1686 | } |
| 1687 | ACCESS_FBINFO(mmio.base) = ctrlptr_phys; | 1687 | minfo->mmio.base = ctrlptr_phys; |
| 1688 | ACCESS_FBINFO(mmio.len) = 16384; | 1688 | minfo->mmio.len = 16384; |
| 1689 | ACCESS_FBINFO(video.base) = video_base_phys; | 1689 | minfo->video.base = video_base_phys; |
| 1690 | if (mga_ioremap(video_base_phys, memsize, MGA_IOREMAP_FB, &ACCESS_FBINFO(video.vbase))) { | 1690 | if (mga_ioremap(video_base_phys, memsize, MGA_IOREMAP_FB, &minfo->video.vbase)) { |
| 1691 | printk(KERN_ERR "matroxfb: cannot ioremap(%lX, %d), matroxfb disabled\n", | 1691 | printk(KERN_ERR "matroxfb: cannot ioremap(%lX, %d), matroxfb disabled\n", |
| 1692 | video_base_phys, memsize); | 1692 | video_base_phys, memsize); |
| 1693 | goto failCtrlIO; | 1693 | goto failCtrlIO; |
| @@ -1696,63 +1696,63 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
| 1696 | u_int32_t cmd; | 1696 | u_int32_t cmd; |
| 1697 | u_int32_t mga_option; | 1697 | u_int32_t mga_option; |
| 1698 | 1698 | ||
| 1699 | pci_read_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, &mga_option); | 1699 | pci_read_config_dword(minfo->pcidev, PCI_OPTION_REG, &mga_option); |
| 1700 | pci_read_config_dword(ACCESS_FBINFO(pcidev), PCI_COMMAND, &cmd); | 1700 | pci_read_config_dword(minfo->pcidev, PCI_COMMAND, &cmd); |
| 1701 | mga_option &= 0x7FFFFFFF; /* clear BIG_ENDIAN */ | 1701 | mga_option &= 0x7FFFFFFF; /* clear BIG_ENDIAN */ |
| 1702 | mga_option |= MX_OPTION_BSWAP; | 1702 | mga_option |= MX_OPTION_BSWAP; |
| 1703 | /* disable palette snooping */ | 1703 | /* disable palette snooping */ |
| 1704 | cmd &= ~PCI_COMMAND_VGA_PALETTE; | 1704 | cmd &= ~PCI_COMMAND_VGA_PALETTE; |
| 1705 | if (pci_dev_present(intel_82437)) { | 1705 | if (pci_dev_present(intel_82437)) { |
| 1706 | if (!(mga_option & 0x20000000) && !ACCESS_FBINFO(devflags.nopciretry)) { | 1706 | if (!(mga_option & 0x20000000) && !minfo->devflags.nopciretry) { |
| 1707 | printk(KERN_WARNING "matroxfb: Disabling PCI retries due to i82437 present\n"); | 1707 | printk(KERN_WARNING "matroxfb: Disabling PCI retries due to i82437 present\n"); |
| 1708 | } | 1708 | } |
| 1709 | mga_option |= 0x20000000; | 1709 | mga_option |= 0x20000000; |
| 1710 | ACCESS_FBINFO(devflags.nopciretry) = 1; | 1710 | minfo->devflags.nopciretry = 1; |
| 1711 | } | 1711 | } |
| 1712 | pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_COMMAND, cmd); | 1712 | pci_write_config_dword(minfo->pcidev, PCI_COMMAND, cmd); |
| 1713 | pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, mga_option); | 1713 | pci_write_config_dword(minfo->pcidev, PCI_OPTION_REG, mga_option); |
| 1714 | ACCESS_FBINFO(hw).MXoptionReg = mga_option; | 1714 | minfo->hw.MXoptionReg = mga_option; |
| 1715 | 1715 | ||
| 1716 | /* select non-DMA memory for PCI_MGA_DATA, otherwise dump of PCI cfg space can lock PCI bus */ | 1716 | /* select non-DMA memory for PCI_MGA_DATA, otherwise dump of PCI cfg space can lock PCI bus */ |
| 1717 | /* maybe preinit() candidate, but it is same... for all devices... at this time... */ | 1717 | /* maybe preinit() candidate, but it is same... for all devices... at this time... */ |
| 1718 | pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_MGA_INDEX, 0x00003C00); | 1718 | pci_write_config_dword(minfo->pcidev, PCI_MGA_INDEX, 0x00003C00); |
| 1719 | } | 1719 | } |
| 1720 | 1720 | ||
| 1721 | err = -ENXIO; | 1721 | err = -ENXIO; |
| 1722 | matroxfb_read_pins(PMINFO2); | 1722 | matroxfb_read_pins(PMINFO2); |
| 1723 | if (ACCESS_FBINFO(hw_switch)->preinit(PMINFO2)) { | 1723 | if (minfo->hw_switch->preinit(PMINFO2)) { |
| 1724 | goto failVideoIO; | 1724 | goto failVideoIO; |
| 1725 | } | 1725 | } |
| 1726 | 1726 | ||
| 1727 | err = -ENOMEM; | 1727 | err = -ENOMEM; |
| 1728 | if (!matroxfb_getmemory(PMINFO memsize, &ACCESS_FBINFO(video.len)) || !ACCESS_FBINFO(video.len)) { | 1728 | if (!matroxfb_getmemory(PMINFO memsize, &minfo->video.len) || !minfo->video.len) { |
| 1729 | printk(KERN_ERR "matroxfb: cannot determine memory size\n"); | 1729 | printk(KERN_ERR "matroxfb: cannot determine memory size\n"); |
| 1730 | goto failVideoIO; | 1730 | goto failVideoIO; |
| 1731 | } | 1731 | } |
| 1732 | ACCESS_FBINFO(devflags.ydstorg) = 0; | 1732 | minfo->devflags.ydstorg = 0; |
| 1733 | 1733 | ||
| 1734 | ACCESS_FBINFO(video.base) = video_base_phys; | 1734 | minfo->video.base = video_base_phys; |
| 1735 | ACCESS_FBINFO(video.len_usable) = ACCESS_FBINFO(video.len); | 1735 | minfo->video.len_usable = minfo->video.len; |
| 1736 | if (ACCESS_FBINFO(video.len_usable) > b->base->maxdisplayable) | 1736 | if (minfo->video.len_usable > b->base->maxdisplayable) |
| 1737 | ACCESS_FBINFO(video.len_usable) = b->base->maxdisplayable; | 1737 | minfo->video.len_usable = b->base->maxdisplayable; |
| 1738 | #ifdef CONFIG_MTRR | 1738 | #ifdef CONFIG_MTRR |
| 1739 | if (mtrr) { | 1739 | if (mtrr) { |
| 1740 | ACCESS_FBINFO(mtrr.vram) = mtrr_add(video_base_phys, ACCESS_FBINFO(video.len), MTRR_TYPE_WRCOMB, 1); | 1740 | minfo->mtrr.vram = mtrr_add(video_base_phys, minfo->video.len, MTRR_TYPE_WRCOMB, 1); |
| 1741 | ACCESS_FBINFO(mtrr.vram_valid) = 1; | 1741 | minfo->mtrr.vram_valid = 1; |
| 1742 | printk(KERN_INFO "matroxfb: MTRR's turned on\n"); | 1742 | printk(KERN_INFO "matroxfb: MTRR's turned on\n"); |
| 1743 | } | 1743 | } |
| 1744 | #endif /* CONFIG_MTRR */ | 1744 | #endif /* CONFIG_MTRR */ |
| 1745 | 1745 | ||
| 1746 | if (!ACCESS_FBINFO(devflags.novga)) | 1746 | if (!minfo->devflags.novga) |
| 1747 | request_region(0x3C0, 32, "matrox"); | 1747 | request_region(0x3C0, 32, "matrox"); |
| 1748 | matroxfb_g450_connect(PMINFO2); | 1748 | matroxfb_g450_connect(PMINFO2); |
| 1749 | ACCESS_FBINFO(hw_switch->reset(PMINFO2)); | 1749 | minfo->hw_switch->reset(PMINFO2); |
| 1750 | 1750 | ||
| 1751 | ACCESS_FBINFO(fbcon.monspecs.hfmin) = 0; | 1751 | minfo->fbcon.monspecs.hfmin = 0; |
| 1752 | ACCESS_FBINFO(fbcon.monspecs.hfmax) = fh; | 1752 | minfo->fbcon.monspecs.hfmax = fh; |
| 1753 | ACCESS_FBINFO(fbcon.monspecs.vfmin) = 0; | 1753 | minfo->fbcon.monspecs.vfmin = 0; |
| 1754 | ACCESS_FBINFO(fbcon.monspecs.vfmax) = fv; | 1754 | minfo->fbcon.monspecs.vfmax = fv; |
| 1755 | ACCESS_FBINFO(fbcon.monspecs.dpms) = 0; /* TBD */ | 1755 | minfo->fbcon.monspecs.dpms = 0; /* TBD */ |
| 1756 | 1756 | ||
| 1757 | /* static settings */ | 1757 | /* static settings */ |
| 1758 | vesafb_defined.red = colors[depth-1].red; | 1758 | vesafb_defined.red = colors[depth-1].red; |
| @@ -1764,24 +1764,24 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
| 1764 | if (noaccel) | 1764 | if (noaccel) |
| 1765 | vesafb_defined.accel_flags &= ~FB_ACCELF_TEXT; | 1765 | vesafb_defined.accel_flags &= ~FB_ACCELF_TEXT; |
| 1766 | 1766 | ||
| 1767 | ACCESS_FBINFO(fbops) = matroxfb_ops; | 1767 | minfo->fbops = matroxfb_ops; |
| 1768 | ACCESS_FBINFO(fbcon.fbops) = &ACCESS_FBINFO(fbops); | 1768 | minfo->fbcon.fbops = &minfo->fbops; |
| 1769 | ACCESS_FBINFO(fbcon.pseudo_palette) = ACCESS_FBINFO(cmap); | 1769 | minfo->fbcon.pseudo_palette = minfo->cmap; |
| 1770 | /* after __init time we are like module... no logo */ | 1770 | /* after __init time we are like module... no logo */ |
| 1771 | ACCESS_FBINFO(fbcon.flags) = hotplug ? FBINFO_FLAG_MODULE : FBINFO_FLAG_DEFAULT; | 1771 | minfo->fbcon.flags = hotplug ? FBINFO_FLAG_MODULE : FBINFO_FLAG_DEFAULT; |
| 1772 | ACCESS_FBINFO(fbcon.flags) |= FBINFO_PARTIAL_PAN_OK | /* Prefer panning for scroll under MC viewer/edit */ | 1772 | minfo->fbcon.flags |= FBINFO_PARTIAL_PAN_OK | /* Prefer panning for scroll under MC viewer/edit */ |
| 1773 | FBINFO_HWACCEL_COPYAREA | /* We have hw-assisted bmove */ | 1773 | FBINFO_HWACCEL_COPYAREA | /* We have hw-assisted bmove */ |
| 1774 | FBINFO_HWACCEL_FILLRECT | /* And fillrect */ | 1774 | FBINFO_HWACCEL_FILLRECT | /* And fillrect */ |
| 1775 | FBINFO_HWACCEL_IMAGEBLIT | /* And imageblit */ | 1775 | FBINFO_HWACCEL_IMAGEBLIT | /* And imageblit */ |
| 1776 | FBINFO_HWACCEL_XPAN | /* And we support both horizontal */ | 1776 | FBINFO_HWACCEL_XPAN | /* And we support both horizontal */ |
| 1777 | FBINFO_HWACCEL_YPAN; /* And vertical panning */ | 1777 | FBINFO_HWACCEL_YPAN; /* And vertical panning */ |
| 1778 | ACCESS_FBINFO(video.len_usable) &= PAGE_MASK; | 1778 | minfo->video.len_usable &= PAGE_MASK; |
| 1779 | fb_alloc_cmap(&ACCESS_FBINFO(fbcon.cmap), 256, 1); | 1779 | fb_alloc_cmap(&minfo->fbcon.cmap, 256, 1); |
| 1780 | 1780 | ||
| 1781 | #ifndef MODULE | 1781 | #ifndef MODULE |
| 1782 | /* mode database is marked __init!!! */ | 1782 | /* mode database is marked __init!!! */ |
| 1783 | if (!hotplug) { | 1783 | if (!hotplug) { |
| 1784 | fb_find_mode(&vesafb_defined, &ACCESS_FBINFO(fbcon), videomode[0]?videomode:NULL, | 1784 | fb_find_mode(&vesafb_defined, &minfo->fbcon, videomode[0] ? videomode : NULL, |
| 1785 | NULL, 0, &defaultmode, vesafb_defined.bits_per_pixel); | 1785 | NULL, 0, &defaultmode, vesafb_defined.bits_per_pixel); |
| 1786 | } | 1786 | } |
| 1787 | #endif /* !MODULE */ | 1787 | #endif /* !MODULE */ |
| @@ -1871,51 +1871,51 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
| 1871 | to yres_virtual * xres_virtual < 2^32 */ | 1871 | to yres_virtual * xres_virtual < 2^32 */ |
| 1872 | } | 1872 | } |
| 1873 | matroxfb_init_fix(PMINFO2); | 1873 | matroxfb_init_fix(PMINFO2); |
| 1874 | ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase)); | 1874 | minfo->fbcon.screen_base = vaddr_va(minfo->video.vbase); |
| 1875 | /* Normalize values (namely yres_virtual) */ | 1875 | /* Normalize values (namely yres_virtual) */ |
| 1876 | matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon)); | 1876 | matroxfb_check_var(&vesafb_defined, &minfo->fbcon); |
| 1877 | /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over | 1877 | /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over |
| 1878 | * vgacon correctly. fbcon_startup will call fb_set_par for us, WITHOUT check_var, | 1878 | * vgacon correctly. fbcon_startup will call fb_set_par for us, WITHOUT check_var, |
| 1879 | * and unfortunately it will do it BEFORE vgacon contents is saved, so it won't work | 1879 | * and unfortunately it will do it BEFORE vgacon contents is saved, so it won't work |
| 1880 | * anyway. But we at least tried... */ | 1880 | * anyway. But we at least tried... */ |
| 1881 | ACCESS_FBINFO(fbcon.var) = vesafb_defined; | 1881 | minfo->fbcon.var = vesafb_defined; |
| 1882 | err = -EINVAL; | 1882 | err = -EINVAL; |
| 1883 | 1883 | ||
| 1884 | printk(KERN_INFO "matroxfb: %dx%dx%dbpp (virtual: %dx%d)\n", | 1884 | printk(KERN_INFO "matroxfb: %dx%dx%dbpp (virtual: %dx%d)\n", |
| 1885 | vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, | 1885 | vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, |
| 1886 | vesafb_defined.xres_virtual, vesafb_defined.yres_virtual); | 1886 | vesafb_defined.xres_virtual, vesafb_defined.yres_virtual); |
| 1887 | printk(KERN_INFO "matroxfb: framebuffer at 0x%lX, mapped to 0x%p, size %d\n", | 1887 | printk(KERN_INFO "matroxfb: framebuffer at 0x%lX, mapped to 0x%p, size %d\n", |
| 1888 | ACCESS_FBINFO(video.base), vaddr_va(ACCESS_FBINFO(video.vbase)), ACCESS_FBINFO(video.len)); | 1888 | minfo->video.base, vaddr_va(minfo->video.vbase), minfo->video.len); |
| 1889 | 1889 | ||
| 1890 | /* We do not have to set currcon to 0... register_framebuffer do it for us on first console | 1890 | /* We do not have to set currcon to 0... register_framebuffer do it for us on first console |
| 1891 | * and we do not want currcon == 0 for subsequent framebuffers */ | 1891 | * and we do not want currcon == 0 for subsequent framebuffers */ |
| 1892 | 1892 | ||
| 1893 | ACCESS_FBINFO(fbcon).device = &ACCESS_FBINFO(pcidev)->dev; | 1893 | minfo->fbcon.device = &minfo->pcidev->dev; |
| 1894 | if (register_framebuffer(&ACCESS_FBINFO(fbcon)) < 0) { | 1894 | if (register_framebuffer(&minfo->fbcon) < 0) { |
| 1895 | goto failVideoIO; | 1895 | goto failVideoIO; |
| 1896 | } | 1896 | } |
| 1897 | printk("fb%d: %s frame buffer device\n", | 1897 | printk("fb%d: %s frame buffer device\n", |
| 1898 | ACCESS_FBINFO(fbcon.node), ACCESS_FBINFO(fbcon.fix.id)); | 1898 | minfo->fbcon.node, minfo->fbcon.fix.id); |
| 1899 | 1899 | ||
| 1900 | /* there is no console on this fb... but we have to initialize hardware | 1900 | /* there is no console on this fb... but we have to initialize hardware |
| 1901 | * until someone tells me what is proper thing to do */ | 1901 | * until someone tells me what is proper thing to do */ |
| 1902 | if (!ACCESS_FBINFO(initialized)) { | 1902 | if (!minfo->initialized) { |
| 1903 | printk(KERN_INFO "fb%d: initializing hardware\n", | 1903 | printk(KERN_INFO "fb%d: initializing hardware\n", |
| 1904 | ACCESS_FBINFO(fbcon.node)); | 1904 | minfo->fbcon.node); |
| 1905 | /* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var | 1905 | /* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var |
| 1906 | * already before, so register_framebuffer works correctly. */ | 1906 | * already before, so register_framebuffer works correctly. */ |
| 1907 | vesafb_defined.activate |= FB_ACTIVATE_FORCE; | 1907 | vesafb_defined.activate |= FB_ACTIVATE_FORCE; |
| 1908 | fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined); | 1908 | fb_set_var(&minfo->fbcon, &vesafb_defined); |
| 1909 | } | 1909 | } |
| 1910 | 1910 | ||
| 1911 | return 0; | 1911 | return 0; |
| 1912 | failVideoIO:; | 1912 | failVideoIO:; |
| 1913 | matroxfb_g450_shutdown(PMINFO2); | 1913 | matroxfb_g450_shutdown(PMINFO2); |
| 1914 | mga_iounmap(ACCESS_FBINFO(video.vbase)); | 1914 | mga_iounmap(minfo->video.vbase); |
| 1915 | failCtrlIO:; | 1915 | failCtrlIO:; |
| 1916 | mga_iounmap(ACCESS_FBINFO(mmio.vbase)); | 1916 | mga_iounmap(minfo->mmio.vbase); |
| 1917 | failVideoMR:; | 1917 | failVideoMR:; |
| 1918 | release_mem_region(video_base_phys, ACCESS_FBINFO(video.len_maximum)); | 1918 | release_mem_region(video_base_phys, minfo->video.len_maximum); |
| 1919 | failCtrlMR:; | 1919 | failCtrlMR:; |
| 1920 | release_mem_region(ctrlptr_phys, 16384); | 1920 | release_mem_region(ctrlptr_phys, 16384); |
| 1921 | fail:; | 1921 | fail:; |
| @@ -1971,7 +1971,7 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv) { | |||
| 1971 | static void matroxfb_register_device(struct matrox_fb_info* minfo) { | 1971 | static void matroxfb_register_device(struct matrox_fb_info* minfo) { |
| 1972 | struct matroxfb_driver* drv; | 1972 | struct matroxfb_driver* drv; |
| 1973 | int i = 0; | 1973 | int i = 0; |
| 1974 | list_add(&ACCESS_FBINFO(next_fb), &matroxfb_list); | 1974 | list_add(&minfo->next_fb, &matroxfb_list); |
| 1975 | for (drv = matroxfb_driver_l(matroxfb_driver_list.next); | 1975 | for (drv = matroxfb_driver_l(matroxfb_driver_list.next); |
| 1976 | drv != matroxfb_driver_l(&matroxfb_driver_list); | 1976 | drv != matroxfb_driver_l(&matroxfb_driver_list); |
| 1977 | drv = matroxfb_driver_l(drv->node.next)) { | 1977 | drv = matroxfb_driver_l(drv->node.next)) { |
| @@ -1991,7 +1991,7 @@ static void matroxfb_register_device(struct matrox_fb_info* minfo) { | |||
| 1991 | static void matroxfb_unregister_device(struct matrox_fb_info* minfo) { | 1991 | static void matroxfb_unregister_device(struct matrox_fb_info* minfo) { |
| 1992 | int i; | 1992 | int i; |
| 1993 | 1993 | ||
| 1994 | list_del(&ACCESS_FBINFO(next_fb)); | 1994 | list_del(&minfo->next_fb); |
| 1995 | for (i = 0; i < minfo->drivers_count; i++) { | 1995 | for (i = 0; i < minfo->drivers_count; i++) { |
| 1996 | struct matroxfb_driver* drv = minfo->drivers[i]; | 1996 | struct matroxfb_driver* drv = minfo->drivers[i]; |
| 1997 | 1997 | ||
| @@ -2033,51 +2033,51 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm | |||
| 2033 | minfo = kmalloc(sizeof(*minfo), GFP_KERNEL); | 2033 | minfo = kmalloc(sizeof(*minfo), GFP_KERNEL); |
| 2034 | if (!minfo) | 2034 | if (!minfo) |
| 2035 | return -1; | 2035 | return -1; |
| 2036 | memset(MINFO, 0, sizeof(*MINFO)); | 2036 | memset(minfo, 0, sizeof(*minfo)); |
| 2037 | 2037 | ||
| 2038 | ACCESS_FBINFO(pcidev) = pdev; | 2038 | minfo->pcidev = pdev; |
| 2039 | ACCESS_FBINFO(dead) = 0; | 2039 | minfo->dead = 0; |
| 2040 | ACCESS_FBINFO(usecount) = 0; | 2040 | minfo->usecount = 0; |
| 2041 | ACCESS_FBINFO(userusecount) = 0; | 2041 | minfo->userusecount = 0; |
| 2042 | 2042 | ||
| 2043 | pci_set_drvdata(pdev, MINFO); | 2043 | pci_set_drvdata(pdev, minfo); |
| 2044 | /* DEVFLAGS */ | 2044 | /* DEVFLAGS */ |
| 2045 | ACCESS_FBINFO(devflags.memtype) = memtype; | 2045 | minfo->devflags.memtype = memtype; |
| 2046 | if (memtype != -1) | 2046 | if (memtype != -1) |
| 2047 | noinit = 0; | 2047 | noinit = 0; |
| 2048 | if (cmd & PCI_COMMAND_MEMORY) { | 2048 | if (cmd & PCI_COMMAND_MEMORY) { |
| 2049 | ACCESS_FBINFO(devflags.novga) = novga; | 2049 | minfo->devflags.novga = novga; |
| 2050 | ACCESS_FBINFO(devflags.nobios) = nobios; | 2050 | minfo->devflags.nobios = nobios; |
| 2051 | ACCESS_FBINFO(devflags.noinit) = noinit; | 2051 | minfo->devflags.noinit = noinit; |
| 2052 | /* subsequent heads always needs initialization and must not enable BIOS */ | 2052 | /* subsequent heads always needs initialization and must not enable BIOS */ |
| 2053 | novga = 1; | 2053 | novga = 1; |
| 2054 | nobios = 1; | 2054 | nobios = 1; |
| 2055 | noinit = 0; | 2055 | noinit = 0; |
| 2056 | } else { | 2056 | } else { |
| 2057 | ACCESS_FBINFO(devflags.novga) = 1; | 2057 | minfo->devflags.novga = 1; |
| 2058 | ACCESS_FBINFO(devflags.nobios) = 1; | 2058 | minfo->devflags.nobios = 1; |
| 2059 | ACCESS_FBINFO(devflags.noinit) = 0; | 2059 | minfo->devflags.noinit = 0; |
| 2060 | } | 2060 | } |
| 2061 | 2061 | ||
| 2062 | ACCESS_FBINFO(devflags.nopciretry) = no_pci_retry; | 2062 | minfo->devflags.nopciretry = no_pci_retry; |
| 2063 | ACCESS_FBINFO(devflags.mga_24bpp_fix) = inv24; | 2063 | minfo->devflags.mga_24bpp_fix = inv24; |
| 2064 | ACCESS_FBINFO(devflags.precise_width) = option_precise_width; | 2064 | minfo->devflags.precise_width = option_precise_width; |
| 2065 | ACCESS_FBINFO(devflags.sgram) = sgram; | 2065 | minfo->devflags.sgram = sgram; |
| 2066 | ACCESS_FBINFO(capable.cross4MB) = cross4MB; | 2066 | minfo->capable.cross4MB = cross4MB; |
| 2067 | 2067 | ||
| 2068 | spin_lock_init(&ACCESS_FBINFO(lock.DAC)); | 2068 | spin_lock_init(&minfo->lock.DAC); |
| 2069 | spin_lock_init(&ACCESS_FBINFO(lock.accel)); | 2069 | spin_lock_init(&minfo->lock.accel); |
| 2070 | init_rwsem(&ACCESS_FBINFO(crtc2.lock)); | 2070 | init_rwsem(&minfo->crtc2.lock); |
| 2071 | init_rwsem(&ACCESS_FBINFO(altout.lock)); | 2071 | init_rwsem(&minfo->altout.lock); |
| 2072 | mutex_init(&ACCESS_FBINFO(fbcon).mm_lock); | 2072 | mutex_init(&minfo->fbcon.mm_lock); |
| 2073 | ACCESS_FBINFO(irq_flags) = 0; | 2073 | minfo->irq_flags = 0; |
| 2074 | init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait)); | 2074 | init_waitqueue_head(&minfo->crtc1.vsync.wait); |
| 2075 | init_waitqueue_head(&ACCESS_FBINFO(crtc2.vsync.wait)); | 2075 | init_waitqueue_head(&minfo->crtc2.vsync.wait); |
| 2076 | ACCESS_FBINFO(crtc1.panpos) = -1; | 2076 | minfo->crtc1.panpos = -1; |
| 2077 | 2077 | ||
| 2078 | err = initMatrox2(PMINFO b); | 2078 | err = initMatrox2(PMINFO b); |
| 2079 | if (!err) { | 2079 | if (!err) { |
| 2080 | matroxfb_register_device(MINFO); | 2080 | matroxfb_register_device(minfo); |
| 2081 | return 0; | 2081 | return 0; |
| 2082 | } | 2082 | } |
| 2083 | kfree(minfo); | 2083 | kfree(minfo); |
