[PATCH 1/1] drm/amdkfd: Do not ignore requested queue size during allocation

Jan Vesely jan.vesely at rutgers.edu
Thu Nov 16 21:36:31 UTC 2017


Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c
index f1d48281e322..b3bee39661ab 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c
@@ -37,15 +37,16 @@ static bool initialize_vi(struct kernel_queue *kq, struct kfd_dev *dev,
 			enum kfd_queue_type type, unsigned int queue_size)
 {
 	int retval;
+	unsigned int size = ALIGN(queue_size, PAGE_SIZE);
 
-	retval = kfd_gtt_sa_allocate(dev, PAGE_SIZE, &kq->eop_mem);
+	retval = kfd_gtt_sa_allocate(dev, size, &kq->eop_mem);
 	if (retval != 0)
 		return false;
 
 	kq->eop_gpu_addr = kq->eop_mem->gpu_addr;
 	kq->eop_kernel_addr = kq->eop_mem->cpu_ptr;
 
-	memset(kq->eop_kernel_addr, 0, PAGE_SIZE);
+	memset(kq->eop_kernel_addr, 0, size);
 
 	return true;
 }
-- 
2.13.6



More information about the amd-gfx mailing list