Mesa (staging/21.1): panfrost: Fix viewport scissor for preload draws
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun May 2 19:01:51 UTC 2021
Module: Mesa
Branch: staging/21.1
Commit: 3f78ccb7baddfac5d3d9705d4ea3acfd849d3063
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f78ccb7baddfac5d3d9705d4ea3acfd849d3063
Author: Icecream95 <ixn at disroot.org>
Date: Fri Apr 30 22:18:09 2021 +1200
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 at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10542>
(cherry picked from commit ab8e531cf03018ebd4d99d3ea47750332ac96e71)
---
.pick_status.json | 2 +-
src/panfrost/lib/pan_blitter.c | 8 ++++----
src/panfrost/lib/pan_cs.h | 1 +
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 617dd052565..b75a8734281 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -283,7 +283,7 @@
"description": "panfrost: Fix viewport scissor for preload draws",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "8ba2f9f698584d20830ef31bbc2fb8a6635c8314"
},
diff --git a/src/panfrost/lib/pan_blitter.c b/src/panfrost/lib/pan_blitter.c
index ea43e04ab3f..203b9ff9255 100644
--- a/src/panfrost/lib/pan_blitter.c
+++ b/src/panfrost/lib/pan_blitter.c
@@ -877,10 +877,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;
More information about the mesa-commit
mailing list