[Mesa-dev] [PATCH] radeonsi: add DCC buffer for sampler views on new CS
Marek Olšák
maraeo at gmail.com
Sun Jan 24 11:03:13 PST 2016
On Sun, Jan 24, 2016 at 5:40 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> This fixes a VM fault and possible lockup in high memory pressure situations.
>
> Cc: "11.0 11.1" <mesa-stable at lists.freedesktop.org>
Only Mesa 11.1 has DCC.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Good catch.
Marek
> ---
> src/gallium/drivers/radeonsi/si_descriptors.c | 33 +++++++++++++++------------
> 1 file changed, 18 insertions(+), 15 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
> index aad836d..6c79673 100644
> --- a/src/gallium/drivers/radeonsi/si_descriptors.c
> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c
> @@ -138,6 +138,22 @@ static void si_release_sampler_views(struct si_sampler_views *views)
> si_release_descriptors(&views->desc);
> }
>
> +static void si_sampler_view_add_buffers(struct si_context *sctx,
> + struct si_sampler_view *rview)
> +{
> + if (rview->resource) {
> + radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
> + rview->resource, RADEON_USAGE_READ,
> + r600_get_sampler_view_priority(rview->resource));
> + }
> +
> + if (rview->dcc_buffer && rview->dcc_buffer != rview->resource) {
> + radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
> + rview->dcc_buffer, RADEON_USAGE_READ,
> + RADEON_PRIO_DCC);
> + }
> +}
> +
> static void si_sampler_views_begin_new_cs(struct si_context *sctx,
> struct si_sampler_views *views)
> {
> @@ -149,12 +165,7 @@ static void si_sampler_views_begin_new_cs(struct si_context *sctx,
> struct si_sampler_view *rview =
> (struct si_sampler_view*)views->views[i];
>
> - if (!rview->resource)
> - continue;
> -
> - radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
> - rview->resource, RADEON_USAGE_READ,
> - r600_get_sampler_view_priority(rview->resource));
> + si_sampler_view_add_buffers(sctx, rview);
> }
>
> if (!views->desc.buffer)
> @@ -176,15 +187,7 @@ static void si_set_sampler_view(struct si_context *sctx, unsigned shader,
> struct si_sampler_view *rview =
> (struct si_sampler_view*)view;
>
> - if (rview->resource)
> - radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
> - rview->resource, RADEON_USAGE_READ,
> - r600_get_sampler_view_priority(rview->resource));
> -
> - if (rview->dcc_buffer && rview->dcc_buffer != rview->resource)
> - radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
> - rview->dcc_buffer, RADEON_USAGE_READ,
> - RADEON_PRIO_DCC);
> + si_sampler_view_add_buffers(sctx, rview);
>
> pipe_sampler_view_reference(&views->views[slot], view);
> memcpy(views->desc.list + slot*8, view_desc, 8*4);
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list