int rbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop, int16_t planemask) { volatile struct rboxfb *rb = (struct rboxfb *)fb->regkva; if (planemask != 0xff) return (EINVAL); rb_waitbusy(rb); rb->rep_rule = RBOX_DUALROP(rop); rb->source_y = sy; rb->source_x = sx; rb->dest_y = dy; rb->dest_x = dx; rb->wheight = cy; rb->wwidth = cx; rb->wmove = 1; rb_waitbusy(rb); return (0); }
void rbox_windowmove(struct ite_data *ip, int sy, int sx, int dy, int dx, int h, int w, int func) { struct rboxfb *rp = REGBASE; if (h == 0 || w == 0) return; rb_waitbusy(ip->regbase); rp->rep_rule = func << 4 | func; rp->source_y = sy; rp->source_x = sx; rp->dest_y = dy; rp->dest_x = dx; rp->wheight = h; rp->wwidth = w; rp->wmove = 1; }
void rbox_restore(struct diofb *fb) { volatile struct rboxfb *rb = (struct rboxfb *)fb->regkva; u_int i; rb_waitbusy(rb); rb->regs.id = GRFHWID; /* trigger reset */ DELAY(1000); rb->regs.interrupt = 0x04; rb->video_enable = 0x01; rb->drive = 0x01; rb->vdrive = 0x0; rb->opwen = 0xFF; /* * Clear color map */ rb_waitbusy(fb->regkva); for (i = 0; i < 16; i++) { *(fb->regkva + 0x63c3 + i*4) = 0x0; *(fb->regkva + 0x6403 + i*4) = 0x0; *(fb->regkva + 0x6803 + i*4) = 0x0; *(fb->regkva + 0x6c03 + i*4) = 0x0; *(fb->regkva + 0x73c3 + i*4) = 0x0; *(fb->regkva + 0x7403 + i*4) = 0x0; *(fb->regkva + 0x7803 + i*4) = 0x0; *(fb->regkva + 0x7c03 + i*4) = 0x0; } rb->rep_rule = RBOX_DUALROP(RR_COPY); /* * I cannot figure out how to make the blink planes stop. So, we * must set both colormaps so that when the planes blink, and * the secondary colormap is active, we still get text. */ CM1RED(fb)[0x00].value = 0x00; CM1GRN(fb)[0x00].value = 0x00; CM1BLU(fb)[0x00].value = 0x00; CM1RED(fb)[0x01].value = 0xFF; CM1GRN(fb)[0x01].value = 0xFF; CM1BLU(fb)[0x01].value = 0xFF; CM2RED(fb)[0x00].value = 0x00; CM2GRN(fb)[0x00].value = 0x00; CM2BLU(fb)[0x00].value = 0x00; CM2RED(fb)[0x01].value = 0xFF; CM2GRN(fb)[0x01].value = 0xFF; CM2BLU(fb)[0x01].value = 0xFF; rb->blink = 0x00; rb->write_enable = 0x01; rb->opwen = 0x00; /* enable display */ rb->display_enable = 0x01; }
void rbox_init(struct ite_data *ip) { struct rboxfb *regbase = (void *)ip->regbase; int i; ip->bmv = rbox_windowmove; rb_waitbusy(regbase); DELAY(3000); regbase->interrupt = 0x04; regbase->display_enable = 0x01; regbase->video_enable = 0x01; regbase->drive = 0x01; regbase->vdrive = 0x0; ite_fontinfo(ip); regbase->opwen = 0xFF; /* * Clear the framebuffer. */ rbox_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR); rb_waitbusy(regbase); for(i = 0; i < 16; i++) { *((char *)ip->regbase + 0x63c3 + i * 4) = 0x0; *((char *)ip->regbase + 0x6403 + i * 4) = 0x0; *((char *)ip->regbase + 0x6803 + i * 4) = 0x0; *((char *)ip->regbase + 0x6c03 + i * 4) = 0x0; *((char *)ip->regbase + 0x73c3 + i * 4) = 0x0; *((char *)ip->regbase + 0x7403 + i * 4) = 0x0; *((char *)ip->regbase + 0x7803 + i * 4) = 0x0; *((char *)ip->regbase + 0x7c03 + i * 4) = 0x0; } regbase->rep_rule = 0x33; /* * I cannot figure out how to make the blink planes stop. So, we * must set both colormaps so that when the planes blink, and * the secondary colormap is active, we still get text. */ CM1RED[0x00].value = 0x00; CM1GRN[0x00].value = 0x00; CM1BLU[0x00].value = 0x00; CM1RED[0x01].value = 0xFF; CM1GRN[0x01].value = 0xFF; CM1BLU[0x01].value = 0xFF; CM2RED[0x00].value = 0x00; CM2GRN[0x00].value = 0x00; CM2BLU[0x00].value = 0x00; CM2RED[0x01].value = 0xFF; CM2GRN[0x01].value = 0xFF; CM2BLU[0x01].value = 0xFF; regbase->blink = 0x00; regbase->write_enable = 0x01; regbase->opwen = 0x00; ite_fontinit8bpp(ip); /* * Stash the inverted cursor. */ rbox_windowmove(ip, charY(ip, ' '), charX(ip, ' '), ip->cblanky, ip->cblankx, ip->ftheight, ip->ftwidth, RR_COPYINVERTED); }