drm/radeon: fix buffer placement under memory pressure v2
authorChristian König <christian.koenig@amd.com>
Sat, 10 May 2014 16:17:09 +0000 (18:17 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 20 May 2014 12:42:02 +0000 (14:42 +0200)
Some buffers (UVD/VM page tables) must be placed in VRAM,
but the byte restriction for moving buffers didn't took this
into account.

v2: keep closer to the original code

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
drivers/gpu/drm/radeon/radeon_object.c

index 72705fb..4faa4d6 100644 (file)
@@ -458,7 +458,7 @@ int radeon_bo_list_validate(struct radeon_device *rdev,
                         * into account. We don't want to disallow buffer moves
                         * completely.
                         */
-                       if (current_domain != RADEON_GEM_DOMAIN_CPU &&
+                       if ((lobj->alt_domain & current_domain) != 0 &&
                            (domain & current_domain) == 0 && /* will be moved */
                            bytes_moved > bytes_moved_threshold) {
                                /* don't move it */