From a22cd81f847ce028bda2bdcc0259925ba4d252d9 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 25 Aug 2011 09:02:16 +1000 Subject: [PATCH] nouveau: ttm fixes for rhbz#699551 --- drm-ttm-nouveau-oops-fix.patch | 40 ++++++++++++++++++++++++++++++++++ kernel.spec | 4 ++++ 2 files changed, 44 insertions(+) create mode 100644 drm-ttm-nouveau-oops-fix.patch diff --git a/drm-ttm-nouveau-oops-fix.patch b/drm-ttm-nouveau-oops-fix.patch new file mode 100644 index 000000000..e65259e50 --- /dev/null +++ b/drm-ttm-nouveau-oops-fix.patch @@ -0,0 +1,40 @@ +diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c +index 2e618b5..9095b5b 100644 +--- a/drivers/gpu/drm/ttm/ttm_bo.c ++++ b/drivers/gpu/drm/ttm/ttm_bo.c +@@ -390,10 +390,12 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, + * Create and bind a ttm if required. + */ + +- if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED) && (bo->ttm == NULL)) { +- ret = ttm_bo_add_ttm(bo, false); +- if (ret) +- goto out_err; ++ if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) { ++ if (bo->ttm == NULL) { ++ ret = ttm_bo_add_ttm(bo, false); ++ if (ret) ++ goto out_err; ++ } + + ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement); + if (ret) +diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c +index 77dbf40..ae3c6f5 100644 +--- a/drivers/gpu/drm/ttm/ttm_bo_util.c ++++ b/drivers/gpu/drm/ttm/ttm_bo_util.c +@@ -635,13 +635,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, + if (ret) + return ret; + +- ttm_bo_free_old_node(bo); + if ((man->flags & TTM_MEMTYPE_FLAG_FIXED) && + (bo->ttm != NULL)) { + ttm_tt_unbind(bo->ttm); + ttm_tt_destroy(bo->ttm); + bo->ttm = NULL; + } ++ ttm_bo_free_old_node(bo); + } else { + /** + * This should help pipeline ordinary buffer moves. diff --git a/kernel.spec b/kernel.spec index 419093b33..4010266fe 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1161,6 +1161,7 @@ ApplyPatch fix_xen_guest_on_old_EC2.patch ApplyPatch xen-blkfront-name-adjust.patch # DRM core +ApplyPatch drm-ttm-nouveau-oops-fix.patch # Nouveau DRM ApplyOptionalPatch drm-nouveau-updates.patch @@ -1826,6 +1827,9 @@ fi # and build. %changelog +* Thu Aug 25 2011 Ben Skeggs +- nouveau: add patch fixing ttm issues that lead to oopses/corruption (rhbz#699551) + * Wed Aug 24 2011 Chuck Ebbert - Automate the kernel version faking.