Fix buffer cleanup on close. Move memory manager reset from final_context

to lastclose.
This commit is contained in:
Thomas Hellstrom 2006-06-19 09:12:50 +00:00
parent 96f272884d
commit 58b63ee5cc
3 changed files with 17 additions and 15 deletions

View file

@ -72,8 +72,10 @@ static struct drm_driver driver = {
.driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR,
.load = sis_driver_load,
.unload = sis_driver_unload,
.context_dtor = sis_final_context,
.context_dtor = NULL,
.reclaim_buffers = NULL,
.reclaim_buffers_locked = sis_reclaim_buffers_locked,
.lastclose = sis_lastclose,
.get_map_ofs = drm_core_get_map_ofs,
.get_reg_ofs = drm_core_get_reg_ofs,
.ioctls = sis_ioctls,

View file

@ -232,19 +232,18 @@ static int sis_ioctl_agp_alloc(DRM_IOCTL_ARGS)
return sis_drm_alloc(dev, priv, data, AGP_TYPE);
}
int sis_final_context(struct drm_device *dev, int context)
void sis_lastclose(struct drm_device *dev)
{
if (dev->ctx_count == 1 && dev->dev_private) {
drm_sis_private_t *dev_priv = dev->dev_private;
drm_sis_private_t *dev_priv = dev->dev_private;
DRM_DEBUG("Last Context\n");
down(&dev->struct_sem);
drm_sman_cleanup(&dev_priv->sman);
dev_priv->vram_initialized = FALSE;
dev_priv->agp_initialized = FALSE;
up(&dev->struct_sem);
}
return 1;
if (!dev_priv)
return;
down(&dev->struct_sem);
drm_sman_cleanup(&dev_priv->sman);
dev_priv->vram_initialized = FALSE;
dev_priv->agp_initialized = FALSE;
up(&dev->struct_sem);
}
void sis_reclaim_buffers_locked(drm_device_t * dev, struct file *filp)

View file

@ -34,10 +34,10 @@
#define DRIVER_AUTHOR "SIS"
#define DRIVER_NAME "sis"
#define DRIVER_DESC "SIS 300/630/540"
#define DRIVER_DATE "20060529"
#define DRIVER_DATE "20060619"
#define DRIVER_MAJOR 1
#define DRIVER_MINOR 2
#define DRIVER_PATCHLEVEL 0
#define DRIVER_PATCHLEVEL 1
#if defined(__linux__)
#define SIS_HAVE_CORE_MM
@ -58,6 +58,7 @@ typedef struct drm_sis_private {
} drm_sis_private_t;
extern void sis_reclaim_buffers_locked(drm_device_t *dev, struct file *filp);
extern void sis_lastclose(drm_device_t *dev);
#else
#include "sis_ds.h"
@ -68,11 +69,11 @@ typedef struct drm_sis_private {
} drm_sis_private_t;
extern int sis_init_context(drm_device_t * dev, int context);
extern int sis_final_context(drm_device_t * dev, int context);
#endif
extern int sis_final_context(drm_device_t * dev, int context);
extern drm_ioctl_desc_t sis_ioctls[];
extern int sis_max_ioctl;