-
Notifications
You must be signed in to change notification settings - Fork 1
/
0049-pvr-wsi-add-PowerVR-Vulkan-WSI-library.patch
3112 lines (2993 loc) · 126 KB
/
0049-pvr-wsi-add-PowerVR-Vulkan-WSI-library.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From df1927029cc1063aaa8794239925aa84d6e856cf Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Thu, 18 Mar 2021 13:44:57 +0000
Subject: [PATCH] pvr/wsi: add PowerVR Vulkan WSI library
The old (pre-Mesa 22.0.0) Mesa WSI interface has been restored.
The new interface provides API entry points, ready to be plugged
into a Vulkan dispatch table. The new interface is not useable by
PowerVR Vulkan, as the interface make assumptions about some Vulkan
data structures which are not valid on the PowerVR side (e.g.
VkPhysicalDevice being a handle to a Mesa vk_physical_device
structure). The new and old interfaces share code. Where an old
interface function has been reintroduced, the corresponding function
in the new interface has become a wrapper around it.
PowerVR Vulkan will load the WSI library, libpvr_mesa_wsi.so,
and lookup the symbol pvr_mesa_wsi_sym_addr, which is a used to
lookup all other symbols required by Vulkan from the library.
The function is used by Vulkan to lookup the library initialisation
function, pvr_mesa_wsi_init. That function is passed the address
of another lookup function, pvr_vk_mesa_wsi_sym_addr, which is used
by the WSI library to lookup symbols in Vulkan.
The interface between PowerVR Vulkan and Mesa WSI is defined in
pvr_mesa_wsi_interface.h. Most of the functions defined on the WSI
side are wrappers around Mesa WSI functions.
---
meson.build | 1 +
meson_options.txt | 2 +-
src/meson.build | 3 +
src/pvr/meson.build | 23 ++
src/pvr/wsi/meson.build | 82 +++++
src/pvr/wsi/pvr_mesa_wsi_interface.h | 306 +++++++++++++++++
src/pvr/wsi/pvr_wsi.c | 335 +++++++++++++++++++
src/pvr/wsi/pvr_wsi.h | 78 +++++
src/pvr/wsi/pvr_wsi_display.c | 293 ++++++++++++++++
src/pvr/wsi/pvr_wsi_wayland.c | 45 +++
src/pvr/wsi/pvr_wsi_x11.c | 62 ++++
src/vulkan/wsi/wsi_common.c | 248 ++++++++++----
src/vulkan/wsi/wsi_common.h | 60 ++++
src/vulkan/wsi/wsi_common_display.c | 479 +++++++++++++++++++++------
src/vulkan/wsi/wsi_common_display.h | 126 +++++++
src/vulkan/wsi/wsi_common_wayland.c | 57 +++-
src/vulkan/wsi/wsi_common_wayland.h | 35 ++
src/vulkan/wsi/wsi_common_x11.c | 88 +++--
src/vulkan/wsi/wsi_common_x11.h | 41 +++
19 files changed, 2162 insertions(+), 202 deletions(-)
create mode 100644 src/pvr/meson.build
create mode 100644 src/pvr/wsi/meson.build
create mode 100644 src/pvr/wsi/pvr_mesa_wsi_interface.h
create mode 100644 src/pvr/wsi/pvr_wsi.c
create mode 100644 src/pvr/wsi/pvr_wsi.h
create mode 100644 src/pvr/wsi/pvr_wsi_display.c
create mode 100644 src/pvr/wsi/pvr_wsi_wayland.c
create mode 100644 src/pvr/wsi/pvr_wsi_x11.c
create mode 100644 src/vulkan/wsi/wsi_common_wayland.h
create mode 100644 src/vulkan/wsi/wsi_common_x11.h
diff --git a/meson.build b/meson.build
index a37add4..31b6ffd 100644
--- a/meson.build
+++ b/meson.build
@@ -298,6 +298,7 @@ with_broadcom_vk = _vulkan_drivers.contains('broadcom')
with_imagination_vk = _vulkan_drivers.contains('imagination-experimental')
with_imagination_srv = get_option('imagination-srv')
with_microsoft_vk = _vulkan_drivers.contains('microsoft-experimental')
+with_pvr_vk = _vulkan_drivers.contains('pvr')
with_any_vk = _vulkan_drivers.length() != 0
with_any_broadcom = with_gallium_vc4 or with_gallium_v3d or with_broadcom_vk
diff --git a/meson_options.txt b/meson_options.txt
index 84661fb..c78b19a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -204,7 +204,7 @@ option(
'vulkan-drivers',
type : 'array',
value : ['auto'],
- choices : ['auto', 'amd', 'broadcom', 'freedreno', 'imagination-experimental', 'intel', 'microsoft-experimental', 'panfrost', 'swrast', 'virtio-experimental'],
+ choices : ['auto', 'amd', 'broadcom', 'freedreno', 'imagination-experimental', 'intel', 'microsoft-experimental', 'panfrost', 'pvr', 'swrast', 'virtio-experimental'],
description : 'List of vulkan drivers to build. If this is set to auto all drivers applicable to the target OS/architecture will be built'
)
option(
diff --git a/src/meson.build b/src/meson.build
index 0846a60..a70c695 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -103,6 +103,9 @@ endif
if with_gallium_panfrost or with_gallium_lima or with_panfrost_vk or with_tools.contains('panfrost')
subdir('panfrost')
endif
+if with_pvr_vk
+ subdir('pvr')
+endif
if with_gallium_virgl or with_virtio_vk
subdir('virtio')
endif
diff --git a/src/pvr/meson.build b/src/pvr/meson.build
new file mode 100644
index 0000000..09a6986
--- /dev/null
+++ b/src/pvr/meson.build
@@ -0,0 +1,23 @@
+# Copyright (c) Imagination Technologies Ltd.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+if with_pvr_vk
+ subdir('wsi')
+endif
diff --git a/src/pvr/wsi/meson.build b/src/pvr/wsi/meson.build
new file mode 100644
index 0000000..ec91132
--- /dev/null
+++ b/src/pvr/wsi/meson.build
@@ -0,0 +1,82 @@
+# Copyright (c) Imagination Technologies Ltd.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+pvr_wsi_args = vulkan_wsi_args
+
+pvr_wsi_depends = [
+ dep_libdrm,
+ idep_vulkan_util,
+ idep_xmlconfig,
+ idep_vulkan_wsi,
+ idep_vulkan_runtime_headers,
+ idep_vulkan_runtime,
+ idep_nir
+]
+
+pvr_wsi_includes = [
+ inc_include,
+ inc_src,
+ inc_vulkan_util
+]
+
+pvr_wsi_src = [ 'pvr_wsi.c' ]
+
+if with_platform_wayland
+ pvr_wsi_args += '-DVK_USE_PLATFORM_WAYLAND_KHR'
+
+ pvr_wsi_depends += dep_wayland_client
+
+ pvr_wsi_src += 'pvr_wsi_wayland.c'
+endif
+
+if with_platform_x11
+ pvr_wsi_args += [
+ '-DVK_USE_PLATFORM_XCB_KHR',
+ '-DVK_USE_PLATFORM_XLIB_KHR',
+ ]
+
+ pvr_wsi_depends += dep_xcb_dri2
+
+ pvr_wsi_src += 'pvr_wsi_x11.c'
+endif
+
+if system_has_kms_drm and not with_platform_android
+ pvr_wsi_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
+
+ pvr_wsi_src += 'pvr_wsi_display.c'
+endif
+
+if with_xlib_lease
+ pvr_wsi_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
+
+ pvr_wsi_depends += dep_xlib_xrandr
+endif
+
+libpvr_mesa_wsi = shared_library(
+ 'pvr_mesa_wsi',
+ pvr_wsi_src,
+ include_directories : pvr_wsi_includes,
+ dependencies : pvr_wsi_depends,
+ c_args : pvr_wsi_args,
+ link_with: libvulkan_wsi,
+ gnu_symbol_visibility : 'hidden',
+ build_by_default : true,
+ install : true
+)
diff --git a/src/pvr/wsi/pvr_mesa_wsi_interface.h b/src/pvr/wsi/pvr_mesa_wsi_interface.h
new file mode 100644
index 0000000..b4b1bcb
--- /dev/null
+++ b/src/pvr/wsi/pvr_mesa_wsi_interface.h
@@ -0,0 +1,306 @@
+/*************************************************************************/ /*!
+@File
+@Title PVR interface to the Vulkan WSI layer in Mesa
+@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License MIT
+
+The contents of this file are subject to the MIT license as set out below.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/ /**************************************************************************/
+
+#ifndef PVR_MESA_WSI_INTERFACE_H
+#define PVR_MESA_WSI_INTERFACE_H
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include <vulkan/vulkan.h>
+
+/*
+ * The pvr_mesa_wsi structure holds the Mesa WSI state, and is opaque to
+ * the PowerVK DDK.
+ */
+struct pvr_mesa_wsi;
+
+/*
+ * Functions defined in Mesa for use by the PowerVR DDK.
+ * All functions have a "pvr_mesa_wsi" prefix.
+ */
+
+void *
+pvr_mesa_wsi_sym_addr(struct pvr_mesa_wsi *mwsi,
+ const char *name);
+
+VkResult
+pvr_mesa_wsi_init(struct pvr_mesa_wsi **mwsi,
+ VkPhysicalDevice physicalDevice,
+ PFN_vkVoidFunction (VKAPI_PTR *pvr_vk_mesa_wsi_sym_addr)
+ (VkPhysicalDevice physicalDevice, const char *),
+ const VkAllocationCallbacks *alloc,
+ int fd,
+ bool sw);
+
+void
+pvr_mesa_wsi_finish(struct pvr_mesa_wsi *mwsi,
+ const VkAllocationCallbacks *alloc);
+
+VkResult
+pvr_mesa_wsi_common_get_surface_support(struct pvr_mesa_wsi *mwsi,
+ uint32_t queueFamilyIndex,
+ VkSurfaceKHR surface,
+ VkBool32 *pSupported);
+
+VkResult
+pvr_mesa_wsi_common_get_surface_capabilities(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ VkSurfaceCapabilitiesKHR *pSurfaceCapabilities);
+
+VkResult
+pvr_mesa_wsi_common_get_surface_capabilities2(struct pvr_mesa_wsi *mwsi,
+ const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
+ VkSurfaceCapabilities2KHR *pSurfaceCapabilities);
+
+VkResult
+pvr_mesa_wsi_common_get_surface_capabilities2ext(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ VkSurfaceCapabilities2EXT *pSurfaceCapabilities);
+
+VkResult
+pvr_mesa_wsi_common_get_surface_formats(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ uint32_t *pSurfaceFormatCount,
+ VkSurfaceFormatKHR *pSurfaceFormats);
+
+VkResult
+pvr_mesa_wsi_common_get_surface_formats2(struct pvr_mesa_wsi *mwsi,
+ const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
+ uint32_t *pSurfaceFormatCount,
+ VkSurfaceFormat2KHR *pSurfaceFormats);
+
+VkResult
+pvr_mesa_wsi_common_get_surface_present_modes(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ uint32_t *pPresentModeCount,
+ VkPresentModeKHR *pPresentModes);
+
+VkResult
+pvr_mesa_wsi_common_create_swapchain(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ const VkSwapchainCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSwapchainKHR *pSwapchain);
+void
+pvr_mesa_wsi_common_destroy_swapchain(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ VkSwapchainKHR swapchain,
+ const VkAllocationCallbacks *pAllocator);
+
+VkResult
+pvr_mesa_wsi_common_get_images(struct pvr_mesa_wsi *mwsi,
+ VkSwapchainKHR swapchain,
+ uint32_t *pSwapchainImageCount,
+ VkImage *pSwapchainImages);
+
+VkResult
+pvr_mesa_wsi_common_acquire_next_image2(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ const VkAcquireNextImageInfoKHR *pAcquireInfo,
+ uint32_t *pImageIndex);
+
+VkResult
+pvr_mesa_wsi_common_queue_present(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ VkQueue queue,
+ int queue_family_index,
+ const VkPresentInfoKHR *pPresentInfo);
+
+VkResult
+pvr_mesa_wsi_common_get_present_rectangles(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ uint32_t* pRectCount,
+ VkRect2D* pRects);
+
+#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
+VkBool32
+pvr_mesa_wsi_get_physical_device_wayland_presentation_support(struct pvr_mesa_wsi *mwsi,
+ uint32_t queueFamilyIndex,
+ void *display);
+
+VkResult
+pvr_mesa_wsi_create_wayland_surface(struct pvr_mesa_wsi *mwsi,
+ const VkAllocationCallbacks *pAllocator,
+ const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
+ VkSurfaceKHR *pSurface);
+#endif
+
+#if defined(VK_USE_PLATFORM_XCB_KHR)
+VkBool32
+pvr_mesa_wsi_get_physical_device_xcb_presentation_support(struct pvr_mesa_wsi *mwsi,
+ uint32_t queueFamilyIndex,
+ void *connection,
+ uint32_t visualId);
+VkResult
+pvr_mesa_wsi_create_xcb_surface(struct pvr_mesa_wsi *mwsi,
+ const VkAllocationCallbacks *pAllocator,
+ const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
+ VkSurfaceKHR *pSurface);
+#endif
+
+#if defined(VK_USE_PLATFORM_XLIB_KHR)
+VkResult
+pvr_mesa_wsi_create_xlib_surface(struct pvr_mesa_wsi *mwsi,
+ const VkAllocationCallbacks *pAllocator,
+ const VkXlibSurfaceCreateInfoKHR *pCreateInfo,
+ VkSurfaceKHR *pSurface);
+#endif
+
+VkResult
+pvr_mesa_wsi_display_get_physical_device_display_properties(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ uint32_t *pPropertyCount,
+ VkDisplayPropertiesKHR *pProperties);
+
+VkResult
+pvr_mesa_wsi_display_get_physical_device_display_properties2(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ uint32_t *pPropertyCount,
+ VkDisplayProperties2KHR *pProperties);
+
+VkResult
+pvr_mesa_wsi_display_get_physical_device_display_plane_properties(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ uint32_t *pPropertyCount,
+ VkDisplayPlanePropertiesKHR *pProperties);
+
+VkResult
+pvr_mesa_wsi_display_get_physical_device_display_plane_properties2(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ uint32_t *pPropertyCount,
+ VkDisplayPlaneProperties2KHR *pProperties);
+
+VkResult
+pvr_mesa_wsi_display_get_display_plane_supported_displays(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ uint32_t planeIndex,
+ uint32_t *pDisplayCount,
+ VkDisplayKHR *pDisplays);
+
+VkResult
+pvr_mesa_wsi_display_get_display_mode_properties(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ VkDisplayKHR display,
+ uint32_t *pPropertyCount,
+ VkDisplayModePropertiesKHR *pProperties);
+
+VkResult
+pvr_mesa_wsi_display_get_display_mode_properties2(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ VkDisplayKHR display,
+ uint32_t *pPropertyCount,
+ VkDisplayModeProperties2KHR *pProperties);
+
+VkResult
+pvr_mesa_wsi_display_create_display_mode(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ VkDisplayKHR display,
+ const VkDisplayModeCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkDisplayModeKHR *pMode);
+
+VkResult
+pvr_mesa_wsi_get_display_plane_capabilities(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ VkDisplayModeKHR modeKhr,
+ uint32_t planeIndex,
+ VkDisplayPlaneCapabilitiesKHR *pCapabilities);
+
+VkResult
+pvr_mesa_wsi_get_display_plane_capabilities2(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ const VkDisplayPlaneInfo2KHR *pDisplayPlaneInfo,
+ VkDisplayPlaneCapabilities2KHR *pCapabilities);
+
+VkResult
+pvr_mesa_wsi_create_display_surface(struct pvr_mesa_wsi *mwsi,
+ VkInstance instance,
+ const VkAllocationCallbacks *pAllocator,
+ const VkDisplaySurfaceCreateInfoKHR *pCreateInfo,
+ VkSurfaceKHR *pSurface);
+
+VkResult
+pvr_mesa_wsi_release_display(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ VkDisplayKHR display);
+
+#if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT)
+VkResult
+pvr_mesa_wsi_acquire_xlib_display(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ void *dpy,
+ VkDisplayKHR display);
+
+VkResult
+pvr_mesa_wsi_get_randr_output_display(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ void *dpy,
+ uint32_t output,
+ VkDisplayKHR *pDisplay);
+
+#endif
+
+VkResult
+pvr_mesa_wsi_display_power_control(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ VkDisplayKHR display,
+ const VkDisplayPowerInfoEXT *pDisplayPowerInfo);
+
+VkResult
+pvr_mesa_wsi_register_device_event(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ const VkDeviceEventInfoEXT *pDeviceEventInfo,
+ const VkAllocationCallbacks *pAllocator,
+ void **pFence,
+ int syncFd);
+
+VkResult
+pvr_mesa_wsi_register_display_event(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ VkDisplayKHR display,
+ const VkDisplayEventInfoEXT *pDisplayEventInfo,
+ const VkAllocationCallbacks *pAllocator,
+ void **pFence,
+ int syncFd);
+
+VkResult
+pvr_mesa_wsi_get_swapchain_counter(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ VkSwapchainKHR swapchain,
+ VkSurfaceCounterFlagBitsEXT flagBits,
+ uint64_t *pValue);
+
+/*
+ * Functions defined in the PowerVR DDK for use by Mesa.
+ * All functions have a "pvr_vk_mesa_wsi" prefix.
+ */
+VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
+pvr_vk_mesa_wsi_sym_addr(VkPhysicalDevice physicalDevice,
+ const char *name);
+
+#endif /* PVR_MESA_WSI_INTERFACE_H */
diff --git a/src/pvr/wsi/pvr_wsi.c b/src/pvr/wsi/pvr_wsi.c
new file mode 100644
index 0000000..c8a5813
--- /dev/null
+++ b/src/pvr/wsi/pvr_wsi.c
@@ -0,0 +1,335 @@
+/*
+ * Copyright © Imagination Technologies Ltd.
+ *
+ * The contents of this file are subject to the MIT license as set out below.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <string.h>
+
+#include "pvr_wsi.h"
+#include "pvr_mesa_wsi_interface.h"
+
+VkResult
+pvr_mesa_wsi_init(struct pvr_mesa_wsi **pmwsi,
+ VkPhysicalDevice physicalDevice,
+ PFN_vkVoidFunction (VKAPI_PTR *pvr_vk_mesa_wsi_sym_addr)
+ (VkPhysicalDevice physicalDevice, const char *),
+ const VkAllocationCallbacks *alloc,
+ int fd,
+ bool sw)
+{
+ struct pvr_mesa_wsi *mwsi;
+ VkResult result;
+
+ mwsi = vk_zalloc(alloc, sizeof(*mwsi), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+ if (!mwsi)
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ mwsi->symtab.pvr_vk_mesa_wsi_sym_addr = pvr_vk_mesa_wsi_sym_addr;
+ mwsi->physicalDevice = physicalDevice;
+
+ result = wsi_device_init(&mwsi->wsi,
+ physicalDevice,
+ pvr_vk_mesa_wsi_sym_addr,
+ alloc,
+ fd, NULL, sw);
+ if (result != VK_SUCCESS) {
+ vk_free(alloc, mwsi);
+ return result;
+ }
+
+ mwsi->wsi.opaque_vk_handles = true;
+
+ if (!sw)
+ mwsi->wsi.supports_modifiers = true;
+
+ *pmwsi = mwsi;
+
+ return VK_SUCCESS;
+}
+
+void
+pvr_mesa_wsi_finish(struct pvr_mesa_wsi *mwsi,
+ const VkAllocationCallbacks *alloc)
+{
+ wsi_device_finish(&mwsi->wsi, alloc);
+
+ vk_free(alloc, mwsi);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_surface_support(struct pvr_mesa_wsi *mwsi,
+ uint32_t queueFamilyIndex,
+ VkSurfaceKHR surface,
+ VkBool32 *pSupported)
+{
+ return wsi_common_get_surface_support(&mwsi->wsi,
+ queueFamilyIndex,
+ surface,
+ pSupported);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_surface_capabilities(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ VkSurfaceCapabilitiesKHR *pSurfaceCapabilities)
+{
+ return wsi_common_get_surface_capabilities(&mwsi->wsi,
+ surface,
+ pSurfaceCapabilities);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_surface_capabilities2(struct pvr_mesa_wsi *mwsi,
+ const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
+ VkSurfaceCapabilities2KHR *pSurfaceCapabilities)
+{
+ return wsi_common_get_surface_capabilities2(&mwsi->wsi,
+ pSurfaceInfo,
+ pSurfaceCapabilities);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_surface_capabilities2ext(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ VkSurfaceCapabilities2EXT *pSurfaceCapabilities)
+{
+ return wsi_common_get_surface_capabilities2ext(&mwsi->wsi,
+ surface,
+ pSurfaceCapabilities);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_surface_formats(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ uint32_t *pSurfaceFormatCount,
+ VkSurfaceFormatKHR *pSurfaceFormats)
+{
+ return wsi_common_get_surface_formats(&mwsi->wsi,
+ surface,
+ pSurfaceFormatCount,
+ pSurfaceFormats);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_surface_formats2(struct pvr_mesa_wsi *mwsi,
+ const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
+ uint32_t *pSurfaceFormatCount,
+ VkSurfaceFormat2KHR *pSurfaceFormats)
+{
+ return wsi_common_get_surface_formats2(&mwsi->wsi,
+ pSurfaceInfo,
+ pSurfaceFormatCount,
+ pSurfaceFormats);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_surface_present_modes(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ uint32_t *pPresentModeCount,
+ VkPresentModeKHR *pPresentModes)
+{
+ return wsi_common_get_surface_present_modes(&mwsi->wsi,
+ surface,
+ pPresentModeCount,
+ pPresentModes);
+}
+
+VkResult
+pvr_mesa_wsi_common_create_swapchain(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ const VkSwapchainCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSwapchainKHR *pSwapchain)
+{
+ return wsi_common_create_swapchain(&mwsi->wsi,
+ device,
+ pCreateInfo,
+ pAllocator,
+ pSwapchain);
+}
+
+void
+pvr_mesa_wsi_common_destroy_swapchain(UNUSED struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ VkSwapchainKHR swapchain,
+ const VkAllocationCallbacks *pAllocator)
+{
+ return wsi_common_destroy_swapchain(device,
+ swapchain,
+ pAllocator);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_images(UNUSED struct pvr_mesa_wsi *mwsi,
+ VkSwapchainKHR swapchain,
+ uint32_t *pSwapchainImageCount,
+ VkImage *pSwapchainImages)
+{
+ return wsi_common_get_images(swapchain,
+ pSwapchainImageCount,
+ pSwapchainImages);
+}
+
+VkResult
+pvr_mesa_wsi_common_acquire_next_image2(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ const VkAcquireNextImageInfoKHR *pAcquireInfo,
+ uint32_t *pImageIndex)
+{
+ return wsi_common_acquire_next_image2(&mwsi->wsi,
+ device,
+ pAcquireInfo,
+ pImageIndex);
+}
+
+VkResult
+pvr_mesa_wsi_common_queue_present(struct pvr_mesa_wsi *mwsi,
+ VkDevice device,
+ VkQueue queue,
+ int queue_family_index,
+ const VkPresentInfoKHR *pPresentInfo)
+{
+ return wsi_common_queue_present(&mwsi->wsi,
+ device,
+ queue,
+ queue_family_index,
+ pPresentInfo);
+}
+
+VkResult
+pvr_mesa_wsi_common_get_present_rectangles(struct pvr_mesa_wsi *mwsi,
+ VkSurfaceKHR surface,
+ uint32_t* pRectCount,
+ VkRect2D* pRects)
+{
+ return wsi_common_get_present_rectangles(&mwsi->wsi,
+ surface,
+ pRectCount,
+ pRects);
+}
+
+/*
+ * The mwsi parameter is currently unused. Note that it is invalid for
+ * pvr_mesa_wsi_init, which is responsible for allocating it.
+*/
+PUBLIC void *
+pvr_mesa_wsi_sym_addr(UNUSED struct pvr_mesa_wsi *mwsi, const char *name)
+{
+ static const struct {
+ char *name;
+ void *addr;
+ } lookup[] = {
+ { "pvr_mesa_wsi_init",
+ pvr_mesa_wsi_init },
+ { "pvr_mesa_wsi_finish",
+ pvr_mesa_wsi_finish },
+ { "pvr_mesa_wsi_common_get_surface_support",
+ pvr_mesa_wsi_common_get_surface_support },
+ { "pvr_mesa_wsi_common_get_surface_capabilities",
+ pvr_mesa_wsi_common_get_surface_capabilities },
+ { "pvr_mesa_wsi_common_get_surface_capabilities2",
+ pvr_mesa_wsi_common_get_surface_capabilities2 },
+ { "pvr_mesa_wsi_common_get_surface_capabilities2ext",
+ pvr_mesa_wsi_common_get_surface_capabilities2ext },
+ { "pvr_mesa_wsi_common_get_surface_formats",
+ pvr_mesa_wsi_common_get_surface_formats },
+ { "pvr_mesa_wsi_common_get_surface_formats2",
+ pvr_mesa_wsi_common_get_surface_formats2 },
+ { "pvr_mesa_wsi_common_get_surface_present_modes",
+ pvr_mesa_wsi_common_get_surface_present_modes },
+ { "pvr_mesa_wsi_common_create_swapchain",
+ pvr_mesa_wsi_common_create_swapchain },
+ { "pvr_mesa_wsi_common_destroy_swapchain",
+ pvr_mesa_wsi_common_destroy_swapchain },
+ { "pvr_mesa_wsi_common_get_images",
+ pvr_mesa_wsi_common_get_images },
+ { "pvr_mesa_wsi_common_acquire_next_image2",
+ pvr_mesa_wsi_common_acquire_next_image2 },
+ { "pvr_mesa_wsi_common_queue_present",
+ pvr_mesa_wsi_common_queue_present },
+ { "pvr_mesa_wsi_common_get_present_rectangles",
+ pvr_mesa_wsi_common_get_present_rectangles },
+#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
+ { "pvr_mesa_wsi_get_physical_device_wayland_presentation_support",
+ pvr_mesa_wsi_get_physical_device_wayland_presentation_support },
+ { "pvr_mesa_wsi_create_wayland_surface",
+ pvr_mesa_wsi_create_wayland_surface },
+#endif
+#if defined(VK_USE_PLATFORM_XCB_KHR)
+ { "pvr_mesa_wsi_get_physical_device_xcb_presentation_support",
+ pvr_mesa_wsi_get_physical_device_xcb_presentation_support },
+ { "pvr_mesa_wsi_create_xcb_surface",
+ pvr_mesa_wsi_create_xcb_surface },
+#endif
+#if defined(VK_USE_PLATFORM_XLIB_KHR)
+ { "pvr_mesa_wsi_create_xlib_surface",
+ pvr_mesa_wsi_create_xlib_surface },
+#endif
+ { "pvr_mesa_wsi_display_get_physical_device_display_properties",
+ pvr_mesa_wsi_display_get_physical_device_display_properties },
+ { "pvr_mesa_wsi_display_get_physical_device_display_properties2",
+ pvr_mesa_wsi_display_get_physical_device_display_properties2 },
+ { "pvr_mesa_wsi_display_get_physical_device_display_plane_properties",
+ pvr_mesa_wsi_display_get_physical_device_display_plane_properties },
+ { "pvr_mesa_wsi_display_get_physical_device_display_plane_properties2",
+ pvr_mesa_wsi_display_get_physical_device_display_plane_properties2 },
+ { "pvr_mesa_wsi_display_get_display_plane_supported_displays",
+ pvr_mesa_wsi_display_get_display_plane_supported_displays },
+ { "pvr_mesa_wsi_display_get_display_mode_properties",
+ pvr_mesa_wsi_display_get_display_mode_properties },
+ { "pvr_mesa_wsi_display_get_display_mode_properties2",
+ pvr_mesa_wsi_display_get_display_mode_properties2 },
+ { "pvr_mesa_wsi_display_create_display_mode",
+ pvr_mesa_wsi_display_create_display_mode },
+ { "pvr_mesa_wsi_get_display_plane_capabilities",
+ pvr_mesa_wsi_get_display_plane_capabilities },
+ { "pvr_mesa_wsi_get_display_plane_capabilities2",
+ pvr_mesa_wsi_get_display_plane_capabilities2 },
+ { "pvr_mesa_wsi_create_display_surface",
+ pvr_mesa_wsi_create_display_surface },
+ { "pvr_mesa_wsi_release_display",
+ pvr_mesa_wsi_release_display },
+#if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT)
+ { "pvr_mesa_wsi_acquire_xlib_display",
+ pvr_mesa_wsi_acquire_xlib_display },
+ { "pvr_mesa_wsi_get_randr_output_display",
+ pvr_mesa_wsi_get_randr_output_display },
+#endif
+ { "pvr_mesa_wsi_display_power_control",
+ pvr_mesa_wsi_display_power_control },
+ { "pvr_mesa_wsi_register_device_event",
+ pvr_mesa_wsi_register_device_event },
+ { "pvr_mesa_wsi_register_display_event",
+ pvr_mesa_wsi_register_display_event },
+ { "pvr_mesa_wsi_get_swapchain_counter",
+ pvr_mesa_wsi_get_swapchain_counter },
+ };
+ unsigned i;
+
+ for (i = 0; i < ARRAY_SIZE(lookup); i++) {
+ if (!strcmp(name, lookup[i].name))
+ return lookup[i].addr;
+ }
+
+ return NULL;
+}
diff --git a/src/pvr/wsi/pvr_wsi.h b/src/pvr/wsi/pvr_wsi.h
new file mode 100644
index 0000000..142358d
--- /dev/null
+++ b/src/pvr/wsi/pvr_wsi.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright © Imagination Technologies Ltd.
+ *
+ * The contents of this file are subject to the MIT license as set out below.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#if !defined PVR_WSI_H
+#define PVR_WSI_H
+
+#include "util/macros.h"
+#include "util/u_memory.h"
+#include "util/u_atomic.h"
+
+#include "wsi_common.h"
+
+#define Container(p, s, m) ((s *) ((uintptr_t)(p) - Offset(s, m)))
+
+#define _MAKE_STRING(x) # x
+#define MAKE_STRING(x) _MAKE_STRING(x)
+
+#define LOOKUP_DDK(mwsi, sym) \
+ mwsi->symtab.pvr_vk_mesa_wsi_sym_addr(MAKE_STRING(sym))
+
+#define JUMP_DDK(mwsi, sym, ...) \
+ do { \
+ void *_entry = p_atomic_read(&mwsi->symtab.sym); \
+ \
+ if (!_entry) { \
+ _entry = LOOKUP_DDK(mwsi, sym); \
+ \
+ if (_entry) \
+ p_atomic_set(&mwsi->symtab.sym, _entry); \
+ } \
+ \
+ if (_entry) { \
+ __typeof__(mwsi->symtab.sym) _func = _entry; \
+ \
+ return _func(__VA_ARGS__); \
+ } \
+ } while(0)
+
+struct pvr_vk_mesa_wsi_sym_tab
+{
+ PFN_vkVoidFunction (VKAPI_PTR *pvr_vk_mesa_wsi_sym_addr)
+ (VkPhysicalDevice physicalDevice, const char *);
+};
+
+struct pvr_mesa_wsi
+{
+ struct wsi_device wsi;
+ struct pvr_vk_mesa_wsi_sym_tab symtab;
+ VkPhysicalDevice physicalDevice;
+};
+
+static inline struct pvr_mesa_wsi *pvr_mesa_wsi(struct wsi_device *wsi_ptr)
+{
+ return Container(wsi_ptr, struct pvr_mesa_wsi, wsi);
+}
+
+#endif
diff --git a/src/pvr/wsi/pvr_wsi_display.c b/src/pvr/wsi/pvr_wsi_display.c
new file mode 100644
index 0000000..8ee1389
--- /dev/null
+++ b/src/pvr/wsi/pvr_wsi_display.c
@@ -0,0 +1,293 @@
+/*
+ * Copyright © Imagination Technologies Ltd.
+ *
+ * The contents of this file are subject to the MIT license as set out below.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "wsi_common_display.h"
+
+#if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT)
+#include "wsi_common_x11.h"
+#endif
+
+#include "pvr_wsi.h"
+#include "pvr_mesa_wsi_interface.h"
+
+VkResult
+pvr_mesa_wsi_display_get_physical_device_display_properties(struct pvr_mesa_wsi *mwsi,
+ VkPhysicalDevice physicalDevice,
+ uint32_t *pPropertyCount,
+ VkDisplayPropertiesKHR *pProperties)
+{
+ return wsi_display_get_physical_device_display_properties(physicalDevice,
+ &mwsi->wsi,
+ pPropertyCount,