The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/main: Improve word choice/clarity

+22 -26
+13 -13
src/xrt/compositor/main/comp_compositor.c
··· 760 760 761 761 #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT 762 762 static bool 763 - _match_wl_entry(const char *wl_entry, VkDisplayPropertiesKHR *disp) 763 + _match_allowlist_entry(const char *al_entry, VkDisplayPropertiesKHR *disp) 764 764 { 765 - unsigned long wl_entry_length = strlen(wl_entry); 765 + unsigned long al_entry_length = strlen(al_entry); 766 766 unsigned long disp_entry_length = strlen(disp->displayName); 767 - if (disp_entry_length < wl_entry_length) 767 + if (disp_entry_length < al_entry_length) 768 768 return false; 769 769 770 - // we have a match with this whitelist entry. 771 - if (strncmp(wl_entry, disp->displayName, wl_entry_length) == 0) 770 + // we have a match with this allowlist entry. 771 + if (strncmp(al_entry, disp->displayName, al_entry_length) == 0) 772 772 return true; 773 773 774 774 return false; ··· 814 814 815 815 for (uint32_t i = 0; i < display_count; i++) { 816 816 VkDisplayPropertiesKHR *disp = display_props + i; 817 - // check this display against our whitelist 818 - for (uint32_t j = 0; j < ARRAY_SIZE(NV_DIRECT_WHITELIST); j++) { 819 - if (_match_wl_entry(NV_DIRECT_WHITELIST[j], disp)) { 817 + // check this display against our allowlist 818 + for (uint32_t j = 0; j < ARRAY_SIZE(NV_DIRECT_ALLOWLIST); j++) { 819 + if (_match_allowlist_entry(NV_DIRECT_ALLOWLIST[j], disp)) { 820 820 free(display_props); 821 821 return true; 822 822 } 823 823 } 824 824 825 - if (c->settings.nvidia_display && _match_wl_entry(c->settings.nvidia_display, disp)) { 825 + if (c->settings.nvidia_display && _match_allowlist_entry(c->settings.nvidia_display, disp)) { 826 826 free(display_props); 827 827 return true; 828 828 } 829 829 } 830 830 831 - COMP_ERROR(c, "NVIDIA: No whitelisted displays found!"); 831 + COMP_ERROR(c, "NVIDIA: No allowlisted displays found!"); 832 832 833 - COMP_ERROR(c, "== Current Whitelist =="); 834 - for (uint32_t i = 0; i < ARRAY_SIZE(NV_DIRECT_WHITELIST); i++) 835 - COMP_ERROR(c, "%s", NV_DIRECT_WHITELIST[i]); 833 + COMP_ERROR(c, "== Current Allowlist =="); 834 + for (uint32_t i = 0; i < ARRAY_SIZE(NV_DIRECT_ALLOWLIST); i++) 835 + COMP_ERROR(c, "%s", NV_DIRECT_ALLOWLIST[i]); 836 836 837 837 COMP_ERROR(c, "== Found Displays =="); 838 838 for (uint32_t i = 0; i < display_count; i++)
+1 -1
src/xrt/compositor/main/comp_settings.h
··· 27 27 * be careful about which displays we attempt to acquire. 28 28 * We may wish to allow user configuration to extend this list. 29 29 */ 30 - XRT_MAYBE_UNUSED static const char *NV_DIRECT_WHITELIST[] = { 30 + XRT_MAYBE_UNUSED static const char *NV_DIRECT_ALLOWLIST[] = { 31 31 "Sony SIE HMD *08", "HTC Corporation HTC-VIVE", 32 32 "HTC Corporation VIVE Pro", "Oculus VR Inc. Rift", /* Matches DK1, DK2 and CV1 */ 33 33 "Valve Corporation Index HMD",
+1 -2
src/xrt/compositor/main/comp_target_swapchain.c
··· 631 631 cts->preferred.color_space = color_space; 632 632 633 633 634 - // Sanity check. 634 + // Preliminary check of the environment 635 635 ret = vk->vkGetPhysicalDeviceSurfaceSupportKHR( // 636 636 vk->physical_device, // physicalDevice 637 637 vk->queue_family_index, // queueFamilyIndex ··· 643 643 COMP_ERROR(ct->c, "vkGetPhysicalDeviceSurfaceSupportKHR: Surface not supported!"); 644 644 } 645 645 646 - // More sanity checks. 647 646 if (!check_surface_present_mode(cts, cts->surface.handle, cts->present_mode)) { 648 647 // Free old. 649 648 destroy_old(cts, old_swapchain_handle);
+6 -7
src/xrt/compositor/main/comp_window_direct_nvidia.c
··· 144 144 if (strncmp(wl_entry, disp->displayName, wl_entry_length) != 0) 145 145 return false; 146 146 147 - // we have a match with this whitelist entry. 147 + // we have a match with this allowlist entry. 148 148 w->base.base.c->settings.preferred.width = disp->physicalResolution.width; 149 149 w->base.base.c->settings.preferred.height = disp->physicalResolution.height; 150 150 struct comp_window_direct_nvidia_display d = {.name = U_TYPED_ARRAY_CALLOC(char, disp_entry_length + 1), ··· 172 172 struct comp_window_direct_nvidia *w_direct = (struct comp_window_direct_nvidia *)ct; 173 173 struct vk_bundle *vk = get_vk(ct); 174 174 175 - // Sanity check. 176 175 if (vk->instance == VK_NULL_HANDLE) { 177 176 COMP_ERROR(ct->c, "Vulkan not initialized before NVIDIA init!"); 178 177 return false; ··· 183 182 return false; 184 183 } 185 184 186 - // find our display using nvidia whitelist, enumerate its modes, and 185 + // find our display using nvidia allowlist, enumerate its modes, and 187 186 // pick the best one get a list of attached displays 188 187 uint32_t display_count; 189 188 if (vk->vkGetPhysicalDeviceDisplayPropertiesKHR(vk->physical_device, &display_count, NULL) != VK_SUCCESS) { ··· 205 204 return false; 206 205 } 207 206 208 - // TODO: what if we have multiple whitelisted HMD displays connected? 207 + /// @todo what if we have multiple allowlisted HMD displays connected? 209 208 for (uint32_t i = 0; i < display_count; i++) { 210 209 struct VkDisplayPropertiesKHR disp = *(display_props + i); 211 210 ··· 213 212 append_nvidia_entry_on_match(w_direct, ct->c->settings.nvidia_display, &disp); 214 213 } 215 214 216 - // check this display against our whitelist 217 - for (uint32_t j = 0; j < ARRAY_SIZE(NV_DIRECT_WHITELIST); j++) 218 - if (append_nvidia_entry_on_match(w_direct, NV_DIRECT_WHITELIST[j], &disp)) 215 + // check this display against our allowlist 216 + for (uint32_t j = 0; j < ARRAY_SIZE(NV_DIRECT_ALLOWLIST); j++) 217 + if (append_nvidia_entry_on_match(w_direct, NV_DIRECT_ALLOWLIST[j], &disp)) 219 218 break; 220 219 } 221 220
-1
src/xrt/compositor/main/comp_window_direct_randr.c
··· 177 177 struct comp_window_direct_randr *w_direct = (struct comp_window_direct_randr *)ct; 178 178 struct vk_bundle *vk = get_vk(w_direct); 179 179 180 - // Sanity check. 181 180 if (vk->instance != VK_NULL_HANDLE) { 182 181 COMP_ERROR(ct->c, "Vulkan initialized before RANDR init!"); 183 182 return false;
-1
src/xrt/compositor/main/comp_window_vk_display.c
··· 161 161 struct comp_window_vk_display *w_direct = (struct comp_window_vk_display *)ct; 162 162 struct vk_bundle *vk = get_vk(ct); 163 163 164 - // Sanity check. 165 164 if (vk->instance == VK_NULL_HANDLE) { 166 165 COMP_ERROR(ct->c, "Vulkan not initialized before vk display init!"); 167 166 return false;
+1 -1
src/xrt/compositor/main/comp_window_wayland.c
··· 322 322 w_wayland->xdg_toplevel = xdg_surface_get_toplevel(w_wayland->xdg_surface); 323 323 324 324 xdg_toplevel_add_listener(w_wayland->xdg_toplevel, &xdg_toplevel_listener, w_wayland); 325 - /* Sane defaults */ 325 + /* basic defaults */ 326 326 xdg_toplevel_set_app_id(w_wayland->xdg_toplevel, "openxr"); 327 327 xdg_toplevel_set_title(w_wayland->xdg_toplevel, "OpenXR application"); 328 328