Mesa (main): v3dv/cmd_buffer: add helper job_emit_binning_prolog

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 22 10:35:42 UTC 2021


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

Author: Alejandro Piñeiro <apinheiro at igalia.com>
Date:   Wed Jun  2 13:53:31 2021 +0200

v3dv/cmd_buffer: add helper job_emit_binning_prolog

Just to isolate more tightly cl_emit calls. That would make easier to
split v3dv_cmd_buffer.

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11310>

---

 src/broadcom/vulkan/v3dv_cmd_buffer.c | 52 ++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c
index 27d775a17f5..a6d4b2e10d7 100644
--- a/src/broadcom/vulkan/v3dv_cmd_buffer.c
+++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c
@@ -524,6 +524,35 @@ job_compute_frame_tiling(struct v3dv_job *job,
    return tiling;
 }
 
+static void
+job_emit_binning_prolog(struct v3dv_job *job,
+                        const struct v3dv_frame_tiling *tiling,
+                        uint32_t layers)
+{
+   /* This must go before the binning mode configuration. It is
+    * required for layered framebuffers to work.
+    */
+   cl_emit(&job->bcl, NUMBER_OF_LAYERS, config) {
+      config.number_of_layers = layers;
+   }
+
+   cl_emit(&job->bcl, TILE_BINNING_MODE_CFG, config) {
+      config.width_in_pixels = tiling->width;
+      config.height_in_pixels = tiling->height;
+      config.number_of_render_targets = MAX2(tiling->render_target_count, 1);
+      config.multisample_mode_4x = tiling->msaa;
+      config.maximum_bpp_of_all_render_targets = tiling->internal_bpp;
+   }
+
+   /* There's definitely nothing in the VCD cache we want. */
+   cl_emit(&job->bcl, FLUSH_VCD_CACHE, bin);
+
+   /* "Binning mode lists must have a Start Tile Binning item (6) after
+    *  any prefix state data before the binning list proper starts."
+    */
+   cl_emit(&job->bcl, START_TILE_BINNING, bin);
+}
+
 void
 v3dv_job_start_frame(struct v3dv_job *job,
                      uint32_t width,
@@ -588,28 +617,7 @@ v3dv_job_start_frame(struct v3dv_job *job,
 
    v3dv_job_add_bo_unchecked(job, job->tile_state);
 
-   /* This must go before the binning mode configuration. It is
-    * required for layered framebuffers to work.
-    */
-   cl_emit(&job->bcl, NUMBER_OF_LAYERS, config) {
-      config.number_of_layers = layers;
-   }
-
-   cl_emit(&job->bcl, TILE_BINNING_MODE_CFG, config) {
-      config.width_in_pixels = tiling->width;
-      config.height_in_pixels = tiling->height;
-      config.number_of_render_targets = MAX2(tiling->render_target_count, 1);
-      config.multisample_mode_4x = tiling->msaa;
-      config.maximum_bpp_of_all_render_targets = tiling->internal_bpp;
-   }
-
-   /* There's definitely nothing in the VCD cache we want. */
-   cl_emit(&job->bcl, FLUSH_VCD_CACHE, bin);
-
-   /* "Binning mode lists must have a Start Tile Binning item (6) after
-    *  any prefix state data before the binning list proper starts."
-    */
-   cl_emit(&job->bcl, START_TILE_BINNING, bin);
+   job_emit_binning_prolog(job, tiling, layers);
 
    job->ez_state = V3D_EZ_UNDECIDED;
    job->first_ez_state = V3D_EZ_UNDECIDED;



More information about the mesa-commit mailing list