iris: move iris_flush_resource so we can call it from get_handle
authorTapani Pälli <tapani.palli@intel.com>
Thu, 28 Mar 2019 08:49:45 +0000 (10:49 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 4 Apr 2019 20:36:51 +0000 (13:36 -0700)
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_resource.c

index c16fc8eb0158519863ba85d56e3fa6c007c00085..d0a473fd72af71b6500e458a785c64e18be6c3a4 100644 (file)
@@ -815,6 +815,21 @@ fail:
    return NULL;
 }
 
+static void
+iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
+{
+   struct iris_context *ice = (struct iris_context *)ctx;
+   struct iris_batch *render_batch = &ice->batches[IRIS_BATCH_RENDER];
+   struct iris_resource *res = (void *) resource;
+   const struct isl_drm_modifier_info *mod = res->mod_info;
+
+   iris_resource_prepare_access(ice, render_batch, res,
+                                0, INTEL_REMAINING_LEVELS,
+                                0, INTEL_REMAINING_LAYERS,
+                                mod ? mod->aux_usage : ISL_AUX_USAGE_NONE,
+                                mod ? mod->supports_clear_color : false);
+}
+
 static boolean
 iris_resource_get_handle(struct pipe_screen *pscreen,
                          struct pipe_context *ctx,
@@ -1385,21 +1400,6 @@ iris_transfer_unmap(struct pipe_context *ctx, struct pipe_transfer *xfer)
    slab_free(&ice->transfer_pool, map);
 }
 
-static void
-iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
-{
-   struct iris_context *ice = (struct iris_context *)ctx;
-   struct iris_batch *render_batch = &ice->batches[IRIS_BATCH_RENDER];
-   struct iris_resource *res = (void *) resource;
-   const struct isl_drm_modifier_info *mod = res->mod_info;
-
-   iris_resource_prepare_access(ice, render_batch, res,
-                                0, INTEL_REMAINING_LEVELS,
-                                0, INTEL_REMAINING_LAYERS,
-                                mod ? mod->aux_usage : ISL_AUX_USAGE_NONE,
-                                mod ? mod->supports_clear_color : false);
-}
-
 void
 iris_flush_and_dirty_for_history(struct iris_context *ice,
                                  struct iris_batch *batch,