From ca1a77683d523dc1d2268531b19ea23b3e1ae4f0 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Thu, 15 Jun 2006 18:37:05 +0000 Subject: via: -Remove out of memory error message. -Move sman cleanup from final_context to lastclose. -Add the P4VM800PRO (?) PCI ID. --- linux-core/via_mm.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'linux-core') diff --git a/linux-core/via_mm.c b/linux-core/via_mm.c index 2881a1d1..7d520ea2 100644 --- a/linux-core/via_mm.c +++ b/linux-core/via_mm.c @@ -104,18 +104,26 @@ int via_final_context(struct drm_device *dev, int context) drm_irq_uninstall(dev); via_cleanup_futex(dev_priv); via_do_cleanup_map(dev); - - down(&dev->struct_sem); - drm_sman_cleanup(&dev_priv->sman); - dev_priv->vram_initialized = FALSE; - dev_priv->agp_initialized = FALSE; - up(&dev->struct_sem); } #endif - return 1; } +void via_lastclose(struct drm_device *dev) +{ + drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private; + + 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); +} + + int via_mem_alloc(DRM_IOCTL_ARGS) { DRM_DEVICE; @@ -156,7 +164,7 @@ int via_mem_alloc(DRM_IOCTL_ARGS) mem.offset = 0; mem.size = 0; mem.index = 0; - DRM_ERROR("Video memory allocation failed\n"); + DRM_DEBUG("Video memory allocation failed\n"); retval = DRM_ERR(ENOMEM); } DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem, sizeof(mem)); @@ -182,6 +190,9 @@ int via_mem_free(DRM_IOCTL_ARGS) return ret; } + + + void via_reclaim_buffers_locked(drm_device_t * dev, struct file *filp) { drm_via_private_t *dev_priv = dev->dev_private; -- cgit v1.2.3