-/* $OpenBSD: agp.c,v 1.23 2008/07/07 07:54:48 bernd Exp $ */
+/* $OpenBSD: agp.c,v 1.24 2008/07/12 17:31:06 oga Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
* All rights reserved.
sc->sc_pc = pa->pa_pc;
sc->sc_id = pa->pa_id;
sc->sc_dmat = pa->pa_dmat;
+ sc->sc_memt = pa->pa_memt;
+ sc->sc_vgapcitag = aaa->apa_vga_args.pa_tag;
+ sc->sc_vgapc = aaa->apa_vga_args.pa_pc;
pci_get_capability(sc->sc_pc, sc->sc_pcitag, PCI_CAP_AGP,
&sc->sc_capoff, NULL);
pcireg_t command;
int rq, sba, fw, rate, capoff;
- if (pci_get_capability(sc->sc_pc, sc->sc_pcitag, PCI_CAP_AGP,
+ if (pci_get_capability(sc->sc_vgapc, sc->sc_vgapcitag, PCI_CAP_AGP,
&capoff, NULL) == 0) {
printf("agp_generic_enable: not an AGP capable device\n");
return (-1);
tstatus = pci_conf_read(sc->sc_pc, sc->sc_pcitag,
sc->sc_capoff + AGP_STATUS);
- mstatus = pci_conf_read(sc->sc_pc, sc->sc_pcitag,
+ /* display agp mode */
+ mstatus = pci_conf_read(sc->sc_vgapc, sc->sc_vgapcitag,
capoff + AGP_STATUS);
/* Set RQ to the min of mode, tstatus and mstatus */
command = AGP_MODE_SET_FW(command, fw);
command = AGP_MODE_SET_RATE(command, rate);
command = AGP_MODE_SET_AGP(command, 1);
+
pci_conf_write(sc->sc_pc, sc->sc_pcitag,
sc->sc_capoff + AGP_COMMAND, command);
- pci_conf_write(sc->sc_pc, sc->sc_pcitag, capoff + AGP_COMMAND, command);
+ pci_conf_write(sc->sc_vgapc, sc->sc_vgapcitag, capoff + AGP_COMMAND,
+ command);
return (0);
}
-/* $OpenBSD: agp_i810.c,v 1.39 2008/07/07 07:54:48 bernd Exp $ */
+/* $OpenBSD: agp_i810.c,v 1.40 2008/07/12 17:31:06 oga Exp $ */
/* $NetBSD: agp_i810.c,v 1.15 2003/01/31 00:07:39 thorpej Exp $ */
/*-
/* XXXfvdl */
sc->sc_dmat = isc->vga_pa.pa_dmat;
+ sc->sc_memt = isc->vga_pa.pa_memt;
switch (PCI_PRODUCT(isc->vga_pa.pa_id)) {
case PCI_PRODUCT_INTEL_82810_IGD:
-/* $OpenBSD: agpvar.h,v 1.13 2008/05/06 19:19:02 oga Exp $ */
+/* $OpenBSD: agpvar.h,v 1.14 2008/07/12 17:31:06 oga Exp $ */
/* $NetBSD: agpvar.h,v 1.4 2001/10/01 21:54:48 fvdl Exp $ */
/*-
struct agpbus_attach_args {
struct pci_attach_args apa_pci_args;
+ struct pci_attach_args apa_vga_args;
};
enum agp_acquire_state {
pcireg_t sc_id;
pci_chipset_tag_t sc_pc;
+ pci_chipset_tag_t sc_vgapc;
+ pcitag_t sc_vgapcitag;
+
struct agp_methods *sc_methods;
void *sc_chipc; /* chipset-dependent state */
-/* $OpenBSD: vga_pci.c,v 1.33 2008/06/12 00:58:47 oga Exp $ */
+/* $OpenBSD: vga_pci.c,v 1.34 2008/07/12 17:31:06 oga Exp $ */
/* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */
/*
*/
if (agp_pchb_pa_set) {
aba.apa_pci_args = agp_pchb_pa;
+ memcpy(&aba.apa_vga_args, pa, sizeof(struct pci_attach_args));
config_found_sm(self, &aba, agpbus_print, agpsubmatch);
}