1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

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
This commit is contained in:
Ruslan Ermilov 2001-11-27 14:12:21 +00:00
parent c79ae091de
commit 3e0cee70d7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86976
2 changed files with 12 additions and 20 deletions

View File

@ -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;

View File

@ -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;