[Mesa-dev] [PATCH] nvc0: fix valid range for shader buffers
Ilia Mirkin
imirkin at alum.mit.edu
Mon Oct 10 19:29:24 UTC 2016
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
On Sun, Oct 9, 2016 at 4:17 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> When offset != 0, the valid range was wrong because the second
> argument of util_range_add() is end, not size.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 1 +
> src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 1 +
> src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 1 +
> 3 files changed, 3 insertions(+)
>
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
> index dc4d1b3..11635c9 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
> @@ -288,6 +288,7 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0)
> BCTX_REFN(nvc0->bufctx_cp, CP_BUF, res, RDWR);
> util_range_add(&res->valid_buffer_range,
> nvc0->buffers[s][i].buffer_offset,
> + nvc0->buffers[s][i].buffer_offset +
> nvc0->buffers[s][i].buffer_size);
> } else {
> PUSH_DATA (push, 0);
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
> index 6683795..025f4e3 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
> @@ -561,6 +561,7 @@ nvc0_validate_buffers(struct nvc0_context *nvc0)
> BCTX_REFN(nvc0->bufctx_3d, 3D_BUF, res, RDWR);
> util_range_add(&res->valid_buffer_range,
> nvc0->buffers[s][i].buffer_offset,
> + nvc0->buffers[s][i].buffer_offset +
> nvc0->buffers[s][i].buffer_size);
> } else {
> PUSH_DATA (push, 0);
> diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
> index e85e9b4..d661c00 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
> @@ -444,6 +444,7 @@ nve4_compute_validate_buffers(struct nvc0_context *nvc0)
> BCTX_REFN(nvc0->bufctx_cp, CP_BUF, res, RDWR);
> util_range_add(&res->valid_buffer_range,
> nvc0->buffers[s][i].buffer_offset,
> + nvc0->buffers[s][i].buffer_offset +
> nvc0->buffers[s][i].buffer_size);
> } else {
> PUSH_DATA (push, 0);
> --
> 2.10.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list