Lines Matching full:pci
38 /* SiS 761 does not support AGP cards, use PCI mode */
44 nvkm_agp_fini(struct nvkm_pci *pci) in nvkm_agp_fini() argument
46 if (pci->agp.acquired) { in nvkm_agp_fini()
47 agp_backend_release(pci->agp.bridge); in nvkm_agp_fini()
48 pci->agp.acquired = false; in nvkm_agp_fini()
56 nvkm_agp_preinit(struct nvkm_pci *pci) in nvkm_agp_preinit() argument
58 struct nvkm_device *device = pci->subdev.device; in nvkm_agp_preinit()
59 u32 mode = nvkm_pci_rd32(pci, 0x004c); in nvkm_agp_preinit()
66 if ((mode | pci->agp.mode) & PCI_AGP_COMMAND_FW) { in nvkm_agp_preinit()
67 mode = pci->agp.mode & ~PCI_AGP_COMMAND_FW; in nvkm_agp_preinit()
68 agp_enable(pci->agp.bridge, mode); in nvkm_agp_preinit()
72 save[0] = nvkm_pci_rd32(pci, 0x0004); in nvkm_agp_preinit()
73 nvkm_pci_wr32(pci, 0x0004, save[0] & ~0x00000004); in nvkm_agp_preinit()
74 nvkm_pci_wr32(pci, 0x004c, 0x00000000); in nvkm_agp_preinit()
81 nvkm_pci_wr32(pci, 0x0004, save[0]); in nvkm_agp_preinit()
85 nvkm_agp_init(struct nvkm_pci *pci) in nvkm_agp_init() argument
87 if (!agp_backend_acquire(pci->pdev)) { in nvkm_agp_init()
88 nvkm_error(&pci->subdev, "failed to acquire agp\n"); in nvkm_agp_init()
92 agp_enable(pci->agp.bridge, pci->agp.mode); in nvkm_agp_init()
93 pci->agp.acquired = true; in nvkm_agp_init()
98 nvkm_agp_dtor(struct nvkm_pci *pci) in nvkm_agp_dtor() argument
100 arch_phys_wc_del(pci->agp.mtrr); in nvkm_agp_dtor()
104 nvkm_agp_ctor(struct nvkm_pci *pci) in nvkm_agp_ctor() argument
107 struct nvkm_subdev *subdev = &pci->subdev; in nvkm_agp_ctor()
125 if (!(pci->agp.bridge = agp_backend_acquire(pci->pdev))) { in nvkm_agp_ctor()
129 agp_copy_info(pci->agp.bridge, &info); in nvkm_agp_ctor()
130 agp_backend_release(pci->agp.bridge); in nvkm_agp_ctor()
132 pci->agp.mode = info.mode; in nvkm_agp_ctor()
133 pci->agp.base = info.aper_base; in nvkm_agp_ctor()
134 pci->agp.size = info.aper_size * 1024 * 1024; in nvkm_agp_ctor()
135 pci->agp.cma = info.cant_use_aperture; in nvkm_agp_ctor()
136 pci->agp.mtrr = -1; in nvkm_agp_ctor()
143 pci->pdev->vendor == quirk->chip_vendor) && in nvkm_agp_ctor()
145 pci->pdev->device == quirk->chip_device)) { in nvkm_agp_ctor()
157 if (pci->agp.mode & 0x00000008) in nvkm_agp_ctor()
159 pci->agp.mode &= ~0x00000007; in nvkm_agp_ctor()
160 pci->agp.mode |= (mode & 0x7); in nvkm_agp_ctor()
163 pci->agp.bridge = NULL; in nvkm_agp_ctor()
171 pci->agp.mode &= ~PCI_AGP_COMMAND_FW; in nvkm_agp_ctor()
173 pci->agp.mtrr = arch_phys_wc_add(pci->agp.base, pci->agp.size); in nvkm_agp_ctor()