Lines Matching refs:bridge_agpstat
479 static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_agpstat) in agp_v2_parse_one() argument
499 switch (*bridge_agpstat & 7) { in agp_v2_parse_one()
501 *bridge_agpstat |= (AGPSTAT2_2X | AGPSTAT2_1X); in agp_v2_parse_one()
506 *bridge_agpstat |= AGPSTAT2_1X; in agp_v2_parse_one()
537 …if (!((*bridge_agpstat & AGPSTAT_SBA) && (*vga_agpstat & AGPSTAT_SBA) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
538 *bridge_agpstat &= ~AGPSTAT_SBA; in agp_v2_parse_one()
541 …if (!((*bridge_agpstat & AGPSTAT2_4X) && (*vga_agpstat & AGPSTAT2_4X) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
542 *bridge_agpstat &= ~AGPSTAT2_4X; in agp_v2_parse_one()
544 …if (!((*bridge_agpstat & AGPSTAT2_2X) && (*vga_agpstat & AGPSTAT2_2X) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
545 *bridge_agpstat &= ~AGPSTAT2_2X; in agp_v2_parse_one()
547 …if (!((*bridge_agpstat & AGPSTAT2_1X) && (*vga_agpstat & AGPSTAT2_1X) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
548 *bridge_agpstat &= ~AGPSTAT2_1X; in agp_v2_parse_one()
551 if (*bridge_agpstat & AGPSTAT2_4X) in agp_v2_parse_one()
552 *bridge_agpstat &= ~(AGPSTAT2_1X | AGPSTAT2_2X); /* 4X */ in agp_v2_parse_one()
554 if (*bridge_agpstat & AGPSTAT2_2X) in agp_v2_parse_one()
555 *bridge_agpstat &= ~(AGPSTAT2_1X | AGPSTAT2_4X); /* 2X */ in agp_v2_parse_one()
557 if (*bridge_agpstat & AGPSTAT2_1X) in agp_v2_parse_one()
558 *bridge_agpstat &= ~(AGPSTAT2_2X | AGPSTAT2_4X); /* 1X */ in agp_v2_parse_one()
562 *bridge_agpstat &= ~AGPSTAT_FW; in agp_v2_parse_one()
565 *bridge_agpstat &= ~AGPSTAT_SBA; in agp_v2_parse_one()
568 *bridge_agpstat &= ~(AGPSTAT2_2X | AGPSTAT2_4X); in agp_v2_parse_one()
569 *bridge_agpstat |= AGPSTAT2_1X; in agp_v2_parse_one()
573 if (*bridge_agpstat & AGPSTAT2_1X) in agp_v2_parse_one()
574 *bridge_agpstat &= ~AGPSTAT_FW; in agp_v2_parse_one()
582 static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_agpstat) in agp_v3_parse_one() argument
584 u32 origbridge=*bridge_agpstat, origvga=*vga_agpstat; in agp_v3_parse_one()
606 *bridge_agpstat = ((*bridge_agpstat & ~AGPSTAT_ARQSZ) | in agp_v3_parse_one()
607 max_t(u32,(*bridge_agpstat & AGPSTAT_ARQSZ),(*vga_agpstat & AGPSTAT_ARQSZ))); in agp_v3_parse_one()
611 *bridge_agpstat = ((*bridge_agpstat & ~AGPSTAT_CAL_MASK) | in agp_v3_parse_one()
612 min_t(u32,(*bridge_agpstat & AGPSTAT_CAL_MASK),(*vga_agpstat & AGPSTAT_CAL_MASK))); in agp_v3_parse_one()
615 *bridge_agpstat |= AGPSTAT_SBA; in agp_v3_parse_one()
647 if (!(*bridge_agpstat & AGPSTAT3_8X)) { in agp_v3_parse_one()
648 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
649 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
654 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
655 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
660 *bridge_agpstat &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD); in agp_v3_parse_one()
664 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
665 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
675 if ((*bridge_agpstat & AGPSTAT3_8X) && (*vga_agpstat & AGPSTAT3_8X)) { in agp_v3_parse_one()
678 *bridge_agpstat &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD); in agp_v3_parse_one()
682 if (!(*bridge_agpstat & AGPSTAT3_8X)) { in agp_v3_parse_one()
684 *bridge_agpstat, origbridge); in agp_v3_parse_one()
685 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
686 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
700 *bridge_agpstat &= ~AGPSTAT_FW; in agp_v3_parse_one()
703 *bridge_agpstat &= ~AGPSTAT_SBA; in agp_v3_parse_one()
706 *bridge_agpstat &= ~(AGPSTAT2_2X | AGPSTAT2_4X); in agp_v3_parse_one()
707 *bridge_agpstat |= AGPSTAT2_1X; in agp_v3_parse_one()
721 …2 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode, u32 bridge_agpstat) in agp_collect_device_status() argument
745 bridge_agpstat = ((bridge_agpstat & ~AGPSTAT_RQ_DEPTH) | in agp_collect_device_status()
747 min_t(u32, (bridge_agpstat & AGPSTAT_RQ_DEPTH), (vga_agpstat & AGPSTAT_RQ_DEPTH)))); in agp_collect_device_status()
750 if (!((bridge_agpstat & AGPSTAT_FW) && in agp_collect_device_status()
753 bridge_agpstat &= ~AGPSTAT_FW; in agp_collect_device_status()
757 agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); in agp_collect_device_status()
759 agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); in agp_collect_device_status()
762 return bridge_agpstat; in agp_collect_device_status()
767 void agp_device_command(u32 bridge_agpstat, bool agp_v3) in agp_device_command() argument
772 mode = bridge_agpstat & 0x7; in agp_device_command()
783 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, bridge_agpstat); in agp_device_command()
806 u32 bridge_agpstat, temp; in agp_generic_enable() local
814 agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat); in agp_generic_enable()
816 bridge_agpstat = agp_collect_device_status(agp_bridge, requested_mode, bridge_agpstat); in agp_generic_enable()
817 if (bridge_agpstat == 0) in agp_generic_enable()
821 bridge_agpstat |= AGPSTAT_AGP_ENABLE; in agp_generic_enable()
829 agp_device_command(bridge_agpstat, true); in agp_generic_enable()
833 bridge_agpstat &= ~(7<<10) ; in agp_generic_enable()
845 agp_device_command(bridge_agpstat, false); in agp_generic_enable()