diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4087-drm-amdgpu-Use-the-ALIGN-macro.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4087-drm-amdgpu-Use-the-ALIGN-macro.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4087-drm-amdgpu-Use-the-ALIGN-macro.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4087-drm-amdgpu-Use-the-ALIGN-macro.patch new file mode 100644 index 00000000..d2b86243 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4087-drm-amdgpu-Use-the-ALIGN-macro.patch @@ -0,0 +1,49 @@ +From 0159f5808d07299060963be691b386b227319859 Mon Sep 17 00:00:00 2001 +From: Luben Tuikov <luben.tuikov@amd.com> +Date: Wed, 2 Oct 2019 00:02:18 -0400 +Subject: [PATCH 4087/4256] drm/amdgpu: Use the ALIGN() macro +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the ALIGN() macro to set "num_dw" to a +multiple of 8, i.e. lower 3 bits cleared. + +Signed-off-by: Luben Tuikov <luben.tuikov@amd.com> +Reviewed-by: Christian König <christian.koenig@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +index 2e0e7fe98b3c..87284e8c8ece 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +@@ -2242,10 +2242,7 @@ static int amdgpu_map_buffer(struct ttm_buffer_object *bo, + *addr += (u64)window * AMDGPU_GTT_MAX_TRANSFER_SIZE * + AMDGPU_GPU_PAGE_SIZE; + +- num_dw = adev->mman.buffer_funcs->copy_num_dw; +- while (num_dw & 0x7) +- num_dw++; +- ++ num_dw = ALIGN(adev->mman.buffer_funcs->copy_num_dw, 8); + num_bytes = num_pages * 8; + + r = amdgpu_job_alloc_with_ib(adev, num_dw * 4 + num_bytes, &job); +@@ -2305,11 +2302,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset, + + max_bytes = adev->mman.buffer_funcs->copy_max_bytes; + num_loops = DIV_ROUND_UP(byte_count, max_bytes); +- num_dw = num_loops * adev->mman.buffer_funcs->copy_num_dw; +- +- /* for IB padding */ +- while (num_dw & 0x7) +- num_dw++; ++ num_dw = ALIGN(num_loops * adev->mman.buffer_funcs->copy_num_dw, 8); + + r = amdgpu_job_alloc_with_ib(adev, num_dw * 4, &job); + if (r) +-- +2.17.1 + |