[Mesa-dev] [PATCH 03/17] gallium/radeon: allow VRAM-only placements again on APUs & recent amdgpu
Ernst Sjöstrand
ernstp at gmail.com
Thu Jan 26 19:43:14 UTC 2017
Should this code be able to handle drm 4.0.0?
2017-01-26 17:04 GMT+01:00 Marek Olšák <maraeo at gmail.com>:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/gallium/drivers/radeon/r600_buffer_common.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c
> b/src/gallium/drivers/radeon/r600_buffer_common.c
> index c6f4d0d..da6f020 100644
> --- a/src/gallium/drivers/radeon/r600_buffer_common.c
> +++ b/src/gallium/drivers/radeon/r600_buffer_common.c
> @@ -163,22 +163,26 @@ void r600_init_resource_fields(struct
> r600_common_screen *rscreen,
> !rtex->surface.is_linear) {
> res->domains = RADEON_DOMAIN_VRAM;
> res->flags &= ~RADEON_FLAG_CPU_ACCESS;
> res->flags |= RADEON_FLAG_NO_CPU_ACCESS |
> RADEON_FLAG_GTT_WC;
> }
>
> /* If VRAM is just stolen system memory, allow both VRAM and
> * GTT, whichever has free space. If a buffer is evicted from
> * VRAM to GTT, it will stay there.
> + *
> + * DRM 3.6.0 has good BO move throttling, so we can allow VRAM-only
> + * placements even with a low amount of stolen VRAM.
> */
> if (!rscreen->info.has_dedicated_vram &&
> + (rscreen->info.drm_major < 3 || rscreen->info.drm_minor < 6) &&
> res->domains == RADEON_DOMAIN_VRAM)
> res->domains = RADEON_DOMAIN_VRAM_GTT;
>
> if (rscreen->debug_flags & DBG_NO_WC)
> res->flags &= ~RADEON_FLAG_GTT_WC;
>
> /* Set expected VRAM and GART usage for the buffer. */
> res->vram_usage = 0;
> res->gart_usage = 0;
>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170126/57c56d71/attachment.html>
More information about the mesa-dev
mailing list