<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks Christian, I'll improve the coding style.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Monday, August 19, 2019 15:39<br>
<b>To:</b> Yin, Tianci (Rico) <Tianci.Yin@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Xiao, Jack <Jack.Xiao@amd.com>; Yuan, Xiaojie <Xiaojie.Yuan@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu/psp: move TMR to cpu invisible vram region</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 19.08.19 um 09:34 schrieb Tianci Yin:<br>
> From: "Tianci.Yin" <tianci.yin@amd.com><br>
><br>
> so that more visible vram can be available for ocl applications.<br>
><br>
> Signed-off-by: Tianci.Yin <tianci.yin@amd.com><br>
> ---<br>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +++--<br>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    | 4 ++--<br>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h    | 1 -<br>
>   3 files changed, 5 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
> index 1059771..ca35869 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
> @@ -246,8 +246,9 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,<br>
>        bp.size = size;<br>
>        bp.byte_align = align;<br>
>        bp.domain = domain;<br>
> -     bp.flags = AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |<br>
> -             AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;<br>
> +     bp.flags = (cpu_addr)?AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED<br>
> +             :AMDGPU_GEM_CREATE_NO_CPU_ACCESS;<br>
<br>
Coding style: You can drop the "()",  but there should be spaces before <br>
and after the "?" and ":".<br>
<br>
And please double check that this change doesn't affect any other user <br>
of amdgpu_bo_create_kernel()/amdgpu_bo_create_reserved().<br>
<br>
Apart from that looks good to me and is a nice improvement,<br>
Christian.<br>
<br>
> +     bp.flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;<br>
>        bp.type = ttm_bo_type_kernel;<br>
>        bp.resv = NULL;<br>
>   <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c<br>
> index 7715c0d..5e7fbbe 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c<br>
> @@ -264,7 +264,7 @@ static int psp_tmr_init(struct psp_context *psp)<br>
>   <br>
>        ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE,<br>
>                                      AMDGPU_GEM_DOMAIN_VRAM,<br>
> -                                   &psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);<br>
> +                                   &psp->tmr_bo, &psp->tmr_mc_addr, NULL);<br>
>   <br>
>        return ret;<br>
>   }<br>
> @@ -1215,7 +1215,7 @@ static int psp_hw_fini(void *handle)<br>
>   <br>
>        psp_ring_destroy(psp, PSP_RING_TYPE__KM);<br>
>   <br>
> -     amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);<br>
> +     amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, NULL);<br>
>        amdgpu_bo_free_kernel(&psp->fw_pri_bo,<br>
>                              &psp->fw_pri_mc_addr, &psp->fw_pri_buf);<br>
>        amdgpu_bo_free_kernel(&psp->fence_buf_bo,<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h<br>
> index 0029fa2..48b057d 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h<br>
> @@ -172,7 +172,6 @@ struct psp_context<br>
>        /* tmr buffer */<br>
>        struct amdgpu_bo                *tmr_bo;<br>
>        uint64_t                        tmr_mc_addr;<br>
> -     void                            *tmr_buf;<br>
>   <br>
>        /* asd firmware and buffer */<br>
>        const struct firmware           *asd_fw;<br>
<br>
</div>
</span></font></div>
</body>
</html>