Mesa (main): panfrost: Adapt viewport/scissor to Valhall

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 18:02:37 UTC 2022


Module: Mesa
Branch: main
Commit: 0d48a5745214bfdbb7af9ccbdc141e10e424e2be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d48a5745214bfdbb7af9ccbdc141e10e424e2be

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu Apr  7 11:19:39 2022 -0400

panfrost: Adapt viewport/scissor to Valhall

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 34 ++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index cf6df4f9281..8b8bed36bdf 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -722,24 +722,40 @@ panfrost_emit_viewport(struct panfrost_batch *batch)
         if (maxx == 0 || maxy == 0)
                 maxx = maxy = minx = miny = 1;
 
+        panfrost_batch_union_scissor(batch, minx, miny, maxx, maxy);
+        batch->scissor_culls_everything = (minx >= maxx || miny >= maxy);
+
+        /* [minx, maxx) and [miny, maxy) are exclusive ranges in the hardware */
+        maxx--;
+        maxy--;
+
+        batch->minimum_z = rast->depth_clip_near ? minz : -INFINITY;
+        batch->maximum_z = rast->depth_clip_far  ? maxz : +INFINITY;
+
+#if PAN_ARCH <= 7
         struct panfrost_ptr T = pan_pool_alloc_desc(&batch->pool.base, VIEWPORT);
 
         pan_pack(T.cpu, VIEWPORT, cfg) {
-                /* [minx, maxx) and [miny, maxy) are exclusive ranges, but
-                 * these are inclusive */
                 cfg.scissor_minimum_x = minx;
                 cfg.scissor_minimum_y = miny;
-                cfg.scissor_maximum_x = maxx - 1;
-                cfg.scissor_maximum_y = maxy - 1;
+                cfg.scissor_maximum_x = maxx;
+                cfg.scissor_maximum_y = maxy;
 
-                cfg.minimum_z = rast->depth_clip_near ? minz : -INFINITY;
-                cfg.maximum_z = rast->depth_clip_far ? maxz : INFINITY;
+                cfg.minimum_z = batch->minimum_z;
+                cfg.maximum_z = batch->maximum_z;
         }
 
-        panfrost_batch_union_scissor(batch, minx, miny, maxx, maxy);
-        batch->scissor_culls_everything = (minx >= maxx || miny >= maxy);
-
         return T.gpu;
+#else
+        pan_pack(&batch->scissor, SCISSOR, cfg) {
+                cfg.scissor_minimum_x = minx;
+                cfg.scissor_minimum_y = miny;
+                cfg.scissor_maximum_x = maxx;
+                cfg.scissor_maximum_y = maxy;
+        }
+
+        return 0;
+#endif
 }
 
 static mali_ptr



More information about the mesa-commit mailing list