diff options
author | Christoph Bumiller <[email protected]> | 2013-07-05 20:55:36 +0200 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2013-07-11 19:11:44 -0400 |
commit | 9974593dfbf87e95a4c396772b82c302d663d1f8 (patch) | |
tree | 93bed8a796420ceff5a47eec6e25392f2159ca02 | |
parent | 1d9271a95c055855f04d57fa9a9eb06cd075e9ec (diff) |
r600g: x/y coordinates must be divided by block dim in dma blit
Note: this is a candidate for the 9.1 branch.
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 4166b18e262..980e75aa7bd 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -3733,6 +3733,7 @@ boolean evergreen_dma_blit(struct pipe_context *ctx, struct r600_texture *rdst = (struct r600_texture*)dst; unsigned dst_pitch, src_pitch, bpp, dst_mode, src_mode, copy_height; unsigned src_w, dst_w; + unsigned src_x, src_y; if (rctx->rings.dma.cs == NULL) { return FALSE; @@ -3741,6 +3742,11 @@ boolean evergreen_dma_blit(struct pipe_context *ctx, return FALSE; } + src_x = util_format_get_nblocksx(src->format, src_box->x); + dst_x = util_format_get_nblocksx(src->format, dst_x); + src_y = util_format_get_nblocksy(src->format, src_box->y); + dst_y = util_format_get_nblocksy(src->format, dst_y); + bpp = rdst->surface.bpe; dst_pitch = rdst->surface.level[dst_level].pitch_bytes; src_pitch = rsrc->surface.level[src_level].pitch_bytes; @@ -3785,7 +3791,7 @@ boolean evergreen_dma_blit(struct pipe_context *ctx, */ src_offset= rsrc->surface.level[src_level].offset; src_offset += rsrc->surface.level[src_level].slice_size * src_box->z; - src_offset += src_box->y * src_pitch + src_box->x * bpp; + src_offset += src_y * src_pitch + src_x * bpp; dst_offset = rdst->surface.level[dst_level].offset; dst_offset += rdst->surface.level[dst_level].slice_size * dst_z; dst_offset += dst_y * dst_pitch + dst_x * bpp; @@ -3793,7 +3799,7 @@ boolean evergreen_dma_blit(struct pipe_context *ctx, src_box->height * src_pitch); } else { evergreen_dma_copy_tile(rctx, dst, dst_level, dst_x, dst_y, dst_z, - src, src_level, src_box->x, src_box->y, src_box->z, + src, src_level, src_x, src_y, src_box->z, copy_height, dst_pitch, bpp); } return TRUE; diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 759f71f97e7..4590fdddc80 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -3132,6 +3132,7 @@ boolean r600_dma_blit(struct pipe_context *ctx, struct r600_texture *rdst = (struct r600_texture*)dst; unsigned dst_pitch, src_pitch, bpp, dst_mode, src_mode, copy_height; unsigned src_w, dst_w; + unsigned src_x, src_y; if (rctx->rings.dma.cs == NULL) { return FALSE; @@ -3140,6 +3141,11 @@ boolean r600_dma_blit(struct pipe_context *ctx, return FALSE; } + src_x = util_format_get_nblocksx(src->format, src_box->x); + dst_x = util_format_get_nblocksx(src->format, dst_x); + src_y = util_format_get_nblocksy(src->format, src_box->y); + dst_y = util_format_get_nblocksy(src->format, dst_y); + bpp = rdst->surface.bpe; dst_pitch = rdst->surface.level[dst_level].pitch_bytes; src_pitch = rsrc->surface.level[src_level].pitch_bytes; @@ -3172,7 +3178,7 @@ boolean r600_dma_blit(struct pipe_context *ctx, */ src_offset= rsrc->surface.level[src_level].offset; src_offset += rsrc->surface.level[src_level].slice_size * src_box->z; - src_offset += src_box->y * src_pitch + src_box->x * bpp; + src_offset += src_y * src_pitch + src_x * bpp; dst_offset = rdst->surface.level[dst_level].offset; dst_offset += rdst->surface.level[dst_level].slice_size * dst_z; dst_offset += dst_y * dst_pitch + dst_x * bpp; @@ -3184,7 +3190,7 @@ boolean r600_dma_blit(struct pipe_context *ctx, r600_dma_copy(rctx, dst, src, dst_offset, src_offset, size); } else { return r600_dma_copy_tile(rctx, dst, dst_level, dst_x, dst_y, dst_z, - src, src_level, src_box->x, src_box->y, src_box->z, + src, src_level, src_x, src_y, src_box->z, copy_height, dst_pitch, bpp); } return TRUE; |