#include "loader.h"
#include "egl_dri2.h"
-#include "egl_dri2_fallbacks.h"
#ifdef HAVE_DRM_GRALLOC
#include <gralloc_drm_handle.h>
}
static _EGLSurface *
-droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, void *native_window,
- const EGLint *attrib_list)
+droid_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf,
+ void *native_window, const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
}
static _EGLSurface *
-droid_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, void *native_window,
- const EGLint *attrib_list)
+droid_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf,
+ void *native_window, const EGLint *attrib_list)
{
- return droid_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ return droid_create_surface(disp, EGL_WINDOW_BIT, conf,
native_window, attrib_list);
}
static _EGLSurface *
-droid_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, const EGLint *attrib_list)
+droid_create_pbuffer_surface(_EGLDisplay *disp, _EGLConfig *conf,
+ const EGLint *attrib_list)
{
- return droid_create_surface(drv, disp, EGL_PBUFFER_BIT, conf,
- NULL, attrib_list);
+ return droid_create_surface(disp, EGL_PBUFFER_BIT, conf,
+ NULL, attrib_list);
}
static EGLBoolean
-droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
+droid_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
}
static EGLBoolean
-droid_swap_interval(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLSurface *surf, EGLint interval)
+droid_swap_interval(_EGLDisplay *disp, _EGLSurface *surf, EGLint interval)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
struct ANativeWindow *window = dri2_surf->window;
}
static EGLint
-droid_query_buffer_age(_EGLDriver *drv,
+droid_query_buffer_age(const _EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surface)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
}
static EGLBoolean
-droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+droid_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
#endif /* HAVE_DRM_GRALLOC */
static EGLBoolean
-droid_query_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
+droid_query_surface(_EGLDisplay *disp, _EGLSurface *surf,
EGLint attribute, EGLint *value)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
default:
break;
}
- return _eglQuerySurface(drv, disp, surf, attribute, value);
+ return _eglQuerySurface(disp, surf, attribute, value);
}
static _EGLImage *
}
static _EGLImage *
-droid_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
+droid_create_image_khr(const _EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
}
static EGLBoolean
-droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
+droid_add_configs_for_visuals(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
static const struct {
static EGLBoolean
droid_load_driver(_EGLDisplay *disp, bool swrast)
{
- struct dri2_egl_display *dri2_dpy = disp->DriverData;
- const char *err;
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
dri2_dpy->driver_name = loader_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL)
* systems.) */
dri2_dpy->loader_extensions = droid_dri2_loader_extensions;
if (!dri2_load_driver(disp)) {
- err = "DRI2: failed to load driver";
goto error;
}
#else
free(dri2_dpy->driver_name);
dri2_dpy->driver_name = strdup("kms_swrast");
} else {
- err = "DRI3: failed to find software capable driver";
goto error;
}
}
dri2_dpy->loader_extensions = droid_image_loader_extensions;
if (!dri2_load_driver_dri3(disp)) {
- err = "DRI3: failed to load driver";
goto error;
}
#endif
#endif
EGLBoolean
-dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
+dri2_initialize_android(_EGLDisplay *disp)
{
_EGLDevice *dev;
bool device_opened = false;
/* Create configs *after* enabling extensions because presence of DRI
* driver extensions can affect the capabilities of EGLConfigs.
*/
- if (!droid_add_configs_for_visuals(drv, disp)) {
+ if (!droid_add_configs_for_visuals(disp)) {
err = "DRI2: failed to add configs";
goto cleanup;
}