Lines Matching refs:minfo

86 static inline int *get_ctrl_ptr(struct matrox_fb_info *minfo, unsigned int idx)  in get_ctrl_ptr()  argument
88 return (int*)((char*)minfo + g450_controls[idx].control); in get_ctrl_ptr()
91 static void tvo_fill_defaults(struct matrox_fb_info *minfo) in tvo_fill_defaults() argument
96 *get_ctrl_ptr(minfo, i) = g450_controls[i].desc.default_value; in tvo_fill_defaults()
100 static int cve2_get_reg(struct matrox_fb_info *minfo, int reg) in cve2_get_reg() argument
106 matroxfb_DAC_out(minfo, 0x87, reg); in cve2_get_reg()
107 val = matroxfb_DAC_in(minfo, 0x88); in cve2_get_reg()
112 static void cve2_set_reg(struct matrox_fb_info *minfo, int reg, int val) in cve2_set_reg() argument
117 matroxfb_DAC_out(minfo, 0x87, reg); in cve2_set_reg()
118 matroxfb_DAC_out(minfo, 0x88, val); in cve2_set_reg()
122 static void cve2_set_reg10(struct matrox_fb_info *minfo, int reg, int val) in cve2_set_reg10() argument
127 matroxfb_DAC_out(minfo, 0x87, reg); in cve2_set_reg10()
128 matroxfb_DAC_out(minfo, 0x88, val >> 2); in cve2_set_reg10()
129 matroxfb_DAC_out(minfo, 0x87, reg + 1); in cve2_set_reg10()
130 matroxfb_DAC_out(minfo, 0x88, val & 3); in cve2_set_reg10()
134 static void g450_compute_bwlevel(const struct matrox_fb_info *minfo, int *bl, in g450_compute_bwlevel() argument
137 const int b = minfo->altout.tvo_params.brightness + BLMIN; in g450_compute_bwlevel()
138 const int c = minfo->altout.tvo_params.contrast; in g450_compute_bwlevel()
167 struct matrox_fb_info *minfo = md; in g450_set_ctrl() local
175 if (p->value == *get_ctrl_ptr(minfo, i)) return 0; in g450_set_ctrl()
186 *get_ctrl_ptr(minfo, i) = p->value; in g450_set_ctrl()
193 g450_compute_bwlevel(minfo, &blacklevel, &whitelevel); in g450_set_ctrl()
194 cve2_set_reg10(minfo, 0x0e, blacklevel); in g450_set_ctrl()
195 cve2_set_reg10(minfo, 0x1e, whitelevel); in g450_set_ctrl()
199 cve2_set_reg(minfo, 0x20, p->value); in g450_set_ctrl()
200 cve2_set_reg(minfo, 0x22, p->value); in g450_set_ctrl()
203 cve2_set_reg(minfo, 0x25, p->value); in g450_set_ctrl()
207 unsigned char val = cve2_get_reg(minfo, 0x05); in g450_set_ctrl()
210 cve2_set_reg(minfo, 0x05, val); in g450_set_ctrl()
221 struct matrox_fb_info *minfo = md; in g450_get_ctrl() local
225 p->value = *get_ctrl_ptr(minfo, i); in g450_get_ctrl()
239 static void computeRegs(struct matrox_fb_info *minfo, struct mavenregs *r, in computeRegs() argument
266 mnp = matroxfb_g450_setclk(minfo, piic, M_VIDEO_PLL); in computeRegs()
269 mt->pixclock = g450_mnp2f(minfo, mnp); in computeRegs()
505 #define LR(x) cve2_set_reg(minfo, (x), m->regs[(x)])
506 static void cve2_init_TV(struct matrox_fb_info *minfo, in cve2_init_TV() argument
515 cve2_set_reg(minfo, 0x3E, 0x01); in cve2_init_TV()
520 cve2_set_reg(minfo, 0x3E, 0x00); in cve2_init_TV()
524 struct matrox_fb_info *minfo = md; in matroxfb_g450_compute() local
526 dprintk(KERN_DEBUG "Computing, mode=%u\n", minfo->outputs[1].mode); in matroxfb_g450_compute()
529 minfo->outputs[1].mode != MATROXFB_OUTPUT_MODE_MONITOR) { in matroxfb_g450_compute()
532 cve2_init_TVdata(minfo->outputs[1].mode, &minfo->hw.maven, &outd); in matroxfb_g450_compute()
535 g450_compute_bwlevel(minfo, &blacklevel, &whitelevel); in matroxfb_g450_compute()
536 minfo->hw.maven.regs[0x0E] = blacklevel >> 2; in matroxfb_g450_compute()
537 minfo->hw.maven.regs[0x0F] = blacklevel & 3; in matroxfb_g450_compute()
538 minfo->hw.maven.regs[0x1E] = whitelevel >> 2; in matroxfb_g450_compute()
539 minfo->hw.maven.regs[0x1F] = whitelevel & 3; in matroxfb_g450_compute()
541 minfo->hw.maven.regs[0x20] = in matroxfb_g450_compute()
542 minfo->hw.maven.regs[0x22] = minfo->altout.tvo_params.saturation; in matroxfb_g450_compute()
544 minfo->hw.maven.regs[0x25] = minfo->altout.tvo_params.hue; in matroxfb_g450_compute()
546 if (minfo->altout.tvo_params.testout) { in matroxfb_g450_compute()
547 minfo->hw.maven.regs[0x05] |= 0x02; in matroxfb_g450_compute()
550 computeRegs(minfo, &minfo->hw.maven, mt, outd); in matroxfb_g450_compute()
554 …mt->mnp = matroxfb_g450_setclk(minfo, mt->pixclock, (mt->crtc == MATROXFB_SRC_CRTC1) ? M_PIXEL_PLL… in matroxfb_g450_compute()
555 mt->pixclock = g450_mnp2f(minfo, mt->mnp); in matroxfb_g450_compute()
562 struct matrox_fb_info *minfo = md; in matroxfb_g450_program() local
564 if (minfo->outputs[1].mode != MATROXFB_OUTPUT_MODE_MONITOR) { in matroxfb_g450_program()
565 cve2_init_TV(minfo, &minfo->hw.maven); in matroxfb_g450_program()
581 struct matrox_fb_info *minfo = md; in g450_dvi_compute() local
584 …mt->mnp = matroxfb_g450_setclk(minfo, mt->pixclock, (mt->crtc == MATROXFB_SRC_CRTC1) ? M_PIXEL_PLL… in g450_dvi_compute()
585 mt->pixclock = g450_mnp2f(minfo, mt->mnp); in g450_dvi_compute()
605 void matroxfb_g450_connect(struct matrox_fb_info *minfo) in matroxfb_g450_connect() argument
607 if (minfo->devflags.g450dac) { in matroxfb_g450_connect()
608 down_write(&minfo->altout.lock); in matroxfb_g450_connect()
609 tvo_fill_defaults(minfo); in matroxfb_g450_connect()
610 minfo->outputs[1].src = minfo->outputs[1].default_src; in matroxfb_g450_connect()
611 minfo->outputs[1].data = minfo; in matroxfb_g450_connect()
612 minfo->outputs[1].output = &matroxfb_g450_altout; in matroxfb_g450_connect()
613 minfo->outputs[1].mode = MATROXFB_OUTPUT_MODE_MONITOR; in matroxfb_g450_connect()
614 minfo->outputs[2].src = minfo->outputs[2].default_src; in matroxfb_g450_connect()
615 minfo->outputs[2].data = minfo; in matroxfb_g450_connect()
616 minfo->outputs[2].output = &matroxfb_g450_dvi; in matroxfb_g450_connect()
617 minfo->outputs[2].mode = MATROXFB_OUTPUT_MODE_MONITOR; in matroxfb_g450_connect()
618 up_write(&minfo->altout.lock); in matroxfb_g450_connect()
622 void matroxfb_g450_shutdown(struct matrox_fb_info *minfo) in matroxfb_g450_shutdown() argument
624 if (minfo->devflags.g450dac) { in matroxfb_g450_shutdown()
625 down_write(&minfo->altout.lock); in matroxfb_g450_shutdown()
626 minfo->outputs[1].src = MATROXFB_SRC_NONE; in matroxfb_g450_shutdown()
627 minfo->outputs[1].output = NULL; in matroxfb_g450_shutdown()
628 minfo->outputs[1].data = NULL; in matroxfb_g450_shutdown()
629 minfo->outputs[1].mode = MATROXFB_OUTPUT_MODE_MONITOR; in matroxfb_g450_shutdown()
630 minfo->outputs[2].src = MATROXFB_SRC_NONE; in matroxfb_g450_shutdown()
631 minfo->outputs[2].output = NULL; in matroxfb_g450_shutdown()
632 minfo->outputs[2].data = NULL; in matroxfb_g450_shutdown()
633 minfo->outputs[2].mode = MATROXFB_OUTPUT_MODE_MONITOR; in matroxfb_g450_shutdown()
634 up_write(&minfo->altout.lock); in matroxfb_g450_shutdown()