@@ -159,6 +159,10 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, struct et
link_target = buffer->paddr + buffer->offset * 4;
link_size = 6;
+ /* Save the event and buffer position of the new event trigger */
+ gpu->event[event].fence = submit->fence;
+ gpu->event[event].ring_pos = buffer->offset;
+
/* trigger event */
CMD_LOAD_STATE(buffer, VIVS_GL_EVENT, VIVS_GL_EVENT_EVENT_ID(event) | VIVS_GL_EVENT_FROM_PE);
@@ -781,8 +781,6 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu, struct etnaviv_gem_submit *submi
goto fail;
}
- gpu->event[event].fence = submit->fence;
-
etnaviv_buffer_queue(gpu, event, submit);
priv->lastctx = ctx;
@@ -834,6 +832,7 @@ static irqreturn_t irq_handler(int irq, void *data)
uint8_t event = __fls(intr);
dev_dbg(gpu->dev->dev, "event %u\n", event);
gpu->retired_fence = gpu->event[event].fence;
+ gpu->last_ring_pos = gpu->event[event].ring_pos;
event_free(gpu, event);
etnaviv_gpu_retire(gpu);
}
@@ -81,6 +81,7 @@ struct etnaviv_chip_identity {
struct etnaviv_event {
bool used;
uint32_t fence;
+ uint32_t ring_pos;
};
struct etnaviv_gpu {
@@ -102,6 +103,7 @@ struct etnaviv_gpu {
uint32_t submitted_fence;
uint32_t retired_fence;
+ uint32_t last_ring_pos;
/* worker for handling active-list retiring: */
struct work_struct retire_work;