2014-01-28 20:34:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Intel Corporation
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
* Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2017-03-20 16:04:18 +00:00
|
|
|
#ifndef EGL_DRI2_FALLBACKS_INCLUDED
|
|
|
|
#define EGL_DRI2_FALLBACKS_INCLUDED
|
2014-01-28 20:34:19 +00:00
|
|
|
|
2018-06-27 20:07:20 +01:00
|
|
|
#include "eglcurrent.h"
|
2014-01-28 20:34:19 +00:00
|
|
|
#include "egltypedefs.h"
|
|
|
|
|
2014-01-29 01:03:03 +00:00
|
|
|
struct wl_buffer;
|
|
|
|
|
2014-01-29 00:45:07 +00:00
|
|
|
static inline _EGLSurface *
|
|
|
|
dri2_fallback_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
|
|
|
_EGLConfig *conf,
|
egl/main: Stop using EGLNative types internally
Internally, much of the EGL code uses EGLNativeDisplayType,
EGLNativeWindowType, and EGLPixmapType. However, the EGLNative type
often does not match the variable's actual type.
The concept of EGLNative types are a bad match for Linux, as explained
below. And the EGL platform extensions don't use EGLNative types at all.
Those extensions attempt to solve cross-platform issues by moving the
EGL API away from the EGLNative types.
The core of the problem is that eglplatform.h can define each EGLNative
type once only, but Linux supports multiple EGL platforms.
To work around the problem, Mesa's eglplatform.h contains multiple
definitions of each EGLNative type, selected by feature macros. Mesa
expects EGL clients to set the feature macro approrpiately. But the
feature macros don't work when a single codebase must be built with
support for multiple EGL platforms, *such as Mesa itself*.
When building libEGL, autotools chooses the EGLNative typedefs based on
the first element of '--with-egl-platforms'. For example,
'--with-egl-platforms=x11,drm,wayland' defines the following:
typedef Display* EGLNativeDisplayType;
typedef Window EGLNativeWindowType;
typedef Pixmap EGLNativePixmapType;
Clearly, this doesn't work well for Wayland and GBM. Mesa works around
the problem by casting the EGLNative types to different things in
different files.
For sanity's sake, and to prepare for the EGL platform extensions, this
patch removes from egl/main and egl/dri2 all internal use of the
EGLNative types. It replaces them with 'void*' and checks each explicit
cast with a static assertion. Also, the patch touches egl_gallium the
minimal amount to keep it compatible with eglapi.h.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-07 22:54:51 +00:00
|
|
|
void *native_pixmap,
|
2014-01-29 00:45:07 +00:00
|
|
|
const EGLint *attrib_list)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-01-29 01:03:03 +00:00
|
|
|
static inline _EGLSurface *
|
|
|
|
dri2_fallback_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
|
|
|
_EGLConfig *conf,
|
|
|
|
const EGLint *attrib_list)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-05-01 10:12:46 +01:00
|
|
|
static inline _EGLImage*
|
|
|
|
dri2_fallback_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
|
|
|
_EGLContext *ctx, EGLenum target,
|
|
|
|
EGLClientBuffer buffer,
|
|
|
|
const EGLint *attr_list)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-01-29 00:26:44 +00:00
|
|
|
static inline EGLBoolean
|
2019-02-02 11:38:45 +00:00
|
|
|
dri2_fallback_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *disp,
|
2014-01-29 00:26:44 +00:00
|
|
|
_EGLSurface *surf,
|
|
|
|
const EGLint *rects, EGLint n_rects)
|
|
|
|
{
|
2019-02-02 11:38:45 +00:00
|
|
|
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
|
|
|
dri2_dpy->vtbl->set_damage_region(drv, disp, surf, rects, n_rects);
|
|
|
|
return dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
|
2014-01-29 00:26:44 +00:00
|
|
|
}
|
2014-01-29 01:03:03 +00:00
|
|
|
|
2014-01-29 01:03:03 +00:00
|
|
|
static inline EGLBoolean
|
2019-02-02 11:38:45 +00:00
|
|
|
dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
|
2014-01-29 01:03:03 +00:00
|
|
|
_EGLSurface *surf,
|
|
|
|
EGLint numRects, const EGLint *rects)
|
|
|
|
{
|
|
|
|
return EGL_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-01-29 01:03:03 +00:00
|
|
|
static inline EGLBoolean
|
2019-02-02 11:38:45 +00:00
|
|
|
dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp,
|
2014-01-29 01:03:03 +00:00
|
|
|
_EGLSurface *draw,
|
|
|
|
EGLint x, EGLint y, EGLint width, EGLint height)
|
|
|
|
{
|
|
|
|
return EGL_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-01-29 01:03:03 +00:00
|
|
|
static inline EGLBoolean
|
2019-02-02 11:38:45 +00:00
|
|
|
dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp,
|
2014-01-29 01:03:03 +00:00
|
|
|
_EGLSurface *surf,
|
egl/main: Stop using EGLNative types internally
Internally, much of the EGL code uses EGLNativeDisplayType,
EGLNativeWindowType, and EGLPixmapType. However, the EGLNative type
often does not match the variable's actual type.
The concept of EGLNative types are a bad match for Linux, as explained
below. And the EGL platform extensions don't use EGLNative types at all.
Those extensions attempt to solve cross-platform issues by moving the
EGL API away from the EGLNative types.
The core of the problem is that eglplatform.h can define each EGLNative
type once only, but Linux supports multiple EGL platforms.
To work around the problem, Mesa's eglplatform.h contains multiple
definitions of each EGLNative type, selected by feature macros. Mesa
expects EGL clients to set the feature macro approrpiately. But the
feature macros don't work when a single codebase must be built with
support for multiple EGL platforms, *such as Mesa itself*.
When building libEGL, autotools chooses the EGLNative typedefs based on
the first element of '--with-egl-platforms'. For example,
'--with-egl-platforms=x11,drm,wayland' defines the following:
typedef Display* EGLNativeDisplayType;
typedef Window EGLNativeWindowType;
typedef Pixmap EGLNativePixmapType;
Clearly, this doesn't work well for Wayland and GBM. Mesa works around
the problem by casting the EGLNative types to different things in
different files.
For sanity's sake, and to prepare for the EGL platform extensions, this
patch removes from egl/main and egl/dri2 all internal use of the
EGLNative types. It replaces them with 'void*' and checks each explicit
cast with a static assertion. Also, the patch touches egl_gallium the
minimal amount to keep it compatible with eglapi.h.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-01-07 22:54:51 +00:00
|
|
|
void *native_pixmap_target)
|
2014-01-29 01:03:03 +00:00
|
|
|
{
|
2018-06-27 20:07:20 +01:00
|
|
|
return _eglError(EGL_BAD_NATIVE_PIXMAP, "no support for native pixmaps");
|
2014-01-29 01:03:03 +00:00
|
|
|
}
|
|
|
|
|
2017-06-09 15:43:34 +01:00
|
|
|
static inline EGLBoolean
|
2019-02-02 11:38:45 +00:00
|
|
|
dri2_fallback_set_damage_region(_EGLDriver *drv, _EGLDisplay *disp,
|
2017-06-09 15:43:34 +01:00
|
|
|
_EGLSurface *surf,
|
|
|
|
const EGLint *rects, EGLint n_rects)
|
|
|
|
{
|
|
|
|
return EGL_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-01-29 01:03:03 +00:00
|
|
|
static inline EGLint
|
2019-02-02 11:38:45 +00:00
|
|
|
dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp,
|
2014-01-29 01:03:03 +00:00
|
|
|
_EGLSurface *surf)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2014-01-29 01:03:03 +00:00
|
|
|
|
|
|
|
static inline struct wl_buffer*
|
|
|
|
dri2_fallback_create_wayland_buffer_from_image(_EGLDriver *drv,
|
2019-02-02 11:38:45 +00:00
|
|
|
_EGLDisplay *disp,
|
2014-01-29 01:03:03 +00:00
|
|
|
_EGLImage *img)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-05-06 20:10:57 +01:00
|
|
|
|
|
|
|
static inline EGLBoolean
|
2019-02-02 11:38:45 +00:00
|
|
|
dri2_fallback_get_sync_values(_EGLDisplay *disp, _EGLSurface *surf,
|
2014-05-06 20:10:57 +01:00
|
|
|
EGLuint64KHR *ust, EGLuint64KHR *msc,
|
|
|
|
EGLuint64KHR *sbc)
|
|
|
|
{
|
|
|
|
return EGL_FALSE;
|
|
|
|
}
|
2017-03-20 16:04:18 +00:00
|
|
|
|
|
|
|
#endif /* EGL_DRI2_FALLBACKS_INCLUDED */
|