[Mesa-dev] [PATCH 1/2] nvc0: mark bound buffer range valid
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri Jun 3 08:26:22 UTC 2016
All this code duplication is... sad but heh?! :)
I guess it would be, at least, easy to refactor nvc0_validate_buffers()
and nvc0_compute_validate_buffers().
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
On 06/03/2016 08:25 AM, Ilia Mirkin wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Cc: "12.0" <mesa-stable at lists.freedesktop.org>
> ---
> src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 3 +++
> src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 3 +++
> src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 3 +++
> 3 files changed, 9 insertions(+)
>
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
> index 5cc119c..8c88225 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
> @@ -262,6 +262,9 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0)
> PUSH_DATA (push, nvc0->buffers[s][i].buffer_size);
> PUSH_DATA (push, 0);
> 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_size);
> } else {
> PUSH_DATA (push, 0);
> 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 a77486d..ad44e85 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
> @@ -517,6 +517,9 @@ nvc0_validate_buffers(struct nvc0_context *nvc0)
> PUSH_DATA (push, nvc0->buffers[s][i].buffer_size);
> PUSH_DATA (push, 0);
> 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_size);
> } else {
> PUSH_DATA (push, 0);
> 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 2d9688e..60508d8 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
> @@ -379,6 +379,9 @@ nve4_compute_validate_buffers(struct nvc0_context *nvc0)
> PUSH_DATA (push, nvc0->buffers[s][i].buffer_size);
> PUSH_DATA (push, 0);
> 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_size);
> } else {
> PUSH_DATA (push, 0);
> PUSH_DATA (push, 0);
>
--
-Samuel
More information about the mesa-dev
mailing list