gallium: add support for SVM (Share Virtual Memory) migrate
authorJérôme Glisse <jglisse@redhat.com>
Thu, 9 Aug 2018 18:53:53 +0000 (14:53 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 2 Feb 2021 16:11:35 +0000 (16:11 +0000)
v2 (Karol): Fix declaration of pointers argument
v3 (Karol): Move flags into function interface as bools

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6401>

src/gallium/include/pipe/p_context.h

index b8c25a84e8fd2297251831ebaf74a49f2057afff..f0c94ed4c7fb1590cfb26d27068ae9757bb57259 100644 (file)
@@ -907,6 +907,22 @@ struct pipe_context {
                        const struct pipe_grid_info *info);
    /*@}*/
 
+   /**
+    * SVM (Share Virtual Memory) helpers
+    */
+   /*@{*/
+   /**
+    * Migrate range of virtual address to device or host memory.
+    *
+    * \param to_device - true if the virtual memory is migrated to the device
+    *                    false if the virtual memory is migrated to the host
+    * \param migrate_content - whether the content should be migrated as well
+    */
+   void (*svm_migrate)(struct pipe_context *context, unsigned num_ptrs,
+                       const void* const* ptrs, const size_t *sizes,
+                       bool to_device, bool migrate_content);
+   /*@}*/
+
    /**
     * Get the default sample position for an individual sample point.
     *