blob: 9ac70ed333590d31a6f88c2486e40b331f09f8c4 [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,
48 xcb_randr_crtc_t crtc,
49 XGL_UINT64* pMsc);
50
51XGL_RESULT XGLAPI intelWsiX11CreatePresentableImage(
52 XGL_DEVICE device,
53 const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo,
54 XGL_IMAGE* pImage,
55 XGL_GPU_MEMORY* pMem);
56
57XGL_RESULT XGLAPI intelWsiX11QueuePresent(
58 XGL_QUEUE queue,
59 const XGL_WSI_X11_PRESENT_INFO* pPresentInfo,
60 XGL_FENCE fence);
61
62#else /* ENABLE_WSI_X11 */
63
64static inline XGL_RESULT intel_wsi_x11_wait(struct intel_wsi_x11 *x11,
65 uint32_t serial, bool wait)
66{
67 return XGL_SUCCESS;
68}
69
70static inline void intel_wsi_x11_destroy(struct intel_wsi_x11 *x11)
71{
72}
73
74static inline XGL_RESULT XGLAPI intelWsiX11AssociateConnection(
75 XGL_PHYSICAL_GPU gpu,
76 const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo)
77{
78 return XGL_ERROR_UNKNOWN;
79}
80
81static inline XGL_RESULT XGLAPI intelWsiX11GetMSC(
82 XGL_DEVICE device,
83 xcb_randr_crtc_t crtc,
84 XGL_UINT64* pMsc)
85{
86 return XGL_ERROR_UNKNOWN;
87}
88
89static inline XGL_RESULT XGLAPI intelWsiX11CreatePresentableImage(
90 XGL_DEVICE device,
91 const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo,
92 XGL_IMAGE* pImage,
93 XGL_GPU_MEMORY* pMem)
94{
95 return XGL_ERROR_UNKNOWN;
96}
97
98static inline XGL_RESULT XGLAPI intelWsiX11QueuePresent(
99 XGL_QUEUE queue,
100 const XGL_WSI_X11_PRESENT_INFO* pPresentInfo,
101 XGL_FENCE fence)
102{
103 return XGL_ERROR_UNKNOWN;
104}
105
106#endif /* ENABLE_WSI_X11 */
107
108#endif /* WSI_X11_H */