<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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,Arial,Helvetica,sans-serif">
<p>Xiangliang</p>
<p><br>
</p>
<p>good cleanup, but there are more, please help proceed them all:</p>
<p><br>
</p>
<p></p>
<div>struct amdgpu_mec {<br>
struct amdgpu_bo *hpd_eop_obj;<br>
u64 hpd_eop_gpu_addr;<br>
u32 num_pipe;<br>
u32 num_mec;<br>
u32 num_queue;<br>
struct vi_mqd *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS + 1];<br>
};<br>
<br>
change:<br>
<span>struct vi_mqd *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS + 1];<br>
to:<br>
<span>void *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS + 1];</span><br>
<br>
</span><br>
thanks <br>
<br>
<br>
with above address, <br>
Reviewed-by: Monk Liu <monk.liu@amd.com><br>
<br>
other two patches:<br>
<span>Reviewed-by: Monk Liu <monk.liu@amd.com></span><br>
<br>
BR Monk<br>
</div>
<br>
<p></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>发件人:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de><br>
<b>发送时间:</b> 2017年2月16日 17:16:15<br>
<b>收件人:</b> Yu, Xiangliang; amd-gfx@lists.freedesktop.org<br>
<b>主题:</b> Re: [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Am 16.02.2017 um 08:25 schrieb Xiangliang Yu:<br>
> vi_mqd is only used by VI family but mqd_ptr is common for all<br>
> ASIC, so change the pointer to void.<br>
><br>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com><br>
<br>
Nice cleanup, patch is Reviewed-by: Christian König <br>
<christian.koenig@amd.com>.<br>
<br>
Patch #2 and #3 are Acked-by: Christian König <christian.koenig@amd.com>.<br>
<br>
Regards,<br>
Christian.<br>
<br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 2 +-<br>
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 26 +++++++++++++++++---------<br>
> 2 files changed, 18 insertions(+), 10 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h<br>
> index 3fd4ce8..a1bfc4e 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h<br>
> @@ -162,7 +162,7 @@ struct amdgpu_ring {<br>
> u32 queue;<br>
> struct amdgpu_bo *mqd_obj;<br>
> uint64_t mqd_gpu_addr;<br>
> - struct vi_mqd *mqd_ptr;<br>
> + void *mqd_ptr;<br>
> u32 doorbell_index;<br>
> bool use_doorbell;<br>
> unsigned wptr_offs;<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
> index 772c42b..2202f02 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
> @@ -4940,8 +4940,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)<br>
> gfx_v8_0_cp_compute_enable(adev, true);<br>
> <br>
> ring = &adev->gfx.kiq.ring;<br>
> - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {<br>
> - r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);<br>
> + if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {<br>
> + r = gfx_v8_0_kiq_init_queue(ring,<br>
> + (struct vi_mqd *)ring->mqd_ptr,<br>
> + ring->mqd_gpu_addr);<br>
> amdgpu_bo_kunmap(ring->mqd_obj);<br>
> ring->mqd_ptr = NULL;<br>
> if (r)<br>
> @@ -4952,8 +4954,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)<br>
> <br>
> for (i = 0; i < adev->gfx.num_compute_rings; i++) {<br>
> ring = &adev->gfx.compute_ring[i];<br>
> - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {<br>
> - r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);<br>
> + if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {<br>
> + r = gfx_v8_0_kiq_init_queue(ring,<br>
> + (struct vi_mqd *)ring->mqd_ptr,<br>
> + ring->mqd_gpu_addr);<br>
> amdgpu_bo_kunmap(ring->mqd_obj);<br>
> ring->mqd_ptr = NULL;<br>
> if (r)<br>
> @@ -7333,7 +7337,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)<br>
> if (!ring->mqd_obj) {<br>
> r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,<br>
> AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,<br>
> - &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);<br>
> + &ring->mqd_gpu_addr, &ring->mqd_ptr);<br>
> if (r) {<br>
> dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);<br>
> return r;<br>
> @@ -7352,7 +7356,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)<br>
> if (!ring->mqd_obj) {<br>
> r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,<br>
> AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,<br>
> - &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);<br>
> + &ring->mqd_gpu_addr, &ring->mqd_ptr);<br>
> if (r) {<br>
> dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);<br>
> return r;<br>
> @@ -7375,9 +7379,13 @@ static void gfx_v8_0_compute_mqd_soft_fini(struct amdgpu_device *adev)<br>
> <br>
> for (i = 0; i < adev->gfx.num_compute_rings; i++) {<br>
> ring = &adev->gfx.compute_ring[i];<br>
> - amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);<br>
> + amdgpu_bo_free_kernel(&ring->mqd_obj,<br>
> + &ring->mqd_gpu_addr,<br>
> + &ring->mqd_ptr);<br>
> }<br>
> <br>
> ring = &adev->gfx.kiq.ring;<br>
> - amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);<br>
> -}<br>
> \ No newline at end of file<br>
> + amdgpu_bo_free_kernel(&ring->mqd_obj,<br>
> + &ring->mqd_gpu_addr,<br>
> + &ring->mqd_ptr);<br>
> +}<br>
<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font>
</body>
</html>