fix 0012-misc-additions.patch for 6.0.7 (#639)
Signed-off-by: Peter Jung <admin@ptr1337.dev> Signed-off-by: Peter Jung <admin@ptr1337.dev>
This commit is contained in:
@@ -557,95 +557,3 @@ index af6c1a93372d90..002bc26b525e87 100644
|
||||
|
||||
sdw_cdns_probe(cdns);
|
||||
|
||||
From 785699dbc7041b99e0027bff27ffe17eba202e96 Mon Sep 17 00:00:00 2001
|
||||
From: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
|
||||
Date: Tue, 4 Oct 2022 07:33:39 -0700
|
||||
Subject: [PATCH] drm/amdgpu: Fix VRAM BO swap issue
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
DRM buddy manager allocates the contiguous memory requests in
|
||||
a single block or multiple blocks. So for the ttm move operation
|
||||
(incase of low vram memory) we should consider all the blocks to
|
||||
compute the total memory size which compared with the struct
|
||||
ttm_resource num_pages in order to verify that the blocks are
|
||||
contiguous for the eviction process.
|
||||
|
||||
v2: Added a Fixes tag
|
||||
v3: Rewrite the code to save a bit of calculations and
|
||||
variables (Christian)
|
||||
|
||||
Fixes: c9cad937c0c5 ("drm/amdgpu: add drm buddy support to amdgpu")
|
||||
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
|
||||
Reviewed-by: Christian König <christian.koenig@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 17 ++++++++++++-----
|
||||
1 file changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
||||
index 134575a3893c53..794062ab57fca4 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
||||
@@ -424,8 +424,9 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
|
||||
static bool amdgpu_mem_visible(struct amdgpu_device *adev,
|
||||
struct ttm_resource *mem)
|
||||
{
|
||||
- uint64_t mem_size = (u64)mem->num_pages << PAGE_SHIFT;
|
||||
+ u64 mem_size = (u64)mem->num_pages << PAGE_SHIFT;
|
||||
struct amdgpu_res_cursor cursor;
|
||||
+ u64 end;
|
||||
|
||||
if (mem->mem_type == TTM_PL_SYSTEM ||
|
||||
mem->mem_type == TTM_PL_TT)
|
||||
@@ -434,12 +435,18 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev,
|
||||
return false;
|
||||
|
||||
amdgpu_res_first(mem, 0, mem_size, &cursor);
|
||||
+ end = cursor.start + cursor.size;
|
||||
+ while (cursor.remaining) {
|
||||
+ amdgpu_res_next(&cursor, cursor.size);
|
||||
|
||||
- /* ttm_resource_ioremap only supports contiguous memory */
|
||||
- if (cursor.size != mem_size)
|
||||
- return false;
|
||||
+ /* ttm_resource_ioremap only supports contiguous memory */
|
||||
+ if (end != cursor.start)
|
||||
+ return false;
|
||||
+
|
||||
+ end = cursor.start + cursor.size;
|
||||
+ }
|
||||
|
||||
- return cursor.start + cursor.size <= adev->gmc.visible_vram_size;
|
||||
+ return end <= adev->gmc.visible_vram_size;
|
||||
}
|
||||
|
||||
/*
|
||||
From 6df3912f64cea68409b08d282ffbccf0af7f8d8e Mon Sep 17 00:00:00 2001
|
||||
From: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
|
||||
Date: Mon, 17 Oct 2022 13:15:21 -0700
|
||||
Subject: [PATCH] drm/amdgpu: Fix for BO move issue
|
||||
|
||||
If there are no blocks to compare then exit
|
||||
the loop.
|
||||
|
||||
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
||||
index 794062ab57fca4..9e6c23266a1a0f 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
|
||||
@@ -439,6 +439,9 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev,
|
||||
while (cursor.remaining) {
|
||||
amdgpu_res_next(&cursor, cursor.size);
|
||||
|
||||
+ if (!cursor.remaining)
|
||||
+ break;
|
||||
+
|
||||
/* ttm_resource_ioremap only supports contiguous memory */
|
||||
if (end != cursor.start)
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user