From d245fc33c912a4ae4a78fe6034d752c11a0d7111 Mon Sep 17 00:00:00 2001 From: Jakob Borncrantz Date: Tue, 15 Oct 2019 20:52:39 +0200 Subject: [PATCH] d/ohmd: Add variable tracking --- src/xrt/drivers/ohmd/oh_device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xrt/drivers/ohmd/oh_device.c b/src/xrt/drivers/ohmd/oh_device.c index c754025d9..423c14a75 100644 --- a/src/xrt/drivers/ohmd/oh_device.c +++ b/src/xrt/drivers/ohmd/oh_device.c @@ -19,6 +19,7 @@ #include "math/m_api.h" #include "xrt/xrt_device.h" +#include "util/u_var.h" #include "util/u_misc.h" #include "util/u_debug.h" #include "util/u_device.h" @@ -38,6 +39,9 @@ oh_device_destroy(struct xrt_device *xdev) { struct oh_device *ohd = oh_device(xdev); + // Remove the variable tracking. + u_var_remove_root(ohd); + if (ohd->dev != NULL) { ohmd_close_device(ohd->dev); ohd->dev = NULL; @@ -550,5 +554,8 @@ oh_device_create(ohmd_context *ctx, u_device_dump_config(&ohd->base, __func__, prod); } + u_var_add_root(ohd, "OpenHMD Wrapper", true); + u_var_add_ro_text(ohd, ohd->base.str, "Card"); + return ohd; }