linux/drivers/gpu/drm/scheduler
Christian König 4e82b9c11d dma-buf: add dma_fence_timestamp helper
[ Upstream commit b83ce9cb4a ]

When a fence signals there is a very small race window where the timestamp
isn't updated yet. sync_file solves this by busy waiting for the
timestamp to appear, but on other ocassions didn't handled this
correctly.

Provide a dma_fence_timestamp() helper function for this and use it in
all appropriate cases.

Another alternative would be to grab the spinlock when that happens.

v2 by teddy: add a wait parameter to wait for the timestamp to show up, in case
   the accurate timestamp is needed and/or the timestamp is not based on
   ktime (e.g. hw timestamp)
v3 chk: drop the parameter again for unified handling

Signed-off-by: Yunxiang Li <Yunxiang.Li@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 1774baa64f ("drm/scheduler: Change scheduled fence track v2")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20230929104725.2358-1-christian.koenig@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-02-23 08:55:10 +01:00
..
gpu_scheduler_trace.h drm/sched: add run job trace 2020-03-13 11:52:36 -04:00
Makefile drm/scheduler: rename gpu_scheduler.c to sched_main.c 2018-08-27 11:10:44 -05:00
sched_entity.c drm/sched: Avoid data corruptions 2021-05-19 23:50:28 -04:00
sched_fence.c drm/scheduler: fix sched_fence.c kernel-doc warnings 2020-09-15 17:52:42 -04:00
sched_main.c dma-buf: add dma_fence_timestamp helper 2024-02-23 08:55:10 +01:00