Mesa (master): gallium: add support for SVM (Share Virtual Memory) migrate

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 2 16:33:05 UTC 2021


Module: Mesa
Branch: master
Commit: e3c2432b375237bc0a2d3c75d5c8ae0b18fb3903
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3c2432b375237bc0a2d3c75d5c8ae0b18fb3903

Author: Jérôme Glisse <jglisse at redhat.com>
Date:   Thu Aug  9 14:53:53 2018 -0400

gallium: add support for SVM (Share Virtual Memory) migrate

v2 (Karol): Fix declaration of pointers argument
v3 (Karol): Move flags into function interface as bools

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

---

 src/gallium/include/pipe/p_context.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index b8c25a84e8f..f0c94ed4c7f 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -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.
     *



More information about the mesa-commit mailing list