gallium/radeon: add a return value to cs_flush
authorMarek Olšák <marek.olsak@amd.com>
Wed, 13 Jul 2016 13:16:20 +0000 (15:16 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 14 Jul 2016 20:00:54 +0000 (22:00 +0200)
Required by our UVD code.

Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeon/radeon_winsys.h
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
src/gallium/winsys/radeon/drm/radeon_drm_cs.c

index 090cafc7ff6c593c75b17750653d4526fe4b8843..a9c9b9ebf3202e5873f2b503bc512a0d13a9566a 100644 (file)
@@ -733,10 +733,12 @@ struct radeon_winsys {
      * \param flags,      RADEON_FLUSH_ASYNC or 0.
      * \param fence       Pointer to a fence. If non-NULL, a fence is inserted
      *                    after the CS and is returned through this parameter.
+     * \return Negative POSIX error code or 0 for success.
+     *         Asynchronous submissions never return an error.
      */
-    void (*cs_flush)(struct radeon_winsys_cs *cs,
-                     unsigned flags,
-                     struct pipe_fence_handle **fence);
+    int (*cs_flush)(struct radeon_winsys_cs *cs,
+                    unsigned flags,
+                    struct pipe_fence_handle **fence);
 
     /**
      * Return true if a buffer is referenced by a command stream.
index 1302f293c261e189743a9d171d3d8217bd31673c..1094c3f61c8bd0106ae04d06cea2e5b7ebf65d95 100644 (file)
@@ -968,9 +968,9 @@ void amdgpu_cs_sync_flush(struct radeon_winsys_cs *rcs)
 
 DEBUG_GET_ONCE_BOOL_OPTION(noop, "RADEON_NOOP", false)
 
-static void amdgpu_cs_flush(struct radeon_winsys_cs *rcs,
-                            unsigned flags,
-                            struct pipe_fence_handle **fence)
+static int amdgpu_cs_flush(struct radeon_winsys_cs *rcs,
+                           unsigned flags,
+                           struct pipe_fence_handle **fence)
 {
    struct amdgpu_cs *cs = amdgpu_cs(rcs);
    struct amdgpu_winsys *ws = cs->ctx->ws;
@@ -1069,6 +1069,7 @@ static void amdgpu_cs_flush(struct radeon_winsys_cs *rcs,
       amdgpu_get_new_ib(&ws->base, cs, IB_CONST_PREAMBLE);
 
    ws->num_cs_flushes++;
+   return 0;
 }
 
 static void amdgpu_cs_destroy(struct radeon_winsys_cs *rcs)
index ed34a2cb55266465f19023b2d3b37b7ba5e757b3..767c263a33d09987746e7a55b04db909458a3a58 100644 (file)
@@ -471,9 +471,9 @@ void radeon_drm_cs_sync_flush(struct radeon_winsys_cs *rcs)
 
 DEBUG_GET_ONCE_BOOL_OPTION(noop, "RADEON_NOOP", false)
 
-static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs,
-                                unsigned flags,
-                                struct pipe_fence_handle **fence)
+static int radeon_drm_cs_flush(struct radeon_winsys_cs *rcs,
+                               unsigned flags,
+                               struct pipe_fence_handle **fence)
 {
     struct radeon_drm_cs *cs = radeon_drm_cs(rcs);
     struct radeon_cs_context *tmp;
@@ -602,6 +602,7 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs,
     cs->base.current.cdw = 0;
 
     cs->ws->num_cs_flushes++;
+    return 0;
 }
 
 static void radeon_drm_cs_destroy(struct radeon_winsys_cs *rcs)