nouveau: ttm fixes for rhbz#699551

This commit is contained in:
Ben Skeggs 2011-08-25 09:02:16 +10:00
parent 8728f9c48f
commit a22cd81f84
2 changed files with 44 additions and 0 deletions

View File

@ -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.

View File

@ -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 <bskeggs@redhat.com>
- nouveau: add patch fixing ttm issues that lead to oopses/corruption (rhbz#699551)
* Wed Aug 24 2011 Chuck Ebbert <cebbert@redhat.com>
- Automate the kernel version faking.