Module: Mesa Branch: main Commit: 2e4994526a52c1dda22de44e01cbbdac1839d35f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e4994526a52c1dda22de44e01cbbdac1839d35f
Author: Iago Toral Quiroga <[email protected]> Date: Tue May 18 09:50:17 2021 +0200 v3d: take TLB blit framebuffer dimensions from smallest surface dimensions Typically, we program the framebuffer dimensions using the destination surface, however, if we blit a rect from a surface that is smaller than the destination, the simulator will complain that the TLB load stride is not large enough to match the destination framebuffer. We can work around this by programming the smallest size of both surfaces, which should be okay because the tlb blit path requires that the blit coordinates are the same for both src and dst. Fixes assert crashes with the simulator for MSAA tests in: ./bin/gl-1.0-logicop Reviewed-by: Juan A. Suarez <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10863> --- src/gallium/drivers/v3d/v3d_blit.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/v3d/v3d_blit.c b/src/gallium/drivers/v3d/v3d_blit.c index 70c55d3928a..7b19b39e6ae 100644 --- a/src/gallium/drivers/v3d/v3d_blit.c +++ b/src/gallium/drivers/v3d/v3d_blit.c @@ -521,11 +521,17 @@ v3d_tlb_blit(struct pipe_context *pctx, struct pipe_blit_info *info) job->draw_min_y = info->dst.box.y; job->draw_max_x = info->dst.box.x + info->dst.box.width; job->draw_max_y = info->dst.box.y + info->dst.box.height; - job->draw_width = dst_surf->width; - job->draw_height = dst_surf->height; - job->draw_tiles_x = DIV_ROUND_UP(dst_surf->width, + /* The simulator complains if we do a TLB load from a source with a + * stride that is smaller than the destination's, so we program the + * 'frame region' to match the smallest dimensions of the two surfaces. + * This should be fine because we only get here if the src and dst boxes + * match, so we know the blit involves the same tiles on both surfaces. + */ + job->draw_width = MIN2(dst_surf->width, src_surf->width); + job->draw_height = MIN2(dst_surf->height, src_surf->height); + job->draw_tiles_x = DIV_ROUND_UP(job->draw_width, job->tile_width); - job->draw_tiles_y = DIV_ROUND_UP(dst_surf->height, + job->draw_tiles_y = DIV_ROUND_UP(job->draw_height, job->tile_height); job->needs_flush = true; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
