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: 8ba2f9f698 ("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>
(cherry picked from commit ab8e531cf0)
This commit is contained in:
Icecream95 2021-04-30 22:18:09 +12:00 committed by Eric Engestrom
parent f53f73b8df
commit 3f78ccb7ba
3 changed files with 6 additions and 5 deletions

View file

@ -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"
},

View file

@ -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;
}
}

View file

@ -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;