From d4046f81f7d36cf1d6225a1b491f81832cfa9079 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 14 Mar 2013 20:38:34 -0400 Subject: [PATCH] r600g: fix dma copies on evergreen/cayman (v2) Need to set the non_disp bit for 128 bit formats. Note that evergreen has a 1 bit non_disp field and cayman has a 2 bit non_disp field. For compatibility bit 28 is non_disp[0] and bit 27 is non_disp[1]. v2: fix bit order Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=60802 Note: this is a candidate for the 9.1 branch. Signed-off-by: Alex Deucher --- src/gallium/drivers/r600/evergreen_state.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 97f91df..a1fbfe0 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -3603,7 +3603,7 @@ static void evergreen_dma_copy_tile(struct r600_context *rctx, struct r600_texture *rdst = (struct r600_texture*)dst; unsigned array_mode, lbpp, pitch_tile_max, slice_tile_max, size; unsigned ncopy, height, cheight, detile, i, x, y, z, src_mode, dst_mode; - unsigned sub_cmd, bank_h, bank_w, mt_aspect, nbanks, tile_split; + unsigned sub_cmd, bank_h, bank_w, mt_aspect, nbanks, tile_split, non_disp = 0; uint64_t base, addr; /* make sure that the dma ring is only one active */ @@ -3647,6 +3647,9 @@ static void evergreen_dma_copy_tile(struct r600_context *rctx, tile_split = eg_tile_split(rsrc->surface.tile_split); base += r600_resource_va(&rctx->screen->screen, src); addr += r600_resource_va(&rctx->screen->screen, dst); + /* bit 28 is non_disp[0] and bit 27 is non_disp[1] */ + if (util_format_get_blocksize(src->format) >= 16) + non_disp = 2; } else { /* L2T */ array_mode = evergreen_array_mode(dst_mode); @@ -3672,6 +3675,9 @@ static void evergreen_dma_copy_tile(struct r600_context *rctx, tile_split = eg_tile_split(rdst->surface.tile_split); base += r600_resource_va(&rctx->screen->screen, dst); addr += r600_resource_va(&rctx->screen->screen, src); + /* bit 28 is non_disp[0] and bit 27 is non_disp[1] */ + if (util_format_get_blocksize(dst->format) >= 16) + non_disp = 2; } size = (copy_height * pitch) >> 2; @@ -3695,7 +3701,7 @@ static void evergreen_dma_copy_tile(struct r600_context *rctx, cs->buf[cs->cdw++] = (pitch_tile_max << 0) | ((height - 1) << 16); cs->buf[cs->cdw++] = (slice_tile_max << 0); cs->buf[cs->cdw++] = (x << 0) | (z << 18); - cs->buf[cs->cdw++] = (y << 0) | (tile_split << 21) | (nbanks << 25); + cs->buf[cs->cdw++] = (y << 0) | (tile_split << 21) | (nbanks << 25) | (non_disp << 27); cs->buf[cs->cdw++] = addr & 0xfffffffc; cs->buf[cs->cdw++] = (addr >> 32UL) & 0xff; copy_height -= cheight; -- 1.7.7.5