Skip to content

Commit

Permalink
drm/etnaviv: reduce number of ktime_get calls in IRQ handler
Browse files Browse the repository at this point in the history
A single IRQ might signal the completion of multiple jobs/fences
at once. There is no point in attaching a new timestamp to each
fence that only differs in when exactly the IRQ handler was able
to process this fence.

Get a single timestamp when the IRQ handler has determined that
there are completed jobs and reuse this for all fences that get
signalled by the handler.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
  • Loading branch information
lynxeye-dev committed Jun 26, 2024
1 parent 58979ad commit beb311f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/etnaviv/etnaviv_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,7 @@ static irqreturn_t irq_handler(int irq, void *data)
u32 intr = gpu_read(gpu, VIVS_HI_INTR_ACKNOWLEDGE);

if (intr != 0) {
ktime_t now = ktime_get();
int event;

pm_runtime_mark_last_busy(gpu->dev);
Expand Down Expand Up @@ -1597,7 +1598,7 @@ static irqreturn_t irq_handler(int irq, void *data)
*/
if (fence_after(fence->seqno, gpu->completed_fence))
gpu->completed_fence = fence->seqno;
dma_fence_signal(fence);
dma_fence_signal_timestamp(fence, now);

event_free(gpu, event);
}
Expand Down

0 comments on commit beb311f

Please sign in to comment.