[Mesa-dev] [PATCH 05/20] radeonsi: return correct eviction stats for NVX_gpu_memory_info
Edward O'Callaghan
funfunctor at folklore1984.net
Tue Aug 30 09:07:42 UTC 2016
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
On 08/30/2016 01:28 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/gallium/drivers/radeon/r600_pipe_common.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
> index b1da22f..32486c8 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
> @@ -1055,22 +1055,27 @@ static void r600_query_memory_info(struct pipe_screen *screen,
>
> info->avail_device_memory =
> vram_usage <= info->total_device_memory ?
> info->total_device_memory - vram_usage : 0;
> info->avail_staging_memory =
> gtt_usage <= info->total_staging_memory ?
> info->total_staging_memory - gtt_usage : 0;
>
> info->device_memory_evicted =
> ws->query_value(ws, RADEON_NUM_BYTES_MOVED) / 1024;
> - /* Just return the number of evicted 64KB pages. */
> - info->nr_device_memory_evictions = info->device_memory_evicted / 64;
> +
> + if (rscreen->info.drm_major == 3 && rscreen->info.drm_minor >= 4)
> + info->nr_device_memory_evictions =
> + ws->query_value(ws, RADEON_NUM_EVICTIONS);
> + else
> + /* Just return the number of evicted 64KB pages. */
> + info->nr_device_memory_evictions = info->device_memory_evicted / 64;
> }
>
> struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen,
> const struct pipe_resource *templ)
> {
> struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
>
> if (templ->target == PIPE_BUFFER) {
> return r600_buffer_create(screen, templ,
> rscreen->info.gart_page_size);
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160830/0f019023/attachment.sig>
More information about the mesa-dev
mailing list