[Mesa-dev] [PATCH] r600g: fix bug 91881

Dave Airlie airlied at gmail.com
Sun Sep 6 17:15:42 PDT 2015


On 7 September 2015 at 08:17, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91881

Might be nice to say where the regression happened in the commit, and
why we shouldn't be using the buffer size.

Otherwise,
Reviewed-by: Dave Airlie <airlied at redhat.com>
>
> Cc: 11.0 <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/drivers/r600/evergreen_state.c | 4 ++--
>  src/gallium/drivers/r600/r600_state.c      | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
> index 5b478fd..aa92b70 100644
> --- a/src/gallium/drivers/r600/evergreen_state.c
> +++ b/src/gallium/drivers/r600/evergreen_state.c
> @@ -1870,7 +1870,7 @@ static void evergreen_emit_vertex_buffers(struct r600_context *rctx,
>                 radeon_emit(cs, PKT3(PKT3_SET_RESOURCE, 8, 0) | pkt_flags);
>                 radeon_emit(cs, (resource_offset + buffer_index) * 8);
>                 radeon_emit(cs, va); /* RESOURCEi_WORD0 */
> -               radeon_emit(cs, rbuffer->buf->size - vb->buffer_offset - 1); /* RESOURCEi_WORD1 */
> +               radeon_emit(cs, rbuffer->b.b.width0 - vb->buffer_offset - 1); /* RESOURCEi_WORD1 */
>                 radeon_emit(cs, /* RESOURCEi_WORD2 */
>                                  S_030008_ENDIAN_SWAP(r600_endian_swap(32)) |
>                                  S_030008_STRIDE(vb->stride) |
> @@ -1940,7 +1940,7 @@ static void evergreen_emit_constant_buffers(struct r600_context *rctx,
>                 radeon_emit(cs, PKT3(PKT3_SET_RESOURCE, 8, 0) | pkt_flags);
>                 radeon_emit(cs, (buffer_id_base + buffer_index) * 8);
>                 radeon_emit(cs, va); /* RESOURCEi_WORD0 */
> -               radeon_emit(cs, rbuffer->buf->size - cb->buffer_offset - 1); /* RESOURCEi_WORD1 */
> +               radeon_emit(cs, rbuffer->b.b.width0 - cb->buffer_offset - 1); /* RESOURCEi_WORD1 */
>                 radeon_emit(cs, /* RESOURCEi_WORD2 */
>                             S_030008_ENDIAN_SWAP(gs_ring_buffer ? ENDIAN_NONE : r600_endian_swap(32)) |
>                             S_030008_STRIDE(gs_ring_buffer ? 4 : 16) |
> diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
> index 8d95464..4ae40e7 100644
> --- a/src/gallium/drivers/r600/r600_state.c
> +++ b/src/gallium/drivers/r600/r600_state.c
> @@ -1028,7 +1028,7 @@ static void r600_init_color_surface(struct r600_context *rctx,
>
>                 /* CMASK. */
>                 if (!rctx->dummy_cmask ||
> -                   rctx->dummy_cmask->buf->size < cmask.size ||
> +                   rctx->dummy_cmask->b.b.width0 < cmask.size ||
>                     rctx->dummy_cmask->buf->alignment % cmask.alignment != 0) {
>                         struct pipe_transfer *transfer;
>                         void *ptr;
> @@ -1046,7 +1046,7 @@ static void r600_init_color_surface(struct r600_context *rctx,
>
>                 /* FMASK. */
>                 if (!rctx->dummy_fmask ||
> -                   rctx->dummy_fmask->buf->size < fmask.size ||
> +                   rctx->dummy_fmask->b.b.width0 < fmask.size ||
>                     rctx->dummy_fmask->buf->alignment % fmask.alignment != 0) {
>                         pipe_resource_reference((struct pipe_resource**)&rctx->dummy_fmask, NULL);
>                         rctx->dummy_fmask = r600_buffer_create_helper(rscreen, fmask.size, fmask.alignment);
> @@ -1715,7 +1715,7 @@ static void r600_emit_vertex_buffers(struct r600_context *rctx, struct r600_atom
>                 radeon_emit(cs, PKT3(PKT3_SET_RESOURCE, 7, 0));
>                 radeon_emit(cs, (320 + buffer_index) * 7);
>                 radeon_emit(cs, offset); /* RESOURCEi_WORD0 */
> -               radeon_emit(cs, rbuffer->buf->size - offset - 1); /* RESOURCEi_WORD1 */
> +               radeon_emit(cs, rbuffer->b.b.width0 - offset - 1); /* RESOURCEi_WORD1 */
>                 radeon_emit(cs, /* RESOURCEi_WORD2 */
>                                  S_038008_ENDIAN_SWAP(r600_endian_swap(32)) |
>                                  S_038008_STRIDE(vb->stride));
> @@ -1764,7 +1764,7 @@ static void r600_emit_constant_buffers(struct r600_context *rctx,
>                 radeon_emit(cs, PKT3(PKT3_SET_RESOURCE, 7, 0));
>                 radeon_emit(cs, (buffer_id_base + buffer_index) * 7);
>                 radeon_emit(cs, offset); /* RESOURCEi_WORD0 */
> -               radeon_emit(cs, rbuffer->buf->size - offset - 1); /* RESOURCEi_WORD1 */
> +               radeon_emit(cs, rbuffer->b.b.width0 - offset - 1); /* RESOURCEi_WORD1 */
>                 radeon_emit(cs, /* RESOURCEi_WORD2 */
>                             S_038008_ENDIAN_SWAP(gs_ring_buffer ? ENDIAN_NONE : r600_endian_swap(32)) |
>                             S_038008_STRIDE(gs_ring_buffer ? 4 : 16));
> --
> 2.1.4
>
> _______________________________________________
> 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