diff --git a/src/xrt/ipc/client/ipc_client_compositor.c b/src/xrt/ipc/client/ipc_client_compositor.c index e60839f8a..55efdded4 100644 --- a/src/xrt/ipc/client/ipc_client_compositor.c +++ b/src/xrt/ipc/client/ipc_client_compositor.c @@ -279,21 +279,21 @@ swapchain_server_create(struct ipc_client_compositor *icc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc) { - xrt_graphics_buffer_handle_t remote_handles[IPC_MAX_SWAPCHAIN_HANDLES] = {0}; + xrt_graphics_buffer_handle_t remote_handles[XRT_MAX_SWAPCHAIN_IMAGES] = {0}; xrt_result_t r = XRT_SUCCESS; uint32_t handle; uint32_t image_count; uint64_t size; bool use_dedicated_allocation; - r = ipc_call_swapchain_create(icc->ipc_c, // connection - info, // in - &handle, // out - &image_count, // out - &size, // out - &use_dedicated_allocation, // out - remote_handles, // handles - IPC_MAX_SWAPCHAIN_HANDLES); // handles + r = ipc_call_swapchain_create(icc->ipc_c, // connection + info, // in + &handle, // out + &image_count, // out + &size, // out + &use_dedicated_allocation, // out + remote_handles, // handles + XRT_MAX_SWAPCHAIN_IMAGES); // handles if (r != XRT_SUCCESS) { return r; } @@ -327,7 +327,7 @@ swapchain_server_import(struct ipc_client_compositor *icc, struct xrt_swapchain **out_xsc) { struct ipc_arg_swapchain_from_native args = {0}; - xrt_graphics_buffer_handle_t handles[IPC_MAX_SWAPCHAIN_HANDLES] = {0}; + xrt_graphics_buffer_handle_t handles[XRT_MAX_SWAPCHAIN_IMAGES] = {0}; xrt_result_t r = XRT_SUCCESS; uint32_t id = 0; diff --git a/src/xrt/ipc/server/ipc_server_handler.c b/src/xrt/ipc/server/ipc_server_handler.c index dad216b59..06aacf0e3 100644 --- a/src/xrt/ipc/server/ipc_server_handler.c +++ b/src/xrt/ipc/server/ipc_server_handler.c @@ -789,7 +789,7 @@ ipc_handle_swapchain_create(volatile struct ipc_client_state *ics, struct xrt_swapchain_native *xscn = (struct xrt_swapchain_native *)xsc; // Limit checking - assert(xsc->image_count <= IPC_MAX_SWAPCHAIN_HANDLES); + assert(xsc->image_count <= XRT_MAX_SWAPCHAIN_IMAGES); assert(xsc->image_count <= max_handle_capacity); for (size_t i = 1; i < xsc->image_count; i++) { @@ -830,7 +830,7 @@ ipc_handle_swapchain_import(volatile struct ipc_client_state *ics, return xret; } - struct xrt_image_native xins[IPC_MAX_SWAPCHAIN_HANDLES] = {0}; + struct xrt_image_native xins[XRT_MAX_SWAPCHAIN_IMAGES] = {0}; for (uint32_t i = 0; i < handle_count; i++) { xins[i].handle = handles[i]; xins[i].size = args->sizes[i]; diff --git a/src/xrt/ipc/shared/ipc_protocol.h b/src/xrt/ipc/shared/ipc_protocol.h index 3d895a837..e3a8bad97 100644 --- a/src/xrt/ipc/shared/ipc_protocol.h +++ b/src/xrt/ipc/shared/ipc_protocol.h @@ -10,6 +10,7 @@ #pragma once +#include "xrt/xrt_limits.h" #include "xrt/xrt_compiler.h" #include "xrt/xrt_compositor.h" #include "xrt/xrt_results.h" @@ -23,7 +24,7 @@ #include -#define IPC_MAX_SWAPCHAIN_HANDLES 8 + #define IPC_CRED_SIZE 1 // auth not implemented #define IPC_BUF_SIZE 512 // must be >= largest message length in bytes #define IPC_MAX_VIEWS 8 // max views we will return configs for @@ -297,7 +298,7 @@ struct ipc_app_state */ struct ipc_arg_swapchain_from_native { - uint32_t sizes[IPC_MAX_SWAPCHAIN_HANDLES]; + uint32_t sizes[XRT_MAX_SWAPCHAIN_IMAGES]; }; /*!