mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
Update to use eglGetDRMDisplayMESA()
This commit is contained in:
parent
86e0989673
commit
f252d6a98e
7 changed files with 4 additions and 36 deletions
|
|
@ -30,7 +30,6 @@
|
|||
#include <time.h>
|
||||
#include <cairo.h>
|
||||
#include <glib.h>
|
||||
#include <cairo-drm.h>
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#define EGL_EGLEXT_PROTOTYPES
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include <cairo.h>
|
||||
#include <cairo-drm.h>
|
||||
#include <glib.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <ctype.h>
|
||||
#include <cairo.h>
|
||||
#include <glib.h>
|
||||
#include <cairo-drm.h>
|
||||
|
||||
#include <X11/keysym.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include <cairo.h>
|
||||
#include <cairo-drm.h>
|
||||
#include <glib.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -820,7 +820,6 @@ init_xkb(struct display *d)
|
|||
struct display *
|
||||
display_create(int *argc, char **argv[], const GOptionEntry *option_entries)
|
||||
{
|
||||
PFNEGLGETTYPEDDISPLAYMESA get_typed_display_mesa;
|
||||
struct display *d;
|
||||
EGLint major, minor, count;
|
||||
EGLConfig config;
|
||||
|
|
@ -869,15 +868,7 @@ display_create(int *argc, char **argv[], const GOptionEntry *option_entries)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
get_typed_display_mesa =
|
||||
(PFNEGLGETTYPEDDISPLAYMESA) eglGetProcAddress("eglGetTypedDisplayMESA");
|
||||
if (get_typed_display_mesa == NULL) {
|
||||
fprintf(stderr, "eglGetDisplayMESA() not found\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
d->dpy = get_typed_display_mesa(EGL_DRM_DISPLAY_TYPE_MESA,
|
||||
(void *) fd);
|
||||
d->dpy = eglGetDRMDisplayMESA(fd);
|
||||
if (!eglInitialize(d->dpy, &major, &minor)) {
|
||||
fprintf(stderr, "failed to initialize display\n");
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -305,7 +305,6 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
|
|||
{
|
||||
EGLint major, minor, count;
|
||||
EGLConfig config;
|
||||
PFNEGLGETTYPEDDISPLAYMESA get_typed_display_mesa;
|
||||
|
||||
static const EGLint config_attribs[] = {
|
||||
EGL_SURFACE_TYPE, 0,
|
||||
|
|
@ -314,13 +313,6 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
|
|||
EGL_NONE
|
||||
};
|
||||
|
||||
get_typed_display_mesa =
|
||||
(PFNEGLGETTYPEDDISPLAYMESA) eglGetProcAddress("eglGetTypedDisplayMESA");
|
||||
if (get_typed_display_mesa == NULL) {
|
||||
fprintf(stderr, "eglGetTypedDisplayMESA() not found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ec->base.base.device = strdup(udev_device_get_devnode(device));
|
||||
ec->drm_fd = open(ec->base.base.device, O_RDWR);
|
||||
if (ec->drm_fd < 0) {
|
||||
|
|
@ -330,8 +322,7 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
|
|||
return -1;
|
||||
}
|
||||
|
||||
ec->base.display = get_typed_display_mesa(EGL_DRM_DISPLAY_TYPE_MESA,
|
||||
(void *) ec->drm_fd);
|
||||
ec->base.display = eglGetDRMDisplayMESA(ec->drm_fd);
|
||||
if (ec->base.display == NULL) {
|
||||
fprintf(stderr, "failed to create display\n");
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,6 @@ dri2_authenticate(struct x11_compositor *c)
|
|||
static int
|
||||
x11_compositor_init_egl(struct x11_compositor *c)
|
||||
{
|
||||
PFNEGLGETTYPEDDISPLAYMESA get_typed_display_mesa;
|
||||
EGLint major, minor, count;
|
||||
EGLConfig config;
|
||||
|
||||
|
|
@ -211,7 +210,7 @@ x11_compositor_init_egl(struct x11_compositor *c)
|
|||
|
||||
if (dri2_connect(c) < 0)
|
||||
return -1;
|
||||
|
||||
|
||||
c->drm_fd = open(c->base.base.device, O_RDWR);
|
||||
if (c->drm_fd == -1) {
|
||||
fprintf(stderr,
|
||||
|
|
@ -223,16 +222,7 @@ x11_compositor_init_egl(struct x11_compositor *c)
|
|||
if (dri2_authenticate(c) < 0)
|
||||
return -1;
|
||||
|
||||
get_typed_display_mesa =
|
||||
(PFNEGLGETTYPEDDISPLAYMESA)
|
||||
eglGetProcAddress("eglGetTypedDisplayMESA");
|
||||
if (get_typed_display_mesa == NULL) {
|
||||
fprintf(stderr, "eglGetTypedDisplayMESA() not found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
c->base.display = get_typed_display_mesa(EGL_DRM_DISPLAY_TYPE_MESA,
|
||||
(void *) c->drm_fd);
|
||||
c->base.display = eglGetDRMDisplayMESA(c->drm_fd);
|
||||
if (c->base.display == NULL) {
|
||||
fprintf(stderr, "failed to create display\n");
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue