summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-11-27 14:12:21 +0000
committerru <ru@FreeBSD.org>2001-11-27 14:12:21 +0000
commitd146c782790dc942f430f0e71169abc97a2e6efc (patch)
tree76de5defc3f0588e762d5ef00026ad2b1dd89451 /sys
parent8ee8d7c8d6970b575b23f82aaaf20971b506627a (diff)
downloadFreeBSD-src-d146c782790dc942f430f0e71169abc97a2e6efc.zip
FreeBSD-src-d146c782790dc942f430f0e71169abc97a2e6efc.tar.gz
Don't automatically unbind/deallocate memory when releasing.
This fixes the VT switching problem with the i810 X driver. Explained by: David Dawes <dawes@XFree86.Org> Reviewed by: dfr
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/agp/agp.c16
-rw-r--r--sys/pci/agp.c16
2 files changed, 12 insertions, 20 deletions
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c
index 138fe45..a938055 100644
--- a/sys/dev/agp/agp.c
+++ b/sys/dev/agp/agp.c
@@ -531,7 +531,6 @@ static int
agp_release_helper(device_t dev, enum agp_acquire_state state)
{
struct agp_softc *sc = device_get_softc(dev);
- struct agp_memory *mem;
if (sc->as_state == AGP_ACQUIRE_FREE)
return 0;
@@ -539,15 +538,6 @@ agp_release_helper(device_t dev, enum agp_acquire_state state)
if (sc->as_state != state)
return EBUSY;
- /*
- * Clear out the aperture and free any outstanding memory blocks.
- */
- while ((mem = TAILQ_FIRST(&sc->as_memory)) != 0) {
- if (mem->am_is_bound)
- AGP_UNBIND_MEMORY(dev, mem);
- AGP_FREE_MEMORY(dev, mem);
- }
-
sc->as_state = AGP_ACQUIRE_FREE;
return 0;
}
@@ -663,10 +653,16 @@ agp_close(dev_t kdev, int fflag, int devtype, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
+ struct agp_memory *mem;
/*
* Clear the GATT and force release on last close
*/
+ while ((mem = TAILQ_FIRST(&sc->as_memory)) != 0) {
+ if (mem->am_is_bound)
+ AGP_UNBIND_MEMORY(dev, mem);
+ AGP_FREE_MEMORY(dev, mem);
+ }
if (sc->as_state == AGP_ACQUIRE_USER)
agp_release_helper(dev, AGP_ACQUIRE_USER);
sc->as_isopen = 0;
diff --git a/sys/pci/agp.c b/sys/pci/agp.c
index 138fe45..a938055 100644
--- a/sys/pci/agp.c
+++ b/sys/pci/agp.c
@@ -531,7 +531,6 @@ static int
agp_release_helper(device_t dev, enum agp_acquire_state state)
{
struct agp_softc *sc = device_get_softc(dev);
- struct agp_memory *mem;
if (sc->as_state == AGP_ACQUIRE_FREE)
return 0;
@@ -539,15 +538,6 @@ agp_release_helper(device_t dev, enum agp_acquire_state state)
if (sc->as_state != state)
return EBUSY;
- /*
- * Clear out the aperture and free any outstanding memory blocks.
- */
- while ((mem = TAILQ_FIRST(&sc->as_memory)) != 0) {
- if (mem->am_is_bound)
- AGP_UNBIND_MEMORY(dev, mem);
- AGP_FREE_MEMORY(dev, mem);
- }
-
sc->as_state = AGP_ACQUIRE_FREE;
return 0;
}
@@ -663,10 +653,16 @@ agp_close(dev_t kdev, int fflag, int devtype, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
+ struct agp_memory *mem;
/*
* Clear the GATT and force release on last close
*/
+ while ((mem = TAILQ_FIRST(&sc->as_memory)) != 0) {
+ if (mem->am_is_bound)
+ AGP_UNBIND_MEMORY(dev, mem);
+ AGP_FREE_MEMORY(dev, mem);
+ }
if (sc->as_state == AGP_ACQUIRE_USER)
agp_release_helper(dev, AGP_ACQUIRE_USER);
sc->as_isopen = 0;
OpenPOWER on IntegriCloud