Mesa (main): iris: Move away from "hw" for some context terminology

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 3 01:14:03 UTC 2021


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

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Fri Nov 19 14:44:41 2021 -0800

iris: Move away from "hw" for some context terminology

Kernel contexts can take two forms now. In the older case a kernel
context will have a single hardware context. With an "engines" based
context, the context can now have 1 or more hardware contexts.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>

---

 src/gallium/drivers/iris/iris_batch.c             | 20 ++++++++++----------
 src/gallium/drivers/iris/iris_batch.h             |  2 +-
 src/gallium/drivers/iris/iris_bufmgr.c            |  2 +-
 src/gallium/drivers/iris/iris_bufmgr.h            |  2 +-
 src/gallium/drivers/iris/iris_monitor.c           |  2 +-
 src/gallium/drivers/iris/iris_performance_query.c |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c
index 47c7208cde9..aa9da2215e6 100644
--- a/src/gallium/drivers/iris/iris_batch.c
+++ b/src/gallium/drivers/iris/iris_batch.c
@@ -241,10 +241,10 @@ iris_init_non_engine_contexts(struct iris_context *ice, int priority)
 
    for (int i = 0; i < IRIS_BATCH_COUNT; i++) {
       struct iris_batch *batch = &ice->batches[i];
-      batch->hw_ctx_id = iris_create_hw_context(screen->bufmgr);
+      batch->ctx_id = iris_create_hw_context(screen->bufmgr);
       batch->exec_flags = I915_EXEC_RENDER;
-      assert(batch->hw_ctx_id);
-      iris_hw_context_set_priority(screen->bufmgr, batch->hw_ctx_id, priority);
+      assert(batch->ctx_id);
+      iris_hw_context_set_priority(screen->bufmgr, batch->ctx_id, priority);
    }
 }
 
@@ -488,7 +488,7 @@ iris_batch_free(struct iris_batch *batch)
    batch->map = NULL;
    batch->map_next = NULL;
 
-   iris_destroy_hw_context(bufmgr, batch->hw_ctx_id);
+   iris_destroy_kernel_context(bufmgr, batch->ctx_id);
 
    iris_destroy_batch_measure(batch->measure);
    batch->measure = NULL;
@@ -614,12 +614,12 @@ replace_hw_ctx(struct iris_batch *batch)
    struct iris_screen *screen = batch->screen;
    struct iris_bufmgr *bufmgr = screen->bufmgr;
 
-   uint32_t new_ctx = iris_clone_hw_context(bufmgr, batch->hw_ctx_id);
+   uint32_t new_ctx = iris_clone_hw_context(bufmgr, batch->ctx_id);
    if (!new_ctx)
       return false;
 
-   iris_destroy_hw_context(bufmgr, batch->hw_ctx_id);
-   batch->hw_ctx_id = new_ctx;
+   iris_destroy_kernel_context(bufmgr, batch->ctx_id);
+   batch->ctx_id = new_ctx;
 
    /* Notify the context that state must be re-initialized. */
    iris_lost_context_state(batch);
