* Patch "drm/amdgpu: fix lru size grouping v2" has been added to the 4.7-stable tree
@ 2016-09-05 13:55 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-05 13:55 UTC (permalink / raw)
To: christian.koenig, alexander.deucher, felix.kuehling, gregkh
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
drm/amdgpu: fix lru size grouping v2
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-amdgpu-fix-lru-size-grouping-v2.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 5661538749511d4c2f7d33e1e179f10c545b24d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
Date: Wed, 17 Aug 2016 13:44:20 +0200
Subject: drm/amdgpu: fix lru size grouping v2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Christian König <christian.koenig@amd.com>
commit 5661538749511d4c2f7d33e1e179f10c545b24d5 upstream.
Adding a BO can make it the insertion point for larger sizes as well.
v2: add a comment about the guard structure.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 ++++++++
2 files changed, 10 insertions(+)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -415,6 +415,8 @@ struct amdgpu_mman {
/* custom LRU management */
struct amdgpu_mman_lru log2_size[AMDGPU_TTM_LRU_SIZE];
+ /* guard for log2_size array, don't add anything in between */
+ struct amdgpu_mman_lru guard;
};
int amdgpu_copy_buffer(struct amdgpu_ring *ring,
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -943,6 +943,8 @@ static struct list_head *amdgpu_ttm_lru_
struct list_head *res = lru->lru[tbo->mem.mem_type];
lru->lru[tbo->mem.mem_type] = &tbo->lru;
+ while ((++lru)->lru[tbo->mem.mem_type] == res)
+ lru->lru[tbo->mem.mem_type] = &tbo->lru;
return res;
}
@@ -953,6 +955,8 @@ static struct list_head *amdgpu_ttm_swap
struct list_head *res = lru->swap_lru;
lru->swap_lru = &tbo->swap;
+ while ((++lru)->swap_lru == res)
+ lru->swap_lru = &tbo->swap;
return res;
}
@@ -1004,6 +1008,10 @@ int amdgpu_ttm_init(struct amdgpu_device
lru->swap_lru = &adev->mman.bdev.glob->swap_lru;
}
+ for (j = 0; j < TTM_NUM_MEM_TYPES; ++j)
+ adev->mman.guard.lru[j] = NULL;
+ adev->mman.guard.swap_lru = NULL;
+
adev->mman.initialized = true;
r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_VRAM,
adev->mc.real_vram_size >> PAGE_SHIFT);
Patches currently in stable-queue which might be from christian.koenig@amd.com are
queue-4.7/drm-amdgpu-change-gart-offset-to-64-bit.patch
queue-4.7/drm-amdgpu-avoid-a-possible-array-overflow.patch
queue-4.7/drm-amdgpu-record-error-code-when-ring-test-failed.patch
queue-4.7/drm-amdgpu-fix-lru-size-grouping-v2.patch
queue-4.7/drm-amdgpu-skip-tv-cv-in-display-parsing.patch
queue-4.7/drm-amdgpu-fix-amdgpu_move_blit-on-32bit-systems.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-05 13:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-05 13:55 Patch "drm/amdgpu: fix lru size grouping v2" has been added to the 4.7-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).