<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Christian,</p>
<p><br>
</p>
<p>I used eclipse. The reason why I changed the indent is that the current indents are composed of tabs and spaces, and I will get style warning from checkpatch script when trying to submit it to gerrit, so I made the indents all tabs. In this case, should
I still use the previous indents?</p>
<p><br>
</p>
<p>Regards,</p>
<p>Yong</p>
<p><br>
</p>
<p><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Christian König <deathsimple@vodafone.de><br>
<b>Sent:</b> Thursday, July 27, 2017 5:34:58 AM<br>
<b>To:</b> Zhao, Yong; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 1/2] drm/amdgpu: Add support for filling a buffer with 64 bit value</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Am 26.07.2017 um 22:45 schrieb Yong Zhao:<br>
> That function will be used later to support setting a page table<br>
> block with 64 bit value.<br>
><br>
> Change-Id: Ib142ebd4163d6e23670a3f0ceed536d59133b942<br>
> Signed-off-by: Yong Zhao <Yong.Zhao@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 19 +++++++++++++------<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 +-<br>
> 2 files changed, 14 insertions(+), 7 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
> index 4d2a454..6ab30da 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
> @@ -1509,11 +1509,12 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,<br>
> }<br>
> <br>
> int amdgpu_fill_buffer(struct amdgpu_bo *bo,<br>
> - uint32_t src_data,<br>
> - struct reservation_object *resv,<br>
> - struct dma_fence **fence)<br>
> + uint64_t src_data,<br>
> + struct reservation_object *resv,<br>
> + struct dma_fence **fence)<br>
<br>
Looks like you accidentally changed the indentation of the other <br>
function parameters here. What editor do you use?<br>
<br>
Please make sure that you only change the type, with that fixed the <br>
patch is Reviewed-by: Christian König <christian.koenig@amd.com>.<br>
<br>
Regards,<br>
Christian.<br>
<br>
> {<br>
> struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);<br>
> + /* max_bytes applies to SDMA_OP_PTEPDE as well as SDMA_OP_CONST_FILL*/<br>
> uint32_t max_bytes = adev->mman.buffer_funcs->fill_max_bytes;<br>
> struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;<br>
> <br>
> @@ -1545,7 +1546,9 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,<br>
> num_pages -= mm_node->size;<br>
> ++mm_node;<br>
> }<br>
> - num_dw = num_loops * adev->mman.buffer_funcs->fill_num_dw;<br>
> +<br>
> + /* 10 double words for each SDMA_OP_PTEPDE cmd */<br>
> + num_dw = num_loops * 10;<br>
> <br>
> /* for IB padding */<br>
> num_dw += 64;<br>
> @@ -1570,12 +1573,16 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,<br>
> uint32_t byte_count = mm_node->size << PAGE_SHIFT;<br>
> uint64_t dst_addr;<br>
> <br>
> + WARN_ONCE(byte_count & 0x7, "size should be a multiple of 8");<br>
> +<br>
> dst_addr = amdgpu_mm_node_addr(&bo->tbo, mm_node, &bo->tbo.mem);<br>
> while (byte_count) {<br>
> uint32_t cur_size_in_bytes = min(byte_count, max_bytes);<br>
> <br>
> - amdgpu_emit_fill_buffer(adev, &job->ibs[0], src_data,<br>
> - dst_addr, cur_size_in_bytes);<br>
> + amdgpu_vm_set_pte_pde(adev, &job->ibs[0],<br>
> + dst_addr, 0,<br>
> + cur_size_in_bytes >> 3, 0,<br>
> + src_data);<br>
> <br>
> dst_addr += cur_size_in_bytes;<br>
> byte_count -= cur_size_in_bytes;<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h<br>
> index f137c24..0e2399f 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h<br>
> @@ -73,7 +73,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,<br>
> struct dma_fence **fence, bool direct_submit,<br>
> bool vm_needs_flush);<br>
> int amdgpu_fill_buffer(struct amdgpu_bo *bo,<br>
> - uint32_t src_data,<br>
> + uint64_t src_data,<br>
> struct reservation_object *resv,<br>
> struct dma_fence **fence);<br>
> <br>
<br>
<br>
</div>
</span></font>
</body>
</html>