freedreno/drm/virtio: Trigger host side wait boost
Let the host know that we'll be waiting for a fence via an asynchronous WAIT_FENCE command. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23955>
This commit is contained in:
@@ -122,13 +122,6 @@ virtio_pipe_wait(struct fd_pipe *pipe, const struct fd_fence *fence, uint64_t ti
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
assert(fence->use_fence_fd);
|
||||
|
||||
if (fence->use_fence_fd)
|
||||
return sync_wait(fence->fence_fd, timeout / 1000000);
|
||||
|
||||
/* TODO remove !use_fence_fd path */
|
||||
|
||||
struct msm_ccmd_wait_fence_req req = {
|
||||
.hdr = MSM_CCMD(WAIT_FENCE, sizeof(req)),
|
||||
.queue_id = to_virtio_pipe(pipe)->queue_id,
|
||||
@@ -138,6 +131,19 @@ virtio_pipe_wait(struct fd_pipe *pipe, const struct fd_fence *fence, uint64_t ti
|
||||
int64_t end_time = os_time_get_nano() + timeout;
|
||||
int ret;
|
||||
|
||||
/* Do a non-blocking wait to trigger host-side wait-boost,
|
||||
* if the host kernel is new enough
|
||||
*/
|
||||
rsp = virtio_alloc_rsp(pipe->dev, &req.hdr, sizeof(*rsp));
|
||||
ret = virtio_execbuf(pipe->dev, &req.hdr, false);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
virtio_execbuf_flush(pipe->dev);
|
||||
|
||||
if (fence->use_fence_fd)
|
||||
return sync_wait(fence->fence_fd, timeout / 1000000);
|
||||
|
||||
do {
|
||||
rsp = virtio_alloc_rsp(pipe->dev, &req.hdr, sizeof(*rsp));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user