diff mbox

[4/6] drm/amdgpu: double the priority of kernel allocations

Message ID MWHPR1201MB0127C6ABDC00E5E1F5580EC1FD7D0@MWHPR1201MB0127.namprd12.prod.outlook.com (mailing list archive)
State New, archived
Headers show

Commit Message

He, Hongbo Jan. 16, 2017, 3:30 a.m. UTC
Reviewed-by: Roger.He <Hongbo.He@amd.com>

-----Original Message-----
From: Christian König [mailto:deathsimple@vodafone.de] 
Sent: Friday, January 13, 2017 5:51 PM
To: He, Hongbo <Hongbo.He@amd.com>
Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
Subject: [PATCH 4/6] drm/amdgpu: double the priority of kernel allocations

From: Christian König <christian.koenig@amd.com>

Give kernel allocations a higher priority cause it is often more work to swap them back in.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
 1 file changed, 2 insertions(+)

--
2.7.4
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index f399d98..2de1dda 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -387,6 +387,8 @@  int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
 		return r;
 
 	bo->tbo.priority = ilog2(bo->tbo.num_pages);
+	if (kernel)
+		bo->tbo.priority *= 2;
 	bo->tbo.priority = min(bo->tbo.priority, TTM_MAX_BO_PRIORITY - 1);
 
 	if (flags & AMDGPU_GEM_CREATE_VRAM_CLEARED &&