freedreno/drm: Move no_implicit_sync to base

No need to duplicate between backends.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
This commit is contained in:
Rob Clark 2022-12-03 08:19:23 -08:00 committed by Marge Bot
parent 9372f11c81
commit 87f89a0383
6 changed files with 15 additions and 19 deletions

View file

@ -263,6 +263,12 @@ struct fd_pipe {
uint32_t last_enqueue_fence; /* just for debugging */
/**
* If we *ever* see an in-fence-fd, assume that userspace is
* not relying on implicit fences.
*/
bool no_implicit_sync;
struct fd_bo *control_mem;
volatile struct fd_pipe_control *control;

View file

@ -54,12 +54,6 @@ struct msm_pipe {
uint64_t gmem_base;
uint32_t gmem;
uint32_t queue_id;
/**
* If we *ever* see an in-fence-fd, assume that userspace is
* not relying on implicit fences.
*/
bool no_implicit_sync;
};
FD_DEFINE_CAST(fd_pipe, msm_pipe);

View file

@ -37,7 +37,8 @@ static int
flush_submit_list(struct list_head *submit_list)
{
struct fd_submit_sp *fd_submit = to_fd_submit_sp(last_submit(submit_list));
struct msm_pipe *msm_pipe = to_msm_pipe(fd_submit->base.pipe);
struct fd_pipe *pipe = fd_submit->base.pipe;
struct msm_pipe *msm_pipe = to_msm_pipe(pipe);
struct drm_msm_gem_submit req = {
.flags = msm_pipe->pipe,
.queueid = msm_pipe->queue_id,
@ -104,10 +105,10 @@ flush_submit_list(struct list_head *submit_list)
if (fd_submit->in_fence_fd != -1) {
req.flags |= MSM_SUBMIT_FENCE_FD_IN;
req.fence_fd = fd_submit->in_fence_fd;
msm_pipe->no_implicit_sync = true;
pipe->no_implicit_sync = true;
}
if (msm_pipe->no_implicit_sync) {
if (pipe->no_implicit_sync) {
req.flags |= MSM_SUBMIT_NO_IMPLICIT;
}

View file

@ -113,7 +113,7 @@ virtio_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op)
/* If buffer is shared, but we are using explicit sync, no
* need to fallback to implicit sync in host:
*/
if (pipe && to_virtio_pipe(pipe)->no_implicit_sync)
if (pipe && pipe->no_implicit_sync)
goto out;
struct msm_ccmd_gem_cpu_prep_req req = {

View file

@ -135,12 +135,6 @@ struct virtio_pipe {
uint32_t ring_idx;
struct slab_parent_pool ring_pool;
/**
* If we *ever* see an in-fence-fd, assume that userspace is
* not relying on implicit fences.
*/
bool no_implicit_sync;
/**
* We know that the kernel allocated fence seqno's sequentially per-
* submitqueue in a range 1..INT_MAX, which is incremented *after* any

View file

@ -54,7 +54,8 @@ flush_submit_list(struct list_head *submit_list)
{
struct fd_submit_sp *fd_submit = to_fd_submit_sp(last_submit(submit_list));
struct virtio_pipe *virtio_pipe = to_virtio_pipe(fd_submit->base.pipe);
struct fd_device *dev = virtio_pipe->base.dev;
struct fd_pipe *pipe = &virtio_pipe->base;
struct fd_device *dev = pipe->dev;
unsigned nr_cmds = 0;
@ -194,10 +195,10 @@ flush_submit_list(struct list_head *submit_list)
}
if (fd_submit->in_fence_fd != -1) {
virtio_pipe->no_implicit_sync = true;
pipe->no_implicit_sync = true;
}
if (virtio_pipe->no_implicit_sync) {
if (pipe->no_implicit_sync) {
req->flags |= MSM_SUBMIT_NO_IMPLICIT;
}