Lines Matching refs:bridge_agpstat
478 static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_agpstat) in agp_v2_parse_one() argument
498 switch (*bridge_agpstat & 7) { in agp_v2_parse_one()
500 *bridge_agpstat |= (AGPSTAT2_2X | AGPSTAT2_1X); in agp_v2_parse_one()
505 *bridge_agpstat |= AGPSTAT2_1X; in agp_v2_parse_one()
536 …if (!((*bridge_agpstat & AGPSTAT_SBA) && (*vga_agpstat & AGPSTAT_SBA) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
537 *bridge_agpstat &= ~AGPSTAT_SBA; in agp_v2_parse_one()
540 …if (!((*bridge_agpstat & AGPSTAT2_4X) && (*vga_agpstat & AGPSTAT2_4X) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
541 *bridge_agpstat &= ~AGPSTAT2_4X; in agp_v2_parse_one()
543 …if (!((*bridge_agpstat & AGPSTAT2_2X) && (*vga_agpstat & AGPSTAT2_2X) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
544 *bridge_agpstat &= ~AGPSTAT2_2X; in agp_v2_parse_one()
546 …if (!((*bridge_agpstat & AGPSTAT2_1X) && (*vga_agpstat & AGPSTAT2_1X) && (*requested_mode & AGPSTA… in agp_v2_parse_one()
547 *bridge_agpstat &= ~AGPSTAT2_1X; in agp_v2_parse_one()
550 if (*bridge_agpstat & AGPSTAT2_4X) in agp_v2_parse_one()
551 *bridge_agpstat &= ~(AGPSTAT2_1X | AGPSTAT2_2X); /* 4X */ in agp_v2_parse_one()
553 if (*bridge_agpstat & AGPSTAT2_2X) in agp_v2_parse_one()
554 *bridge_agpstat &= ~(AGPSTAT2_1X | AGPSTAT2_4X); /* 2X */ in agp_v2_parse_one()
556 if (*bridge_agpstat & AGPSTAT2_1X) in agp_v2_parse_one()
557 *bridge_agpstat &= ~(AGPSTAT2_2X | AGPSTAT2_4X); /* 1X */ in agp_v2_parse_one()
561 *bridge_agpstat &= ~AGPSTAT_FW; in agp_v2_parse_one()
564 *bridge_agpstat &= ~AGPSTAT_SBA; in agp_v2_parse_one()
567 *bridge_agpstat &= ~(AGPSTAT2_2X | AGPSTAT2_4X); in agp_v2_parse_one()
568 *bridge_agpstat |= AGPSTAT2_1X; in agp_v2_parse_one()
572 if (*bridge_agpstat & AGPSTAT2_1X) in agp_v2_parse_one()
573 *bridge_agpstat &= ~AGPSTAT_FW; in agp_v2_parse_one()
581 static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_agpstat) in agp_v3_parse_one() argument
583 u32 origbridge=*bridge_agpstat, origvga=*vga_agpstat; in agp_v3_parse_one()
605 *bridge_agpstat = ((*bridge_agpstat & ~AGPSTAT_ARQSZ) | in agp_v3_parse_one()
606 max_t(u32,(*bridge_agpstat & AGPSTAT_ARQSZ),(*vga_agpstat & AGPSTAT_ARQSZ))); in agp_v3_parse_one()
610 *bridge_agpstat = ((*bridge_agpstat & ~AGPSTAT_CAL_MASK) | in agp_v3_parse_one()
611 min_t(u32,(*bridge_agpstat & AGPSTAT_CAL_MASK),(*vga_agpstat & AGPSTAT_CAL_MASK))); in agp_v3_parse_one()
614 *bridge_agpstat |= AGPSTAT_SBA; in agp_v3_parse_one()
646 if (!(*bridge_agpstat & AGPSTAT3_8X)) { in agp_v3_parse_one()
647 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
648 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
653 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
654 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
659 *bridge_agpstat &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD); in agp_v3_parse_one()
663 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
664 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
674 if ((*bridge_agpstat & AGPSTAT3_8X) && (*vga_agpstat & AGPSTAT3_8X)) { in agp_v3_parse_one()
677 *bridge_agpstat &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD); in agp_v3_parse_one()
681 if (!(*bridge_agpstat & AGPSTAT3_8X)) { in agp_v3_parse_one()
683 *bridge_agpstat, origbridge); in agp_v3_parse_one()
684 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); in agp_v3_parse_one()
685 *bridge_agpstat |= AGPSTAT3_4X; in agp_v3_parse_one()
699 *bridge_agpstat &= ~AGPSTAT_FW; in agp_v3_parse_one()
702 *bridge_agpstat &= ~AGPSTAT_SBA; in agp_v3_parse_one()
705 *bridge_agpstat &= ~(AGPSTAT2_2X | AGPSTAT2_4X); in agp_v3_parse_one()
706 *bridge_agpstat |= AGPSTAT2_1X; in agp_v3_parse_one()
720 …2 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode, u32 bridge_agpstat) in agp_collect_device_status() argument
744 bridge_agpstat = ((bridge_agpstat & ~AGPSTAT_RQ_DEPTH) | in agp_collect_device_status()
746 min_t(u32, (bridge_agpstat & AGPSTAT_RQ_DEPTH), (vga_agpstat & AGPSTAT_RQ_DEPTH)))); in agp_collect_device_status()
749 if (!((bridge_agpstat & AGPSTAT_FW) && in agp_collect_device_status()
752 bridge_agpstat &= ~AGPSTAT_FW; in agp_collect_device_status()
756 agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); in agp_collect_device_status()
758 agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); in agp_collect_device_status()
761 return bridge_agpstat; in agp_collect_device_status()
766 void agp_device_command(u32 bridge_agpstat, bool agp_v3) in agp_device_command() argument
771 mode = bridge_agpstat & 0x7; in agp_device_command()
782 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, bridge_agpstat); in agp_device_command()
805 u32 bridge_agpstat, temp; in agp_generic_enable() local
813 agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat); in agp_generic_enable()
815 bridge_agpstat = agp_collect_device_status(agp_bridge, requested_mode, bridge_agpstat); in agp_generic_enable()
816 if (bridge_agpstat == 0) in agp_generic_enable()
820 bridge_agpstat |= AGPSTAT_AGP_ENABLE; in agp_generic_enable()
828 agp_device_command(bridge_agpstat, true); in agp_generic_enable()
832 bridge_agpstat &= ~(7<<10) ; in agp_generic_enable()
844 agp_device_command(bridge_agpstat, false); in agp_generic_enable()