[Mesa-dev] [PATCH 7/8] radeonsi: always put persistent buffers into GTT on radeon

Dylan Baker dylan at pnwbakers.com
Wed Jun 20 16:47:14 UTC 2018


Quoting Marek Olšák (2018-06-20 08:58:05)
> On Wed, Jun 20, 2018 at 11:26 AM, Dylan Baker <dylan at pnwbakers.com> wrote:
> > Quoting Marek Olšák (2018-06-08 20:16:54)
> >> From: Marek Olšák <marek.olsak at amd.com>
> >>
> >> This improves performance for certain games.
> >>
> >> Cc: 18.1 <mesa-stable at lists.freedesktop.org>
> >> ---
> >>  src/gallium/drivers/radeonsi/si_buffer.c | 6 +++++-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c
> >> index 2d68edc3404..0546fa9d336 100644
> >> --- a/src/gallium/drivers/radeonsi/si_buffer.c
> >> +++ b/src/gallium/drivers/radeonsi/si_buffer.c
> >> @@ -144,22 +144,26 @@ void si_init_resource_fields(struct si_screen *sscreen,
> >>         if (res->b.b.target == PIPE_BUFFER &&
> >>             res->b.b.flags & (PIPE_RESOURCE_FLAG_MAP_PERSISTENT |
> >>                               PIPE_RESOURCE_FLAG_MAP_COHERENT)) {
> >>                 /* Use GTT for all persistent mappings with older
> >>                  * kernels, because they didn't always flush the HDP
> >>                  * cache before CS execution.
> >>                  *
> >>                  * Write-combined CPU mappings are fine, the kernel
> >>                  * ensures all CPU writes finish before the GPU
> >>                  * executes a command stream.
> >> +                *
> >> +                * radeon doesn't have good BO move throttling, so put all
> >> +                * persistent buffers into GTT to prevent VRAM CPU page faults.
> >>                  */
> >> -               if (!sscreen->info.kernel_flushes_hdp_before_ib)
> >> +               if (!sscreen->info.kernel_flushes_hdp_before_ib ||
> >> +                   sscreen->info.drm_major == 2)
> >>                         res->domains = RADEON_DOMAIN_GTT;
> >>         }
> >>
> >>         /* Tiled textures are unmappable. Always put them in VRAM. */
> >>         if ((res->b.b.target != PIPE_BUFFER && !rtex->surface.is_linear) ||
> >>             res->b.b.flags & SI_RESOURCE_FLAG_UNMAPPABLE) {
> >>                 res->domains = RADEON_DOMAIN_VRAM;
> >>                 res->flags |= RADEON_FLAG_NO_CPU_ACCESS |
> >>                          RADEON_FLAG_GTT_WC;
> >>         }
> >> --
> >> 2.17.1
> >>
> >> _______________________________________________
> >> mesa-dev mailing list
> >> mesa-dev at lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> > Hi Marek,
> >
> > This doesn't apply cleanly to 18.1, since
> > b81149e258a492ed0c81058fb535f6bfdacb36da isn't in 18.1; would you like me to
> > pull that commit as well, or do something else?
> 
> Yes, you can pull that commit too. Thanks!
> 
> Marek

Both pulled into the 18.1-proposed branch

There was a very minor conflict in the b811 commit (git being stupid really),
which I resolved. You can look at it here:
https://cgit.freedesktop.org/~dbaker/mesa/commit/?h=18.1-proposed&id=e979b79cecb347b045c3b3eca8678c30bf450fa6.
Let me know if anything looks off.

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180620/31636d13/attachment.sig>


More information about the mesa-dev mailing list