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@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>
This commit is contained in:
Jordan Justen
2021-11-19 14:44:41 -08:00
parent 3643450dc0
commit 5b4914aaf7
6 changed files with 15 additions and 15 deletions

View File

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

View File

@@ -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 */

View File

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

View File

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

View File

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

View File

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