Mesa (main): intel/blorp: Modify the SKL+ CCS resolve rectangle
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Dec 11 04:39:15 UTC 2021
Module: Mesa
Branch: main
Commit: c35b8a2889be5aebddb69327083bc556a935b452
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c35b8a2889be5aebddb69327083bc556a935b452
Author: Nanley Chery <nanley.g.chery at intel.com>
Date: Fri Oct 22 17:13:13 2021 -0700
intel/blorp: Modify the SKL+ CCS resolve rectangle
According to Bspec 2424, "Render Target Resolve":
The Resolve Rectangle size is same as Clear Rectangle size from SKL+.
Use get_fast_clear_rect in blorp_ccs_resolve for SKL+.
Note that the Bspec differs from Vol7 of the Sky Lake PRM, which only
specifies aligning by the scaledown factors.
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13555>
---
src/intel/blorp/blorp_clear.c | 65 ++++++++++++++++++++++++-------------------
1 file changed, 36 insertions(+), 29 deletions(-)
diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c
index cbd409ba18d..5ab777dfeb2 100644
--- a/src/intel/blorp/blorp_clear.c
+++ b/src/intel/blorp/blorp_clear.c
@@ -1197,38 +1197,45 @@ blorp_ccs_resolve(struct blorp_batch *batch,
brw_blorp_surface_info_init(batch, ¶ms.dst, surf,
level, start_layer, format, true);
- /* From the Ivy Bridge PRM, Vol2 Part1 11.9 "Render Target Resolve":
- *
- * A rectangle primitive must be scaled down by the following factors
- * with respect to render target being resolved.
- *
- * The scaledown factors in the table that follows are related to the block
- * size of the CCS format. For IVB and HSW, we divide by two, for BDW we
- * multiply by 8 and 16. On Sky Lake, we multiply by 8.
- */
- const struct isl_format_layout *aux_fmtl =
- isl_format_get_layout(params.dst.aux_surf.format);
- assert(aux_fmtl->txc == ISL_TXC_CCS);
-
- unsigned x_scaledown, y_scaledown;
- if (ISL_GFX_VER(batch->blorp->isl_dev) >= 12) {
- x_scaledown = aux_fmtl->bw * 8;
- y_scaledown = aux_fmtl->bh * 4;
- } else if (ISL_GFX_VER(batch->blorp->isl_dev) >= 9) {
- x_scaledown = aux_fmtl->bw * 8;
- y_scaledown = aux_fmtl->bh * 8;
- } else if (ISL_GFX_VER(batch->blorp->isl_dev) >= 8) {
- x_scaledown = aux_fmtl->bw * 8;
- y_scaledown = aux_fmtl->bh * 16;
- } else {
- x_scaledown = aux_fmtl->bw / 2;
- y_scaledown = aux_fmtl->bh / 2;
- }
params.x0 = params.y0 = 0;
params.x1 = u_minify(params.dst.surf.logical_level0_px.width, level);
params.y1 = u_minify(params.dst.surf.logical_level0_px.height, level);
- params.x1 = ALIGN(params.x1, x_scaledown) / x_scaledown;
- params.y1 = ALIGN(params.y1, y_scaledown) / y_scaledown;
+ if (ISL_GFX_VER(batch->blorp->isl_dev) >= 9) {
+ /* From Bspec 2424, "Render Target Resolve":
+ *
+ * The Resolve Rectangle size is same as Clear Rectangle size from
+ * SKL+.
+ *
+ * Note that this differs from Vol7 of the Sky Lake PRM, which only
+ * specifies aligning by the scaledown factors.
+ */
+ get_fast_clear_rect(batch->blorp->isl_dev, surf->aux_surf,
+ ¶ms.x0, ¶ms.y0, ¶ms.x1, ¶ms.y1);
+ } else {
+ /* From the Ivy Bridge PRM, Vol2 Part1 11.9 "Render Target Resolve":
+ *
+ * A rectangle primitive must be scaled down by the following factors
+ * with respect to render target being resolved.
+ *
+ * The scaledown factors in the table that follows are related to the
+ * block size of the CCS format. For IVB and HSW, we divide by two, for
+ * BDW we multiply by 8 and 16.
+ */
+ const struct isl_format_layout *aux_fmtl =
+ isl_format_get_layout(params.dst.aux_surf.format);
+ assert(aux_fmtl->txc == ISL_TXC_CCS);
+
+ unsigned x_scaledown, y_scaledown;
+ if (ISL_GFX_VER(batch->blorp->isl_dev) >= 8) {
+ x_scaledown = aux_fmtl->bw * 8;
+ y_scaledown = aux_fmtl->bh * 16;
+ } else {
+ x_scaledown = aux_fmtl->bw / 2;
+ y_scaledown = aux_fmtl->bh / 2;
+ }
+ params.x1 = ALIGN(params.x1, x_scaledown) / x_scaledown;
+ params.y1 = ALIGN(params.y1, y_scaledown) / y_scaledown;
+ }
if (batch->blorp->isl_dev->info->ver >= 10) {
assert(resolve_op == ISL_AUX_OP_FULL_RESOLVE ||
More information about the mesa-commit
mailing list