[Mesa-dev] [PATCH 3/3] radeonsi: fix undefined left-shift into sign bit

Marek Olšák maraeo at gmail.com
Tue Jun 14 18:03:54 UTC 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Jun 14, 2016 at 4:37 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
>  src/gallium/drivers/radeonsi/cik_sdma.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c
> index d8ec2a3..a36bbce 100644
> --- a/src/gallium/drivers/radeonsi/cik_sdma.c
> +++ b/src/gallium/drivers/radeonsi/cik_sdma.c
> @@ -370,12 +370,13 @@ static bool cik_sdma_copy_texture(struct si_context *sctx,
>                     copy_height <= (1 << 14) &&
>                     copy_depth <= (1 << 11)) {
>                         struct radeon_winsys_cs *cs = sctx->b.dma.cs;
> +                       uint32_t direction = linear == rdst ? 1u << 31 : 0;
>
>                         r600_need_dma_space(&sctx->b, 14, &rdst->resource, &rsrc->resource);
>
>                         radeon_emit(cs, CIK_SDMA_PACKET(CIK_SDMA_OPCODE_COPY,
>                                                         CIK_SDMA_COPY_SUB_OPCODE_TILED_SUB_WINDOW, 0) |
> -                                       ((linear == rdst) << 31));
> +                                       direction);
>                         radeon_emit(cs, tiled_address);
>                         radeon_emit(cs, tiled_address >> 32);
>                         radeon_emit(cs, tiled_x | (tiled_y << 16));
> --
> 2.7.4
>
> _______________________________________________
> 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