alistair23-linux/drivers/gpu/drm/ttm
Ben Skeggs 9f1feed2e1 drm/ttm: fix two regressions since move_notify changes
Both changes in dc97b3409a cause serious
regressions in the nouveau driver.

move_notify() was originally able to presume that bo->mem is the old node,
and new_mem is the new node.  The above commit moves the call to
move_notify() to after move() has been done, which means that now, sometimes,
new_mem isn't the new node at all, bo->mem is, and new_mem points at a
stale, possibly-just-been-killed-by-move node.

This is clearly not a good situation.  This patch reverts this change, and
replaces it with a cleanup in the move() failure path instead.

The second issue is that the call to move_notify() from cleanup_memtype_use()
causes the TTM ghost objects to get passed into the driver.  This is clearly
bad as the driver knows nothing about these "fake" TTM BOs, and ends up
accessing uninitialised memory.

I worked around this in nouveau's move_notify() hook by ensuring the BO
destructor was nouveau's.  I don't particularly like this solution, and
would rather TTM never pass the driver these objects.  However, I don't
clearly understand the reason why we're calling move_notify() here anyway
and am happy to work around the problem in nouveau instead of breaking the
behaviour expected by other drivers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Jerome Glisse <j.glisse@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-25 18:54:28 +00:00
..
Makefile drm/ttm: provide dma aware ttm page pool code V9 2011-12-06 10:39:33 +00:00
ttm_agp_backend.c ttm: fix agp since ttm tt rework 2012-01-06 09:34:03 +00:00
ttm_bo.c drm/ttm: fix two regressions since move_notify changes 2012-01-25 18:54:28 +00:00
ttm_bo_manager.c drm/ttm: Use private locks for the default bo range manager 2010-11-09 13:33:24 +10:00
ttm_bo_util.c drm/ttm: simplify memory accounting for ttm user v2 2011-12-06 10:40:11 +00:00
ttm_bo_vm.c drm/ttm: introduce callback for ttm_tt populate & unpopulate V4 2011-12-06 10:39:24 +00:00
ttm_execbuf_util.c Revert "drm/ttm: add a way to bo_wait for either the last read or last write" 2011-10-27 18:28:37 +02:00
ttm_lock.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ttm_memory.c drm/ttm: provide dma aware ttm page pool code V9 2011-12-06 10:39:33 +00:00
ttm_module.c drm: move ttm global code to core drm 2010-08-04 09:46:06 +10:00
ttm_object.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ttm_page_alloc.c drm/ttm: isolate dma data from ttm_tt V4 2011-12-06 10:40:02 +00:00
ttm_page_alloc_dma.c ttm/dma: Remove the WARN() which is not useful. 2012-01-13 08:59:47 +00:00
ttm_tt.c ttm: fix agp since ttm tt rework 2012-01-06 09:34:03 +00:00