blob: 9e093650970ab447935c22396e22360fdd887ae0 [file] [log] [blame]
Chia-I Wu1db76e02014-09-15 14:21:14 +08001/*
2 * XGL
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Authors:
25 * Chia-I Wu <olv@lunarg.com>
26 */
27
28#ifndef WSI_X11_H
29#define WSI_X11_H
30
31#include "intel.h"
32
33struct intel_wsi_x11;
34
35#ifdef ENABLE_WSI_X11
36
37XGL_RESULT intel_wsi_x11_wait(struct intel_wsi_x11 *x11,
38 uint32_t serial, bool wait);
39
40void intel_wsi_x11_destroy(struct intel_wsi_x11 *x11);
41
42XGL_RESULT XGLAPI intelWsiX11AssociateConnection(
43 XGL_PHYSICAL_GPU gpu,
44 const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo);
45
46XGL_RESULT XGLAPI intelWsiX11GetMSC(
47 XGL_DEVICE device,
Chia-I Wu6204f342014-11-07 13:33:45 +080048 xcb_window_t window,
Chia-I Wu1db76e02014-09-15 14:21:14 +080049 xcb_randr_crtc_t crtc,
50 XGL_UINT64* pMsc);
51
52XGL_RESULT XGLAPI intelWsiX11CreatePresentableImage(
53 XGL_DEVICE device,
54 const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo,
55 XGL_IMAGE* pImage,
56 XGL_GPU_MEMORY* pMem);
57
58XGL_RESULT XGLAPI intelWsiX11QueuePresent(
59 XGL_QUEUE queue,
60 const XGL_WSI_X11_PRESENT_INFO* pPresentInfo,
61 XGL_FENCE fence);
62
63#else /* ENABLE_WSI_X11 */
64
65static inline XGL_RESULT intel_wsi_x11_wait(struct intel_wsi_x11 *x11,
66 uint32_t serial, bool wait)
67{
68 return XGL_SUCCESS;
69}
70
71static inline void intel_wsi_x11_destroy(struct intel_wsi_x11 *x11)
72{
73}
74
75static inline XGL_RESULT XGLAPI intelWsiX11AssociateConnection(
76 XGL_PHYSICAL_GPU gpu,
77 const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo)
78{
79 return XGL_ERROR_UNKNOWN;
80}
81
82static inline XGL_RESULT XGLAPI intelWsiX11GetMSC(
83 XGL_DEVICE device,
Chia-I Wu6204f342014-11-07 13:33:45 +080084 xcb_window_t window,
Chia-I Wu1db76e02014-09-15 14:21:14 +080085 xcb_randr_crtc_t crtc,
86 XGL_UINT64* pMsc)
87{
88 return XGL_ERROR_UNKNOWN;
89}
90
91static inline XGL_RESULT XGLAPI intelWsiX11CreatePresentableImage(
92 XGL_DEVICE device,
93 const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo,
94 XGL_IMAGE* pImage,
95 XGL_GPU_MEMORY* pMem)
96{
97 return XGL_ERROR_UNKNOWN;
98}
99
100static inline XGL_RESULT XGLAPI intelWsiX11QueuePresent(
101 XGL_QUEUE queue,
102 const XGL_WSI_X11_PRESENT_INFO* pPresentInfo,
103 XGL_FENCE fence)
104{
105 return XGL_ERROR_UNKNOWN;
106}
107
108#endif /* ENABLE_WSI_X11 */
109
110#endif /* WSI_X11_H */