Skip to content
Commit a4739432 authored by Christian König's avatar Christian König Committed by Greg Kroah-Hartman
Browse files

dma-buf: add dma_fence_timestamp helper



commit b83ce9cb upstream.

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: default avatarYunxiang Li <Yunxiang.Li@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Fixes: 1774baa6 ("drm/scheduler: Change scheduled fence track v2")
Reviewed-by: default avatarAlex 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent da9de0b7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment