diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2008-06-25 15:16:38 +0200 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2008-06-25 15:16:38 +0200 |
commit | 09b67dda0bc040860aedce4a2d28bce1c80e56d6 (patch) | |
tree | 2fd8e0c292fa511c8be55b94e9963b6835789171 /shared-core | |
parent | be7276281694145e7c947b91a1c8e6e347de666c (diff) |
NV50: Some cleanup and fixes.
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/nouveau_mem.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/shared-core/nouveau_mem.c b/shared-core/nouveau_mem.c index 51ac48dd0..4acd6bd68 100644 --- a/shared-core/nouveau_mem.c +++ b/shared-core/nouveau_mem.c @@ -34,6 +34,8 @@ #include "drm.h" #include "drm_sarea.h" #include "nouveau_drv.h" +#include "nv50_kms_wrapper.h" + static struct mem_block * split_block(struct mem_block *p, uint64_t start, uint64_t size, @@ -730,6 +732,33 @@ void nouveau_mem_free(struct drm_device* dev, struct mem_block* block) DRM_DEBUG("freeing 0x%llx type=0x%08x\n", block->start, block->flags); + /* Check if the deallocations cause problems for our modesetting system. */ + if (drm_core_check_feature(dev, DRIVER_MODESET)) { + if (dev_priv->card_type >= NV_50) { + struct nv50_crtc *crtc = NULL; + struct nv50_display *display = nv50_get_display(dev); + + list_for_each_entry(crtc, &display->crtcs, head) { + if (crtc->fb->block == block) { + crtc->fb->block = NULL; + + /* this will force a lut change next time a fb is loaded */ + crtc->lut->depth = 0; + + if (!crtc->blanked) + crtc->blank(crtc, TRUE); + } + + if (crtc->cursor->block == block) { + crtc->cursor->block = NULL; + + if (crtc->cursor->visible) + crtc->cursor->hide(crtc); + } + } + } + } + if (block->flags&NOUVEAU_MEM_MAPPED) drm_rmmap(dev, block->map); |