Chia-I Wu | 1db76e0 | 2014-09-15 14:21:14 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 33 | struct intel_wsi_x11; |
Chia-I Wu | 7fbe2ab | 2014-11-07 13:26:45 +0800 | [diff] [blame^] | 34 | struct intel_wsi_x11_window; |
Chia-I Wu | 1db76e0 | 2014-09-15 14:21:14 +0800 | [diff] [blame] | 35 | |
| 36 | #ifdef ENABLE_WSI_X11 |
| 37 | |
| 38 | XGL_RESULT intel_wsi_x11_wait(struct intel_wsi_x11 *x11, |
Chia-I Wu | 7fbe2ab | 2014-11-07 13:26:45 +0800 | [diff] [blame^] | 39 | struct intel_wsi_x11_window *win, |
Chia-I Wu | 1db76e0 | 2014-09-15 14:21:14 +0800 | [diff] [blame] | 40 | uint32_t serial, bool wait); |
| 41 | |
| 42 | void intel_wsi_x11_destroy(struct intel_wsi_x11 *x11); |
| 43 | |
| 44 | XGL_RESULT XGLAPI intelWsiX11AssociateConnection( |
| 45 | XGL_PHYSICAL_GPU gpu, |
| 46 | const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo); |
| 47 | |
| 48 | XGL_RESULT XGLAPI intelWsiX11GetMSC( |
| 49 | XGL_DEVICE device, |
Chia-I Wu | 6204f34 | 2014-11-07 13:33:45 +0800 | [diff] [blame] | 50 | xcb_window_t window, |
Chia-I Wu | 1db76e0 | 2014-09-15 14:21:14 +0800 | [diff] [blame] | 51 | xcb_randr_crtc_t crtc, |
| 52 | XGL_UINT64* pMsc); |
| 53 | |
| 54 | XGL_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 | |
| 60 | XGL_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 | |
| 67 | static inline XGL_RESULT intel_wsi_x11_wait(struct intel_wsi_x11 *x11, |
Chia-I Wu | 7fbe2ab | 2014-11-07 13:26:45 +0800 | [diff] [blame^] | 68 | struct intel_wsi_x11_window *win, |
Chia-I Wu | 1db76e0 | 2014-09-15 14:21:14 +0800 | [diff] [blame] | 69 | uint32_t serial, bool wait) |
| 70 | { |
| 71 | return XGL_SUCCESS; |
| 72 | } |
| 73 | |
| 74 | static inline void intel_wsi_x11_destroy(struct intel_wsi_x11 *x11) |
| 75 | { |
| 76 | } |
| 77 | |
| 78 | static 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 | |
| 85 | static inline XGL_RESULT XGLAPI intelWsiX11GetMSC( |
| 86 | XGL_DEVICE device, |
Chia-I Wu | 6204f34 | 2014-11-07 13:33:45 +0800 | [diff] [blame] | 87 | xcb_window_t window, |
Chia-I Wu | 1db76e0 | 2014-09-15 14:21:14 +0800 | [diff] [blame] | 88 | xcb_randr_crtc_t crtc, |
| 89 | XGL_UINT64* pMsc) |
| 90 | { |
| 91 | return XGL_ERROR_UNKNOWN; |
| 92 | } |
| 93 | |
| 94 | static 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 | |
| 103 | static 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 */ |