bool nv_lockvgac(void *obj, bool lock) { bool locked = !nv_rdvgac(obj, 0, 0x1f); u8 data = lock ? 0x99 : 0x57; nv_wrvgac(obj, 0, 0x1f, data); if (nv_device(obj)->chipset == 0x11) { if (!(nv_rd32(obj, 0x001084) & 0x10000000)) nv_wrvgac(obj, 1, 0x1f, data); } return locked; }
void nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value) { if (port == 0x03c4) nv_wrvgas(obj, head, index, value); else if (port == 0x03ce) nv_wrvgag(obj, head, index, value); else if (port == 0x03d4) nv_wrvgac(obj, head, index, value); else nv_error(obj, "unknown indexed vga port 0x%04x\n", port); }
bool nv_lockvgac(void *obj, bool lock) { struct nouveau_device *dev = nv_device(obj); bool locked = !nv_rdvgac(obj, 0, 0x1f); u8 data = lock ? 0x99 : 0x57; if (dev->card_type < NV_50) nv_wrvgac(obj, 0, 0x1f, data); else nv_wrvgac(obj, 0, 0x3f, data); if (dev->chipset == 0x11) { if (!(nv_rd32(obj, 0x001084) & 0x10000000)) nv_wrvgac(obj, 1, 0x1f, data); } return locked; }
void nv_wrvgaowner(void *obj, u8 select) { if (nv_device(obj)->card_type < NV_50) { u8 owner = (select == 1) ? 3 : select; if (nv_device(obj)->chipset == 0x11) { /* workaround hw lockup bug */ nv_rdvgac(obj, 0, 0x1f); nv_rdvgac(obj, 1, 0x1f); } nv_wrvgac(obj, 0, 0x44, owner); if (nv_device(obj)->chipset == 0x11) { nv_wrvgac(obj, 0, 0x2e, owner); nv_wrvgac(obj, 0, 0x2e, owner); } } else nv_error(obj, "wrvgaowner after nv4x\n"); }