d/wmr: Add stub WinMR builder

This commit is contained in:
Jakob Bornecrantz 2022-12-23 18:37:54 +00:00
parent 05b83d5102
commit 56dd75c14d
4 changed files with 115 additions and 2 deletions

View file

@ -45,6 +45,11 @@ if(XRT_BUILD_DRIVER_NS)
target_link_libraries(target_lists PRIVATE drv_ns)
endif()
if(XRT_BUILD_DRIVER_WMR)
target_sources(target_lists PRIVATE target_builder_wmr.c)
target_link_libraries(target_lists PRIVATE drv_wmr)
endif()
###
# Drivers
#

View file

@ -1,4 +1,4 @@
// Copyright 2022, Collabora, Ltd.
// Copyright 2022-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
@ -43,6 +43,10 @@
#define T_BUILDER_SIMULAVR
#endif
#if defined(XRT_BUILD_DRIVER_WMR) || defined(XRT_DOXYGEN)
#define T_BUILDER_WMR
#endif
/*
*
@ -106,3 +110,11 @@ t_builder_simulated_create(void);
struct xrt_builder *
t_builder_simula_create(void);
#endif
#ifdef T_BUILDER_WMR
/*!
* Builder for Windows Mixed Reality headsets
*/
struct xrt_builder *
t_builder_wmr_create(void);
#endif

View file

@ -0,0 +1,92 @@
// Copyright 2022-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief @ref drv_wmr driver builder.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @ingroup xrt_iface
*/
#include "xrt/xrt_config_drivers.h"
#include "xrt/xrt_prober.h"
#include "util/u_misc.h"
#include "util/u_logging.h"
#include "util/u_builders.h"
#include "util/u_config_json.h"
#include "util/u_system_helpers.h"
#include "target_builder_interface.h"
#include "wmr/wmr_interface.h"
#include <assert.h>
#ifndef XRT_BUILD_DRIVER_WMR
#error "Must only be built with XRT_BUILD_DRIVER_WMR set"
#endif
/*
*
* Various helper functions and lists.
*
*/
static const char *driver_list[] = {
"wmr",
};
/*
*
* Member functions.
*
*/
static xrt_result_t
wmr_estimate_system(struct xrt_builder *xb,
cJSON *config,
struct xrt_prober *xp,
struct xrt_builder_estimate *out_estimate)
{
return XRT_SUCCESS;
}
static xrt_result_t
wmr_open_system(struct xrt_builder *xb,
cJSON *config,
struct xrt_prober *xp,
struct xrt_system_devices **out_xsysd,
struct xrt_space_overseer **out_xso)
{
return XRT_SUCCESS;
}
static void
wmr_destroy(struct xrt_builder *xb)
{
free(xb);
}
/*
*
* 'Exported' functions.
*
*/
struct xrt_builder *
t_builder_wmr_create(void)
{
struct xrt_builder *xb = U_TYPED_CALLOC(struct xrt_builder);
xb->estimate_system = wmr_estimate_system;
xb->open_system = wmr_open_system;
xb->destroy = wmr_destroy;
xb->identifier = "wmr";
xb->name = "Windows Mixed Reality";
xb->driver_identifiers = driver_list;
xb->driver_identifier_count = ARRAY_SIZE(driver_list);
return xb;
}

View file

@ -1,4 +1,4 @@
// Copyright 2019-2022, Collabora, Ltd.
// Copyright 2019-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
@ -124,6 +124,10 @@ xrt_builder_create_func_t target_builder_list[] = {
t_builder_north_star_create,
#endif // T_BUILDER_NS
#ifdef T_BUILDER_WMR
t_builder_wmr_create,
#endif // T_BUILDER_WMR
#ifdef T_BUILDER_LEGACY
t_builder_legacy_create,
#endif // T_BUILDER_LEGACY