blob: 11e8ce063524390091d469105e64b1f97dad018c [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;
Chia-I Wu7fbe2ab2014-11-07 13:26:45 +080034struct intel_wsi_x11_window;
Chia-I Wu1db76e02014-09-15 14:21:14 +080035
36#ifdef ENABLE_WSI_X11
37
38XGL_RESULT intel_wsi_x11_wait(struct intel_wsi_x11 *x11,
Chia-I Wu7fbe2ab2014-11-07 13:26:45 +080039 struct intel_wsi_x11_window *win,
Chia-I Wu1db76e02014-09-15 14:21:14 +080040 uint32_t serial, bool wait);
41
42void intel_wsi_x11_destroy(struct intel_wsi_x11 *x11);
43
44XGL_RESULT XGLAPI intelWsiX11AssociateConnection(
45 XGL_PHYSICAL_GPU gpu,
46 const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo);
47
48XGL_RESULT XGLAPI intelWsiX11GetMSC(
49 XGL_DEVICE device,
Chia-I Wu6204f342014-11-07 13:33:45 +080050 xcb_window_t window,
Chia-I Wu1db76e02014-09-15 14:21:14 +080051 xcb_randr_crtc_t crtc,
52 XGL_UINT64* pMsc);
53
54XGL_RESULT XGLAPI intelWsiX11CreatePresentableImage(
55 XGL_DEVICE device,
56 const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo,
57 XGL_IMAGE* pImage,
58 XGL_GPU_MEMORY* pMem);
59
60XGL_RESULT XGLAPI intelWsiX11QueuePresent(
61 XGL_QUEUE queue,
62 const XGL_WSI_X11_PRESENT_INFO* pPresentInfo,
63 XGL_FENCE fence);
64
65#else /* ENABLE_WSI_X11 */
66
67static inline XGL_RESULT intel_wsi_x11_wait(struct intel_wsi_x11 *x11,
Chia-I Wu7fbe2ab2014-11-07 13:26:45 +080068 struct intel_wsi_x11_window *win,
Chia-I Wu1db76e02014-09-15 14:21:14 +080069 uint32_t serial, bool wait)
70{
71 return XGL_SUCCESS;
72}
73
74static inline void intel_wsi_x11_destroy(struct intel_wsi_x11 *x11)
75{
76}
77
78static inline XGL_RESULT XGLAPI intelWsiX11AssociateConnection(
79 XGL_PHYSICAL_GPU gpu,
80 const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo)
81{
82 return XGL_ERROR_UNKNOWN;
83}
84
85static inline XGL_RESULT XGLAPI intelWsiX11GetMSC(
86 XGL_DEVICE device,
Chia-I Wu6204f342014-11-07 13:33:45 +080087 xcb_window_t window,
Chia-I Wu1db76e02014-09-15 14:21:14 +080088 xcb_randr_crtc_t crtc,
89 XGL_UINT64* pMsc)
90{
91 return XGL_ERROR_UNKNOWN;
92}
93
94static inline XGL_RESULT XGLAPI intelWsiX11CreatePresentableImage(
95 XGL_DEVICE device,
96 const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo,
97 XGL_IMAGE* pImage,
98 XGL_GPU_MEMORY* pMem)
99{
100 return XGL_ERROR_UNKNOWN;
101}
102
103static inline XGL_RESULT XGLAPI intelWsiX11QueuePresent(
104 XGL_QUEUE queue,
105 const XGL_WSI_X11_PRESENT_INFO* pPresentInfo,
106 XGL_FENCE fence)
107{
108 return XGL_ERROR_UNKNOWN;
109}
110
111#endif /* ENABLE_WSI_X11 */
112
113#endif /* WSI_X11_H */