freedreno/drm: Move no_implicit_sync to base
authorRob Clark <robdclark@chromium.org>
Sat, 3 Dec 2022 16:19:23 +0000 (08:19 -0800)
committerMarge Bot <emma+marge@anholt.net>
Sat, 17 Dec 2022 19:14:12 +0000 (19:14 +0000)
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>

src/freedreno/drm/freedreno_priv.h
src/freedreno/drm/msm/msm_priv.h
src/freedreno/drm/msm/msm_ringbuffer_sp.c
src/freedreno/drm/virtio/virtio_bo.c
src/freedreno/drm/virtio/virtio_priv.h
src/freedreno/drm/virtio/virtio_ringbuffer.c

index c4b8a47cb0ed8e477c196133c8a46ac7136a8bca..242577cb0466477febf5ceacac2269e73e665696 100644 (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;
 
index b41d1ffb15d0064065ed3a76d43b17a58003a5d5..b597f7c749243054ed48702b883f73827ffc670c 100644 (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);
 
index 96e7462df6267d3ff48f03bbe249b4e9fcb4d328..fb1869cdaa6fc0fd048c86be18589a55b047f5ed 100644 (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;
    }
 
index d5d163f7084e10f2ea429583adfbf116d4ac175a..8f1e5b150b38f2cd637d220b98379e9923b7edd9 100644 (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 = {
index d453d15c26c97b1c645491181590203bfa098be3..4915f39e07a7a935dd7394c42bc9459e245f3a81 100644 (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
index 6da91f4ab455d25f4fd71f45fc9f6d941d2499eb..7beaa0b4c7314b6afc7794e029cefae47595d914 100644 (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;
    }