FreeBSD Bugzilla – Attachment 45360 Details for
Bug 69953
[agp] VIA agp: System reboots on startx with DRI enabled (xorg, radeon)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
via-8377-fix.diff
via-8377-fix.diff (text/x-patch), 2.79 KB, created by
Eric Anholt
on 2004-08-05 18:47:18 UTC
(
hide
)
Description:
via-8377-fix.diff
Filename:
MIME Type:
Creator:
Eric Anholt
Created:
2004-08-05 18:47:18 UTC
Size:
2.79 KB
patch
obsolete
>Index: agp_via.c >=================================================================== >RCS file: /home/ncvs/src/sys/pci/agp_via.c,v >retrieving revision 1.16 >diff -u -r1.16 agp_via.c >--- agp_via.c 2 Jul 2004 03:39:33 -0000 1.16 >+++ agp_via.c 5 Aug 2004 17:44:21 -0000 >@@ -122,11 +122,21 @@ > struct agp_via_softc *sc = device_get_softc(dev); > struct agp_gatt *gatt; > int error; >+ u_int32_t agpsel; > > switch (pci_get_devid(dev)) { > case 0x31881106: > case 0x31891106: >- sc->regs = via_v3_regs; >+ /* The newer VIA chipsets will select the AGP version based on >+ * what AGP versions the card supports. We still have to >+ * program it using the v2 registers if it has chosen to use >+ * compatibility mode. >+ */ >+ agpsel = pci_read_config(dev, AGP_VIA_AGPSEL, 1); >+ if ((agpsel & (1 << 1)) == 0) >+ sc->regs = via_v3_regs; >+ else >+ sc->regs = via_v2_regs; > break; > default: > sc->regs = via_v2_regs; >@@ -155,11 +165,22 @@ > } > sc->gatt = gatt; > >- /* Install the gatt. */ >- pci_write_config(dev, sc->regs[REG_ATTBASE], gatt->ag_physical | 3, 4); >- >- /* Enable the aperture. */ >- pci_write_config(dev, sc->regs[REG_GARTCTRL], 0x0f, 4); >+ if (sc->regs == via_v2_regs) { >+ /* Install the gatt. */ >+ pci_write_config(dev, sc->regs[REG_ATTBASE], gatt->ag_physical | 3, 4); >+ >+ /* Enable the aperture. */ >+ pci_write_config(dev, sc->regs[REG_GARTCTRL], 0x0f, 4); >+ } else { >+ u_int32_t gartctrl; >+ >+ /* Install the gatt. */ >+ pci_write_config(dev, sc->regs[REG_ATTBASE], gatt->ag_physical, 4); >+ >+ /* Enable the aperture. */ >+ gartctrl = pci_read_config(dev, sc->regs[REG_ATTBASE], 4); >+ pci_write_config(dev, sc->regs[REG_GARTCTRL], gartctrl | (3 << 7), 4); >+ } > > return 0; > } >@@ -250,9 +271,18 @@ > agp_via_flush_tlb(device_t dev) > { > struct agp_via_softc *sc = device_get_softc(dev); >+ u_int32_t gartctrl; > >- pci_write_config(dev, sc->regs[REG_GARTCTRL], 0x8f, 4); >- pci_write_config(dev, sc->regs[REG_GARTCTRL], 0x0f, 4); >+ if (sc->regs == via_v2_regs) { >+ pci_write_config(dev, sc->regs[REG_GARTCTRL], 0x8f, 4); >+ pci_write_config(dev, sc->regs[REG_GARTCTRL], 0x0f, 4); >+ } else { >+ gartctrl = pci_read_config(dev, sc->regs[REG_GARTCTRL], 4); >+ pci_write_config(dev, sc->regs[REG_GARTCTRL], gartctrl & >+ ~(1 << 7), 4); >+ pci_write_config(dev, sc->regs[REG_GARTCTRL], gartctrl, 4); >+ } >+ > } > > static device_method_t agp_via_methods[] = { >Index: agpreg.h >=================================================================== >RCS file: /home/ncvs/src/sys/pci/agpreg.h,v >retrieving revision 1.11 >diff -u -r1.11 agpreg.h >--- agpreg.h 13 May 2004 20:05:42 -0000 1.11 >+++ agpreg.h 5 Aug 2004 17:31:36 -0000 >@@ -99,6 +99,7 @@ > #define AGP3_VIA_GARTCTRL 0x90 > #define AGP3_VIA_APSIZE 0x94 > #define AGP3_VIA_ATTBASE 0x98 >+#define AGP_VIA_AGPSEL 0xfd > > /* > * Config offsets for SiS AGP chipsets.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 69953
: 45360 |
45361