@@ -632,7 +632,7 @@ iris_batch_check_for_reset(struct iris_batch *batch)
 {
    struct iris_screen *screen = batch->screen;
    enum pipe_reset_status status = PIPE_NO_RESET;
-   struct drm_i915_reset_stats stats = { .ctx_id = batch->hw_ctx_id };
+   struct drm_i915_reset_stats stats = { .ctx_id = batch->ctx_id };
 
    if (intel_ioctl(screen->fd, DRM_IOCTL_I915_GET_RESET_STATS, &stats))
       DBG("DRM_IOCTL_I915_GET_RESET_STATS failed: %s\n", strerror(errno));
@@ -847,7 +847,7 @@ submit_batch(struct iris_batch *batch)
                I915_EXEC_NO_RELOC |
                I915_EXEC_BATCH_FIRST |
                I915_EXEC_HANDLE_LUT,
-      .rsvd1 = batch->hw_ctx_id, /* rsvd1 is actually the context ID */
+      .rsvd1 = batch->ctx_id, /* rsvd1 is actually the context ID */
    };
 
    if (num_fences(batch)) {
@@ -914,7 +914,7 @@ _iris_batch_flush(struct iris_batch *batch, const char *file, int line)
 
       fprintf(stderr, "%19s:%-3d: %s batch [%u] flush with %5db (%0.1f%%) "
               "(cmds), %4d BOs (%0.1fMb aperture)\n",
-              file, line, batch_name_to_string(batch->name), batch->hw_ctx_id,
+              file, line, batch_name_to_string(batch->name), batch->ctx_id,
               batch->total_chained_batch_size,
               100.0f * batch->total_chained_batch_size / BATCH_SZ,
               batch->exec_count,
diff --git a/src/gallium/drivers/iris/iris_batch.h b/src/gallium/drivers/iris/iris_batch.h
index 230d63b28c4..b86e7aa9d5d 100644
--- a/src/gallium/drivers/iris/iris_batch.h
+++ b/src/gallium/drivers/iris/iris_batch.h
@@ -79,7 +79,7 @@ struct iris_batch {
    /** Last Surface State Base Address set in this hardware context. */
    uint64_t last_surface_base_address;
 
-   uint32_t hw_ctx_id;
+   uint32_t ctx_id;
    uint32_t exec_flags;
 
    /** A list of all BOs referenced by this batch */
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index 467f24fb5e6..e0c2c7c25b1 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -2101,7 +2101,7 @@ iris_clone_hw_context(struct iris_bufmgr *bufmgr, uint32_t ctx_id)
 }
 
 void
-iris_destroy_hw_context(struct iris_bufmgr *bufmgr, uint32_t ctx_id)
+iris_destroy_kernel_context(struct iris_bufmgr *bufmgr, uint32_t ctx_id)
 {
    struct drm_i915_gem_context_destroy d = { .ctx_id = ctx_id };
 
diff --git a/src/gallium/drivers/iris/iris_bufmgr.h b/src/gallium/drivers/iris/iris_bufmgr.h
index 197b9e93635..af4790eef36 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.h
+++ b/src/gallium/drivers/iris/iris_bufmgr.h
@@ -460,7 +460,7 @@ void iris_hw_context_set_unrecoverable(struct iris_bufmgr *bufmgr,
 int iris_hw_context_set_priority(struct iris_bufmgr *bufmgr,
                                  uint32_t ctx_id, int priority);
 
-void iris_destroy_hw_context(struct iris_bufmgr *bufmgr, uint32_t ctx_id);
+void iris_destroy_kernel_context(struct iris_bufmgr *bufmgr, uint32_t ctx_id);
 
 int iris_gem_get_tiling(struct iris_bo *bo, uint32_t *tiling);
 int iris_gem_set_tiling(struct iris_bo *bo, const struct isl_surf *surf);
diff --git a/src/gallium/drivers/iris/iris_monitor.c b/src/gallium/drivers/iris/iris_monitor.c
index 9f7d7abec0a..54d2e669956 100644
--- a/src/gallium/drivers/iris/iris_monitor.c
+++ b/src/gallium/drivers/iris/iris_monitor.c
@@ -157,7 +157,7 @@ iris_init_monitor_ctx(struct iris_context *ice)
                          ice,
                          screen->bufmgr,
                          &screen->devinfo,
-                         ice->batches[IRIS_BATCH_RENDER].hw_ctx_id,
+                         ice->batches[IRIS_BATCH_RENDER].ctx_id,
                          screen->fd);
 }
 
diff --git a/src/gallium/drivers/iris/iris_performance_query.c b/src/gallium/drivers/iris/iris_performance_query.c
index 277fded379d..8e8d8bf9357 100644
--- a/src/gallium/drivers/iris/iris_performance_query.c
+++ b/src/gallium/drivers/iris/iris_performance_query.c
@@ -76,7 +76,7 @@ iris_init_perf_query_info(struct pipe_context *pipe)
                          ice,
                          screen->bufmgr,
                          &screen->devinfo,
-                         ice->batches[IRIS_BATCH_RENDER].hw_ctx_id,
+                         ice->batches[IRIS_BATCH_RENDER].ctx_id,
                          screen->fd);
 
    return perf_cfg->n_queries;



More information about the mesa-commit mailing list