@@ -298,6 +298,22 @@ struct drm_device {
*/
struct drm_fb_helper *fb_helper;
+ /**
+ * @mem_total:
+ *
+ * The total size of all GEM objects known to this DRM device. Used
+ * with `gpu_mem_total` tracepoint.
+ */
+ atomic64_t mem_total;
+
+ /**
+ * @import_mem_total:
+ *
+ * The total size of all GEM objects imported into this DRM device from
+ * external exporters. Used with `gpu_mem_total` tracepoint.
+ */
+ atomic64_t import_mem_total;
+
/* Everything below here is for legacy driver, never use! */
/* private: */
#if IS_ENABLED(CONFIG_DRM_LEGACY)
@@ -362,6 +362,22 @@ struct drm_file {
*/
struct drm_prime_file_private prime;
+ /**
+ * @mem_instance:
+ *
+ * The total size of all GEM objects known into this instance of the DRM
+ * device. Used with `gpu_mem_instance` tracepoint.
+ */
+ atomic64_t mem_instance;
+
+ /**
+ * @import_mem_instance:
+ *
+ * The total size of all GEM objects imported into this instance of the
+ * DRM device. Used with `gpu_mem_instance` tracepoint.
+ */
+ atomic64_t import_mem_instance;
+
/* private: */
#if IS_ENABLED(CONFIG_DRM_LEGACY)
unsigned long lock_count; /* DRI1 legacy lock count */
For struct drm_device, add: - mem_total - import_mem_total For struct drm_file, add: - mem_instance - import_mem_instance Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org> --- include/drm/drm_device.h | 16 ++++++++++++++++ include/drm/drm_file.h | 16 ++++++++++++++++ 2 files changed, 32 insertions(+)