summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2021-04-30 22:18:09 +1200
committerMarge Bot <eric+marge@anholt.net>2021-04-30 22:24:58 +0000
commitab8e531cf03018ebd4d99d3ea47750332ac96e71 (patch)
treebc4279ebcc129cd9b060910a301ed6b2af4f9bfc
parent9910a14a1a06a8071a98f309eb5a1e020c21e225 (diff)
panfrost: Fix viewport scissor for preload draws
The max values are inclusive, so add 1 before aligning. This means that a max of 32 will be aligned up to 64 then be decremented to 63. Add a comment to the pan_fb_info struct to document maxx and maxy as inclusive. Fixes: 8ba2f9f6985 ("panfrost: Create a blitter library to replace the existing preload helpers") Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10542>
-rw-r--r--src/panfrost/lib/pan_blitter.c8
-rw-r--r--src/panfrost/lib/pan_cs.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/src/panfrost/lib/pan_blitter.c b/src/panfrost/lib/pan_blitter.c
index 4682598e0be..7cfe2d9614d 100644
--- a/src/panfrost/lib/pan_blitter.c
+++ b/src/panfrost/lib/pan_blitter.c
@@ -882,10 +882,10 @@ pan_preload_emit_viewport(struct pan_pool *pool,
/* Align on 32x32 tiles */
cfg.scissor_minimum_x = fb->extent.minx & ~31;
cfg.scissor_minimum_y = fb->extent.miny & ~31;
- cfg.scissor_maximum_x = MIN2(ALIGN_POT(fb->extent.maxx, 32) - 1,
- fb->width - 1);
- cfg.scissor_maximum_y = MIN2(ALIGN_POT(fb->extent.maxy, 32) - 1,
- fb->height - 1);
+ cfg.scissor_maximum_x = MIN2(ALIGN_POT(fb->extent.maxx + 1, 32),
+ fb->width) - 1;
+ cfg.scissor_maximum_y = MIN2(ALIGN_POT(fb->extent.maxy + 1, 32),
+ fb->height) - 1;
}
}
diff --git a/src/panfrost/lib/pan_cs.h b/src/panfrost/lib/pan_cs.h
index 8f5db219014..ac27f688d00 100644
--- a/src/panfrost/lib/pan_cs.h
+++ b/src/panfrost/lib/pan_cs.h
@@ -103,6 +103,7 @@ struct pan_fb_bifrost_info {
struct pan_fb_info {
unsigned width, height;
struct {
+ /* Max values are inclusive */
unsigned minx, miny, maxx, maxy;
} extent;
unsigned nr_samples;