|
Packit |
4d0513 |
/*
|
|
Packit |
4d0513 |
* Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved.
|
|
Packit |
4d0513 |
*
|
|
Packit |
4d0513 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit |
4d0513 |
* copy of this software and associated documentation files (the "Software"),
|
|
Packit |
4d0513 |
* to deal in the Software without restriction, including without limitation
|
|
Packit |
4d0513 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
Packit |
4d0513 |
* and/or sell copies of the Software, and to permit persons to whom the
|
|
Packit |
4d0513 |
* Software is furnished to do so, subject to the following conditions:
|
|
Packit |
4d0513 |
*
|
|
Packit |
4d0513 |
* The above copyright notice and this permission notice shall be included in
|
|
Packit |
4d0513 |
* all copies or substantial portions of the Software.
|
|
Packit |
4d0513 |
*
|
|
Packit |
4d0513 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit |
4d0513 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit |
4d0513 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
Packit |
4d0513 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
Packit |
4d0513 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
Packit |
4d0513 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
Packit |
4d0513 |
* DEALINGS IN THE SOFTWARE.
|
|
Packit |
4d0513 |
*/
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
#ifndef WAYLAND_EGLDEVICE_H
|
|
Packit |
4d0513 |
#define WAYLAND_EGLDEVICE_H
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
#include <EGL/egl.h>
|
|
Packit |
4d0513 |
#include <EGL/eglext.h>
|
|
Packit |
4d0513 |
#include <wayland-client.h>
|
|
Packit |
4d0513 |
#include "wayland-external-exports.h"
|
|
Packit |
4d0513 |
#include "wayland-eglhandle.h"
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
#ifdef __cplusplus
|
|
Packit |
4d0513 |
extern "C" {
|
|
Packit |
4d0513 |
#endif
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
/**
|
|
Packit |
4d0513 |
* Keeps track of an internal display.
|
|
Packit |
4d0513 |
*
|
|
Packit |
4d0513 |
* Since the same internal display can be shared by multiple external displays,
|
|
Packit |
4d0513 |
* the internal displays are always created with the EGL_TRACK_REFERENCES_KHR
|
|
Packit |
4d0513 |
* flag set. If the driver doesn't support that extension, then we keep track
|
|
Packit |
4d0513 |
* of an initialization count to produce the same behavior.
|
|
Packit |
4d0513 |
*/
|
|
Packit |
4d0513 |
typedef struct WlEglDeviceDpyRec {
|
|
Packit |
4d0513 |
EGLDeviceEXT eglDevice;
|
|
Packit |
4d0513 |
EGLDisplay eglDisplay;
|
|
Packit |
4d0513 |
WlEglPlatformData *data;
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
unsigned int initCount;
|
|
Packit |
4d0513 |
EGLint major;
|
|
Packit |
4d0513 |
EGLint minor;
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
struct {
|
|
Packit |
4d0513 |
unsigned int stream : 1;
|
|
Packit |
4d0513 |
unsigned int stream_attrib : 1;
|
|
Packit |
4d0513 |
unsigned int stream_cross_process_fd : 1;
|
|
Packit |
4d0513 |
unsigned int stream_remote : 1;
|
|
Packit |
4d0513 |
unsigned int stream_producer_eglsurface : 1;
|
|
Packit |
4d0513 |
unsigned int stream_fifo_synchronous : 1;
|
|
Packit |
4d0513 |
unsigned int stream_sync : 1;
|
|
Packit |
4d0513 |
unsigned int stream_flush : 1;
|
|
Packit |
4d0513 |
} exts;
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
struct wl_list link;
|
|
Packit |
4d0513 |
} WlEglDeviceDpy;
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
/**
|
|
Packit |
4d0513 |
* Returns the WlEglDeviceDpy structure for a given device.
|
|
Packit |
4d0513 |
* Note that the same device will always return the same WlEglDeviceDpy.
|
|
Packit |
4d0513 |
*/
|
|
Packit |
4d0513 |
WlEglDeviceDpy *wlGetInternalDisplay(WlEglPlatformData *data, EGLDeviceEXT device);
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
/**
|
|
Packit |
4d0513 |
* Frees all of the WlEglDeviceDpy structures.
|
|
Packit |
4d0513 |
*/
|
|
Packit |
4d0513 |
void wlFreeAllInternalDisplays(WlEglPlatformData *data);
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
EGLBoolean wlInternalInitialize(WlEglDeviceDpy *devDpy);
|
|
Packit |
4d0513 |
EGLBoolean wlInternalTerminate(WlEglDeviceDpy *devDpy);
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
#ifdef __cplusplus
|
|
Packit |
4d0513 |
}
|
|
Packit |
4d0513 |
#endif
|
|
Packit |
4d0513 |
|
|
Packit |
4d0513 |
#endif // WAYLAND_EGLDEVICE_H
|