diff options
Diffstat (limited to 'drivers/video/matrox/matroxfb_g450.c')
-rw-r--r-- | drivers/video/matrox/matroxfb_g450.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/drivers/video/matrox/matroxfb_g450.c b/drivers/video/matrox/matroxfb_g450.c index 6209a761f674..841b439ecca3 100644 --- a/drivers/video/matrox/matroxfb_g450.c +++ b/drivers/video/matrox/matroxfb_g450.c | |||
@@ -81,7 +81,7 @@ static int get_ctrl_id(__u32 v4l2_id) { | |||
81 | } | 81 | } |
82 | 82 | ||
83 | static inline int* get_ctrl_ptr(WPMINFO unsigned int idx) { | 83 | static inline int* get_ctrl_ptr(WPMINFO unsigned int idx) { |
84 | return (int*)((char*)MINFO + g450_controls[idx].control); | 84 | return (int*)((char*)minfo + g450_controls[idx].control); |
85 | } | 85 | } |
86 | 86 | ||
87 | static void tvo_fill_defaults(WPMINFO2) { | 87 | static void tvo_fill_defaults(WPMINFO2) { |
@@ -124,8 +124,8 @@ static void cve2_set_reg10(WPMINFO int reg, int val) { | |||
124 | } | 124 | } |
125 | 125 | ||
126 | static void g450_compute_bwlevel(CPMINFO int *bl, int *wl) { | 126 | static void g450_compute_bwlevel(CPMINFO int *bl, int *wl) { |
127 | const int b = ACCESS_FBINFO(altout.tvo_params.brightness) + BLMIN; | 127 | const int b = minfo->altout.tvo_params.brightness + BLMIN; |
128 | const int c = ACCESS_FBINFO(altout.tvo_params.contrast); | 128 | const int c = minfo->altout.tvo_params.contrast; |
129 | 129 | ||
130 | *bl = max(b - c, BLMIN); | 130 | *bl = max(b - c, BLMIN); |
131 | *wl = min(b + c, WLMAX); | 131 | *wl = min(b + c, WLMAX); |
@@ -509,31 +509,31 @@ static void cve2_init_TV(WPMINFO const struct mavenregs* m) { | |||
509 | static int matroxfb_g450_compute(void* md, struct my_timming* mt) { | 509 | static int matroxfb_g450_compute(void* md, struct my_timming* mt) { |
510 | MINFO_FROM(md); | 510 | MINFO_FROM(md); |
511 | 511 | ||
512 | dprintk(KERN_DEBUG "Computing, mode=%u\n", ACCESS_FBINFO(outputs[1]).mode); | 512 | dprintk(KERN_DEBUG "Computing, mode=%u\n", minfo->outputs[1].mode); |
513 | 513 | ||
514 | if (mt->crtc == MATROXFB_SRC_CRTC2 && | 514 | if (mt->crtc == MATROXFB_SRC_CRTC2 && |
515 | ACCESS_FBINFO(outputs[1]).mode != MATROXFB_OUTPUT_MODE_MONITOR) { | 515 | minfo->outputs[1].mode != MATROXFB_OUTPUT_MODE_MONITOR) { |
516 | const struct output_desc* outd; | 516 | const struct output_desc* outd; |
517 | 517 | ||
518 | cve2_init_TVdata(ACCESS_FBINFO(outputs[1]).mode, &ACCESS_FBINFO(hw).maven, &outd); | 518 | cve2_init_TVdata(minfo->outputs[1].mode, &minfo->hw.maven, &outd); |
519 | { | 519 | { |
520 | int blacklevel, whitelevel; | 520 | int blacklevel, whitelevel; |
521 | g450_compute_bwlevel(PMINFO &blacklevel, &whitelevel); | 521 | g450_compute_bwlevel(PMINFO &blacklevel, &whitelevel); |
522 | ACCESS_FBINFO(hw).maven.regs[0x0E] = blacklevel >> 2; | 522 | minfo->hw.maven.regs[0x0E] = blacklevel >> 2; |
523 | ACCESS_FBINFO(hw).maven.regs[0x0F] = blacklevel & 3; | 523 | minfo->hw.maven.regs[0x0F] = blacklevel & 3; |
524 | ACCESS_FBINFO(hw).maven.regs[0x1E] = whitelevel >> 2; | 524 | minfo->hw.maven.regs[0x1E] = whitelevel >> 2; |
525 | ACCESS_FBINFO(hw).maven.regs[0x1F] = whitelevel & 3; | 525 | minfo->hw.maven.regs[0x1F] = whitelevel & 3; |
526 | 526 | ||
527 | ACCESS_FBINFO(hw).maven.regs[0x20] = | 527 | minfo->hw.maven.regs[0x20] = |
528 | ACCESS_FBINFO(hw).maven.regs[0x22] = ACCESS_FBINFO(altout.tvo_params.saturation); | 528 | minfo->hw.maven.regs[0x22] = minfo->altout.tvo_params.saturation; |
529 | 529 | ||
530 | ACCESS_FBINFO(hw).maven.regs[0x25] = ACCESS_FBINFO(altout.tvo_params.hue); | 530 | minfo->hw.maven.regs[0x25] = minfo->altout.tvo_params.hue; |
531 | 531 | ||
532 | if (ACCESS_FBINFO(altout.tvo_params.testout)) { | 532 | if (minfo->altout.tvo_params.testout) { |
533 | ACCESS_FBINFO(hw).maven.regs[0x05] |= 0x02; | 533 | minfo->hw.maven.regs[0x05] |= 0x02; |
534 | } | 534 | } |
535 | } | 535 | } |
536 | computeRegs(PMINFO &ACCESS_FBINFO(hw).maven, mt, outd); | 536 | computeRegs(PMINFO &minfo->hw.maven, mt, outd); |
537 | } else if (mt->mnp < 0) { | 537 | } else if (mt->mnp < 0) { |
538 | /* We must program clocks before CRTC2, otherwise interlaced mode | 538 | /* We must program clocks before CRTC2, otherwise interlaced mode |
539 | startup may fail */ | 539 | startup may fail */ |
@@ -547,8 +547,8 @@ static int matroxfb_g450_compute(void* md, struct my_timming* mt) { | |||
547 | static int matroxfb_g450_program(void* md) { | 547 | static int matroxfb_g450_program(void* md) { |
548 | MINFO_FROM(md); | 548 | MINFO_FROM(md); |
549 | 549 | ||
550 | if (ACCESS_FBINFO(outputs[1]).mode != MATROXFB_OUTPUT_MODE_MONITOR) { | 550 | if (minfo->outputs[1].mode != MATROXFB_OUTPUT_MODE_MONITOR) { |
551 | cve2_init_TV(PMINFO &ACCESS_FBINFO(hw).maven); | 551 | cve2_init_TV(PMINFO &minfo->hw.maven); |
552 | } | 552 | } |
553 | return 0; | 553 | return 0; |
554 | } | 554 | } |
@@ -589,33 +589,33 @@ static struct matrox_altout matroxfb_g450_dvi = { | |||
589 | }; | 589 | }; |
590 | 590 | ||
591 | void matroxfb_g450_connect(WPMINFO2) { | 591 | void matroxfb_g450_connect(WPMINFO2) { |
592 | if (ACCESS_FBINFO(devflags.g450dac)) { | 592 | if (minfo->devflags.g450dac) { |
593 | down_write(&ACCESS_FBINFO(altout.lock)); | 593 | down_write(&minfo->altout.lock); |
594 | tvo_fill_defaults(PMINFO2); | 594 | tvo_fill_defaults(PMINFO2); |
595 | ACCESS_FBINFO(outputs[1]).src = ACCESS_FBINFO(outputs[1]).default_src; | 595 | minfo->outputs[1].src = minfo->outputs[1].default_src; |
596 | ACCESS_FBINFO(outputs[1]).data = MINFO; | 596 | minfo->outputs[1].data = minfo; |
597 | ACCESS_FBINFO(outputs[1]).output = &matroxfb_g450_altout; | 597 | minfo->outputs[1].output = &matroxfb_g450_altout; |
598 | ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; | 598 | minfo->outputs[1].mode = MATROXFB_OUTPUT_MODE_MONITOR; |
599 | ACCESS_FBINFO(outputs[2]).src = ACCESS_FBINFO(outputs[2]).default_src; | 599 | minfo->outputs[2].src = minfo->outputs[2].default_src; |
600 | ACCESS_FBINFO(outputs[2]).data = MINFO; | 600 | minfo->outputs[2].data = minfo; |
601 | ACCESS_FBINFO(outputs[2]).output = &matroxfb_g450_dvi; | 601 | minfo->outputs[2].output = &matroxfb_g450_dvi; |
602 | ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR; | 602 | minfo->outputs[2].mode = MATROXFB_OUTPUT_MODE_MONITOR; |
603 | up_write(&ACCESS_FBINFO(altout.lock)); | 603 | up_write(&minfo->altout.lock); |
604 | } | 604 | } |
605 | } | 605 | } |
606 | 606 | ||
607 | void matroxfb_g450_shutdown(WPMINFO2) { | 607 | void matroxfb_g450_shutdown(WPMINFO2) { |
608 | if (ACCESS_FBINFO(devflags.g450dac)) { | 608 | if (minfo->devflags.g450dac) { |
609 | down_write(&ACCESS_FBINFO(altout.lock)); | 609 | down_write(&minfo->altout.lock); |
610 | ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE; | 610 | minfo->outputs[1].src = MATROXFB_SRC_NONE; |
611 | ACCESS_FBINFO(outputs[1]).output = NULL; | 611 | minfo->outputs[1].output = NULL; |
612 | ACCESS_FBINFO(outputs[1]).data = NULL; | 612 | minfo->outputs[1].data = NULL; |
613 | ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; | 613 | minfo->outputs[1].mode = MATROXFB_OUTPUT_MODE_MONITOR; |
614 | ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_NONE; | 614 | minfo->outputs[2].src = MATROXFB_SRC_NONE; |
615 | ACCESS_FBINFO(outputs[2]).output = NULL; | 615 | minfo->outputs[2].output = NULL; |
616 | ACCESS_FBINFO(outputs[2]).data = NULL; | 616 | minfo->outputs[2].data = NULL; |
617 | ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR; | 617 | minfo->outputs[2].mode = MATROXFB_OUTPUT_MODE_MONITOR; |
618 | up_write(&ACCESS_FBINFO(altout.lock)); | 618 | up_write(&minfo->altout.lock); |
619 | } | 619 | } |
620 | } | 620 | } |
621 | 621 | ||