mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
iris: add a iris_context reference to iris_batch
This eliminates the need to use container_of in error handling code. INTEL_MEASURE will need to access the iris context from each batch. suggested-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354>
This commit is contained in:
parent
e67b8f504b
commit
b338bb70e0
4 changed files with 4 additions and 8 deletions
|
|
@ -180,6 +180,7 @@ iris_init_batch(struct iris_context *ice,
|
|||
batch->reset = &ice->reset;
|
||||
batch->state_sizes = ice->state.sizes;
|
||||
batch->name = name;
|
||||
batch->ice = ice;
|
||||
|
||||
batch->fine_fences.uploader =
|
||||
u_upload_create(&ice->ctx, 4096, PIPE_BIND_CUSTOM,
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ enum iris_batch_name {
|
|||
#define IRIS_BATCH_COUNT 2
|
||||
|
||||
struct iris_batch {
|
||||
struct iris_context *ice;
|
||||
struct iris_screen *screen;
|
||||
struct pipe_debug_callback *dbg;
|
||||
struct pipe_device_reset_callback *reset;
|
||||
|
|
|
|||
|
|
@ -78,17 +78,11 @@ iris_lost_context_state(struct iris_batch *batch)
|
|||
* we do need to inform the context of batch catastrophe. We know the
|
||||
* batch is one of our context's, so hackily claw our way back.
|
||||
*/
|
||||
struct iris_context *ice = NULL;
|
||||
struct iris_context *ice = batch->ice;
|
||||
|
||||
if (batch->name == IRIS_BATCH_RENDER) {
|
||||
ice = container_of(batch, struct iris_context, batches[IRIS_BATCH_RENDER]);
|
||||
assert(&ice->batches[IRIS_BATCH_RENDER] == batch);
|
||||
|
||||
batch->screen->vtbl.init_render_context(batch);
|
||||
} else if (batch->name == IRIS_BATCH_COMPUTE) {
|
||||
ice = container_of(batch, struct iris_context, batches[IRIS_BATCH_COMPUTE]);
|
||||
assert(&ice->batches[IRIS_BATCH_COMPUTE] == batch);
|
||||
|
||||
batch->screen->vtbl.init_compute_context(batch);
|
||||
} else {
|
||||
unreachable("unhandled batch reset");
|
||||
|
|
|
|||
|
|
@ -812,7 +812,7 @@ iris_upload_slice_hashing_state(struct iris_batch *batch)
|
|||
if (subslices_delta == 0)
|
||||
return;
|
||||
|
||||
struct iris_context *ice = container_of(batch, struct iris_context, batches[IRIS_BATCH_RENDER]);
|
||||
struct iris_context *ice = batch->ice;
|
||||
assert(&ice->batches[IRIS_BATCH_RENDER] == batch);
|
||||
|
||||
unsigned size = GENX(SLICE_HASH_TABLE_length) * 4;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue