<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 11, 2018 at 6:54 AM, Michel Dänzer <span dir="ltr"><<a href="mailto:michel@daenzer.net" target="_blank">michel@daenzer.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 2018-06-09 05:16 AM, Marek Olšák wrote:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br>
> <br>
> This improves performance for certain games.<br>
> <br>
> Cc: 18.1 <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
> ---<br>
>  src/gallium/drivers/radeonsi/<wbr>si_buffer.c | 6 +++++-<br>
>  1 file changed, 5 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/src/gallium/drivers/<wbr>radeonsi/si_buffer.c b/src/gallium/drivers/<wbr>radeonsi/si_buffer.c<br>
> index 2d68edc3404..0546fa9d336 100644<br>
> --- a/src/gallium/drivers/<wbr>radeonsi/si_buffer.c<br>
> +++ b/src/gallium/drivers/<wbr>radeonsi/si_buffer.c<br>
> @@ -144,22 +144,26 @@ void si_init_resource_fields(struct si_screen *sscreen,<br>
>       if (res->b.b.target == PIPE_BUFFER &&<br>
>           res->b.b.flags & (PIPE_RESOURCE_FLAG_MAP_<wbr>PERSISTENT |<br>
>                             PIPE_RESOURCE_FLAG_MAP_<wbr>COHERENT)) {<br>
>               /* Use GTT for all persistent mappings with older<br>
>                * kernels, because they didn't always flush the HDP<br>
>                * cache before CS execution.<br>
>                *<br>
>                * Write-combined CPU mappings are fine, the kernel<br>
>                * ensures all CPU writes finish before the GPU<br>
>                * executes a command stream.<br>
> +              *<br>
> +              * radeon doesn't have good BO move throttling, so put all<br>
> +              * persistent buffers into GTT to prevent VRAM CPU page faults.<br>
>                */<br>
> -             if (!sscreen->info.kernel_<wbr>flushes_hdp_before_ib)<br>
> +             if (!sscreen->info.kernel_<wbr>flushes_hdp_before_ib ||<br>
> +                 sscreen->info.drm_major == 2)<br>
>                       res->domains = RADEON_DOMAIN_GTT;<br>
<br>
</div></div>sscreen->info.kernel_flushes_<wbr>hdp_before_ib is always true with amdgpu,<br>
so this could be simplified to<br>
<br>
        if (sscreen->info.drm_major == 2)<br></blockquote><div><br></div><div>It might not be true for a hypothetical third and fourth winsys. :)<br></div><div><br></div><div>Marek<br></div></div><br></div></div>